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

assets.8366.f2c02a6931d7dfe731de.js Maven / Gradle / Ivy

"use strict";(self.webpackChunkopen_metadata=self.webpackChunkopen_metadata||[]).push([[8366],{98366:function(e,t,n){n.r(t),n.d(t,{default:function(){return M}});var r=n(70655),a=n(34901),s=n(67294),l=n(68432),u=n(15137),i=n(83716),o=n(31007),c=n(72431),m=n(69523),d=n(80646),f=n(8752),y=n(79839),v=n(73213),h=n(62761),p=n(92693),E=n(61105),g=n(72819),S=n(1222),A=n(59291),N=n(39570),b=n(96840),C=n(46321),R=n(71230),G=n(15746),Z=n(56256),x=n(71577),I=n(28682),O=n(98661),w=n(57599),T=n(88816),k=n(56652),L=n(24671),_=function(e){var t=e.glossaries,n=(0,l.$)().t,a=(0,f.BL)().permissions,i=(0,u.UO)().fqn,o=i?decodeURIComponent(i):null,c=(0,u.k6)(),m=(0,s.useMemo)((function(){return(0,N.P_)(g.OX.Create,y.A.GLOSSARY,a)}),[a]),d=(0,s.useMemo)((function(){return o?A.Z.split(o)[0]:t[0].fullyQualifiedName}),[o]),v=(0,s.useMemo)((function(){return t.reduce((function(e,t){var n;return(0,r.ev)((0,r.ev)([],(0,r.CR)(e)),[{key:null!==(n=t.fullyQualifiedName)&&void 0!==n?n:"",label:(0,L.C_)(t),icon:s.createElement(O.ReactComponent,{height:16,width:16})}])}),[])}),[t]);return s.createElement(T.Z,{id:"glossary"},s.createElement(k.Z,{loading:0===t.length},s.createElement(R.Z,{className:"p-y-xs",gutter:[0,16]},s.createElement(G.Z,{className:"p-x-sm",span:24},s.createElement(Z.Z.Text,{strong:!0,className:"m-b-0"},n("label.glossary"))),m&&s.createElement(G.Z,{className:"p-x-sm",span:24},s.createElement(x.Z,{block:!0,className:"text-primary","data-testid":"add-glossary",onClick:function(){c.push(h.Z6.ADD_GLOSSARY)}},s.createElement("div",{className:"flex-center"},s.createElement(w.ReactComponent,{className:"anticon m-r-xss"}),n("label.add")))),s.createElement(G.Z,{span:24},v.length?s.createElement(I.Z,{className:"custom-menu","data-testid":"glossary-left-panel",items:v,mode:"inline",selectedKeys:[d],onClick:function(e){c.push((0,b.$x)(e.key))}}):s.createElement("p",{className:"text-grey-muted text-center"},s.createElement("span",null,n("label.no-glossary-found")))))))},M=function(){var e=(0,l.$)().t,t=(0,f.BL)().permissions,n=(0,u.UO)().fqn,R=decodeURIComponent(n),G=(0,u.k6)(),Z=(0,r.CR)((0,s.useState)([]),2),x=Z[0],I=Z[1],O=(0,r.CR)((0,s.useState)(!0),2),w=O[0],T=O[1],k=(0,r.CR)((0,s.useState)(E.Vu.INITIAL),2),L=k[0],M=k[1],V=(0,r.CR)((0,s.useState)(),2),P=V[0],Q=V[1],D=(0,r.CR)((0,s.useState)(!0),2),Y=D[0],$=D[1],U=(0,r.CR)((0,s.useState)(),2),W=U[0],X=U[1],q=(0,s.useMemo)((function(){return $(!0),Q(void 0),!R||1===A.Z.split(R).length}),[R]),J=(0,s.useMemo)((function(){return(0,N.P_)(g.OX.Create,q?y.A.GLOSSARY:y.A.GLOSSARY_TERM,t)}),[t,q]),B=(0,s.useMemo)((function(){return(0,N.P_)(g.OX.ViewBasic,q?y.A.GLOSSARY:y.A.GLOSSARY_TERM,t)}),[t,q]),z=(0,s.useMemo)((function(){return(0,N.P_)(g.OX.ViewAll,q?y.A.GLOSSARY:y.A.GLOSSARY_TERM,t)}),[t,q]),K=function(){return(0,r.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,r.Jh)(this,(function(n){switch(n.label){case 0:$(!0),T(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,S.Uv)({fields:"owner,tags,reviewers,votes,domain",limit:h.SF})];case 2:return e=n.sent().data,I(e),[3,5];case 3:return t=n.sent(),(0,C.Eo)(t),[3,5];case 4:return T(!1),$(!1),[7];case 5:return[2]}}))}))};(0,s.useEffect)((function(){K()}),[]);var j=function(){return(0,r.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,r.Jh)(this,(function(n){switch(n.label){case 0:$(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,S.GM)(R,"relatedTerms,reviewers,tags,owner,children,votes,domain")];case 2:return e=n.sent(),Q(e),[3,5];case 3:return t=n.sent(),(0,C.Eo)(t),[3,5];case 4:return $(!1),[7];case 5:return[2]}}))}))};return(0,s.useEffect)((function(){$(!0),x.length&&(q?(Q(x.find((function(e){return e.fullyQualifiedName===R}))||x[0]),!R&&x[0].fullyQualifiedName&&G.replace((0,b.$x)(x[0].fullyQualifiedName)),$(!1)):j())}),[q,R,x]),w?s.createElement(m.Z,null):B||z?0!==x.length||w?s.createElement(d.Z,{className:"glossary-page-layout",leftPanel:q&&s.createElement(_,{glossaries:x}),pageTitle:e("label.glossary"),rightPanel:W&&s.createElement(o.Z,{entityDetails:W,handleClosePanel:function(){return X(void 0)}}),rightPanelWidth:400},Y?s.createElement(m.Z,null):s.createElement(c.Z,{deleteStatus:L,isGlossaryActive:q,isSummaryPanelOpen:Boolean(W),isVersionsView:!1,refreshActiveGlossaryTerm:j,selectedData:P,updateGlossary:function(e){return(0,r.mG)(void 0,void 0,void 0,(function(){var t,n,s;return(0,r.Jh)(this,(function(r){switch(r.label){case 0:t=(0,a.qu)(P,e),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(0,S.Q6)(null==P?void 0:P.id,t)];case 2:return n=r.sent(),I((function(e){return e.map((function(e){return e.name===n.name?n:e}))})),(null==P?void 0:P.name)!==e.name&&(G.push((0,b.$x)(n.fullyQualifiedName)),K()),[3,4];case 3:return s=r.sent(),(0,C.Eo)(s),[3,4];case 4:return[2]}}))}))},updateVote:function(e){return(0,r.mG)(void 0,void 0,void 0,(function(){var t,n,a;return(0,r.Jh)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),A.Z.split(null==P?void 0:P.fullyQualifiedName).length<=1?[4,(0,S.kq)(null!==(n=null==P?void 0:P.id)&&void 0!==n?n:"",e)]:[3,2];case 1:return r.sent(),K(),[3,4];case 2:return[4,(0,S.nz)(null!==(a=null==P?void 0:P.id)&&void 0!==a?a:"",e)];case 3:r.sent(),j(),r.label=4;case 4:return[3,6];case 5:return t=r.sent(),(0,C.Eo)(t),[3,6];case 6:return[2]}}))}))},onAssetClick:function(e){X(e)},onGlossaryDelete:function(t){M(E.Vu.WAITING),(0,S.cr)(t).then((function(){M(E.Vu.SUCCESS),(0,C.XA)(e("server.entity-deleted-successfully",{entity:e("label.glossary")})),T(!0);var n=x.filter((function(e){return e.id!==t})),r=n.length>0?(0,b.$x)(n[0].fullyQualifiedName):(0,b.$x)();G.push(r),K()})).catch((function(t){(0,C.Eo)(t,e("server.delete-entity-error",{entity:e("label.glossary")}))})).finally((function(){return M(E.Vu.INITIAL)}))},onGlossaryTermDelete:function(t){M(E.Vu.WAITING),(0,S.tk)(t).then((function(){var t;if(M(E.Vu.SUCCESS),(0,C.XA)(e("server.entity-deleted-successfully",{entity:e("label.glossary-term")})),R){var n=A.Z.split(R);n.pop(),t=n.join(v.o)}T(!0),G.push((0,b.$x)(t)),K()})).catch((function(t){(0,C.Eo)(t,e("server.delete-entity-error",{entity:e("label.glossary-term")}))})).finally((function(){return M(E.Vu.INITIAL)}))},onGlossaryTermUpdate:function(t){return(0,r.mG)(void 0,void 0,void 0,(function(){var n,s,l;return(0,r.Jh)(this,(function(r){switch(r.label){case 0:n=(0,a.qu)(P,t),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(0,S.zx)(null==P?void 0:P.id,n)];case 2:if(!(s=r.sent()))throw e("server.entity-updating-error",{entity:e("label.glossary-term")});return Q(s),(null==P?void 0:P.name)!==t.name&&(G.push((0,b.$x)(s.fullyQualifiedName)),K()),[3,4];case 3:return l=r.sent(),(0,C.Eo)(l),[3,4];case 4:return[2]}}))}))}})):s.createElement(i.Z,{buttonId:"add-glossary",className:"mt-0-important",doc:p.cK,heading:e("label.glossary"),permission:J,type:J?E.Wx.CREATE:E.Wx.NO_DATA,onClick:function(){G.push(h.Z6.ADD_GLOSSARY)}}):s.createElement(i.Z,{type:E.Wx.PERMISSION})}}}]);




© 2015 - 2025 Weber Informatics LLC | Privacy Policy