All Downloads are FREE. Search and download functionalities are using the official Maven repository.

assets.2088.9bf1d89926b9972b5b0a.js Maven / Gradle / Ivy

There is a newer version: 1.6.0-rc1
Show newest version
"use strict";(self.webpackChunkopen_metadata=self.webpackChunkopen_metadata||[]).push([[2088],{94661:function(e,t,a){var n=a(8081),r=a.n(n),i=a(23645),l=a.n(i)()(r());l.push([e.id,'/*\n *  Copyright 2022 Collate.\n *  Licensed under the Apache License, Version 2.0 (the "License");\n *  you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *  http://www.apache.org/licenses/LICENSE-2.0\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an "AS IS" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n */\n/*\n *  Copyright 2022 Collate.\n *  Licensed under the Apache License, Version 2.0 (the "License");\n *  you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *  http://www.apache.org/licenses/LICENSE-2.0\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an "AS IS" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n */\n/* navbar+tab_height+padding = 64+46+12  */\n.kpi-slider .ant-slider-track {\n  background: var(--ant-primary-color);\n}\n',""]),t.Z=l},48539:function(e,t,a){var n=a(93379),r=a.n(n),i=a(7795),l=a.n(i),s=a(90569),c=a.n(s),m=a(3565),u=a.n(m),d=a(19216),o=a.n(d),p=a(44589),f=a.n(p),b=a(94661),h={};h.styleTagTransform=f(),h.setAttributes=u(),h.insert=c().bind(null,"head"),h.domAPI=l(),h.insertStyleElement=o(),r()(b.Z,h),b.Z&&b.Z.locals&&b.Z.locals},87057:function(e,t,a){var n;a.d(t,{m:function(){return n}}),function(e){e.Number="NUMBER",e.Percentage="PERCENTAGE"}(n||(n={}))},42088:function(e,t,a){a.r(t);var n=a(70655),r=a(56256),i=a(49409),l=a(34041),s=a(4107),c=a(71230),m=a(15746),u=a(99177),d=a(85986),o=a(11448),p=a(19650),f=a(71577),b=a(50963),h=a(23031),g=a(96486),y=a(30381),E=a.n(y),N=a(67294),w=a(68432),D=a(15137),Z=a(89011),v=a(97359),I=a(36169),O=a(62761),T=a(60625),k=a(64632),S=a(4334),A=a(96094),C=a(36096),L=a(34582),P=a(46321),x=(a(48539),[{name:(0,h.t)("label.data-insight"),url:(0,C.zc)()},{name:(0,h.t)("label.kpi-list"),url:O.Z6.KPI_LIST},{name:(0,h.t)("label.add-new-entity",{entity:(0,h.t)("label.kpi-uppercase")}),url:"",activeTitle:!0}]);t.default=function(){var e=(0,w.$)().t,t=(0,D.k6)(),a=(0,n.CR)((0,b.useForm)(),1)[0],h=(0,n.CR)((0,N.useState)(!1),2),y=h[0],V=h[1],W=(0,n.CR)((0,N.useState)([]),2),R=W[0],K=W[1],F=(0,b.useWatch)("metricType",a),q=(0,N.useMemo)((function(){return(0,L.Gs)(R)}),[R]);return(0,N.useEffect)((function(){(0,n.mG)(void 0,void 0,void 0,(function(){var e;return(0,n.Jh)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,A.Gw)({fields:k.GB.DATA_INSIGHT_CHART})];case 1:return e=t.sent(),K(e.data),[3,3];case 2:return t.sent(),K([]),[3,3];case 3:return[2]}}))}))}),[]),N.createElement(Z.Z,{className:"content-height-with-resizable-panel",firstPanel:{className:"content-resizable-panel-container",children:N.createElement("div",{className:"max-width-md w-9/10 service-form-container","data-testid":"add-kpi-container"},N.createElement(I.Z,{className:"my-4",titleLinks:x}),N.createElement(r.Z.Paragraph,{className:"text-base","data-testid":"form-title"},e("label.add-new-entity",{entity:e("label.kpi-uppercase")})),N.createElement(i.Z,{"data-testid":"kpi-form",form:a,id:"kpi-form",layout:"vertical",validateMessages:O.NG,onFinish:function(e){return(0,n.mG)(void 0,void 0,void 0,(function(){var a,r,i,l,s,c;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:a=e.startDate.valueOf(),r=e.endDate.valueOf(),i=(0,L.OJ)(e.chartType,F),l={dataInsightChart:i,description:e.description,name:(0,g.kebabCase)((null!==(c=e.displayName)&&void 0!==c?c:"")+" "+F),displayName:e.displayName,startDate:a,endDate:r,metricType:F,targetValue:e.targetValue},V(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,A.gg)(l)];case 2:return n.sent(),t.push(O.Z6.KPI_LIST),[3,5];case 3:return s=n.sent(),(0,P.Eo)(s),[3,5];case 4:return V(!1),[7];case 5:return[2]}}))}))},onValuesChange:function(e,t){if(e.startDate){var n=E()(e.startDate).startOf("day");a.setFieldsValue({startDate:n}),e.startDate>t.endDate&&a.setFieldsValue({endDate:""})}if(e.endDate){var r=E()(e.endDate).endOf("day");a.setFieldsValue({endDate:r}),e.endDate=0?Promise.resolve():Promise.reject(e("message.field-text-is-required",{fieldText:e("label.metric-value")}))}}]},N.createElement(N.Fragment,null,F===S.m.Percentage&&N.createElement(N.Fragment,null,N.createElement(c.Z,{gutter:32},N.createElement(m.Z,{span:20},N.createElement(i.Z.Item,{noStyle:!0,name:"targetValue",wrapperCol:{span:20}},N.createElement(u.Z,{className:"kpi-slider",marks:{0:"0%",100:"100%"},max:100,min:0,tooltip:{open:!1}}))),N.createElement(m.Z,{span:4},N.createElement(i.Z.Item,{noStyle:!0,name:"targetValue",wrapperCol:{span:4}},N.createElement(d.Z,{formatter:function(e){return e+"%"},max:100,min:0,step:1}))))),F===S.m.Number&&N.createElement(i.Z.Item,{noStyle:!0,name:"targetValue"},N.createElement(d.Z,{className:"w-full","data-testid":"metric-number-input",min:0})))),N.createElement(c.Z,{gutter:[8,8]},N.createElement(m.Z,{span:12},N.createElement(i.Z.Item,{label:e("label.start-entity",{entity:e("label.date")}),messageVariables:{fieldName:"startDate"},name:"startDate",rules:[{required:!0,message:e("label.field-required",{field:e("label.start-entity",{entity:e("label.date")})})}]},N.createElement(o.Z,{className:"w-full","data-testid":"start-date",disabledDate:C.nu,format:T.aJ}))),N.createElement(m.Z,{span:12},N.createElement(i.Z.Item,{label:e("label.end-date"),messageVariables:{fieldName:"endDate"},name:"endDate",rules:[{required:!0,message:e("label.field-required",{field:e("label.end-date")})}]},N.createElement(o.Z,{className:"w-full","data-testid":"end-date",disabledDate:C.nu,format:T.aJ})))),N.createElement(i.Z.Item,{label:e("label.description"),name:"description",trigger:"onTextChange",valuePropName:"initialValue"},N.createElement(v.Z,{height:"200px",placeHolder:e("message.write-your-description"),style:{margin:0}})),N.createElement(p.Z,{align:"center",className:"w-full justify-end"},N.createElement(f.Z,{"data-testid":"cancel-btn",type:"link",onClick:function(){return t.goBack()}},e("label.cancel")),N.createElement(f.Z,{"data-testid":"submit-btn",form:"kpi-form",htmlType:"submit",loading:y,type:"primary"},e("label.submit"))))),minWidth:700,flex:.7},pageTitle:e("label.add-new-entity",{entity:e("label.kpi-uppercase")}),secondPanel:{children:N.createElement("div",{"data-testid":"right-panel"},N.createElement(r.Z.Paragraph,{className:"text-base font-medium"},e("label.add-entity",{entity:e("label.kpi-uppercase")})),N.createElement(r.Z.Text,null,e("message.add-kpi-message"))),className:"p-md p-t-xl content-resizable-panel-container",minWidth:400,flex:.3}})}},34582:function(e,t,a){a.d(t,{Gs:function(){return m},OJ:function(){return u},S$:function(){return s},hR:function(){return c},wc:function(){return d}});var n,r=a(4334),i=a(87057),l=a(74475);!function(e){e.Description="description",e.Owner="owner"}(n||(n={}));var s=[{label:l.Z.t("label.percentage"),value:i.m.Percentage},{label:l.Z.t("label.number"),value:i.m.Number}],c=[{label:l.Z.t("label.description-kpi"),value:n.Description},{label:l.Z.t("label.owner-kpi"),value:n.Owner}],m=function(e){var t=e.map((function(e){return e.dataInsightChart.fullyQualifiedName}));return c.filter((function(e){return t.every((function(t){return!(null==t?void 0:t.includes(e.value))}))}))},u=function(e,t){if(e===n.Description)switch(t){case i.m.Percentage:return r.e.PercentageOfDataAssetWithDescriptionKpi;case i.m.Number:return r.e.NumberOfDataAssetWithDescriptionKpi}else switch(t){case i.m.Percentage:return r.e.PercentageOfDataAssetWithOwnerKpi;case i.m.Number:return r.e.NumberOfDataAssetWithOwnerKpi}},d=function(e){switch(e){case r.e.PercentageOfDataAssetWithDescriptionKpi:case r.e.NumberOfDataAssetWithDescriptionKpi:return n.Description;case r.e.PercentageOfDataAssetWithOwnerKpi:case r.e.NumberOfDataAssetWithOwnerKpi:return n.Owner;default:return n.Description}}}}]);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy