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

assets.3284.9bf1d89926b9972b5b0a.js Maven / Gradle / Ivy

There is a newer version: 1.5.4
Show newest version
"use strict";(self.webpackChunkopen_metadata=self.webpackChunkopen_metadata||[]).push([[3284],{31727:function(e,t,n){var a=n(8081),r=n.n(a),i=n(23645),l=n.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.roles-container {\n  display: flex;\n  justify-content: space-between;\n  margin-bottom: 1rem;\n  flex-direction: column;\n  align-items: flex-start;\n}\n.user-page-tabs {\n  margin-top: 10px;\n}\n.user-page-tabs .ant-tabs-nav {\n  margin: 0 !important;\n  padding: 0 20px;\n}\n.user-layout > .ant-col {\n  padding-top: 0;\n}\n.user-layout .user-profile-container .ant-collapse-item > .ant-collapse-header {\n  align-items: center;\n}\n.user-layout .user-profile-container .profile-image-container {\n  width: 54px;\n  height: 54px;\n  border-radius: 50%;\n  overflow: hidden;\n}\n.user-layout .user-profile-container .ant-card {\n  background: none;\n}\n.user-layout .user-page-layout .user-layout-scroll {\n  height: calc(100vh - var(--ant-navbar-height) - 58px);\n  overflow-y: scroll;\n}\n.user-layout .user-page-layout .user-page-layout-right-panel {\n  padding-right: 0 !important;\n  background-color: #fff;\n  border: 1px solid #0000001a;\n  border-radius: 0;\n  padding-left: 0 !important;\n  border-top: 0;\n}\n.user-layout .activity-feed-tab .center-container {\n  height: calc(100vh - var(--ant-navbar-height) - 58px);\n}\n.user-layout .activity-feed-tab .right-container {\n  height: calc(100vh - var(--ant-navbar-height) - 58px);\n}\n.user-layout .summary-panel-container {\n  height: calc(100vh - var(--ant-navbar-height) - 58px);\n}\n.user-layout .explore-search-card {\n  margin: 0 12px;\n}\n',""]),t.Z=l},52828:function(e,t,n){var a=n(8081),r=n.n(a),i=n(23645),l=n.n(i)()(r());l.push([e.id,'/*\n *  Copyright 2024 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.chip-tag-link {\n  display: flex;\n  color: #000000;\n  gap: 4px;\n}\n.chip-tag-link:hover {\n  color: #000000;\n}\n',""]),t.Z=l},43284:function(e,t,n){n.r(t),n.d(t,{default:function(){return Ve}});var a=n(70655),r=n(56256),i=n(34901),l=n(96486),s=n(80129),o=n.n(s),c=n(67294),u=n(68432),d=n(15137),m=n(35850),p=n(71230),f=n(15746),h=n(94199),v=n(19650),y=n(27279),g=n(25499),b=n(35295),E=n(68260),N=n(62761),w=n(5397),C=n(64632),Z=n(22653),S=n(85087),A=n(48794),x=n(66537),T=n(39117),k=n(24671),R=n(12981),L=n(62748),D=n(39895),P=n(55241),I=n(60331),U=n(76),O=n(30213),M=n(93379),G=n.n(M),J=n(7795),_=n.n(J),F=n(90569),Y=n.n(F),q=n(3565),B=n.n(q),H=n(19216),K=n.n(H),W=n(44589),V=n.n(W),$=n(52828),j={};j.styleTagTransform=V(),j.setAttributes=B(),j.insert=Y().bind(null,"head"),j.domAPI=_(),j.insertStyleElement=K(),G()($.Z,j),$.Z&&$.Z.locals&&$.Z.locals;var Q,z=function(e){var t=e.data,n=e.icon,i=e.entityType,s=e.noDataPlaceholder,o=e.showNoDataPlaceholder,u=void 0===o||o,d=(0,a.CR)((0,c.useState)(0),2),m=d[0],h=d[1],y=(0,c.useMemo)((function(){return m>N.b5}),[m]),g=function(e){var t;return c.createElement(f.Z,{"data-testid":"tag-chip",key:e.name},c.createElement(U.Link,{className:"chip-tag-link","data-testid":e.name+"-link",to:O.Z.getEntityLink(i,null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"")},n,c.createElement(r.Z.Text,{className:"text-left"},(0,k.C_)(e))))};return(0,c.useEffect)((function(){var e;h(null!==(e=null==t?void 0:t.length)&&void 0!==e?e:0)}),[t]),(0,l.isEmpty)(t)&&u?c.createElement(r.Z.Paragraph,{className:"text-grey-muted m-b-0"},null!=s?s:N.lH):c.createElement(p.Z,{wrap:!0,className:"align-middle","data-testid":"chip-container",gutter:[20,6]},t.slice(0,N.b5).map(g),y&&c.createElement(P.Z,{className:"cursor-pointer",content:c.createElement(v.Z,{wrap:!0,size:6},t.slice(N.b5).map(g)),overlayClassName:"w-56",trigger:"click"},c.createElement(I.Z,{className:"m-l-xss","data-testid":"plus-more-count"},"+"+(m-N.b5)+" more")))},X=n(57081),ee=n(75705),te=n(73546),ne=n(66208),ae=n(8035),re=n(71577),ie=n(23031),le=n(38780),se=n(56018),oe=n(58851),ce=function(e){return c.createElement(v.Z,null,e?c.createElement(r.Z.Text,null,(0,k.C_)(e)):c.createElement(r.Z.Text,{className:"text-grey-body"},(0,ie.t)("message.no-data-available")))},ue=function(e){var t=e.hasPermission,n=e.selectedPersonas,r=void 0===n?[]:n,i=e.onUpdate,l=e.children,s=e.popoverProps,o=e.multiSelect,d=void 0!==o&&o,m=e.personaList,p=(0,a.CR)((0,c.useState)(!1),2),f=p[0],v=p[1],y=(0,u.$)().t,g=(0,a.CR)((0,c.useState)(null!=m?m:[]),2),b=g[0],E=g[1],w=(0,c.useCallback)((function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(t){switch(t.label){case 0:return d?[4,i(e)]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,i(e[0])];case 3:t.sent(),t.label=4;case 4:return v(!1),[2]}}))}))}),[i]);return t?c.createElement(re.Z,{className:"remove-button-default-styling",onClick:function(e){return e.stopPropagation()}},c.createElement(P.Z,(0,a.pi)({destroyTooltipOnHide:!0,content:c.createElement(oe.e,{customTagRenderer:ce,fetchOptions:function(e,t){return(0,a.mG)(void 0,void 0,void 0,(function(){var n,r,i,l,s;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:if(!e)return[3,1];try{return n=b.filter((function(t){var n,a,r;return(null===(n=t.displayName)||void 0===n?void 0:n.includes(e))||(null===(a=t.name)||void 0===a?void 0:a.includes(e))||(null===(r=t.description)||void 0===r?void 0:r.includes(e))})),[2,{data:n,paging:{total:n.length}}]}catch(e){return[2,{data:[],paging:{total:0}}]}return[3,4];case 1:return a.trys.push([1,3,,4]),m?[2,{data:m,paging:{total:m.length}}]:[4,(0,se.XQ)({limit:N.SF,after:null!=t?t:void 0})];case 2:return r=a.sent(),i=r.data,l=r.paging,s=(0,k.nP)(i,C.py.PERSONA),E(s),[2,{data:s,paging:l}];case 3:return a.sent(),[2,{data:[],paging:{total:0}}];case 4:return[2]}}))}))},multiSelect:d,searchPlaceholder:y("label.search-for-type",{type:y("label.persona")}),selectedItems:r,onCancel:function(){return v(!1)},onUpdate:w}),open:f,overlayClassName:"user-select-popover p-0",placement:"bottomRight",showArrow:!1,trigger:"click",onOpenChange:v},s),null!=l?l:c.createElement(h.Z,{title:y("label.edit-entity",{entity:y("label.persona")})},c.createElement(re.Z,{className:"p-0 flex-center","data-testid":"edit-persona",icon:c.createElement(le.ReactComponent,{color:N.MJ,width:"14px"}),size:"small",type:"text"})))):null},de=n(76709),me=n(57052);!function(e){e.ACTIVITY="activity_feed",e.MY_DATA="mydata",e.FOLLOWING="following",e.ACCESS_TOKEN="access-token"}(Q||(Q={}));var pe=n(31727),fe={};fe.styleTagTransform=V(),fe.setAttributes=B(),fe.insert=Y().bind(null,"head"),fe.domAPI=_(),fe.insertStyleElement=K(),G()(pe.Z,fe),pe.Z&&pe.Z.locals&&pe.Z.locals;var he,ve=n(68855),ye=n(27049),ge=n(4107);!function(e){e.Self="SELF",e.User="USER"}(he||(he={}));var be=n(53026),Ee=n(32957),Ne=n(23313),we=n(46321),Ce=n(45633),Ze=n(66318),Se=n(44654),Ae=n(85068),xe=n(49409),Te=n(50146),ke=n(16139),Re=function(e){var t=e.visible,n=e.onCancel,r=e.onSave,i=e.isLoggedInUser,l=e.isLoading,s=(0,u.$)().t,o=(0,a.CR)(xe.Z.useForm(),1)[0],d=xe.Z.useWatch("newPassword",o);return c.createElement(re.Z,{className:"remove-button-default-styling",onClick:function(e){return e.stopPropagation()}},c.createElement(Te.Z,{centered:!0,closable:!1,confirmLoading:l,"data-testid":"modal-container",maskClosable:!1,okButtonProps:{form:"change-password-form",type:"primary",htmlType:"submit"},okText:s("label.update-entity",{entity:s("label.password")}),open:t,title:s("label.change-entity",{entity:s("label.password")}),width:500,onCancel:function(){o.resetFields(),n()}},c.createElement(xe.Z,{form:o,id:"change-password-form",layout:"vertical",name:"change-password-form",validateMessages:N.NG,onFinish:r},i&&c.createElement(xe.Z.Item,{"data-testid":"oldPassword",label:s("label.old-password"),name:"oldPassword",rules:[{required:!0}]},c.createElement(ge.Z.Password,{autoComplete:"off","data-testid":"input-oldPassword",placeholder:s("label.enter-type-password",{type:s("label.old")})})),c.createElement(xe.Z.Item,{label:s("label.new-password"),name:"newPassword",rules:[{required:!0},{pattern:ke.BV,message:s("message.password-error-message")}]},c.createElement(ge.Z.Password,{autoComplete:"off","data-testid":"input-newPassword",placeholder:s("label.enter-type-password",{type:s("label.new")})})),c.createElement(xe.Z.Item,{label:s("label.confirm-new-password"),name:"confirmPassword",rules:[{validator:function(e,t){return t!==d?Promise.reject(s("label.password-not-match")):Promise.resolve()}}]},c.createElement(ge.Z.Password,{autoComplete:"off","data-testid":"input-confirm-newPassword",placeholder:s("label.confirm-new-password")})))))},Le=n(27904),De=n(82775),Pe=n(25577),Ie=function(e){var t,n=e.userData,r=(0,a.CR)((0,c.useState)(!0),2),i=r[0],l=r[1],s=(0,c.useMemo)((function(){return(0,De.U)(De.G["6x"],null==n?void 0:n.images)}),[null==n?void 0:n.images]);return(0,c.useEffect)((function(){l(Boolean(s))}),[s]),c.createElement("div",{className:"profile-image-container","data-testid":"profile-image-container"},i?c.createElement(Le.Z,{alt:"profile","data-testid":"user-profile-image",preview:!1,referrerPolicy:"no-referrer",src:null!=s?s:"",onError:function(){l(!1)}}):c.createElement(Pe.Z,{displayName:(0,k.C_)(n),height:"54",name:null!==(t=null==n?void 0:n.name)&&void 0!==t?t:"",width:"54"}))},Ue=function(e){var t,n=e.userData,i=e.afterDeleteAction,s=e.updateUserDetails,o=(0,u.$)().t,d=(0,x.f)().fqn,m=(0,S.a)().isAdminUser,p=(0,A.N)(),f=p.authConfig,y=p.currentUser,g=(0,a.CR)((0,c.useState)(!1),2),b=g[0],E=g[1],w=(0,a.CR)((0,c.useState)(!1),2),Z=w[0],T=w[1],R=(0,a.CR)((0,c.useState)(n.displayName),2),L=R[0],D=R[1],P=(0,a.CR)((0,c.useState)(!1),2),I=P[0],U=P[1],O=(0,c.useMemo)((function(){return(null==f?void 0:f.provider)===be.Ho.Basic||(null==f?void 0:f.provider)===be.Ho.LDAP}),[f]),M=(0,c.useMemo)((function(){return d===(null==y?void 0:y.name)}),[d,y]),G=(0,c.useMemo)((function(){return(m||M)&&!n.deleted}),[m,M,n.deleted]),J=(0,c.useMemo)((function(){return O&&G}),[O,G]),_=(0,c.useMemo)((function(){var e;return null===(e=n.personas)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=n.defaultPersona)||void 0===t?void 0:t.id)}))}),[n]),F=(0,c.useCallback)((function(e){return D(e.target.value)}),[]),Y=(0,c.useCallback)((function(){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(e){switch(e.label){case 0:return L===n.displayName?[3,2]:(E(!0),[4,s({displayName:(0,l.isEmpty)(L)?void 0:L},"displayName")]);case 1:e.sent(),E(!1),e.label=2;case 2:return U(!1),[2]}}))}))}),[n.displayName,L,s]),q=(0,c.useCallback)((function(){D(n.displayName),U(!1)}),[n.displayName]),B=(0,c.useMemo)((function(){return J&&c.createElement(re.Z,{className:"w-full text-xs","data-testid":"change-password-button",type:"primary",onClick:function(e){e.stopPropagation(),T(!0)}},o("label.change-entity",{entity:o("label.password-lowercase")}))}),[J]),H=(0,c.useMemo)((function(){return!(0,Ce.P)(n.email)&&c.createElement(c.Fragment,null,c.createElement(v.Z,{align:"center"},c.createElement(r.Z.Text,{className:"text-grey-muted","data-testid":"user-email-label"},o("label.email")+" :"),c.createElement(r.Z.Paragraph,{className:"m-b-0","data-testid":"user-email-value"},n.email)),c.createElement(ye.Z,{type:"vertical"}))}),[n.email]),K=(0,c.useMemo)((function(){var e,t;return c.createElement("div",{className:"d-flex items-center gap-2"},c.createElement(r.Z.Text,{className:"text-grey-muted","data-testid":"user-domain-label"},o("label.domain")+" :"),c.createElement(Ze.y,{multiple:!0,domain:null==n?void 0:n.domains,entityFqn:null!==(e=n.fullyQualifiedName)&&void 0!==e?e:"",entityId:null!==(t=n.id)&&void 0!==t?t:"",entityType:C.py.USER,hasPermission:Boolean(m)&&!n.deleted,textClassName:"text-sm text-grey-muted"}))}),[n.domains,m]),W=(0,c.useCallback)((function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(t){switch(t.label){case 0:return[4,s({defaultPersona:e},"defaultPersona")];case 1:return t.sent(),[2]}}))}))}),[s]),V=(0,c.useMemo)((function(){return c.createElement(v.Z,{align:"center"},c.createElement(r.Z.Text,{className:"text-grey-muted","data-testid":"default-persona-label"},o("label.default-persona")+" :"),c.createElement(z,{showNoDataPlaceholder:!0,data:_?[_]:[],entityType:C.py.PERSONA,noDataPlaceholder:N.lH}),c.createElement(ue,{hasPermission:G,multiSelect:!1,personaList:n.personas,selectedPersonas:_?[_]:[],onUpdate:W}))}),[_,n.personas,G,W]),$=(0,c.useCallback)((function(){return(0,a.mG)(void 0,void 0,void 0,(function(){var e;return(0,a.Jh)(this,(function(t){switch(t.label){case 0:E(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,(0,Ne.Go)(n.id)];case 2:return t.sent(),i(!0),(0,we.XA)(o("message.entity-restored-success",{entity:o("label.user")})),[3,5];case 3:return e=t.sent(),(0,we.Eo)(e,o("server.entity-updating-error",{entity:o("label.user")})),[3,5];case 4:return E(!1),[7];case 5:return[2]}}))}))}),[n.id]);return c.createElement(c.Fragment,null,c.createElement(v.Z,{wrap:!0,className:"w-full justify-between","data-testid":"user-profile-details",size:"middle"},c.createElement(v.Z,{className:"w-full"},c.createElement(Ie,{userData:n}),I?c.createElement(Ae.Z,{isLoading:b,onCancel:q,onSave:Y},c.createElement(ge.Z,{className:"w-full","data-testid":"displayName",id:"displayName",name:"displayName",placeholder:o("label.display-name"),type:"text",value:L,onChange:F})):c.createElement(v.Z,{align:"center"},n.displayName&&c.createElement(r.Z.Text,{className:"font-medium text-md","data-testid":"user-name",ellipsis:{tooltip:!0},style:{maxWidth:"400px"}},n.displayName),M&&!n.deleted&&c.createElement(h.Z,{title:o("label."+((0,l.isEmpty)(n.displayName)?"add":"edit")+"-entity",{entity:o("label.display-name")})},c.createElement(le.ReactComponent,(0,a.pi)({className:"cursor-pointer align-middle",color:N.MJ,"data-testid":"edit-displayName"},N.K$,{onClick:function(e){e.stopPropagation(),U(!0)}})))),n.deleted&&c.createElement("span",{className:"deleted-badge-button","data-testid":"deleted-badge"},c.createElement(ve.Z,{className:"m-r-xss font-medium text-xs"}),o("label.deleted")),c.createElement(ye.Z,{type:"vertical"}),H,V,c.createElement(ye.Z,{type:"vertical"}),K),c.createElement("div",{className:"d-flex items-center gap-2"},B,c.createElement(Se.Z,{isRecursiveDelete:!0,afterDeleteAction:i,allowSoftDelete:!n.deleted,canDelete:m,deleted:n.deleted,displayName:(0,k.C_)(n),entityId:n.id,entityName:null!==(t=n.fullyQualifiedName)&&void 0!==t?t:n.name,entityType:C.py.USER,onRestoreEntity:$}))),J&&c.createElement(Re,{isLoading:b,isLoggedInUser:M,visible:Z,onCancel:function(){return T(!1)},onSave:function(e){return function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){var t,r,i;return(0,a.Jh)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,3,4]),E(!0),t={username:n.name,requestType:M?he.Self:he.User},r=(0,a.pi)((0,a.pi)({},e),t),[4,(0,Ee.Cp)(r)];case 1:return l.sent(),(0,we.XA)(o("server.update-entity-success",{entity:o("label.password")})),T(!1),[3,4];case 2:return i=l.sent(),(0,we.Eo)(i),[3,4];case 3:return E(!1),[7];case 4:return[2]}}))}))}(e)}}))},Oe=n(91894),Me=n(6351),Ge=function(e){var t=e.inheritedRoles,n=(0,u.$)().t;return c.createElement(Oe.Z,{className:"ant-card-feed relative card-body-border-none card-padding-y-0","data-testid":"user-profile-inherited-roles",key:"inherited-roles-card-component",title:c.createElement(r.Z.Text,{className:"right-panel-label m-b-0","data-testid":"inherited-roles-label"},n("label.inherited-role-plural"))},c.createElement(z,{data:null!=t?t:[],entityType:C.py.ROLE,icon:c.createElement(Me.ReactComponent,{height:20}),noDataPlaceholder:n("message.no-inherited-roles-found")}))},Je=n(34041),_e=n(80897),Fe=n(93895),Ye=function(e){var t=e.userRoles,n=e.isDeletedUser,i=e.updateUserDetails,s=e.isUserAdmin,o=(0,u.$)().t,d=(0,S.a)().isAdminUser,m=(0,a.CR)((0,c.useState)(!1),2),p=m[0],f=m[1],y=(0,a.CR)((0,c.useState)(!1),2),g=y[0],b=y[1],E=(0,a.CR)((0,c.useState)([]),2),w=E[0],Z=E[1],A=(0,a.CR)((0,c.useState)([]),2),x=A[0],T=A[1],R=(0,a.CR)((0,c.useState)(!1),2),L=R[0],D=R[1],P=(0,c.useMemo)((function(){var e=null==x?void 0:x.map((function(e){return{label:(0,k.C_)(e),value:e.id}}));return s||e.push({label:N.MH,value:(0,l.toLower)(N.MH)}),e}),[x,s,k.C_]),I=(0,c.useCallback)((function(){var e,n=(0,a.ev)((0,a.ev)([],(0,a.CR)(null!==(e=null==t?void 0:t.map((function(e){return e.id})))&&void 0!==e?e:[])),(0,a.CR)(s?[(0,l.toLower)(N.MH)]:[]));Z(n)}),[t,s]),U=(0,c.useMemo)((function(){return c.createElement(z,{data:(0,a.ev)((0,a.ev)([],(0,a.CR)(s?[{id:"admin",type:"role",name:N.MH}]:[])),(0,a.CR)(null!=t?t:[])),entityType:C.py.ROLE,icon:c.createElement(Me.ReactComponent,{height:20}),noDataPlaceholder:o("message.no-roles-assigned"),showNoDataPlaceholder:!s})}),[t,s]),O=(0,c.useCallback)((function(){f(!1),I()}),[I]);return(0,c.useEffect)((function(){I()}),[I]),(0,c.useEffect)((function(){p&&(0,l.isEmpty)(x)&&(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:b(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,_e.F3)("",void 0,void 0,!1,N.SF)];case 2:return e=n.sent(),T(e.data),[3,5];case 3:return t=n.sent(),(0,we.Eo)(t,o("server.entity-fetch-error",{entity:o("label.role-plural")})),[3,5];case 4:return b(!1),[7];case 5:return[2]}}))}))}),[p,x]),c.createElement(Oe.Z,{className:"ant-card-feed relative card-body-border-none card-padding-y-0","data-testid":"user-profile-roles",key:"roles-card",title:c.createElement(v.Z,{align:"center"},c.createElement(r.Z.Text,{className:"right-panel-label"},o("label.role-plural")),!p&&d&&!n&&c.createElement(h.Z,{title:o("label.edit-entity",{entity:o("label.role-plural")})},c.createElement(le.ReactComponent,(0,a.pi)({className:"cursor-pointer align-middle",color:N.MJ,"data-testid":"edit-roles-button"},N.K$,{onClick:function(){return f(!0)}}))))},c.createElement("div",{className:"m-b-md"},p&&d?c.createElement(Ae.Z,{direction:"vertical",isLoading:L,onCancel:O,onSave:function(){return(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 D(!0),e=w.filter((function(e){return e!==(0,l.toLower)(N.MH)})),t=w.find((function(e){return e===(0,l.toLower)(N.MH)})),[4,i({roles:e.map((function(e){var t,n=x.find((function(t){return t.id===e}));return{id:e,type:"role",name:null!==(t=null==n?void 0:n.name)&&void 0!==t?t:""}})),isAdmin:Boolean(t)},"roles")];case 1:return n.sent(),D(!1),f(!1),[2]}}))}))}},c.createElement(Je.Z,{allowClear:!0,showSearch:!0,"aria-label":"Select roles",className:"w-full","data-testid":"select-user-roles",filterOption:Fe.r8,id:"select-role",loading:g,maxTagCount:4,mode:"multiple",options:P,placeholder:o("label.role-plural"),value:g?[]:w,onChange:Z})):U))},qe=n(43443),Be=n(52807),He=function(e){var t=e.teams,n=e.isDeletedUser,i=e.updateUserDetails,l=(0,u.$)().t,s=(0,S.a)().isAdminUser,o=(0,a.CR)((0,c.useState)(!1),2),d=o[0],m=o[1],p=(0,a.CR)((0,c.useState)(!1),2),f=p[0],y=p[1],g=(0,a.CR)((0,c.useState)([]),2),b=g[0],E=g[1],w=(0,c.useMemo)((function(){return c.createElement(z,{data:(0,Fe.Jk)(null!=t?t:[]),entityType:C.py.TEAM,icon:c.createElement(qe.ReactComponent,{height:20}),noDataPlaceholder:l("message.no-team-found")})}),[t,Fe.Jk]),Z=(0,c.useCallback)((function(){E((0,Fe.Jk)(null!=t?t:[]))}),[t]),A=(0,c.useCallback)((function(){y(!1),Z()}),[Z]);return(0,c.useEffect)((function(){Z()}),[Z]),c.createElement(Oe.Z,{className:"relative card-body-border-none card-padding-y-0","data-testid":"user-team-card-container",key:"teams-card",title:c.createElement(v.Z,{align:"center"},c.createElement(r.Z.Text,{className:"right-panel-label"},l("label.team-plural")),!f&&s&&!n&&c.createElement(h.Z,{title:l("label.edit-entity",{entity:l("label.team-plural")})},c.createElement(le.ReactComponent,(0,a.pi)({className:"cursor-pointer align-middle",color:N.MJ,"data-testid":"edit-teams-button"},N.K$,{onClick:function(){return y(!0)}}))))},f&&s?c.createElement(Ae.Z,{direction:"vertical",isLoading:d,onCancel:A,onSave:function(){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(e){switch(e.label){case 0:return m(!0),[4,i({teams:b.map((function(e){return{id:e.id,type:"team"}}))},"teams")];case 1:return e.sent(),m(!1),y(!1),[2]}}))}))}},c.createElement(Be.Z,{filterJoinable:!0,maxValueCount:4,selectedTeams:b,onSelectionChange:E})):w)},Ke=function(e){var t,n,i=e.afterDeleteAction,s=e.userData,o=e.queryFilters,m=e.updateUserDetails,P=(0,d.UO)().tab,I=void 0===P?Q.ACTIVITY:P,U=(0,x.f)().fqn,O=(0,a.CR)((0,c.useState)(0),2),M=O[0],G=O[1],J=(0,S.a)().isAdminUser,_=(0,d.k6)(),F=(0,d.TH)(),Y=(0,A.N)().currentUser,q=(0,a.CR)((0,c.useState)(),2),B=q[0],H=q[1],K=(0,a.CR)((0,c.useState)(!1),2),W=K[0],V=K[1],$=(0,u.$)().t,j=(0,w.o)().getResourceLimit,re=(0,a.CR)((0,c.useState)([]),2),ie=re[0],le=re[1],se=(0,c.useMemo)((function(){return U===(null==Y?void 0:Y.name)}),[U]),oe=(0,c.useCallback)((function(e){H(e)}),[]),ce=(0,c.useCallback)((function(){se||I!==Q.ACCESS_TOKEN||_.push({pathname:(0,N.ZG)(U,Q.ACTIVITY),search:F.search})}),[I,U,se]);(0,c.useEffect)((function(){ce(),(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[4,j("user",!1)];case 1:return e=n.sent(),le(null!==(t=e.configuredLimit.disabledFields)&&void 0!==t?t:[]),[2]}}))}))}),[]);var pe=(0,c.useCallback)((function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(t){switch(t.label){case 0:return[4,m({personas:e},"personas")];case 1:return t.sent(),[2]}}))}))}),[m]),fe=(0,c.useCallback)((function(e){return c.createElement(p.Z,{className:"user-page-layout",wrap:!1},c.createElement(f.Z,{className:"user-layout-scroll",flex:"auto"},c.createElement(ne.Z,(0,a.pi)({isSummaryPanelOpen:!0,assetCount:M,permissions:(0,a.pi)((0,a.pi)({},R.Bd),{Create:!0}),onAddAsset:function(){return _.push(N.Z6.EXPLORE)},onAssetClick:oe},e))),B&&c.createElement(f.Z,{className:"user-page-layout-right-panel",flex:"400px"},c.createElement(te.Z,{entityDetails:B,handleClosePanel:function(){return H(void 0)}})))}),[B,M,oe,H]),he=(0,c.useMemo)((function(){return(0,a.ev)([{label:c.createElement(ee.Z,{id:Q.ACTIVITY,isActive:I===Q.ACTIVITY,name:$("label.activity")}),key:Q.ACTIVITY,children:c.createElement(L.ZP,{user:s.id},c.createElement(D.K,{entityType:C.py.USER,fqn:U,isForFeedTab:!1,onFeedUpdate:l.noop}))},{label:c.createElement(ee.Z,{id:Q.MY_DATA,isActive:I===Q.MY_DATA,name:$("label.my-data")}),key:Q.MY_DATA,children:fe({queryFilter:o.myData,type:ae.V.MY_DATA,noDataPlaceholder:{message:$("server.you-have-not-action-anything-yet",{action:$("label.owned-lowercase")})}})},{label:c.createElement(ee.Z,{id:Q.FOLLOWING,isActive:I===Q.FOLLOWING,name:$("label.following")}),key:Q.FOLLOWING,children:fe({queryFilter:o.following,type:ae.V.FOLLOWING,noDataPlaceholder:{message:$("server.you-have-not-action-anything-yet",{action:$("label.followed-lowercase")})}})}],(0,a.CR)(se?[{label:c.createElement(h.Z,{title:"You have reached the limit"},c.createElement(ee.Z,{id:Q.ACCESS_TOKEN,isActive:I===Q.ACCESS_TOKEN,name:$("label.access-token")})),disabled:ie.includes("personalAccessToken"),key:Q.ACCESS_TOKEN,children:c.createElement(me.Z,{isBot:!1})}]:[]))}),[I,s.id,U,H,fe,ie]),ve=(0,c.useCallback)((function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(t){switch(t.label){case 0:return[4,m({description:e},"description")];case 1:return t.sent(),V(!1),[2]}}))}))}),[m,V]),ye=(0,c.useMemo)((function(){var e;return se?c.createElement(X.Z,{description:null!==(e=s.description)&&void 0!==e?e:"",entityName:(0,k.C_)(s),entityType:C.py.USER,hasEditAccess:se,isEdit:W,showCommentsIcon:!1,onCancel:function(){return V(!1)},onDescriptionEdit:function(){return V(!0)},onDescriptionUpdate:ve}):c.createElement(v.Z,{direction:"vertical",size:"middle"},c.createElement(r.Z.Text,{className:"right-panel-label"},$("label.description")),c.createElement(r.Z.Paragraph,{className:"m-b-0"},(0,l.isEmpty)(s.description)?$("label.no-entity",{entity:$("label.description")}):s.description))}),[s,J,W,se,k.C_,ve]),ge=(0,c.useMemo)((function(){return c.createElement(Ue,{afterDeleteAction:i,updateUserDetails:m,userData:s})}),[s,i,m]);return(0,c.useEffect)((function(){var e;[Q.MY_DATA,Q.FOLLOWING].includes(I)&&(e=I===Q.MY_DATA?o.myData:o.following,(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:return a.trys.push([0,2,,3]),[4,(0,T.rg)("",1,0,e,"","",Z.W.ALL)];case 1:return t=a.sent(),G(null!==(n=t.data.hits.total.value)&&void 0!==n?n:0),[3,3];case 2:return a.sent(),G(0),[3,3];case 3:return[2]}}))})))}),[I]),c.createElement(de.Z,{className:"user-layout h-full",pageTitle:$("label.user")},c.createElement("div",{"data-testid":"user-profile"},c.createElement(y.Z,{accordion:!0,bordered:!1,className:"header-collapse-custom-collapse user-profile-container"},c.createElement(y.Z.Panel,{className:"header-collapse-custom-panel",header:ge,key:"1"},c.createElement(p.Z,{className:"border-top p-y-lg",gutter:[0,24]},c.createElement(f.Z,{span:24},c.createElement(p.Z,{"data-testid":"user-profile-accessibility-details"},c.createElement(f.Z,{className:"p-x-sm border-right",span:6},c.createElement(He,{isDeletedUser:s.deleted,teams:s.teams,updateUserDetails:m})),c.createElement(f.Z,{className:"p-x-sm border-right",span:6},c.createElement(Ye,{isDeletedUser:s.deleted,isUserAdmin:s.isAdmin,updateUserDetails:m,userRoles:s.roles})),c.createElement(f.Z,{className:"p-x-sm border-right",span:6},c.createElement(Ge,{inheritedRoles:s.inheritedRoles})),c.createElement(f.Z,{className:"p-x-sm",span:6},c.createElement("div",{className:"d-flex flex-col justify-between h-full"},c.createElement(b.Z,{className:"ant-card-feed relative card-body-border-none card-padding-y-0",title:c.createElement(r.Z.Text,{className:"right-panel-label items-center d-flex gap-2","data-testid":"persona-list"},$("label.persona"),c.createElement(ue,{multiSelect:!0,hasPermission:Boolean(J)&&!s.deleted,selectedPersonas:null!==(t=s.personas)&&void 0!==t?t:[],onUpdate:pe}))},c.createElement(z,{showNoDataPlaceholder:!0,data:null!==(n=s.personas)&&void 0!==n?n:[],entityType:C.py.PERSONA,icon:c.createElement(E.ReactComponent,{height:20}),noDataPlaceholder:$("message.no-persona-assigned")})))))),c.createElement(f.Z,{className:"border-top p-lg p-b-0",span:24},ye)))),c.createElement(g.Z,{destroyInactiveTabPane:!0,activeKey:null!=I?I:Q.ACTIVITY,className:"user-page-tabs","data-testid":"tabs",items:he,onChange:function(e){F.search="",e!==I&&_.push({pathname:(0,N.ZG)(U,e),search:F.search})}})))},We=n(34530),Ve=function(){var e=(0,d.k6)(),t=(0,u.$)().t,n=(0,x.f)().fqn,s=(0,a.CR)((0,c.useState)(!0),2),p=s[0],f=s[1],h=(0,a.CR)((0,c.useState)({}),2),v=h[0],y=h[1],g=(0,a.CR)((0,c.useState)(!1),2),b=g[0],E=g[1],w=(0,A.N)(),Z=w.currentUser,S=w.updateCurrentUser,T=(0,c.useMemo)((function(){var e,t=(null!==(e=v.teams)&&void 0!==e?e:[]).map((function(e){return e.id}));return"("+(0,a.ev)((0,a.ev)([],(0,a.CR)(t.map((function(e){return"owners.id:"+e})))),["owners.id:"+v.id]).join(" OR ")+")"}),[v]),k=(0,c.useMemo)((function(){return"followers:"+v.id}),[v.id]),R=(0,c.useMemo)((function(){return c.createElement("div",{className:"d-flex items-center justify-center h-full","data-testid":"error"},c.createElement(r.Z.Paragraph,{className:"text-base","data-testid":"error-message"},c.createElement(Fe.u1,{i18nKey:"message.no-username-available",renderElement:c.createElement("strong",{"data-testid":"username"}),values:{user:n}})))}),[n]),L=(0,c.useCallback)((function(e,n){return(0,a.mG)(void 0,void 0,void 0,(function(){var r,s,o,c,u,d,m,p;return(0,a.Jh)(this,(function(f){switch(f.label){case 0:r=(0,a.pi)((0,a.pi)({},v),e),s=(0,i.qu)(v,r),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,(0,Ne.f_)(v.id,s)];case 2:if(!(o=f.sent()))throw t("message.unexpected-error");return c=void 0,"roles"===n?c={roles:o.roles,isAdmin:o.isAdmin}:((p={})[n]=o[n],c=p),u=(0,a.pi)((0,a.pi)({},Z),c),d=(0,a.pi)((0,a.pi)({},v),c),"defaultPersona"===n&&(0,l.isUndefined)(o.defaultPersona)&&(delete u[n],delete d[n]),v.id===(null==Z?void 0:Z.id)&&S(u),y((0,l.omitBy)(d,l.isUndefined)),[3,4];case 3:return m=f.sent(),(0,we.Eo)(m),[3,4];case 4:return[2]}}))}))}),[v,Z,S]),D=(0,c.useCallback)((function(){y((function(e){return(0,a.pi)((0,a.pi)({},e),{deleted:!(null==e?void 0:e.deleted)})}))}),[y]),P=(0,c.useCallback)((function(t){return t?D():e.push(N.Z6.HOME)}),[D]);return(0,c.useEffect)((function(){(0,a.mG)(void 0,void 0,void 0,(function(){var e,r;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),[4,(0,Ne.gs)(n,{fields:[C.GB.PROFILE,C.GB.ROLES,C.GB.TEAMS,C.GB.PERSONAS,C.GB.DEFAULT_PERSONA,C.GB.DOMAINS],include:We.y.All})];case 1:return e=a.sent(),y(e),[3,4];case 2:return r=a.sent(),(0,we.Eo)(r,t("server.entity-fetch-error",{entity:t("label.entity-detail-plural",{entity:t("label.user")})})),E(!0),[3,4];case 3:return f(!1),[7];case 4:return[2]}}))}))}),[n]),p?c.createElement(m.Z,null):b&&(0,l.isEmpty)(v)?R:c.createElement(Ke,{afterDeleteAction:P,handlePaginate:function(t){e.push({search:o().stringify({page:t})})},queryFilters:{myData:T,following:k},updateUserDetails:L,userData:v})}},80897:function(e,t,n){n.d(t,{$j:function(){return f},F3:function(){return s},Ko:function(){return o},QW:function(){return v},_d:function(){return d},cN:function(){return h},dV:function(){return y},n5:function(){return c},sZ:function(){return p},u$:function(){return m},u7:function(){return u}});var a=n(70655),r=n(40734),i=n(2598),l={headers:{"Content-type":"application/json-patch+json"}},s=function(e,t,n,r,l){return void 0===r&&(r=!1),void 0===l&&(l=10),(0,a.mG)(void 0,void 0,void 0,(function(){var s;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:return s={default:r,limit:l,fields:e,after:t,before:n},[4,i.Z.get("/roles",{params:s})];case 1:return[2,a.sent().data]}}))}))},o=function(e,t,n,r){return void 0===r&&(r=10),(0,a.mG)(void 0,void 0,void 0,(function(){var l;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:return l={limit:r,fields:e,after:t,before:n},[4,i.Z.get("/policies",{params:l})];case 1:return[2,a.sent().data]}}))}))},c=function(e,t){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(n){switch(n.label){case 0:return[4,i.Z.get("/roles/name/"+(0,r.Yd)(e),{params:{fields:t}})];case 1:return[2,n.sent().data]}}))}))},u=function(e,t){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(n){switch(n.label){case 0:return[4,i.Z.get("/policies/name/"+(0,r.Yd)(e),{params:{fields:t}})];case 1:return[2,n.sent().data]}}))}))},d=function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(t){switch(t.label){case 0:return[4,i.Z.post("/roles",e)];case 1:return[2,t.sent().data]}}))}))},m=function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(t){switch(t.label){case 0:return[4,i.Z.post("/policies",e)];case 1:return[2,t.sent().data]}}))}))},p=function(e,t){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(n){switch(n.label){case 0:return[4,i.Z.patch("/roles/"+t,e,l)];case 1:return[2,n.sent().data]}}))}))},f=function(e,t){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(n){switch(n.label){case 0:return[4,i.Z.patch("/policies/"+t,e,l)];case 1:return[2,n.sent().data]}}))}))},h=function(){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(e){switch(e.label){case 0:return[4,i.Z.get("/policies/resources")];case 1:return[2,e.sent().data]}}))}))},v=function(){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(e){switch(e.label){case 0:return[4,i.Z.get("/policies/functions")];case 1:return[2,e.sent().data]}}))}))},y=function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){return(0,a.Jh)(this,(function(t){switch(t.label){case 0:return[4,i.Z.get("/policies/validation/condition/"+e)];case 1:return[2,t.sent()]}}))}))}},45633:function(e,t,n){n.d(t,{P:function(){return E},vZ:function(){return N},y5:function(){return b}});var a=n(19586),r=n(19650),i=n(55241),l=n(60331),s=n(23031),o=n(96486),c=n(67294),u=n(76),d=n(46042),m=n(70431),p=n(62761),f=n(57203),h=n(93895),v=n(24671),y=n(12981),g=n(96840),b=function(e){return[{title:(0,s.t)("label.username"),dataIndex:"username",key:"username",render:function(e,t){return(n=t).name?c.createElement("div",{className:"w-fit-content"},c.createElement(d.Z,{showUserName:!0,profileWidth:16,userName:n.name})):(0,v.C_)(n);var n}},{title:(0,s.t)("label.team-plural"),dataIndex:"teams",key:"teams",render:function(t,n){var d,m;if(e)return c.createElement(a.Z,{active:!0,paragraph:!1});var p=null!==(m=null===(d=n.teams)||void 0===d?void 0:d.length)&&void 0!==m?m:0,f=p>y.YD;return(0,o.isUndefined)(n.teams)||(0,o.isEmpty)(n.teams)?c.createElement(c.Fragment,null,(0,s.t)("label.no-entity",{entity:(0,s.t)("label.team")})):c.createElement(r.Z,{wrap:!0,"data-testid":"policy-link",size:4},n.teams.slice(0,y.YD).map((function(e){var t;return c.createElement(u.Link,{className:"cursor-pointer",key:(0,o.uniqueId)(),to:(0,g.KH)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"")},(0,v.C_)(e))})),f&&c.createElement(i.Z,{className:"cursor-pointer",content:c.createElement(r.Z,{wrap:!0,size:4},n.teams.slice(y.YD).map((function(e){var t;return c.createElement(u.Link,{className:"cursor-pointer",key:(0,o.uniqueId)(),to:(0,g.KH)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"")},(0,v.C_)(e))}))),overlayClassName:"w-40",trigger:"click"},c.createElement(l.Z,{className:"m-l-xs","data-testid":"plus-more-count"},"+"+(p-y.YD)+" more")))}},{title:(0,s.t)("label.role-plural"),dataIndex:"roles",key:"roles",render:function(t,n){var d,m,p=null!==(m=null===(d=n.roles)||void 0===d?void 0:d.length)&&void 0!==m?m:0,f=p>y.YD;return e?c.createElement(a.Z,{active:!0,paragraph:!1}):(0,o.isUndefined)(n.roles)||(0,o.isEmpty)(n.roles)?c.createElement(c.Fragment,null,(0,s.t)("label.no-entity",{entity:(0,s.t)("label.role")})):c.createElement(r.Z,{wrap:!0,"data-testid":"policy-link",size:4},n.roles.slice(0,y.YD).map((function(e){var t;return c.createElement(u.Link,{className:"cursor-pointer",key:(0,o.uniqueId)(),to:(0,g.Uy)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"")},(0,v.C_)(e))})),f&&c.createElement(i.Z,{className:"cursor-pointer",content:c.createElement(r.Z,{wrap:!0,size:4},n.roles.slice(y.YD).map((function(e){var t;return c.createElement(u.Link,{className:"cursor-pointer",key:(0,o.uniqueId)(),to:(0,g.Uy)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"")},(0,v.C_)(e))}))),overlayClassName:"w-40",trigger:"click"},c.createElement(l.Z,{className:"m-l-xs","data-testid":"plus-more-count"},"+"+(p-y.YD)+" more")))}}]},E=function(e){return e===f.v},N=function(e){var t,n=e.error,a=e.entity,r=e.entityLowercase,i=e.entityName;if(n){if((0,h.B)(n,p.c9.alreadyExist))return(0,s.t)("server.email-already-exist",{entity:null!=r?r:"",name:null!=i?i:""});if((null===(t=n.response)||void 0===t?void 0:t.status)===m.N.LIMIT_REACHED)return(0,s.t)("server.entity-limit-reached",{entity:a})}return(0,s.t)("server.create-entity-error",{entity:a})}}}]);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy