1"use strict";(self.webpackChunkonomondo_app=self.webpackChunkonomondo_app||[]).push([[5297],{58473(e,t,n){n.r(t),n.d(t,{default:()=>F});var r=()=>n(16654),a=()=>n(5220),o=()=>n(96540);o();var i=n(37283),s=n(64467),l=n(80296),c=n(41376),u=n(89057),d=n(85532),h=n(3198),f=n(82223),p=n(16726),g=n(16075),b=n.n(g),m=n(5556),x=n.n(m),y=n(31848),v=n(68904),w=n(54316);r(),a();var j=n(10467),k=n(54756),O=n.n(k),C=o(),E=C.useState,W=C.useCallback,T=C.useEffect,D=r().default,P=a().default,I=n(68241).default;var A=n(54440),S=n(74848);function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach(function(t){(0,s.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var K=function(e){var t=e.headerText,n=e.text;return(0,S.jsx)(c.bL,{color:"yellow",variant:"surface",size:"1",children:(0,S.jsxs)(u.s,{align:"start",gap:"2",children:[(0,S.jsx)(c.In,{children:(0,S.jsx)(y.A,{name:"information",width:16,height:16,color:"var(--warning-a11)"})}),(0,S.jsxs)(u.s,{direction:"column",children:[(0,S.jsx)(c.EY,{color:"brown",weight:"bold",children:t}),(0,S.jsx)(d.a,{maxHeight:"230px",overflowY:"scroll",children:(0,S.jsx)(c.EY,{color:"brown",children:(0,S.jsx)(h.E,{children:n})})})]})]})})};K.propTypes={headerText:x().string,text:x().string};var z=function(e){var t,n,r=e.originalData,a=e.confirmEditFn,i=e.loading,s=e.confirmEditData,c=e.setConfirmEditData,d=e.setIsEditDialogOpen,h=e.setLoading,g=(0,o().useState)(!0),b=(0,l.A)(g,2),m=b[0],x=b[1];if(i)return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("p",{children:"Checking if change can be made"}),(0,S.jsx)(v.A,{})]});var y=!1;null===(t=s.networkWhitelistChanges)||void 0===t||t.forEach(function(e){null!=e&&e.shouldKeepCurrentNetworkWhitelist||(y=!0)});var w=[];null===(n=s.networkWhitelistChanges)||void 0===n||n.forEach(function(e){if(e.networksThatWillBeRemoved.length>0){var t=e.networksThatWillBeRemoved.map(function(e){return{networkWhitelist:e.networkWhitelist,network:e.name}});w.push(t)}});var j=s.organization.entity.before!==s.organization.entity.after,k=s.losing.apiKeys.status,O=s.losing.apiKeys.count,C=s.losing.connectors.status,E=s.losing.connectors.count,W=s.losing.webhooks.status,T=s.losing.webhooks.count;k||C||W||y||w.length||a(r);var D=s.networkWhitelistChanges.filter(function(e){return!e.shouldKeepCurrentNetworkWhitelist}).map(function(e){return e.networkWhiteListDataBeforeChange.name}).join(", "),P=w.map(function(e){return e.map(function(e){return" ".concat(e.network," (").concat(e.networkWhitelist,")")})}).join(", ");return(0,S.jsx)(f.bL,{open:m,onOpenChange:x,children:(0,S.jsxs)(f.UC,{maxWidth:"450px",children:[(0,S.jsx)(f.hE,{children:"Are you sure you want to edit this organization?"}),(0,S.jsx)(f.VY,{size:"2",children:(0,S.jsxs)(u.s,{direction:"column",gapY:"3",children:[j&&(0,S.jsx)(K,{headerText:"Entity change to:",text:r.entity}),k&&(0,S.jsx)(K,{headerText:"Will lose API access:",text:"".concat(O," API keys will be lost")}),C&&(0,S.jsx)(K,{headerText:"Will lose Connectors access:",text:"".concat(E," Connectors will be lost")}),W&&(0,S.jsx)(K,{headerText:"Will lose Webhooks access:",text:"".concat(T," Webhooks will be lost")}),y&&(0,S.jsx)(K,{headerText:"Will delete these network lists:",text:D}),w&&(0,S.jsx)(K,{headerText:"Will lose access to these networks:",text:P})]})}),(0,S.jsxs)(u.s,{gap:"3",mt:"4",justify:"end",align:"center",children:[(0,S.jsx)(p.$,{onClick:function(){c(null),h(!1)},variant:"ghost",radius:"full",color:"gray",children:"Cancel"}),(0,S.jsx)(p.$,{variant:"outline",color:"gray",highContrast:!0,radius:"full",onClick:function(){a(r),c(null),d(!1),h(!1)},children:"Save changes"})]})]})})};z.propTypes={originalData:x().shape({entity:x().string}),confirmEditFn:x().func,loading:x().bool,confirmEditData:x().shape({organization:x().shape({entity:x().shape({before:x().string,after:x().string})}),losing:x().shape({apiKeys:x().shape({status:x().bool,count:x().number}),connectors:x().shape({status:x().bool,count:x().number}),webhooks:x().shape({status:x().bool,count:x().number})}),networkWhitelistChanges:x().object}),setConfirmEditData:x().func,setIsEditDialogOpen:x().func,setLoading:x().func};const N=function(){var e=(0,r().default)().isGod,t=(0,a().default)(),n=(0,A.A)(),i=function(){var e=D(),t=e.isLoggedIn,n=e.isGod,r=P().isOrgGod,a=E(!0),o=(0,l.A)(a,2),i=o[0],s=o[1],c=E(null),u=(0,l.A)(c,2),d=u[0],h=u[1],f=E(null),p=(0,l.A)(f,2),g=p[0],b=p[1],m=W((0,j.A)(O().mark(function e(){var a,o;return O().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&(n||r)){e.next=1;break}return e.abrupt("return");case 1:return e.prev=1,e.next=2,I.get("/pricelists");case 2:a=e.sent,h(a.data),s(!1),e.next=4;break;case 3:e.prev=3,o=e.catch(1),b(o),s(!1);case 4:case"end":return e.stop()}},e,null,[[1,3]])}
1)),[t,n,r]);return T(function(){s(!0),m()},[m]),{loading:i,data:d,error:g,get:m}}().data,s=(0,o().useState)(""),c=(0,l.A)(s,2),u=c[0],d=c[1],h=(0,o().useMemo)(function(){if(!t.data)return null;var e=t.data;u&&(e=e.filter(function(e){return e.id.toString().includes(u)||e.entity.toLowerCase().includes(u.toLowerCase())})),t.pagination.setTotalItems(e.length);var n=t.pagination.getOffset();return e.slice(n,n+t.pagination.itemsPerPage)},[t.data,t.pagination,u]),f=null!=n&&n.featureList?n.featureList.map(function(e){return e.name}):[],p=i?i.map(function(e){return{value:e.id,label:e.name}}):[],g=[{key:"id",label:"Id",shrink:!0,canOrder:!0},{key:"entity",label:"Entity",maxWidth:600,canOrder:!0},{key:"featureBundleName",label:"Software Package",canOrder:!0,hide:t.isOrgGod},{key:"pricelistTypeName",label:"Pricelist Type",canOrder:!0,hide:t.isOrgGod},{key:"hubspotCompanyId",label:"Hubspot company ID",canOrder:!0,hide:t.isOrgGod},{key:"buttons",label:""}],m=[{autoFocus:!0,type:"text",label:"Entity",valueKey:"entity",validation:b().string().required()},{type:"number",label:"Hubspot company ID",valueKey:"hubspotCompanyId",validation:b().number().allow(null).default(null).min(0).empty("")},{type:"combobox",label:"Software Package",valueKey:"featureBundleName",items:f,canSearch:!0,validation:b().string().required()},{type:"combobox",label:"Pricelist Type",valueKey:"pricelistTypeId",items:p,canSearch:!0,validation:b().string().required()}],x={value:u,onChange:function(e){t.pagination.resetPages(),d(e.target.value)},clear:function(){d("")},reset:function(){d(""),t.pagination.resetPages()},placeholder:"Search by ID or entity...",width:"220px"};return(0,S.jsx)(w.A,{formDefinition:m,noun:"organization",model:G(G({},t),{},{data:h,search:x}),order:g,goToLinkFn:e||t.isOrgGod?function(e,t){return"".concat(e,"/").concat(t.id)}:void 0,canWrite:e,canCreate:e||t.isOrgGod,confirmEdit:!0,ConfirmDialogContent:z,hideTableTitle:!0,noItemIconName:"wow-mondo"})};var B=n(32559);const F=function(){var e=(0,r().default)(),t=e.isGod,n=e.assumeOrganizationId;return(0,o().useEffect)(function(){n(null)},[n]),(0,S.jsxs)(i.A,{children:[t&&(0,S.jsx)(B.A,{}),(0,S.jsx)(N,{})]})}}}]); 2//# sourceMappingURL=organizations.da1ccbb458a1b75bcc85.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.