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

assets.9683.fe2aa19d437481a12fce.js Maven / Gradle / Ivy

There is a newer version: 1.5.4
Show newest version
"use strict";(self.webpackChunkopen_metadata=self.webpackChunkopen_metadata||[]).push([[9683],{30609:function(e,t,n){var a=n(8081),r=n.n(a),i=n(23645),s=n.n(i)()(r());s.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.custom-properties-schemaEditor {\n  border: 1px solid #dce3ec;\n  border-radius: 6px;\n}\n',""]),t.Z=s},19683:function(e,t,n){n.r(t),n.d(t,{default:function(){return Q}});var a=n(70655),r=n(71577),i=n(71230),s=n(15746),c=n(25499),l=n(34901),o=n(96486),u=n(67294),d=n(68432),m=n(15137),p=n(83716),E=n(56256),T=n(19650),S=n(94199),f=n(38780),y=n(8645),b=n(37565),h=n(92693),C=n(52114),R=n(61105),A=n(24671),O=n(24135),v=n(52977),_=n(59136),I=function(e){var t=e.customProperties,n=e.updateEntityType,i=e.hasAccess,s=e.isLoading,c=e.isButtonLoading,l=(0,d.$)().t,m=(0,a.CR)((0,u.useState)({}),2),I=m[0],M=m[1],U=(0,a.CR)((0,u.useState)(R.k8.NO_OPERATION),2),g=U[0],P=U[1],N=function(){M({}),P(R.k8.NO_OPERATION)};(0,u.useEffect)((function(){c||N()}),[c]);var k=(0,u.useMemo)((function(){return!(0,o.isEmpty)(I)&&g===R.k8.DELETE}),[I,g]),x=(0,u.useMemo)((function(){return!(0,o.isEmpty)(I)&&g===R.k8.UPDATE}),[I,g]),Z=(0,u.useMemo)((function(){return[{title:l("label.name"),dataIndex:"name",key:"name",render:function(e,t){return(0,A.C_)(t)}},{title:l("label.type"),dataIndex:"propertyType",key:"propertyType",render:function(e){return(0,A.C_)(e)}},{title:l("label.description"),dataIndex:"description",key:"description",render:function(e){return e?u.createElement(O.Z,{markdown:e||""}):u.createElement(E.Z.Text,{className:"text-grey-muted ","data-testid":"no-description"},l("label.no-description"))}},{title:l("label.action-plural"),dataIndex:"actions",key:"actions",render:function(e,t){return u.createElement(T.Z,{align:"center",size:14},u.createElement(S.Z,{title:!i&&C.oH},u.createElement(r.Z,{className:"cursor-pointer p-0","data-testid":"edit-button",disabled:!i,size:"small",type:"text",onClick:function(){M(t),P(R.k8.UPDATE)}},u.createElement(f.ReactComponent,{name:l("label.edit"),width:16}))),u.createElement(S.Z,{title:!i&&C.oH},u.createElement(r.Z,{className:"cursor-pointer p-0","data-testid":"delete-button",disabled:!i,size:"small",type:"text",onClick:function(){M(t),P(R.k8.DELETE)}},u.createElement(y.ReactComponent,{name:l("label.delete"),width:16}))))}}]}),[i]);return u.createElement(u.Fragment,null,u.createElement(b.Z,{bordered:!0,columns:Z,"data-testid":"entity-custom-properties-table",dataSource:t,loading:s,locale:{emptyText:u.createElement(p.Z,{className:"mt-xs",doc:h.BM,heading:l("label.property"),permission:i,type:R.Wx.CREATE})},pagination:!1,rowKey:"name",size:"small"}),u.createElement(v.Z,{bodyText:l("message.are-you-sure-delete-property",{propertyName:I.name}),cancelText:l("label.cancel"),confirmText:l("label.confirm"),header:l("label.delete-property-name",{propertyName:I.name}),isLoading:c,visible:k,onCancel:N,onConfirm:function(){var e=t.filter((function(e){return e.name!==I.name}));n(e)}}),u.createElement(_.p,{header:l("label.edit-entity-name",{entityType:l("label.property"),entityName:I.name}),placeholder:l("label.enter-field-description",{field:l("label.property")}),value:I.description||"",visible:x,onCancel:N,onSave:function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){var r;return(0,a.Jh)(this,(function(i){switch(i.label){case 0:return r=t.map((function(t){return t.name===I.name?(0,a.pi)((0,a.pi)({},t),{description:e}):t})),[4,n(r)];case 1:return i.sent(),N(),[2]}}))}))}}))},M=n(84065),U=n(8752),g=n(79839),P=n(95549),N=n(67167),k=n(62761),x=n(43104),Z=n(64632),B=n(226),L=n(39570),w=n(46321),W=n(93379),D=n.n(W),j=n(7795),H=n.n(j),J=n(90569),z=n.n(J),G=n(3565),Y=n.n(G),q=n(19216),F=n.n(q),K=n(44589),V=n.n(K),$=n(30609),X={};X.styleTagTransform=V(),X.setAttributes=Y(),X.insert=z().bind(null,"head"),X.domAPI=H(),X.insertStyleElement=F(),D()($.Z,X),$.Z&&$.Z.locals&&$.Z.locals;var Q=function(){var e=(0,d.$)().t,t=(0,m.UO)().tab,n=(0,m.k6)(),E=(0,a.CR)((0,u.useState)(Z.M8.CUSTOM_PROPERTIES),2),T=E[0],S=E[1],f=(0,a.CR)((0,u.useState)(!1),2),y=f[0],b=f[1],h=(0,a.CR)((0,u.useState)(!1),2),C=h[0],R=h[1],A=(0,a.CR)((0,u.useState)({}),2),O=A[0],v=A[1],_=(0,a.CR)((0,u.useState)(!1),2),W=_[0],D=_[1],j=(0,u.useMemo)((function(){return k.uW[t]}),[t]),H=(0,U.BL)().getEntityPermission,J=(0,a.CR)((0,u.useState)(L.Bd),2),z=J[0],G=J[1],Y=(0,u.useMemo)((function(){return z.EditAll}),[z,t]),q=(0,u.useCallback)((function(e){S(e)}),[]),F=(0,u.useCallback)((function(){var e=(0,k.Vw)(j);n.push(e)}),[j,n]),K=(0,u.useCallback)((function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){var t,n,r,i;return(0,a.Jh)(this,(function(s){switch(s.label){case 0:D(!0),t=(0,l.qu)(O,(0,a.pi)((0,a.pi)({},O),{customProperties:e})),s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,(0,B.TJ)(null!==(i=O.id)&&void 0!==i?i:"",t)];case 2:return n=s.sent(),v((function(e){return(0,a.pi)((0,a.pi)({},e),{customProperties:n.customProperties})})),[3,5];case 3:return r=s.sent(),(0,w.Eo)(r),[3,5];case 4:return D(!1),[7];case 5:return[2]}}))}))}),[O]),V=(0,u.useMemo)((function(){switch(j){case k.uW.tables:return x.j.TABLES_CUSTOM_ATTRIBUTES;case k.uW.topics:return x.j.TOPICS_CUSTOM_ATTRIBUTES;case k.uW.dashboards:return x.j.DASHBOARD_CUSTOM_ATTRIBUTES;case k.uW.pipelines:return x.j.PIPELINES_CUSTOM_ATTRIBUTES;case k.uW.mlModels:return x.j.ML_MODELS_CUSTOM_ATTRIBUTES;case k.uW.containers:return x.j.CONTAINER_CUSTOM_ATTRIBUTES;case k.uW.searchIndex:return x.j.SEARCH_INDEX_CUSTOM_ATTRIBUTES;case k.uW.storedProcedure:return x.j.STORED_PROCEDURE_CUSTOM_ATTRIBUTES;case k.uW.glossaryTerm:return x.j.GLOSSARY_TERM_CUSTOM_ATTRIBUTES;case k.uW.database:return x.j.DATABASE_CUSTOM_ATTRIBUTES;case k.uW.databaseSchema:return x.j.DATABASE_SCHEMA_CUSTOM_ATTRIBUTES;default:return x.j.TABLES_CUSTOM_ATTRIBUTES}}),[j]);(0,u.useEffect)((function(){var e;(0,o.isUndefined)(t)||(S(Z.M8.CUSTOM_PROPERTIES),R(!1),e=j,(0,a.mG)(void 0,void 0,void 0,(function(){var t,n;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:b(!0),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,(0,B.ov)(e)];case 2:return t=a.sent(),v(t),[3,4];case 3:return n=a.sent(),(0,w.Eo)(n),R(!0),[3,4];case 4:return b(!1),[2]}}))})))}),[j]),(0,u.useEffect)((function(){(null==O?void 0:O.id)&&(0,a.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,a.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,H(g.A.TYPE,O.id)];case 1:return e=n.sent(),G(e),[3,3];case 2:return t=n.sent(),(0,w.Eo)(t),[3,3];case 3:return[2]}}))}))}),[O]);var $=(0,u.useMemo)((function(){var t=O.customProperties,n=O.schema;return[{label:u.createElement(N.Z,{count:(null!=t?t:[]).length,id:Z.M8.CUSTOM_PROPERTIES,isActive:T===Z.M8.CUSTOM_PROPERTIES,name:e("label.custom-property-plural")}),key:Z.M8.CUSTOM_PROPERTIES,children:u.createElement("div",{"data-testid":"entity-custom-fields"},u.createElement("div",{className:"flex justify-end"},Y&&u.createElement(r.Z,{className:"m-b-md p-y-xss p-x-xs rounded-4","data-testid":"add-field-button",size:"middle",type:"primary",onClick:F},e("label.add-entity",{entity:e("label.property")}))),u.createElement(I,{customProperties:null!=t?t:[],hasAccess:Y,isButtonLoading:W,isLoading:y,updateEntityType:K}))},{label:e("label.schema"),key:Z.M8.SCHEMA,children:u.createElement("div",{"data-testid":"entity-schema"},u.createElement(P.Z,{className:"custom-properties-schemaEditor p-y-md",editorClass:"custom-entity-schema",value:JSON.parse(null!=n?n:"{}")}))}]}),[O.schema,Y,W,V,y,T,F,K]);return C?u.createElement(p.Z,null):u.createElement(i.Z,{className:"m-y-xs","data-testid":"custom-entity-container",gutter:[16,16]},u.createElement(s.Z,{span:24},u.createElement(M.Z,{data:V})),u.createElement(s.Z,{className:"global-settings-tabs",span:24},u.createElement(c.Z,{items:$,key:t,onChange:q})))}}}]);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy