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

assets.1095.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([[1095],{94661:function(e,t,a){var n=a(8081),i=a.n(n),r=a(23645),l=a.n(r)()(i());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),i=a.n(n),r=a(7795),l=a.n(r),s=a(90569),c=a.n(s),u=a(3565),m=a.n(u),d=a(19216),o=a.n(d),p=a(44589),f=a.n(p),b=a(94661),h={};h.styleTagTransform=f(),h.setAttributes=m(),h.insert=c().bind(null,"head"),h.domAPI=l(),h.insertStyleElement=o(),i()(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={}))},61095:function(e,t,a){a.r(t);var n=a(70655),i=a(56256),r=a(49409),l=a(34041),s=a(4107),c=a(71230),u=a(15746),m=a(99177),d=a(85986),o=a(11448),p=a(19650),f=a(71577),b=a(94199),h=a(50963),g=a(34901),y=a(96486),E=a(30381),D=a.n(E),v=a(67294),N=a(68432),Z=a(15137),w=a(35850),T=a(89011),I=a(97359),A=a(36169),O=a(62761),S=a(60625),k=a(64632),C=a(87057),L=a(85087),P=a(66537),V=a(96094),x=a(36096),R=a(34582),W=a(46321);a(48539),t.default=function(){var e=(0,L.a)().isAdminUser,t=(0,P.f)().fqn,a=(0,N.$)().t,E=(0,Z.k6)(),q=(0,n.CR)((0,h.useForm)(),1)[0],G=(0,n.CR)((0,v.useState)(),2),K=G[0],_=G[1],F=(0,n.CR)((0,v.useState)(!1),2),B=F[0],U=F[1],H=(0,n.CR)((0,v.useState)(!1),2),J=H[0],M=H[1],Y=(0,h.useWatch)("metricType",q),z=(0,v.useMemo)((function(){var e;return[{name:a("label.data-insight"),url:(0,x.zc)()},{name:a("label.kpi-list"),url:O.Z6.KPI_LIST},{name:null!==(e=null==K?void 0:K.name)&&void 0!==e?e:"",url:"",activeTitle:!0}]}),[K]),$=(0,v.useMemo)((function(){if(K){var e=D()(K.startDate),t=D()(K.endDate),a=(0,R.wc)(K.fullyQualifiedName);return{name:K.name,chartType:a,displayName:K.displayName,metricType:K.metricType,description:K.description,targetValue:K.targetValue,startDate:e,endDate:t}}return{}}),[K]);return(0,v.useEffect)((function(){(0,n.mG)(void 0,void 0,void 0,(function(){var e,a;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:U(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,V._q)(t,{fields:[k.GB.START_DATE,k.GB.END_DATE,k.GB.TARGET_VALUE,k.GB.DATA_INSIGHT_CHART,k.GB.METRIC_TYPE]})];case 2:return e=n.sent(),_(e),[3,5];case 3:return a=n.sent(),(0,W.Eo)(a),[3,5];case 4:return U(!1),[7];case 5:return[2]}}))}))}),[t]),B?v.createElement(w.Z,null):v.createElement(T.Z,{className:"content-height-with-resizable-panel",firstPanel:{className:"content-resizable-panel-container",children:v.createElement("div",{className:"max-width-md w-9/10 service-form-container","data-testid":"edit-kpi-container"},v.createElement(A.Z,{className:"my-4",titleLinks:z}),v.createElement(i.Z.Paragraph,{className:"text-base","data-testid":"form-title"},a("label.edit-entity",{entity:a("label.kpi-uppercase")})),v.createElement(r.Z,{"data-testid":"kpi-form",form:q,id:"kpi-form",initialValues:$,layout:"vertical",validateMessages:O.NG,onFinish:function(e){return(0,n.mG)(void 0,void 0,void 0,(function(){var t,a,i,r,l,s,c,u,m;return(0,n.Jh)(this,(function(d){switch(d.label){case 0:if(!K)return[3,5];t=e.targetValue,a=e.description,i=e.displayName,r=e.startDate.valueOf(),l=e.endDate.valueOf(),s=(0,n.pi)((0,n.pi)({},K),{description:a,targetValue:t,displayName:i,endDate:l,startDate:r}),c=(0,g.qu)(K,s),M(!0),d.label=1;case 1:return d.trys.push([1,3,4,5]),[4,(0,V.pH)(null!==(m=K.id)&&void 0!==m?m:"",c)];case 2:return d.sent(),E.push(O.Z6.KPI_LIST),[3,5];case 3:return u=d.sent(),(0,W.Eo)(u),[3,5];case 4:return M(!1),[7];case 5:return[2]}}))}))},onValuesChange:function(e,t){if(e.startDate){var a=D()(e.startDate).startOf("day");q.setFieldsValue({startDate:a}),e.startDate>t.endDate&&q.setFieldsValue({endDate:""})}if(e.endDate){var n=D()(e.endDate).endOf("day");q.setFieldsValue({endDate:n}),e.endDate=0?Promise.resolve():Promise.reject(a("message.field-text-is-required",{fieldText:a("label.metric-value")}))}}]},v.createElement(v.Fragment,null,Y===C.m.Percentage&&v.createElement(v.Fragment,null,v.createElement(c.Z,{gutter:32},v.createElement(u.Z,{span:20},v.createElement(r.Z.Item,{noStyle:!0,name:"targetValue",wrapperCol:{span:20}},v.createElement(m.Z,{className:"kpi-slider",marks:{0:"0%",100:"100%"},max:100,min:0,tooltip:{open:!1}}))),v.createElement(u.Z,{span:4},v.createElement(r.Z.Item,{noStyle:!0,name:"targetValue",wrapperCol:{span:4}},v.createElement(d.Z,{formatter:function(e){return e+"%"},max:100,min:0,step:1}))))),Y===C.m.Number&&v.createElement(r.Z.Item,{noStyle:!0,name:"targetValue"},v.createElement(d.Z,{className:"w-full","data-testid":"metric-number-input",min:0})))),v.createElement(c.Z,{gutter:[8,8]},v.createElement(u.Z,{span:12},v.createElement(r.Z.Item,{label:a("label.start-entity",{entity:a("label.date")}),messageVariables:{fieldName:"startDate"},name:"startDate",rules:[{required:!0,message:a("label.field-required",{field:a("label.start-entity",{entity:a("label.date")})})}]},v.createElement(o.Z,{className:"w-full","data-testid":"start-date",disabledDate:x.nu,format:S.aJ}))),v.createElement(u.Z,{span:12},v.createElement(r.Z.Item,{label:a("label.end-date"),messageVariables:{fieldName:"endDate"},name:"endDate",rules:[{required:!0,message:a("label.field-required",{field:a("label.end-date")})}]},v.createElement(o.Z,{className:"w-full","data-testid":"end-date",disabledDate:x.nu,format:S.aJ})))),v.createElement(r.Z.Item,{label:a("label.description"),name:"description",trigger:"onTextChange",valuePropName:"initialValue"},v.createElement(I.Z,{height:"200px",placeHolder:a("message.write-your-description"),style:{margin:0}})),v.createElement(p.Z,{align:"center",className:"w-full justify-end"},v.createElement(f.Z,{"data-testid":"cancel-btn",type:"link",onClick:function(){return E.goBack()}},a("label.go-back")),e?v.createElement(b.Z,{title:a("label.save")},v.createElement(f.Z,{"data-testid":"submit-btn",htmlType:"submit",loading:J,type:"primary"},a("label.save"))):null))),minWidth:700,flex:.7},pageTitle:a("label.edit-entity",{entity:a("label.kpi-uppercase")}),secondPanel:{children:v.createElement("div",{"data-testid":"right-panel"},v.createElement(i.Z.Paragraph,{className:"text-base font-medium"},a("label.edit-entity",{entity:a("label.kpi-uppercase")})),v.createElement(i.Z.Text,null,a("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 u},OJ:function(){return m},S$:function(){return s},hR:function(){return c},wc:function(){return d}});var n,i=a(4334),r=a(87057),l=a(74475);!function(e){e.Description="description",e.Owner="owner"}(n||(n={}));var s=[{label:l.Z.t("label.percentage"),value:r.m.Percentage},{label:l.Z.t("label.number"),value:r.m.Number}],c=[{label:l.Z.t("label.description-kpi"),value:n.Description},{label:l.Z.t("label.owner-kpi"),value:n.Owner}],u=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))}))}))},m=function(e,t){if(e===n.Description)switch(t){case r.m.Percentage:return i.e.PercentageOfDataAssetWithDescriptionKpi;case r.m.Number:return i.e.NumberOfDataAssetWithDescriptionKpi}else switch(t){case r.m.Percentage:return i.e.PercentageOfDataAssetWithOwnerKpi;case r.m.Number:return i.e.NumberOfDataAssetWithOwnerKpi}},d=function(e){switch(e){case i.e.PercentageOfDataAssetWithDescriptionKpi:case i.e.NumberOfDataAssetWithDescriptionKpi:return n.Description;case i.e.PercentageOfDataAssetWithOwnerKpi:case i.e.NumberOfDataAssetWithOwnerKpi:return n.Owner;default:return n.Description}}}}]);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy