@strapi/admin 4.3.0-beta.2 → 4.3.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/components/LeftMenu/index.js +12 -2
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +4 -3
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/cleanData.js +0 -8
- package/admin/src/content-manager/components/PreviewWysiwyg/Wrapper.js +7 -13
- package/admin/src/content-manager/components/SelectOne/SingleValue.js +3 -1
- package/admin/src/content-manager/components/SelectOne/index.js +1 -4
- package/admin/src/content-manager/components/SelectWrapper/Option.js +21 -21
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/index.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +2 -2
- package/admin/src/content-manager/pages/ListView/FieldPicker/index.js +9 -1
- package/admin/src/content-manager/utils/removeKeyInObject.js +0 -4
- package/admin/src/index.js +1 -1
- package/admin/src/pages/Admin/index.js +6 -2
- package/admin/src/pages/App/index.js +4 -0
- package/admin/src/pages/InstalledPluginsPage/Plugins.js +10 -2
- package/admin/src/pages/ProfilePage/index.js +19 -18
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/utils/layout.js +3 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/DynamicTable/TableRows/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/utils/tableHeaders.js +18 -4
- package/admin/src/pages/SettingsPage/pages/Users/components/SelectRoles/index.js +4 -1
- package/admin/src/translations/en.json +36 -0
- package/admin/src/translations/gu.json +618 -0
- package/admin/src/translations/languageNativeNames.js +2 -0
- package/admin/src/translations/ml.json +699 -0
- package/admin/src/translations/zh-Hans.json +55 -8
- package/build/109.1464fd6e.chunk.js +2 -0
- package/build/{9262.25aa12a5.chunk.js → 1669.341e10d8.chunk.js} +1 -1
- package/build/3332.1e443103.chunk.js +102 -0
- package/build/{5520.9dcd6a9f.chunk.js → 5520.3c6bf86a.chunk.js} +35 -35
- package/build/{9166.5c585d7c.chunk.js → 8655.9073e17e.chunk.js} +59 -58
- package/build/{8773.16dea88d.chunk.js → 8773.83d4a28b.chunk.js} +7 -7
- package/build/9799.ce46400f.chunk.js +760 -0
- package/build/Admin-authenticatedApp.dd060dfe.chunk.js +80 -0
- package/build/{2336.cb1c0d6e.chunk.js → Admin_InternalErrorPage.25c53284.chunk.js} +1 -1
- package/build/{Admin_homePage.e3571a75.chunk.js → Admin_homePage.118926e0.chunk.js} +1 -1
- package/build/{Admin_marketplace.284bf8fc.chunk.js → Admin_marketplace.8efd3fd0.chunk.js} +1 -1
- package/build/Admin_pluginsPage.0992c2b5.chunk.js +1 -0
- package/build/Admin_profilePage.35ce8e94.chunk.js +15 -0
- package/build/Admin_settingsPage.5fc517d7.chunk.js +178 -0
- package/build/admin-app.1bd5f67e.chunk.js +112 -0
- package/build/{admin-edit-roles-page.33647266.chunk.js → admin-edit-roles-page.358d98c1.chunk.js} +1 -1
- package/build/admin-edit-users.714863af.chunk.js +10 -0
- package/build/admin-users.2bd6fb37.chunk.js +11 -0
- package/build/{api-tokens-create-page.efa1d2aa.chunk.js → api-tokens-create-page.442e3be0.chunk.js} +1 -1
- package/build/{api-tokens-edit-page.6101f051.chunk.js → api-tokens-edit-page.5f34eec7.chunk.js} +1 -1
- package/build/{api-tokens-list-page.782e872f.chunk.js → api-tokens-list-page.5ea3f6ce.chunk.js} +1 -1
- package/build/{content-manager.adf6fc82.chunk.js → content-manager.57c1cfe3.chunk.js} +62 -66
- package/build/{2863.bf3c1eff.chunk.js → content-type-builder-list-view.b12687b2.chunk.js} +1 -1
- package/build/content-type-builder-translation-en-json.201bfb78.chunk.js +1 -0
- package/build/content-type-builder.b2cbf2e9.chunk.js +142 -0
- package/build/{email-settings-page.d72e7f4c.chunk.js → email-settings-page.818761d5.chunk.js} +1 -1
- package/build/email-translation-en-json.3d74ff95.chunk.js +1 -0
- package/build/email-translation-zh-Hans-json.8172da08.chunk.js +1 -0
- package/build/en-json.6d70e9ff.chunk.js +1 -0
- package/build/gu-json.dafa6f0d.chunk.js +1 -0
- package/build/{i18n-settings-page.8803df0b.chunk.js → i18n-settings-page.9d426e96.chunk.js} +1 -1
- package/build/i18n-translation-en-json.760250ae.chunk.js +1 -0
- package/build/i18n-translation-ko-json.b2d90a83.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/{main.689d6439.js → main.407d75cc.js} +530 -543
- package/build/ml-json.dc946c7f.chunk.js +1 -0
- package/build/runtime~main.70365303.js +2 -0
- package/build/{sso-settings-page.2bae79df.chunk.js → sso-settings-page.445184e0.chunk.js} +1 -1
- package/build/{upload-settings.f1e587c0.chunk.js → upload-settings.4bad0bdd.chunk.js} +1 -1
- package/build/upload-translation-en-json.bc79c867.chunk.js +1 -0
- package/build/upload-translation-zh-Hans-json.37a2981e.chunk.js +1 -0
- package/build/{upload.1346f4b1.chunk.js → upload.b2cb62bd.chunk.js} +2 -2
- package/build/users-providers-settings-page.a0b0fe39.chunk.js +1 -0
- package/build/{users-roles-settings-page.1206751f.chunk.js → users-roles-settings-page.3db986a4.chunk.js} +1 -1
- package/build/{webhook-edit-page.5c9bada0.chunk.js → webhook-edit-page.3417d93c.chunk.js} +2 -2
- package/build/{webhook-list-page.822927af.chunk.js → webhook-list-page.2ab4bbf0.chunk.js} +1 -1
- package/build/zh-Hans-json.eac1d90a.chunk.js +1 -0
- package/ee/admin/pages/SettingsPage/pages/Roles/CreatePage/index.js +3 -3
- package/package.json +22 -15
- package/webpack.alias.js +1 -2
- package/webpack.config.js +2 -5
- package/build/3531.ef1d2cfc.chunk.js +0 -10
- package/build/5250.9988a0ad.chunk.js +0 -12
- package/build/5833.970a963d.chunk.js +0 -112
- package/build/6925.fb35248e.chunk.js +0 -761
- package/build/Admin-authenticatedApp.d38dc4dd.chunk.js +0 -80
- package/build/Admin_pluginsPage.8537476f.chunk.js +0 -1
- package/build/Admin_profilePage.b7f85e78.chunk.js +0 -15
- package/build/Admin_settingsPage.858ef0d7.chunk.js +0 -178
- package/build/admin-edit-users.8cd7519b.chunk.js +0 -10
- package/build/admin-users.6581eec5.chunk.js +0 -11
- package/build/content-type-builder-translation-en-json.e5110288.chunk.js +0 -1
- package/build/content-type-builder.366a3b10.chunk.js +0 -142
- package/build/email-translation-en-json.6da7e388.chunk.js +0 -1
- package/build/email-translation-zh-Hans-json.b463cb25.chunk.js +0 -1
- package/build/en-json.729eb94d.chunk.js +0 -1
- package/build/i18n-translation-en-json.85bc892c.chunk.js +0 -1
- package/build/i18n-translation-ko-json.d0bc1203.chunk.js +0 -1
- package/build/runtime~main.308a7c41.js +0 -2
- package/build/upload-translation-en-json.fddec9a6.chunk.js +0 -1
- package/build/upload-translation-zh-Hans-json.6832ff81.chunk.js +0 -1
- package/build/users-providers-settings-page.82a4ba58.chunk.js +0 -101
- package/build/zh-Hans-json.cbc69f3d.chunk.js +0 -1
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[801],{19782:(H,C,n)=>{n.r(C),n.d(C,{default:()=>en});var e=n(32735),i=n(88425),b=n(84968),P=n(33795),X=n.n(P);const M=JSON.parse('{"i8":"4.3.0-beta.2"}');var $=n(45861),c=n(5141),N=n(4409),L=n(74506),K=n(51968),F=n(88311),G=n.n(F),O=n(58107),T=n(19615),U=n(60216),r=n.n(U),l=n(5636),v=n(64410),E=n(54742),g=n(19192),R=n(9808),J=n(90662),be=n(20763),oe=n(44526),Ne=n(94009),Ge=n.n(Ne);const Ue=(0,T.default)(g.Flex)`
|
|
2
|
-
position: fixed;
|
|
3
|
-
z-index: 4;
|
|
4
|
-
inset: 0;
|
|
5
|
-
/* this is theme.colors.neutral800 with opacity */
|
|
6
|
-
background: ${({theme:t})=>`${t.colors.neutral800}1F`};
|
|
7
|
-
`,se=({onClose:t,onSkip:a,children:o,hideSkip:s})=>{const{formatMessage:p}=(0,l.useIntl)();return e.createElement(v.Portal,null,e.createElement(Ue,{onClick:t,padding:8,justifyContent:"center"},e.createElement(E.FocusTrap,{onEscape:t},e.createElement(J.Stack,{background:"neutral0",width:(0,i.pxToRem)(660),shadow:"popupShadow",hasRadius:!0,padding:4,spacing:8,role:"dialog","aria-modal":!0,onClick:d=>d.stopPropagation()},e.createElement(g.Flex,{justifyContent:"flex-end"},e.createElement(be.IconButton,{onClick:t,"aria-label":p({id:"app.utils.close-label",defaultMessage:"Close"}),icon:e.createElement(Ge(),null)})),e.createElement(R.Box,{paddingLeft:7,paddingRight:7,paddingBottom:s?8:0},o),!s&&e.createElement(g.Flex,{justifyContent:"flex-end"},e.createElement(oe.Button,{variant:"tertiary",onClick:a},p({id:"app.components.GuidedTour.skip",defaultMessage:"Skip the tour"})))))))};se.propTypes={children:r().node.isRequired,onClose:r().func.isRequired,onSkip:r().func.isRequired,hideSkip:r().bool.isRequired};const Fe=se;var re=n(49415);const ie={stepContent:null,sectionIndex:null,stepIndex:null,hasSectionAfter:!1,hasStepAfter:!1},We=(t=ie,a)=>(0,re.default)(t,o=>{switch(a.type){case"UPDATE_MODAL":{o.stepContent=a.content,o.sectionIndex=a.newSectionIndex,o.stepIndex=a.newStepIndex,o.hasSectionAfter=a.newHasSectionAfter,o.hasStepAfter=a.newHasStepAfter;break}default:return o}});var S=n(95602),je=n(30345),le=n.n(je);const $e=T.default.li`
|
|
8
|
-
list-style: disc;
|
|
9
|
-
`,de=({id:t,defaultMessage:a})=>{const{formatMessage:o}=(0,l.useIntl)();return e.createElement(J.Stack,{spacing:4,paddingBottom:6},o({id:t,defaultMessage:a},{documentationLink:s=>e.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest-api.html#api-parameters"},s),b:s=>e.createElement(S.Typography,{fontWeight:"semiBold"},s),p:s=>e.createElement(S.Typography,null,s),light:s=>e.createElement(S.Typography,{textColor:"neutral600"},s),ul:s=>e.createElement(R.Box,{paddingLeft:6},e.createElement("ul",null,s)),li:s=>e.createElement($e,null,s)}))};de.propTypes={id:r().string.isRequired,defaultMessage:r().string.isRequired};const Ke=de;var w=n(78024),Ve=n(14317);const q=({number:t,last:a,type:o})=>e.createElement(R.Box,{paddingTop:3,paddingBottom:a?0:3},e.createElement(Ve.Z,{number:t,type:o}));q.defaultProps={number:void 0,last:!1,type:""},q.propTypes={number:r().number,last:r().bool,type:r().string};const ce=q;var W=n(23678),ze=Object.defineProperty,pe=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable,ue=(t,a,o)=>a in t?ze(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o,Ze=(t,a)=>{for(var o in a||(a={}))He.call(a,o)&&ue(t,o,a[o]);if(pe)for(var o of pe(a))ke.call(a,o)&&ue(t,o,a[o]);return t};const _=({title:t,content:a,cta:o,onCtaClick:s,sectionIndex:p,stepIndex:d,hasSectionAfter:f})=>{const{formatMessage:y}=(0,l.useIntl)(),h=p>0,m=d>0,D=p+1;return e.createElement(e.Fragment,null,e.createElement(g.Flex,{alignItems:"stretch"},e.createElement(g.Flex,{marginRight:8,justifyContent:"center",minWidth:(0,i.pxToRem)(30)},h&&e.createElement(w.Z,{type:W.hx,minHeight:(0,i.pxToRem)(24)})),e.createElement(S.Typography,{variant:"sigma",textColor:"primary600"},y({id:"app.components.GuidedTour.title",defaultMessage:"3 steps to get started"}))),e.createElement(g.Flex,null,e.createElement(g.Flex,{marginRight:8,minWidth:(0,i.pxToRem)(30)},e.createElement(ce,{number:p+1,type:m?W.hx:W.lW})),e.createElement(S.Typography,{variant:"alpha",fontWeight:"bold",textColor:"neutral800",as:"h3",id:"title"},y(t))),e.createElement(g.Flex,{alignItems:"stretch"},e.createElement(g.Flex,{marginRight:8,direction:"column",justifyContent:"center",minWidth:(0,i.pxToRem)(30)},f&&e.createElement(e.Fragment,null,e.createElement(w.Z,{type:W.hx}),m&&e.createElement(ce,{number:D+1,type:W.lW,last:!0}))),e.createElement(R.Box,null,e.createElement(Ke,Ze({},a)),o&&(o.target?e.createElement(i.LinkButton,{endIcon:e.createElement(le(),null),onClick:s,to:o.target},y(o.title)):e.createElement(oe.Button,{endIcon:e.createElement(le(),null),onClick:s},y(o.title))))),m&&f&&e.createElement(R.Box,{paddingTop:3},e.createElement(g.Flex,{marginRight:8,justifyContent:"center",width:(0,i.pxToRem)(30)},e.createElement(w.Z,{type:W.hx,minHeight:(0,i.pxToRem)(24)}))))};_.defaultProps={currentStep:null,cta:void 0},_.propTypes={sectionIndex:r().number.isRequired,stepIndex:r().number.isRequired,hasSectionAfter:r().bool.isRequired,content:r().shape({id:r().string.isRequired,defaultMessage:r().string.isRequired}).isRequired,cta:r().shape({target:r().string,title:r().shape({id:r().string.isRequired,defaultMessage:r().string.isRequired})}),currentStep:r().string,onCtaClick:r().func.isRequired,title:r().shape({id:r().string.isRequired,defaultMessage:r().string.isRequired}).isRequired};const Qe=_;var Ye=Object.defineProperty,Xe=Object.defineProperties,Je=Object.getOwnPropertyDescriptors,me=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,ge=(t,a,o)=>a in t?Ye(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o,_e=(t,a)=>{for(var o in a||(a={}))we.call(a,o)&&ge(t,o,a[o]);if(me)for(var o of me(a))qe.call(a,o)&&ge(t,o,a[o]);return t},et=(t,a)=>Xe(t,Je(a));const tt=()=>{const{currentStep:t,guidedTourState:a,setCurrentStep:o,setStepState:s,isGuidedTourVisible:p,setSkipped:d}=(0,i.useGuidedTour)(),[f,y]=(0,e.useState)(t),[{stepContent:h,sectionIndex:m,stepIndex:D,hasSectionAfter:B,hasStepAfter:V},z]=(0,e.useReducer)(We,ie),{trackUsage:j}=(0,i.useTracking)();(0,e.useEffect)(()=>{if(!t){y(!1);return}const[I]=G()(a,t);y(!I&&p)},[t,a,p]),(0,e.useEffect)(()=>{if(t){const[I]=G()(O.Z,t),Z=Object.keys(a),[Q,Be]=t.split("."),ae=Z.indexOf(Q),Y=Object.keys(a[Q]).indexOf(Be),tn=ae<Z.length-1,nn=Y<Object.keys(a[Q]).length-1;z({type:"UPDATE_MODAL",content:I,newSectionIndex:ae,newStepIndex:Y,newHasSectionAfter:tn,newHasStepAfter:nn})}},[t,a]);const u=()=>{s(t,!0),j(h.trackingEvent),o(null)},x=()=>{d(!0),o(null),j("didSkipGuidedtour")};return f&&h?e.createElement(Fe,{hideSkip:!V&&!B,onSkip:x,onClose:u},e.createElement(Qe,et(_e({},h),{onCtaClick:u,currentStep:t,sectionIndex:m,stepIndex:D,hasSectionAfter:B}))):null};var nt=n(27635),A=n(34499),at=n(82926),ot=n.n(at),st=n(70258),rt=n.n(st),it=n(19799);const lt=(0,T.default)(R.Box)`
|
|
10
|
-
width: ${150/16}rem;
|
|
11
|
-
position: absolute;
|
|
12
|
-
bottom: ${({theme:t})=>t.spaces[9]};
|
|
13
|
-
left: ${({theme:t})=>t.spaces[5]};
|
|
14
|
-
`,fe=(0,T.default)(c.NavLink)`
|
|
15
|
-
display: flex;
|
|
16
|
-
justify-content: space-between;
|
|
17
|
-
align-items: center;
|
|
18
|
-
text-decoration: none;
|
|
19
|
-
padding: ${({theme:t})=>`${t.spaces[2]} ${t.spaces[4]}`};
|
|
20
|
-
border-radius: ${({theme:t})=>t.spaces[1]};
|
|
21
|
-
|
|
22
|
-
&:hover {
|
|
23
|
-
background: ${({theme:t,logout:a})=>a?t.colors.danger100:t.colors.primary100};
|
|
24
|
-
text-decoration: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
svg {
|
|
28
|
-
path {
|
|
29
|
-
fill: ${({theme:t})=>t.colors.danger600};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
`,he=({generalSectionLinks:t,pluginsSectionLinks:a})=>{const o=(0,e.useRef)(),[s,p]=(0,e.useState)(!1),{logos:{menu:d}}=(0,it.Z)(),[f,y]=(0,i.usePersistentState)("navbar-condensed",!1),{userDisplayName:h}=(0,i.useAppInfos)(),{formatMessage:m}=(0,l.useIntl)(),D=h.split(" ").map(u=>u.substring(0,1)).join("").substring(0,2),B=()=>p(u=>!u),V=()=>{i.auth.clearAppStorage(),B()},z=u=>{var x,I;!u.currentTarget.contains(u.relatedTarget)&&((I=(x=u.relatedTarget)==null?void 0:x.parentElement)==null?void 0:I.id)!=="main-nav-user-button"&&p(!1)},j=m({id:"app.components.LeftMenu.navbrand.title",defaultMessage:"Strapi Dashboard"});return e.createElement(A.MainNav,{condensed:f},e.createElement(A.NavBrand,{as:c.NavLink,workplace:m({id:"app.components.LeftMenu.navbrand.workplace",defaultMessage:"Workplace"}),title:j,icon:e.createElement("img",{src:d.custom||d.default,alt:m({id:"app.components.LeftMenu.logo.alt",defaultMessage:"Application logo"})})}),e.createElement(nt.Divider,null),e.createElement(A.NavSections,null,e.createElement(A.NavLink,{as:c.NavLink,to:"/content-manager",icon:e.createElement(ot(),null)},m({id:"global.content-manager",defaultMessage:"Content manager"})),a.length>0?e.createElement(A.NavSection,{label:"Plugins"},a.map(u=>{const x=u.icon;return e.createElement(A.NavLink,{as:c.NavLink,to:u.to,key:u.to,icon:e.createElement(x,null)},m(u.intlLabel))})):null,t.length>0?e.createElement(A.NavSection,{label:"General"},t.map(u=>{const x=u.icon;return e.createElement(A.NavLink,{as:c.NavLink,badgeContent:u.notificationsCount>0&&u.notificationsCount.toString()||void 0,to:u.to,key:u.to,icon:e.createElement(x,null)},m(u.intlLabel))})):null),e.createElement(A.NavUser,{id:"main-nav-user-button",ref:o,onClick:B,initials:D},h),s&&e.createElement(lt,{onBlur:z,padding:1,shadow:"tableShadow",background:"neutral0",hasRadius:!0},e.createElement(E.FocusTrap,{onEscape:B},e.createElement(J.Stack,{spacing:0},e.createElement(fe,{tabIndex:0,onClick:B,to:"/me"},e.createElement(S.Typography,null,m({id:"global.profile",defaultMessage:"Profile"}))),e.createElement(fe,{tabIndex:0,onClick:V,logout:"logout",to:"/auth/login"},e.createElement(S.Typography,{textColor:"danger600"},m({id:"app.components.LeftMenu.logout",defaultMessage:"Logout"})),e.createElement(rt(),null))))),e.createElement(A.NavCondense,{onClick:()=>y(u=>!u)},m(f?{id:"app.components.LeftMenu.expand",defaultMessage:"Expand the navbar"}:{id:"app.components.LeftMenu.collapse",defaultMessage:"Collapse the navbar"})))};he.propTypes={generalSectionLinks:r().array.isRequired,pluginsSectionLinks:r().array.isRequired};const dt=he;var ct=n(16540);const pt=(0,T.default)(R.Box)`
|
|
33
|
-
flex: 1;
|
|
34
|
-
`,Ee=({children:t,sideNav:a})=>{const{formatMessage:o}=(0,l.useIntl)();return e.createElement(R.Box,{background:"neutral100"},e.createElement(ct.SkipToContent,null,o({id:"skipToContent",defaultMessage:"Skip to content"})),e.createElement(g.Flex,{alignItems:"flex-start"},a,e.createElement(pt,null,t)))};Ee.propTypes={children:r().node.isRequired,sideNav:r().node.isRequired};const ut=Ee;var ye=n(7602),mt=n(26648),ee=n(16925),ve=n(28257);const gt=(0,T.default)(R.Box)`
|
|
35
|
-
position: fixed;
|
|
36
|
-
bottom: ${({theme:t})=>t.spaces[2]};
|
|
37
|
-
right: ${({theme:t})=>t.spaces[2]};
|
|
38
|
-
`,ft=T.default.button`
|
|
39
|
-
width: ${({theme:t})=>t.spaces[8]};
|
|
40
|
-
height: ${({theme:t})=>t.spaces[8]};
|
|
41
|
-
background: ${({theme:t})=>t.colors.primary600};
|
|
42
|
-
box-shadow: ${({theme:t})=>t.shadows.tableShadow};
|
|
43
|
-
border-radius: 50%;
|
|
44
|
-
svg {
|
|
45
|
-
color: ${({theme:t})=>t.colors.buttonNeutral0};
|
|
46
|
-
}
|
|
47
|
-
`,ht=(0,T.default)(R.Box)`
|
|
48
|
-
position: absolute;
|
|
49
|
-
bottom: ${({theme:t})=>`${t.spaces[9]}`};
|
|
50
|
-
right: 0;
|
|
51
|
-
width: ${200/16}rem;
|
|
52
|
-
`,Et=T.default.a`
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
text-decoration: none;
|
|
56
|
-
padding: ${({theme:t})=>t.spaces[2]};
|
|
57
|
-
padding-left: ${({theme:t})=>t.spaces[5]};
|
|
58
|
-
|
|
59
|
-
svg {
|
|
60
|
-
color: ${({theme:t})=>t.colors.neutral600};
|
|
61
|
-
margin-right: ${({theme:t})=>t.spaces[2]};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&:hover {
|
|
65
|
-
background: ${({theme:t})=>t.colors.neutral100};
|
|
66
|
-
color: ${({theme:t})=>t.colors.neutral500};
|
|
67
|
-
|
|
68
|
-
svg {
|
|
69
|
-
color: ${({theme:t})=>t.colors.neutral700};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
${[S.Typography]} {
|
|
73
|
-
color: ${({theme:t})=>t.colors.neutral700};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
${[S.Typography]} {
|
|
78
|
-
color: ${({theme:t})=>t.colors.neutral600};
|
|
79
|
-
}
|
|
80
|
-
`,yt=()=>{const[t,a]=(0,e.useState)(!1),{formatMessage:o}=(0,l.useIntl)(),{showTutorials:s}=(0,$.um)();if(!s)return null;const p=[{icon:"book",label:o({id:"global.documentation",defaultMessage:"Documentation"}),destination:"https://docs.strapi.io"},{icon:"file",label:o({id:"app.static.links.cheatsheet",defaultMessage:"CheatSheet"}),destination:"https://strapi-showcase.s3-us-west-2.amazonaws.com/CheatSheet.pdf"}],d=()=>{a(f=>!f)};return e.createElement(gt,{as:"aside"},e.createElement(ft,{id:"onboarding","aria-label":o({id:"app.components.Onboarding.help.button",defaultMessage:"Help button"}),onClick:d},!t&&e.createElement(ee.G,{icon:ve.faQuestion}),t&&e.createElement(ee.G,{icon:ve.faTimes})),t&&e.createElement(E.FocusTrap,{onEscape:d},e.createElement(ht,{background:"neutral0",hasRadius:!0,shadow:"tableShadow",paddingBottom:2,paddingTop:2},p.map(f=>e.createElement(Et,{key:f.label,rel:"nofollow noreferrer noopener",target:"_blank",href:f.destination},e.createElement(ee.G,{icon:f.icon}),e.createElement(S.Typography,null,f.label))))))},vt=(0,e.lazy)(()=>Promise.all([n.e(8469),n.e(9420),n.e(20),n.e(9262),n.e(8773),n.e(994)]).then(n.bind(n,92494))),Tt=(0,e.lazy)(()=>Promise.all([n.e(4800),n.e(3981)]).then(n.bind(n,44762))),Pt=(0,e.lazy)(()=>n.e(3677).then(n.bind(n,15415))),Ct=(0,e.lazy)(()=>Promise.all([n.e(8469),n.e(5516)]).then(n.bind(n,71561))),Te=(0,e.lazy)(()=>Promise.resolve().then(n.bind(n,53951))),Mt=(0,e.lazy)(()=>n.e(2336).then(n.bind(n,92336))),Ot=(0,e.lazy)(()=>n.e(9497).then(n.bind(n,9972))),Pe=(0,e.lazy)(()=>Promise.all([n.e(8469),n.e(9420),n.e(20),n.e(3531),n.e(5895)]).then(n.bind(n,91671))),Rt=()=>{const{trackUsage:t}=(0,i.useTracking)(),a=(0,N.useDispatch)(),o=(0,N.useSelector)(s=>s.admin_app.status);(0,e.useEffect)(()=>{o==="init"&&(t("didAccessAuthenticatedAdministration"),a({type:mt.e}))},[o])},St=()=>{Rt();const{isLoading:t,generalSectionLinks:a,pluginsSectionLinks:o}=(0,$.H9)(),{menu:s}=(0,i.useStrapiApp)(),p=(0,e.useMemo)(()=>s.filter(d=>d.Component).map(({to:d,Component:f,exact:y})=>(0,ye.ot)(f,d,y)),[s]);return t?e.createElement(i.LoadingIndicatorPage,null):e.createElement(L.DndProvider,{backend:K.PD},e.createElement(ut,{sideNav:e.createElement(dt,{generalSectionLinks:a,pluginsSectionLinks:o})},e.createElement(e.Suspense,{fallback:e.createElement(i.LoadingIndicatorPage,null)},e.createElement(c.Switch,null,e.createElement(c.Route,{path:"/",component:Tt,exact:!0}),e.createElement(c.Route,{path:"/me",component:Ot,exact:!0}),e.createElement(c.Route,{path:"/content-manager",component:vt}),p,e.createElement(c.Route,{path:"/settings/:settingId",component:Pe}),e.createElement(c.Route,{path:"/settings",component:Pe,exact:!0}),e.createElement(c.Route,{path:"/marketplace"},e.createElement(Ct,null)),e.createElement(c.Route,{path:"/list-plugins",exact:!0},e.createElement(Pt,null)),e.createElement(c.Route,{path:"/404",component:Te}),e.createElement(c.Route,{path:"/500",component:Mt}),e.createElement(c.Route,{path:"",component:Te}))),e.createElement(tt,null),e.createElement(yt,null)))};var At=Object.defineProperty,Ce=Object.getOwnPropertySymbols,xt=Object.prototype.hasOwnProperty,It=Object.prototype.propertyIsEnumerable,Me=(t,a,o)=>a in t?At(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o,Lt=(t,a)=>{for(var o in a||(a={}))xt.call(a,o)&&Me(t,o,a[o]);if(Ce)for(var o of Ce(a))It.call(a,o)&&Me(t,o,a[o]);return t};const Dt=t=>({plugins:Object.keys(t).reduce((a,o)=>(a[o]=Lt({},t[o]),a),{})});var Bt=n(3040),bt=n.n(Bt);const Oe={plugins:null},Nt=(t=Oe,a)=>(0,re.default)(t,o=>{switch(a.type){case"SET_PLUGIN_READY":{bt()(o,["plugins",a.pluginId,"isReady"],!0);break}default:return o}}),Gt=()=>{const{plugins:t}=(0,i.useStrapiApp)(),[{plugins:a},o]=(0,e.useReducer)(Nt,Oe,()=>Dt(t)),s=(0,e.useRef)(d=>{o({type:"SET_PLUGIN_READY",pluginId:d})});if(Object.keys(a).some(d=>a[d].isReady===!1)){const d=Object.keys(a).reduce((f,y)=>{const h=a[y].initializer;if(h){const m=a[y].pluginId;f.push(e.createElement(h,{key:m,setPlugin:s.current}))}return f},[]);return e.createElement(e.Fragment,null,d,e.createElement(i.LoadingIndicatorPage,null))}return e.createElement(St,null)};var Re=n(17367);const Ut=()=>({type:Re.l}),Ft=t=>({type:Re.m,permissions:t}),Se=({children:t,permissions:a,refetchPermissions:o})=>{const{allPermissions:s}=(0,N.useSelector)(d=>d.rbacProvider),p=(0,N.useDispatch)();return(0,e.useEffect)(()=>(p(Ft(a)),()=>{p(Ut())}),[a,p]),s?e.createElement(i.RBACProviderContext.Provider,{value:{allPermissions:s,refetchPermissions:o}},t):e.createElement(i.LoadingIndicatorPage,null)};Se.propTypes={children:r().element.isRequired,permissions:r().array.isRequired,refetchPermissions:r().func.isRequired};const Wt=Se;var jt=n(2739),$t=n.n(jt),Kt=n(54770),te=n.n(Kt);const Ae=(t,a)=>!te().valid(t)||!te().valid(a)?!1:te().lt(t,a);var ne=n(17247),k=(t,a,o)=>new Promise((s,p)=>{var d=h=>{try{y(o.next(h))}catch(m){p(m)}},f=h=>{try{y(o.throw(h))}catch(m){p(m)}},y=h=>h.done?s(h.value):Promise.resolve(h.value).then(d,f);y((o=o.apply(t,a)).next())});const xe=M.i8,Vt=!JSON.parse(localStorage.getItem("STRAPI_UPDATE_NOTIF")),zt=t=>k(void 0,null,function*(){try{const{data:{tag_name:a}}=yield $t().get("https://api.github.com/repos/strapi/strapi/releases/latest");return Ae(xe,a)&&Vt&&t({type:"info",message:{id:"notification.version.update.message"},link:{url:`https://github.com/strapi/strapi/releases/tag/${a}`,label:{id:"global.see-more"}},blockTransition:!0,onClose:()=>localStorage.setItem("STRAPI_UPDATE_NOTIF",!0)}),a}catch(a){return xe}}),Ht=()=>k(void 0,null,function*(){try{const{data:t,headers:a}=yield ne.be.get("/admin/information");if(!a["content-type"].includes("application/json"))throw new Error("Not found");return t.data}catch(t){throw new Error(t)}}),kt=()=>k(void 0,null,function*(){try{const{data:t,headers:a}=yield ne.be.get("/admin/users/me/permissions");if(!a["content-type"].includes("application/json"))throw new Error("Not found");return t.data}catch(t){throw new Error(t)}}),Zt=()=>k(void 0,null,function*(){try{const{data:{data:{roles:t}}}=yield ne.be.get("/admin/users/me");return t}catch(t){throw new Error(t)}});var Qt=Object.defineProperty,Yt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,Jt=Object.prototype.hasOwnProperty,wt=Object.prototype.propertyIsEnumerable,Le=(t,a,o)=>a in t?Qt(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o,qt=(t,a)=>{for(var o in a||(a={}))Jt.call(a,o)&&Le(t,o,a[o]);if(Ie)for(var o of Ie(a))wt.call(a,o)&&Le(t,o,a[o]);return t},_t=(t,a)=>Yt(t,Xt(a));const De=M.i8,en=()=>{const{setGuidedTourVisibility:t}=(0,i.useGuidedTour)(),a=(0,i.useNotification)(),o=(0,e.useRef)(t),s=i.auth.getUserInfo(),p=X()(s,"username")||(0,ye.Pp)(s.firstname,s.lastname),[d,f]=(0,e.useState)(p),{showReleaseNotification:y}=(0,$.um)(),[{data:h,status:m},{data:D,isLoading:B},{data:V,status:z,refetch:j,isFetched:u,isFetching:x},{data:I}]=(0,b.useQueries)([{queryKey:"app-infos",queryFn:Ht},{queryKey:"strapi-release",queryFn:()=>zt(a),enabled:y,initialData:De},{queryKey:"admin-users-permission",queryFn:kt,initialData:[]},{queryKey:"user-roles",queryFn:Zt}]),Z=(0,e.useMemo)(()=>Ae(De,D),[D]);return(0,e.useEffect)(()=>{I&&I.find(({code:Y})=>Y==="strapi-super-admin")&&o.current(!0)},[I]),B||(x&&u||m==="loading"||z==="loading")?e.createElement(i.LoadingIndicatorPage,null):m==="error"?e.createElement("div",null,"error..."):e.createElement(i.AppInfosContext.Provider,{value:_t(qt({},h),{latestStrapiReleaseTag:D,setUserDisplayName:f,shouldUpdateStrapi:Z,userDisplayName:d})},e.createElement(Wt,{permissions:V,refetchPermissions:j},e.createElement(Gt,null)))}},78024:(H,C,n)=>{n.d(C,{Z:()=>r});var e=n(32735),i=n(60216),b=n.n(i),P=n(88425),X=n.n(P),M=n(9808),$=n.n(M),c=n(23678),N=Object.defineProperty,L=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,G=(l,v,E)=>v in l?N(l,v,{enumerable:!0,configurable:!0,writable:!0,value:E}):l[v]=E,O=(l,v)=>{for(var E in v||(v={}))K.call(v,E)&&G(l,E,v[E]);if(L)for(var E of L(v))F.call(v,E)&&G(l,E,v[E]);return l},T=(l,v)=>{var E={};for(var g in l)K.call(l,g)&&v.indexOf(g)<0&&(E[g]=l[g]);if(l!=null&&L)for(var g of L(l))v.indexOf(g)<0&&F.call(l,g)&&(E[g]=l[g]);return E};const U=l=>{var v=l,{type:E}=v,g=T(v,["type"]);return e.createElement(M.Box,O({width:(0,P.pxToRem)(2),height:"100%",background:E===c.VM?"neutral300":"primary500",hasRadius:!0},g))};U.defaultProps={type:c.VM},U.propTypes={type:b().oneOf([c.lW,c.hx,c.VM])};const r=U},14317:(H,C,n)=>{n.d(C,{Z:()=>U});var e=n(32735),i=n(60216),b=n.n(i),P=n(88425),X=n.n(P),M=n(19192),$=n.n(M),c=n(95602),N=n.n(c),L=n(78752),K=n.n(L),F=n(88677),G=n.n(F),O=n(23678);const T=({type:r,number:l})=>r===O.hx?e.createElement(M.Flex,{background:"primary600",padding:2,borderRadius:"50%",width:(0,P.pxToRem)(30),height:(0,P.pxToRem)(30),justifyContent:"center"},e.createElement(L.Icon,{as:G(),"aria-hidden":!0,width:(0,P.pxToRem)(16),color:"neutral0"})):r===O.lW?e.createElement(M.Flex,{background:"primary600",padding:2,borderRadius:"50%",width:(0,P.pxToRem)(30),height:(0,P.pxToRem)(30),justifyContent:"center"},e.createElement(c.Typography,{fontWeight:"semiBold",textColor:"neutral0"},l)):e.createElement(M.Flex,{borderColor:"neutral500",borderWidth:"1px",borderStyle:"solid",padding:2,borderRadius:"50%",width:(0,P.pxToRem)(30),height:(0,P.pxToRem)(30),justifyContent:"center"},e.createElement(c.Typography,{fontWeight:"semiBold",textColor:"neutral600"},l));T.defaultProps={number:void 0,type:O.VM},T.propTypes={number:b().number,type:b().oneOf([O.lW,O.hx,O.VM])};const U=T},23678:(H,C,n)=>{n.d(C,{VM:()=>b,hx:()=>i,lW:()=>e});const e="isActive",i="isDone",b="isNotDone"},58107:(H,C,n)=>{n.d(C,{Z:()=>i});const i={contentTypeBuilder:{home:{title:{id:"app.components.GuidedTour.home.CTB.title",defaultMessage:"\u{1F9E0} Build the content structure"},cta:{title:{id:"app.components.GuidedTour.home.CTB.cta.title",defaultMessage:"Go to the Content type Builder"},type:"REDIRECT",target:"/plugins/content-type-builder"},trackingEvent:"didClickGuidedTourHomepageContentTypeBuilder"},create:{title:{id:"app.components.GuidedTour.CTB.create.title",defaultMessage:"\u{1F9E0} Create a first Collection type"},content:{id:"app.components.GuidedTour.CTB.create.content",defaultMessage:"<p>Collection types help you manage several entries, Single types are suitable to manage only one entry.</p> <p>Ex: For a Blog website, Articles would be a Collection type whereas a Homepage would be a Single type.</p>"},cta:{title:{id:"app.components.GuidedTour.CTB.create.cta.title",defaultMessage:"Build a Collection type"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep1CollectionType"},success:{title:{id:"app.components.GuidedTour.CTB.success.title",defaultMessage:"Step 1: Completed \u2705"},content:{id:"app.components.GuidedTour.CTB.success.content",defaultMessage:"<p>Good going!</p><b>\u26A1\uFE0F What would you like to share with the world?</b>"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"REDIRECT",target:"/content-manager"},trackingEvent:"didCreateGuidedTourCollectionType"}},contentManager:{home:{title:{id:"app.components.GuidedTour.home.CM.title",defaultMessage:"\u26A1\uFE0F What would you like to share with the world?"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"REDIRECT",target:"/content-manager"},trackingEvent:"didClickGuidedTourHomepageContentManager"},create:{title:{id:"app.components.GuidedTour.CM.create.title",defaultMessage:"\u26A1\uFE0F Create content"},content:{id:"app.components.GuidedTour.CM.create.content",defaultMessage:"<p>Create and manage all the content here in the Content Manager.</p><p>Ex: Taking the Blog website example further, one can write an Article, save and publish it as they like.</p><p>\u{1F4A1} Quick tip - Don't forget to hit publish on the content you create.</p>"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep2ContentManager"},success:{title:{id:"app.components.GuidedTour.CM.success.title",defaultMessage:"Step 2: Completed \u2705"},content:{id:"app.components.GuidedTour.CM.success.content",defaultMessage:"<p>Awesome, one last step to go!</p><b>\u{1F680} See content in action</b>"},cta:{title:{id:"app.components.GuidedTour.CM.success.cta.title",defaultMessage:"Test the API"},type:"REDIRECT",target:"/settings/api-tokens"},trackingEvent:"didCreateGuidedTourEntry"}},apiTokens:{home:{title:{id:"app.components.GuidedTour.apiTokens.create.title",defaultMessage:"\u{1F680} See content in action"},cta:{title:{id:"app.components.GuidedTour.home.apiTokens.cta.title",defaultMessage:"Test the API"},type:"REDIRECT",target:"/settings/api-tokens"},trackingEvent:"didClickGuidedTourHomepageApiTokens"},create:{title:{id:"app.components.GuidedTour.apiTokens.create.title",defaultMessage:"\u{1F680} See content in action"},content:{id:"app.components.GuidedTour.apiTokens.create.content",defaultMessage:"<p>Generate an authentication token here and retrieve the content you just created.</p>"},cta:{title:{id:"app.components.GuidedTour.apiTokens.create.cta.title",defaultMessage:"Generate an API Token"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep3ApiTokens"},success:{title:{id:"app.components.GuidedTour.apiTokens.success.title",defaultMessage:"Step 3: Completed \u2705"},content:{id:"app.components.GuidedTour.apiTokens.success.content",defaultMessage:"<p>See content in action by making an HTTP request:</p><ul><li><p>To this URL: <light>https://'<'YOUR_DOMAIN'>'/api/'<'YOUR_CT'>'</light></p></li><li><p>With the header: <light>Authorization: bearer '<'YOUR_API_TOKEN'>'</light></p></li></ul><p>For more ways to interact with content, see the <documentationLink>documentation</documentationLink>.</p>"},trackingEvent:"didGenerateGuidedTourApiTokens"}}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[3677],{15415:(x,y,t)=>{t.r(y),t.d(y,{default:()=>F});var e=t(32735),c=t(88425),v=t(99357),E=t(5636),P=t(72041),T=t(29270),d=t(11856),f=t(16540),m=t(95602),l=t(53214),M=t(84968),L=t(17247),C=(n,s,o)=>new Promise((h,i)=>{var u=a=>{try{r(o.next(a))}catch(g){i(g)}},p=a=>{try{r(o.throw(a))}catch(g){i(g)}},r=a=>a.done?h(a.value):Promise.resolve(a.value).then(u,p);r((o=o.apply(n,s)).next())});const b=()=>C(void 0,null,function*(){const{data:n}=yield L.be.get("/admin/plugins");return n}),I=n=>{const s=(0,c.useNotification)();return(0,M.useQuery)("list-enabled-plugins",()=>b(),{onSuccess:()=>{n&&n()},onError:()=>{s({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})},N=()=>{const{formatMessage:n}=(0,E.useIntl)(),{notifyStatus:s}=(0,T.useNotifyAT)();(0,c.useFocusWhenNavigate)();const o=n({id:"global.plugins",defaultMessage:"Plugins"}),h=()=>{s(n({id:"app.utils.notify.data-loaded",defaultMessage:"The {target} has loaded"},{target:o}))},{status:i,data:u}=I(h);return i!=="success"&&i!=="error"?e.createElement(d.Layout,null,e.createElement(f.Main,{"aria-busy":!0},e.createElement(c.LoadingIndicatorPage,null))):e.createElement(d.Layout,null,e.createElement(f.Main,null,e.createElement(d.HeaderLayout,{title:o,subtitle:n({id:"app.components.ListPluginsPage.description",defaultMessage:"List of the installed plugins in the project."})}),e.createElement(d.ContentLayout,null,e.createElement(l.Table,{colCount:2,rowCount:(u==null?void 0:u.plugins.length)+1},e.createElement(l.Thead,null,e.createElement(l.Tr,null,e.createElement(l.Th,null,e.createElement(m.Typography,{variant:"sigma",textColor:"neutral600"},n({id:"global.name",defaultMessage:"Name"}))),e.createElement(l.Th,null,e.createElement(m.Typography,{variant:"sigma",textColor:"neutral600"},n({id:"global.description",defaultMessage:"description"}))))),e.createElement(l.Tbody,null,u.plugins.map(({name:r,displayName:a,description:g})=>e.createElement(l.Tr,{key:r},e.createElement(l.Td,null,e.createElement(m.Typography,{textColor:"neutral800",variant:"omega",fontWeight:"bold"},a)),e.createElement(l.Td,null,e.createElement(m.Typography,{textColor:"neutral800"},g)))))))))},F=()=>{const{formatMessage:n}=(0,E.useIntl)(),s=n({id:"global.plugins",defaultMessage:"Plugins"});return e.createElement(c.CheckPagePermissions,{permissions:P.Z.marketplace.main},e.createElement(v.Helmet,{title:s}),e.createElement(N,null))}}}]);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[9497],{9972:(pe,j,t)=>{t.r(j),t.d(j,{default:()=>De});var e=t(32735),f=t(19615),p=t(88425),U=t(5636),Z=t(83281),G=t(23940),V=t.n(G),I=t(84968),D=t(88423),B=t.n(D),N=t(99357),L=t(16540),b=t(95602),O=t(9808),A=t(11856),z=t(44526),u=t(78330),E=t(90662),Q=t(29270),S=t(25716),K=t(20001),W=t(37178),R=t(33912),M=t.n(R),X=t(37341),F=t.n(X),Y=t(88677),d=t.n(Y),s=t(20139),i=t(45861),fe=t(9086),ge=t.n(fe),ee=t(17247),he=Object.defineProperty,ve=Object.defineProperties,Pe=Object.getOwnPropertyDescriptors,te=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,re=(a,n,r)=>n in a?he(a,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[n]=r,Ee=(a,n)=>{for(var r in n||(n={}))ye.call(n,r)&&re(a,r,n[r]);if(te)for(var r of te(n))we.call(n,r)&&re(a,r,n[r]);return a},Se=(a,n)=>ve(a,Pe(n)),ae=(a,n,r)=>new Promise((T,y)=>{var x=m=>{try{P(r.next(m))}catch(w){y(w)}},C=m=>{try{P(r.throw(m))}catch(w){y(w)}},P=m=>m.done?T(m.value):Promise.resolve(m.value).then(x,C);P((r=r.apply(a,n)).next())});const Oe=()=>ae(void 0,null,function*(){const{data:a}=yield ee.be.get("/admin/users/me");return a.data}),Me=a=>ae(void 0,null,function*(){const n=ge()(a,["confirmPassword","currentTheme"]),{data:r}=yield ee.be.put("/admin/users/me",n);return Se(Ee({},r.data),{currentTheme:a.currentTheme})});var Ie=t(5173),Le=t(1057);const be=Ie.Ry().shape(Le.Rw);var ne=t(7602),Ae=Object.defineProperty,Te=Object.defineProperties,xe=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,oe=(a,n,r)=>n in a?Ae(a,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[n]=r,le=(a,n)=>{for(var r in n||(n={}))Ce.call(n,r)&&oe(a,r,n[r]);if(se)for(var r of se(n))je.call(n,r)&&oe(a,r,n[r]);return a},ie=(a,n)=>Te(a,xe(n)),de=(a,n,r)=>new Promise((T,y)=>{var x=m=>{try{P(r.next(m))}catch(w){y(w)}},C=m=>{try{P(r.throw(m))}catch(w){y(w)}},P=m=>m.done?T(m.value):Promise.resolve(m.value).then(x,C);P((r=r.apply(a,n)).next())});const Ge=f.default.a`
|
|
2
|
-
color: ${({theme:a})=>a.colors.primary600};
|
|
3
|
-
`,$=(0,f.default)(W.TextInput)`
|
|
4
|
-
::-ms-reveal {
|
|
5
|
-
display: none;
|
|
6
|
-
}
|
|
7
|
-
`,J=(0,f.default)(K.FieldAction)`
|
|
8
|
-
svg {
|
|
9
|
-
height: 1rem;
|
|
10
|
-
width: 1rem;
|
|
11
|
-
path {
|
|
12
|
-
fill: ${({theme:a})=>a.colors.neutral600};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
`,De=()=>{const[a,n]=(0,e.useState)(!1),[r,T]=(0,e.useState)(!1),[y,x]=(0,e.useState)(!1),{changeLocale:C,localeNames:P}=(0,s.Z)(),{setUserDisplayName:m}=(0,p.useAppInfos)(),w=(0,I.useQueryClient)(),{formatMessage:o}=(0,U.useIntl)(),{trackUsage:Be}=(0,p.useTracking)(),k=(0,p.useNotification)(),{lockApp:Ne,unlockApp:Re}=(0,p.useOverlayBlocker)(),{notifyStatus:Fe}=(0,Q.useNotifyAT)(),{currentTheme:He,themes:ce,onChangeTheme:Ue}=(0,i.M1)();(0,p.useFocusWhenNavigate)();const{status:Ze,data:H}=(0,I.useQuery)("user",()=>Oe(),{onSuccess:()=>{Fe(o({id:"Settings.profile.form.notify.data.loaded",defaultMessage:"Your profile data has been loaded"}))},onError:()=>{k({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}}),Ve=Ze!=="success",me=(0,I.useMutation)(l=>Me(l),{onSuccess:l=>de(void 0,null,function*(){yield w.invalidateQueries("user"),p.auth.setUserInfo(B()(l,["email","firstname","lastname","username","preferedLanguage"]));const g=l.username||(0,ne.Pp)(l.firstname,l.lastname);m(g),C(l.preferedLanguage),Ue(l.currentTheme),Be("didChangeMode",{newMode:l.currentTheme}),k({type:"success",message:{id:"notification.success.saved",defaultMessage:"Saved"}})}),onSettled:()=>{Re()},refetchActive:!0}),{isLoading:ze}=me,Qe=(l,g)=>de(void 0,[l,g],function*(h,{setErrors:q}){Ne();const c=h.username||null;me.mutate(ie(le({},h),{username:c}),{onError:v=>{var ue;const _=(ue=v==null?void 0:v.response)==null?void 0:ue.data;return _!=null&&_.data?q(_.data):k({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})}),Ke=["currentTheme","email","firstname","lastname","username","preferedLanguage"],We=B()(ie(le({},H),{currentTheme:He}),Ke);if(Ve)return e.createElement(L.Main,{"aria-busy":"true"},e.createElement(N.Helmet,{title:o({id:"Settings.profile.form.section.helmet.title",defaultMessage:"User profile"})}),e.createElement(A.HeaderLayout,{title:o({id:"Settings.profile.form.section.profile.page.title",defaultMessage:"Profile page"})}),e.createElement(A.ContentLayout,null,e.createElement(p.LoadingIndicatorPage,null)));const Xe=Object.keys(ce).filter(l=>ce[l]);return e.createElement(L.Main,{"aria-busy":ze},e.createElement(N.Helmet,{title:o({id:"Settings.profile.form.section.helmet.title",defaultMessage:"User profile"})}),e.createElement(Z.Formik,{onSubmit:Qe,initialValues:We,validateOnChange:!1,validationSchema:be,enableReinitialize:!0},({errors:l,values:g,handleChange:h,isSubmitting:q})=>e.createElement(p.Form,null,e.createElement(A.HeaderLayout,{title:H.username||(0,ne.Pp)(H.firstname,H.lastname),primaryAction:e.createElement(z.Button,{startIcon:e.createElement(d(),null),loading:q,type:"submit"},o({id:"global.save",defaultMessage:"Save"}))}),e.createElement(O.Box,{paddingBottom:10},e.createElement(A.ContentLayout,null,e.createElement(E.Stack,{spacing:6},e.createElement(O.Box,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},e.createElement(E.Stack,{spacing:4},e.createElement(b.Typography,{variant:"delta",as:"h2"},o({id:"global.profile",defaultMessage:"Profile"})),e.createElement(u.Grid,{gap:5},e.createElement(u.GridItem,{s:12,col:6},e.createElement(p.GenericInput,{intlLabel:{id:"Auth.form.firstname.label",defaultMessage:"First name"},error:l.firstname,onChange:h,value:g.firstname||"",type:"text",name:"firstname",required:!0})),e.createElement(u.GridItem,{s:12,col:6},e.createElement(p.GenericInput,{intlLabel:{id:"Auth.form.lastname.label",defaultMessage:"Last name"},error:l.lastname,onChange:h,value:g.lastname||"",type:"text",name:"lastname"})),e.createElement(u.GridItem,{s:12,col:6},e.createElement(p.GenericInput,{intlLabel:{id:"Auth.form.email.label",defaultMessage:"Email"},error:l.email,onChange:h,value:g.email||"",type:"email",name:"email",required:!0})),e.createElement(u.GridItem,{s:12,col:6},e.createElement(p.GenericInput,{intlLabel:{id:"Auth.form.username.label",defaultMessage:"Username"},error:l.username,onChange:h,value:g.username||"",type:"text",name:"username"}))))),e.createElement(O.Box,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},e.createElement(E.Stack,{spacing:4},e.createElement(b.Typography,{variant:"delta",as:"h2"},o({id:"global.change-password",defaultMessage:"Change password"})),e.createElement(u.Grid,{gap:5},e.createElement(u.GridItem,{s:12,col:6},e.createElement($,{error:l.currentPassword?o({id:l.currentPassword,defaultMessage:l.currentPassword}):"",onChange:h,value:g.currentPassword||"",label:o({id:"Auth.form.currentPassword.label",defaultMessage:"Current Password"}),name:"currentPassword",type:y?"text":"password",endAction:e.createElement(J,{onClick:c=>{c.stopPropagation(),x(v=>!v)},label:o(y?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},y?e.createElement(M(),null):e.createElement(F(),null))}))),e.createElement(u.Grid,{gap:5},e.createElement(u.GridItem,{s:12,col:6},e.createElement($,{error:l.password?o({id:l.password,defaultMessage:l.password}):"",onChange:h,value:g.password||"",label:o({id:"global.password",defaultMessage:"Password"}),name:"password",type:a?"text":"password",endAction:e.createElement(J,{onClick:c=>{c.stopPropagation(),n(v=>!v)},label:o(a?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},a?e.createElement(M(),null):e.createElement(F(),null))})),e.createElement(u.GridItem,{s:12,col:6},e.createElement($,{error:l.confirmPassword?o({id:l.confirmPassword,defaultMessage:l.confirmPassword}):"",onChange:h,value:g.confirmPassword||"",label:o({id:"Auth.form.confirmPassword.label",defaultMessage:"Password confirmation"}),name:"confirmPassword",type:r?"text":"password",endAction:e.createElement(J,{onClick:c=>{c.stopPropagation(),T(v=>!v)},label:o(r?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},r?e.createElement(M(),null):e.createElement(F(),null))}))))),e.createElement(O.Box,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},e.createElement(E.Stack,{spacing:4},e.createElement(E.Stack,{spacing:1},e.createElement(b.Typography,{variant:"delta",as:"h2"},o({id:"Settings.profile.form.section.experience.title",defaultMessage:"Experience"})),e.createElement(b.Typography,null,o({id:"Settings.profile.form.section.experience.interfaceLanguageHelp",defaultMessage:"Preference changes will apply only to you. More information is available {here}."},{here:e.createElement(Ge,{target:"_blank",rel:"noopener noreferrer",href:"https://docs.strapi.io/developer-docs/latest/development/admin-customization.html#locales"},o({id:"Settings.profile.form.section.experience.documentation",defaultMessage:"here"}))}))),e.createElement(u.Grid,{gap:5},e.createElement(u.GridItem,{s:12,col:6},e.createElement(S.Select,{label:o({id:"Settings.profile.form.section.experience.interfaceLanguage",defaultMessage:"Interface language"}),placeholder:o({id:"global.select",defaultMessage:"Select"}),hint:o({id:"Settings.profile.form.section.experience.interfaceLanguage.hint",defaultMessage:"This will only display your own interface in the chosen language."}),onClear:()=>{h({target:{name:"preferedLanguage",value:null}})},clearLabel:o({id:"Settings.profile.form.section.experience.clear.select",defaultMessage:"Clear the interface language selected"}),value:g.preferedLanguage,onChange:c=>{h({target:{name:"preferedLanguage",value:c}})}},Object.keys(P).map(c=>{const v=P[c];return e.createElement(S.Option,{value:c,key:c},v)}))),e.createElement(u.GridItem,{s:12,col:6},e.createElement(S.Select,{label:o({id:"Settings.profile.form.section.experience.mode.label",defaultMessage:"Interface mode"}),placeholder:o({id:"components.Select.placeholder",defaultMessage:"Select"}),hint:o({id:"Settings.profile.form.section.experience.mode.hint",defaultMessage:"Displays your interface in the chosen mode."}),value:g.currentTheme,onChange:c=>{h({target:{name:"currentTheme",value:c}})}},Xe.map(c=>{const v=o({id:"Settings.profile.form.section.experience.mode.option-label",defaultMessage:"{name} mode"},{name:V()(c)});return e.createElement(S.Option,{value:c,key:c},v)}))))))))))))}},1057:(pe,j,t)=>{t.d(j,{YM:()=>Y,Rw:()=>O});var e=t(5173),f=t(88425),p=Object.defineProperty,U=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,D=(d,s,i)=>s in d?p(d,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):d[s]=i,B=(d,s)=>{for(var i in s||(s={}))V.call(s,i)&&D(d,i,s[i]);if(G)for(var i of G(s))I.call(s,i)&&D(d,i,s[i]);return d},N=(d,s)=>U(d,Z(s));const L={firstname:e.nK().required(f.translatedErrors.required),lastname:e.nK(),email:e.Z_().email(f.translatedErrors.email).lowercase().required(f.translatedErrors.required),username:e.Z_().nullable(),password:e.Z_().min(8,f.translatedErrors.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number"),confirmPassword:e.Z_().min(8,f.translatedErrors.minLength).oneOf([e.iH("password"),null],"components.Input.error.password.noMatch").when("password",(d,s)=>d?s.required(f.translatedErrors.required):s)},O=N(B({},L),{currentPassword:e.Z_().when(["password","confirmPassword"],(d,s,i)=>d||s?i.required(f.translatedErrors.required):i),preferedLanguage:e.Z_().nullable()}),z={roles:e.IX().min(1,f.translatedErrors.required).required(f.translatedErrors.required)};var u=Object.defineProperty,E=Object.defineProperties,Q=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,R=(d,s,i)=>s in d?u(d,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):d[s]=i,M=(d,s)=>{for(var i in s||(s={}))K.call(s,i)&&R(d,i,s[i]);if(S)for(var i of S(s))W.call(s,i)&&R(d,i,s[i]);return d},X=(d,s)=>E(d,Q(s));const Y=e.Ry().shape(M(X(M({},L),{isActive:e.Xg()}),z))}}]);
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5895],{91671:(fe,D,a)=>{a.r(D),a.d(D,{SettingsPage:()=>_t,default:()=>Rn});var e=a(32735),C=a(88425),r=a(5141),K=a(11856),W=a(5636),Le=a(99357),Te=a(45861),pe=a(7602),we=a(84968),Q=a(16540),M=a(9808),P=a(78330),Z=a(95602),me=a(90662),U=a(44526),J=a(14983),Je=a(82372),Xe=a.n(Je),Ue=a(88677),Ee=a.n(Ue),H=a(60216),y=a.n(H),le=a(69898),ke=a(20763),Ve=a(59290),ee=a.n(Ve),ce=a(23101),de=a.n(ce),Ze=a(49415);const Ye={currentStep:void 0},je=(u=Ye,l)=>(0,Ze.default)(u,d=>{switch(l.type){case"GO_TO":{d.currentStep=l.to;break}default:return d}});var Ae=a(4122);const Ge={localImage:void 0},oe=(u=Ge,l)=>(0,Ze.default)(u,d=>{switch(l.type){case"SET_LOCAL_IMAGE":{d.localImage=l.value;break}default:return d}}),L=({onChangeLogo:u,customLogo:l,goTo:d,Component:f,modalTitle:b,next:p,prev:I,currentStep:R})=>{const[{localImage:v},x]=(0,e.useReducer)(oe,Ge),{formatMessage:Se}=(0,W.useIntl)(),ge=yt=>{x({type:"SET_LOCAL_IMAGE",value:yt})},tt=()=>{d(null)};return R?e.createElement(Ae.ModalLayout,{labelledBy:"modal",onClose:tt},e.createElement(Ae.ModalHeader,null,e.createElement(Z.Typography,{fontWeight:"bold",as:"h2",id:"modal"},Se(b))),e.createElement(f,{setLocalImage:ge,goTo:d,next:p,prev:I,onClose:tt,asset:v||l,onChangeLogo:u})):null};L.defaultProps={Component:void 0,currentStep:void 0,customLogo:void 0,modalTitle:void 0,next:null,prev:null},L.propTypes={Component:y().elementType,currentStep:y().string,customLogo:y().shape({name:y().string,url:y().string,width:y().number,height:y().number,ext:y().string}),goTo:y().func.isRequired,modalTitle:y().shape({id:y().string,defaultMessage:y().string}),next:y().string,onChangeLogo:y().func.isRequired,prev:y().string};const te=L,A=750,_=100,ae=["image/jpeg","image/png","image/svg+xml"];var G=a(81700),se=a(27635),z=a(19615),k=a(19192),ne=a(78752),xe=a(20001),ze=a(22795),Ke=a.n(ze),rt=(u,l,d)=>new Promise((f,b)=>{var p=v=>{try{R(d.next(v))}catch(x){b(x)}},I=v=>{try{R(d.throw(v))}catch(x){b(x)}},R=v=>v.done?f(v.value):Promise.resolve(v.value).then(p,I);R((d=d.apply(u,l)).next())});const _e={id:"Settings.application.customization.modal.upload.error-format",defaultMessage:"Wrong format uploaded (accepted formats only: jpeg, jpg, png, svg)."},j={id:"Settings.application.customization.modal.upload.error-size",defaultMessage:"The file uploaded is too large (max dimension: {dimension}x{dimension}, max file size: {size}KB)"},re=u=>new Promise(l=>{const d=new FileReader;d.onload=()=>{const f=new Image;f.onload=function(){l({width:f.width,height:f.height})},f.src=d.result},d.readAsDataURL(u)}),V=(u,l)=>({ext:u.name.split(".").pop(),size:u.size/1e3,name:u.name,url:URL.createObjectURL(u),rawFile:u,width:l.width,height:l.height}),h=u=>rt(void 0,null,function*(){let l;if(!ae.includes(u.type))throw l=new Error("File format"),l.displayMessage=_e,l;const f=yield re(u);if(!(f.width<=A&&f.height<=A))throw l=new Error("File sizing"),l.displayMessage=j,l;const p=V(u,f);if(!(p.size<=_))throw l=new Error("File sizing"),l.displayMessage=j,l;return p});var Ne=(u,l,d)=>new Promise((f,b)=>{var p=v=>{try{R(d.next(v))}catch(x){b(x)}},I=v=>{try{R(d.throw(v))}catch(x){b(x)}},R=v=>v.done?f(v.value):Promise.resolve(v.value).then(p,I);R((d=d.apply(u,l)).next())});const We=(0,z.default)(xe.FieldInput)`
|
|
2
|
-
opacity: 0;
|
|
3
|
-
position: absolute;
|
|
4
|
-
top: 0;
|
|
5
|
-
bottom: 0;
|
|
6
|
-
left: 0;
|
|
7
|
-
right: 0;
|
|
8
|
-
z-index: 1;
|
|
9
|
-
`,Qe=({setLocalImage:u,goTo:l,next:d,onClose:f})=>{const{formatMessage:b}=(0,W.useIntl)(),[p,I]=(0,e.useState)(!1),[R,v]=(0,e.useState)(void 0),x=(0,e.useRef)(null),Se=()=>I(!0),ge=()=>I(!1),tt=at=>{at.preventDefault(),x.current.click()},yt=()=>Ne(void 0,null,function*(){ge();const at=x.current.files[0];if(!!at)try{const st=yield h(at);u(st),l(d)}catch(st){if(st.displayMessage)v(b(st.displayMessage,{size:_,dimension:A})),x.current.focus();else throw st}}),ot=()=>p?"primary500":R?"danger600":"neutral300";return e.createElement(e.Fragment,null,e.createElement("form",null,e.createElement(M.Box,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(xe.Field,{name:"logo-upload",error:R},e.createElement("label",{htmlFor:"logo-upload"},e.createElement(me.Stack,{spacing:2},e.createElement(k.Flex,{paddingTop:9,paddingBottom:7,hasRadius:!0,justifyContent:"center",direction:"column",background:p?"primary100":"neutral100",borderColor:ot(),borderStyle:"dashed",borderWidth:"1px",position:"relative",onDragEnter:Se,onDragLeave:ge},e.createElement(ne.Icon,{color:"primary600",width:`${60/16}rem`,height:`${60/16}rem`,as:Ke(),"aria-hidden":!0}),e.createElement(M.Box,{paddingTop:3,paddingBottom:5},e.createElement(Z.Typography,{variant:"delta",as:"span"},b({id:"Settings.application.customization.modal.upload.drag-drop",defaultMessage:"Drag and Drop here or"}))),e.createElement(We,{accept:ae,cursor:"pointer",as:"input",type:"file",name:"files",tabIndex:-1,zIndex:1,onChange:yt,ref:x,id:"logo-upload"}),e.createElement(U.Button,{type:"button",onClick:tt},b({id:"Settings.application.customization.modal.upload.cta.browse",defaultMessage:"Browse files"})),e.createElement(M.Box,{paddingTop:6},e.createElement(Z.Typography,{variant:"pi",textColor:"neutral600"},b({id:"Settings.application.customization.modal.upload.file-validation",defaultMessage:"Max dimension: {dimension}x{dimension}, Max size: {size}KB"},{size:_,dimension:A})))),e.createElement(xe.FieldError,null)))))),e.createElement(Ae.ModalFooter,{startActions:e.createElement(U.Button,{onClick:f,variant:"tertiary"},b({id:"Settings.application.customization.modal.cancel",defaultMessage:"Cancel"}))}))};Qe.defaultProps={next:null},Qe.propTypes={goTo:y().func.isRequired,next:y().string,onClose:y().func.isRequired,setLocalImage:y().func.isRequired};const Y=Qe;var he=a(37178),be=a(2739),tn=a.n(be),nn=(u,l,d)=>new Promise((f,b)=>{var p=v=>{try{R(d.next(v))}catch(x){b(x)}},I=v=>{try{R(d.throw(v))}catch(x){b(x)}},R=v=>v.done?f(v.value):Promise.resolve(v.value).then(p,I);R((d=d.apply(u,l)).next())});const Bt=u=>nn(void 0,null,function*(){try{const l=yield tn().get(u,{responseType:"blob",timeout:8e3});return new File([l.data],l.config.url,{type:l.headers["content-type"]})}catch(l){throw l.displayMessage={id:"Settings.application.customization.modal.upload.error-network",defaultMessage:"Network error"},l}});var wt=(u,l,d)=>new Promise((f,b)=>{var p=v=>{try{R(d.next(v))}catch(x){b(x)}},I=v=>{try{R(d.throw(v))}catch(x){b(x)}},R=v=>v.done?f(v.value):Promise.resolve(v.value).then(p,I);R((d=d.apply(u,l)).next())});const Et=({goTo:u,next:l,onClose:d,setLocalImage:f})=>{const{formatMessage:b}=(0,W.useIntl)(),[p,I]=(0,e.useState)(""),[R,v]=(0,e.useState)(null),x=ge=>{I(ge.target.value)},Se=()=>wt(void 0,null,function*(){try{const ge=yield Bt(p),tt=yield h(ge);f(tt),u(l)}catch(ge){if(ge.displayMessage)v(b(ge.displayMessage,{size:_,dimension:A}));else throw ge}});return e.createElement("form",{onSubmit:ge=>{ge.preventDefault(),Se()}},e.createElement(M.Box,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(he.TextInput,{label:b({id:"Settings.application.customization.modal.upload.from-url.input-label",defaultMessage:"URL"}),error:R,onChange:x,value:p,name:"logo-url"})),e.createElement(Ae.ModalFooter,{startActions:e.createElement(U.Button,{onClick:d,variant:"tertiary"},b({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(U.Button,{type:"submit"},b({id:"Settings.application.customization.modal.upload.next",defaultMessage:"Next"}))}))};Et.defaultProps={next:null},Et.propTypes={goTo:y().func.isRequired,next:y().string,onClose:y().func.isRequired,setLocalImage:y().func.isRequired};const $n=Et,ut=({setLocalImage:u,goTo:l,next:d,onClose:f})=>{const{formatMessage:b}=(0,W.useIntl)();return e.createElement(G.TabGroup,{label:b({id:"Settings.application.customization.modal.tab.label",defaultMessage:"How do you want to upload your assets?"}),variant:"simple"},e.createElement(M.Box,{paddingLeft:8,paddingRight:8},e.createElement(G.Tabs,null,e.createElement(G.Tab,null,b({id:"Settings.application.customization.modal.upload.from-computer",defaultMessage:"From computer"})),e.createElement(G.Tab,null,b({id:"Settings.application.customization.modal.upload.from-url",defaultMessage:"From url"}))),e.createElement(se.Divider,null)),e.createElement(G.TabPanels,null,e.createElement(G.TabPanel,null,e.createElement(Y,{onClose:f,setLocalImage:u,goTo:l,next:d})),e.createElement(G.TabPanel,null,e.createElement($n,{onClose:f,setLocalImage:u,goTo:l,next:d}))))};ut.defaultProps={next:null},ut.propTypes={goTo:y().func.isRequired,next:y().string,onClose:y().func.isRequired,setLocalImage:y().func.isRequired};const Un=ut;var nt=a(31998);const jt=({asset:u})=>{const{formatMessage:l}=(0,W.useIntl)();return e.createElement(nt.Card,null,e.createElement(nt.CardHeader,null,e.createElement(nt.CardAsset,{size:"S",src:u.url})),e.createElement(nt.CardBody,null,e.createElement(nt.CardContent,null,e.createElement(nt.CardTitle,null,u.name),e.createElement(nt.CardSubtitle,null,`${u.ext.toUpperCase()} - ${u.width}\u2715${u.height}`)),e.createElement(nt.CardBadge,null,l({id:"Settings.application.customization.modal.pending.card-badge",defaultMessage:"image"}))))};jt.propTypes={asset:y().shape({name:y().string,url:y().string,width:y().number,height:y().number,ext:y().string}).isRequired};const Nt=jt,Tt=({onClose:u,asset:l,prev:d,next:f,goTo:b,setLocalImage:p,onChangeLogo:I})=>{const{formatMessage:R}=(0,W.useIntl)(),v=()=>{p(void 0),b(d)},x=()=>{I(l),b(f)};return e.createElement(e.Fragment,null,e.createElement(M.Box,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(k.Flex,{justifyContent:"space-between",paddingBottom:6},e.createElement(k.Flex,{direction:"column",alignItems:"flex-start"},e.createElement(Z.Typography,{variant:"pi",fontWeight:"bold"},R({id:"Settings.application.customization.modal.pending.title",defaultMessage:"Logo ready to upload"})),e.createElement(Z.Typography,{variant:"pi",textColor:"neutral500"},R({id:"Settings.application.customization.modal.pending.subtitle",defaultMessage:"Manage the chosen logo before uploading it"}))),e.createElement(U.Button,{onClick:v,variant:"secondary"},R({id:"Settings.application.customization.modal.pending.choose-another",defaultMessage:"Choose another logo"}))),e.createElement(M.Box,{maxWidth:(0,C.pxToRem)(180)},e.createElement(Nt,{asset:l}))),e.createElement(Ae.ModalFooter,{startActions:e.createElement(U.Button,{onClick:u,variant:"tertiary"},R({id:"Settings.application.customization.modal.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(U.Button,{onClick:x},R({id:"Settings.application.customization.modal.pending.upload",defaultMessage:"Upload logo"}))}))};Tt.defaultProps={next:null,prev:null},Tt.propTypes={goTo:y().func.isRequired,asset:y().shape({name:y().string,url:y().string,width:y().number,height:y().number,ext:y().string}).isRequired,next:y().string,onClose:y().func.isRequired,onChangeLogo:y().func.isRequired,prev:y().string,setLocalImage:y().func.isRequired};const sn={upload:{Component:Un,modalTitle:{id:"Settings.application.customization.modal.upload",defaultMessage:"Upload logo"},next:"pending",prev:null},pending:{Component:Tt,modalTitle:{id:"Settings.application.customization.modal.pending",defaultMessage:"Pending logo"},next:null,prev:"upload"}},pt=({customLogo:u,defaultLogo:l,onChangeLogo:d,onResetMenuLogo:f})=>{const[{currentStep:b},p]=(0,e.useReducer)(je,Ye),{Component:I,next:R,prev:v,modalTitle:x}=sn[b]||{},{formatMessage:Se}=(0,W.useIntl)(),ge=tt=>{p({type:"GO_TO",to:tt})};return e.createElement(e.Fragment,null,e.createElement(le.CarouselInput,{label:Se({id:"Settings.application.customization.carousel.title",defaultMessage:"Logo"}),selectedSlide:0,hint:Se({id:"Settings.application.customization.carousel-hint",defaultMessage:"Change the admin panel logo (Max dimension: {dimension}x{dimension}, Max file size: {size}KB)"},{size:_,dimension:A}),previousLabel:"",nextLabel:"",onNext:()=>{},onPrevious:()=>{},secondaryLabel:(u==null?void 0:u.name)||"logo.png",actions:e.createElement(le.CarouselActions,null,e.createElement(ke.IconButton,{onClick:()=>ge(u?"pending":"upload"),label:Se({id:"Settings.application.customization.carousel.change-action",defaultMessage:"Change logo"}),icon:e.createElement(ee(),null)}),u&&e.createElement(ke.IconButton,{onClick:f,label:Se({id:"Settings.application.customization.carousel.reset-action",defaultMessage:"Reset logo"}),icon:e.createElement(de(),null)}))},e.createElement(le.CarouselSlide,{label:Se({id:"Settings.application.customization.carousel-slide.label",defaultMessage:"Logo slide"})},e.createElement(M.Box,{maxHeight:"40%",maxWidth:"40%",as:"img",src:(u==null?void 0:u.url)||l,alt:Se({id:"Settings.application.customization.carousel.title",defaultMessage:"Logo"})}))),e.createElement(te,{Component:I,currentStep:b,onChangeLogo:d,customLogo:u,goTo:ge,next:R,prev:v,modalTitle:x}))};pt.defaultProps={customLogo:null},pt.propTypes={customLogo:y().shape({url:y().string,name:y().string}),defaultLogo:y().string.isRequired,onChangeLogo:y().func.isRequired,onResetMenuLogo:y().func.isRequired};const Wt=pt,bt={menuLogo:{display:null,submit:{rawFile:null,isReset:!1}}},Vn=(u=bt,l)=>(0,Ze.default)(u,d=>{switch(l.type){case"SET_CUSTOM_MENU_LOGO":{d.menuLogo.display=l.value,d.menuLogo.submit.rawFile=l.value.rawFile;break}case"RESET_CUSTOM_MENU_LOGO":{d.menuLogo.display=null,d.menuLogo.submit={rawFile:null,isReset:!0};break}default:return d}});var At=a(86349),Zn=a.n(At);const Gn=(u,l)=>Zn()(u,{menuLogo:{display:l.menuLogo}}),Ot=(0,e.forwardRef)(({projectSettingsStored:u},l)=>{const{formatMessage:d}=(0,W.useIntl)(),{trackUsage:f}=(0,C.useTracking)(),{logos:{menu:b}}=(0,Te.um)(),[{menuLogo:p},I]=(0,e.useReducer)(Vn,bt,()=>Gn(bt,u)),R=x=>{I({type:"SET_CUSTOM_MENU_LOGO",value:x})},v=()=>{f("didClickResetLogo"),I({type:"RESET_CUSTOM_MENU_LOGO"})};return(0,e.useImperativeHandle)(l,()=>({getValues:()=>({menuLogo:p.submit})})),e.createElement(M.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",paddingTop:6,paddingBottom:6,paddingRight:7,paddingLeft:7},e.createElement(Z.Typography,{variant:"delta",as:"h3"},d({id:"Settings.application.customization",defaultMessage:"Customization"})),e.createElement(P.Grid,{paddingTop:4},e.createElement(P.GridItem,{col:6,s:12},e.createElement(Wt,{onChangeLogo:R,customLogo:p.display,defaultLogo:b.default,onResetMenuLogo:v}))))});Ot.defaultProps={projectSettingsStored:null},Ot.propTypes={projectSettingsStored:y().shape({menuLogo:y().shape({url:y().string,name:y().string})})};const rn=Ot;var $t=a(17247),zn=a(48344),gt=a.n(zn),Kn=Object.defineProperty,ft=Object.defineProperties,Ut=Object.getOwnPropertyDescriptors,Rt=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,ln=Object.prototype.propertyIsEnumerable,Dt=(u,l,d)=>l in u?Kn(u,l,{enumerable:!0,configurable:!0,writable:!0,value:d}):u[l]=d,Vt=(u,l)=>{for(var d in l||(l={}))kt.call(l,d)&&Dt(u,d,l[d]);if(Rt)for(var d of Rt(l))ln.call(l,d)&&Dt(u,d,l[d]);return u},Zt=(u,l)=>ft(u,Ut(l));const xt=u=>gt()(u,(l,d,f)=>{d&&d.url?l[f]=Zt(Vt({},d),{url:(0,C.prefixFileUrlWithBackendUrl)(d.url)}):l[f]=d},{});var Gt=(u,l,d)=>new Promise((f,b)=>{var p=v=>{try{R(d.next(v))}catch(x){b(x)}},I=v=>{try{R(d.throw(v))}catch(x){b(x)}},R=v=>v.done?f(v.value):Promise.resolve(v.value).then(p,I);R((d=d.apply(u,l)).next())});const Xn=()=>Gt(void 0,null,function*(){const{data:u}=yield $t.be.get("/admin/project-settings");return xt(u)}),cn=u=>Gt(void 0,null,function*(){const{data:l}=yield $t.be.post("/admin/project-settings",u);return xt(l)}),un=u=>{const l=new FormData;return Object.entries(u).forEach(([d,f])=>{f&&f.rawFile instanceof File&&l.append(d,f.rawFile),f&&f.isReset&&l.append(d,null)}),l};var zt=(u,l,d)=>new Promise((f,b)=>{var p=v=>{try{R(d.next(v))}catch(x){b(x)}},I=v=>{try{R(d.throw(v))}catch(x){b(x)}},R=v=>v.done?f(v.value):Promise.resolve(v.value).then(p,I);R((d=d.apply(u,l)).next())});const pn=[{action:"admin::project-settings.update",subject:null}],Qn=()=>{const u=(0,e.useRef)(),l=(0,C.useNotification)(),{trackUsage:d}=(0,C.useTracking)(),{formatMessage:f}=(0,W.useIntl)(),b=(0,we.useQueryClient)();(0,C.useFocusWhenNavigate)();const p=(0,C.useAppInfos)(),{shouldUpdateStrapi:I,latestStrapiReleaseTag:R,strapiVersion:v}=p,{updateProjectSettings:x}=(0,Te.um)(),{data:Se}=(0,we.useQuery)("project-settings",Xn),ge=p.communityEdition?"app.components.UpgradePlanModal.text-ce":"app.components.UpgradePlanModal.text-ee",tt=(0,we.useMutation)(ot=>cn(ot),{onSuccess:ot=>zt(void 0,[ot],function*({menuLogo:at}){yield b.invalidateQueries("project-settings",{refetchActive:!0}),x({menuLogo:at==null?void 0:at.url})})}),yt=()=>{const ot=u.current.getValues(),at=un(ot);tt.mutate(at,{onSuccess:()=>{const{menuLogo:st}=ot;st.rawFile&&d("didChangeLogo")},onError:()=>{l({type:"warning",message:{id:"notification.error",defaultMessage:"An error occurred"}})}})};return e.createElement(K.Layout,null,e.createElement(C.SettingsPageTitle,{name:"Application"}),e.createElement(Q.Main,null,e.createElement(K.HeaderLayout,{title:f({id:"Settings.application.title",defaultMessage:"Overview"}),subtitle:f({id:"Settings.application.description",defaultMessage:"Administration panel\u2019s global information"}),primaryAction:e.createElement(U.Button,{onClick:yt,startIcon:e.createElement(Ee(),null)},f({id:"global.save",defaultMessage:"Save"}))}),e.createElement(K.ContentLayout,null,e.createElement(me.Stack,{spacing:6},e.createElement(M.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",paddingTop:6,paddingBottom:6,paddingRight:7,paddingLeft:7},e.createElement(me.Stack,{spacing:5},e.createElement(Z.Typography,{variant:"delta",as:"h3"},f({id:"global.details",defaultMessage:"Details"})),e.createElement(P.Grid,{paddingTop:1},e.createElement(P.GridItem,{col:6,s:12},e.createElement(Z.Typography,{variant:"sigma",textColor:"neutral600"},f({id:"Settings.application.strapiVersion",defaultMessage:"strapi version"})),e.createElement(Z.Typography,{as:"p"},"v",v),e.createElement(J.Link,{href:p.communityEdition?"https://discord.strapi.io":"https://support.strapi.io/support/home",isExternal:!0,endIcon:e.createElement(Xe(),null)},f({id:"Settings.application.get-help",defaultMessage:"Get help"}))),e.createElement(P.GridItem,{col:6,s:12},e.createElement(Z.Typography,{variant:"sigma",textColor:"neutral600"},f({id:"Settings.application.edition-title",defaultMessage:"current plan"})),e.createElement(Z.Typography,{as:"p"},f({id:ge,defaultMessage:`${p.communityEdition?"Community Edition":"Enterprise Edition"}`})))),e.createElement(P.Grid,{paddingTop:1},e.createElement(P.GridItem,{col:6,s:12},I&&e.createElement(J.Link,{href:`https://github.com/strapi/strapi/releases/tag/${R}`,isExternal:!0,endIcon:e.createElement(Xe(),null)},f({id:"Settings.application.link-upgrade",defaultMessage:"Upgrade your admin panel"}))),e.createElement(P.GridItem,{col:6,s:12},e.createElement(J.Link,{href:"https://strapi.io/pricing-self-hosted",isExternal:!0,endIcon:e.createElement(Xe(),null)},f({id:"Settings.application.link-pricing",defaultMessage:"See all pricing plans"})))),e.createElement(M.Box,{paddingTop:1},e.createElement(Z.Typography,{variant:"sigma",textColor:"neutral600"},f({id:"Settings.application.node-version",defaultMessage:"node version"})),e.createElement(Z.Typography,{as:"p"},p.nodeVersion)))),Se&&e.createElement(C.CheckPermissions,{permissions:pn},e.createElement(rn,{ref:u,projectSettingsStored:Se}))))))};var Kt=a(3704),mn=a.n(Kt);const gn=u=>mn()(u,d=>d.links).map(d=>(0,pe.ot)(d.Component,d.to,d.exact||!1)),hn=u=>u.filter(l=>!l.links.every(d=>d.isDisplayed===!1));var Ht=a(15685),et=a(52136),yn=a(72142),ye=a.n(yn),vn=function(){return window&&window.strapi&&window.strapi.isEE?a(20178).Z:a(16329).Z}(),Cn=function(){return window&&window.strapi&&window.strapi.isEE?a(51899).Z:a(45677).Z}(),En=[{Component:function(){return{default:Cn}},to:"/settings/roles",exact:!0},{Component:function(){return{default:vn}},to:"/settings/roles/duplicate/:id",exact:!0},{Component:function(){return{default:vn}},to:"/settings/roles/new",exact:!0},{Component:function(){var u=(0,et.Z)(ye().mark(function d(){var f;return ye().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(2544).then(a.bind(a,33778));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/roles/:id",exact:!0},{Component:function(){var u=(0,et.Z)(ye().mark(function d(){var f;return ye().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(5199).then(a.bind(a,15519));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/users",exact:!0},{Component:function(){var u=(0,et.Z)(ye().mark(function d(){var f;return ye().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(4263).then(a.bind(a,34669));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/users/:id",exact:!0},{Component:function(){var u=(0,et.Z)(ye().mark(function d(){var f;return ye().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,Promise.all([a.e(4715),a.e(5162)]).then(a.bind(a,33238));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/webhooks/create",exact:!0},{Component:function(){var u=(0,et.Z)(ye().mark(function d(){var f;return ye().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,Promise.all([a.e(4715),a.e(5162)]).then(a.bind(a,59021));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/webhooks/:id",exact:!0},{Component:function(){var u=(0,et.Z)(ye().mark(function d(){var f;return ye().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(4121).then(a.bind(a,70791));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/webhooks",exact:!0},{Component:function(){var u=(0,et.Z)(ye().mark(function d(){var f;return ye().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(8056).then(a.bind(a,23923));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/api-tokens",exact:!0},{Component:function(){var u=(0,et.Z)(ye().mark(function d(){var f;return ye().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(4299).then(a.bind(a,3330));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/api-tokens/create",exact:!0},{Component:function(){var u=(0,et.Z)(ye().mark(function d(){var f;return ye().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(92).then(a.bind(a,97841));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/api-tokens/:id",exact:!0}];const bn=En;var Xt=function(){return window&&window.strapi&&window.strapi.isEE?a(63775).Z:a(75936).Z}();const Sn=[].concat((0,Ht.Z)(Xt),(0,Ht.Z)(bn));var ht=a(89420),Yt=Object.defineProperty,Pn=Object.defineProperties,Tn=Object.getOwnPropertyDescriptors,Qt=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,An=Object.prototype.propertyIsEnumerable,Lt=(u,l,d)=>l in u?Yt(u,l,{enumerable:!0,configurable:!0,writable:!0,value:d}):u[l]=d,It=(u,l)=>{for(var d in l||(l={}))Mt.call(l,d)&&Lt(u,d,l[d]);if(Qt)for(var d of Qt(l))An.call(l,d)&&Lt(u,d,l[d]);return u},Jt=(u,l)=>Pn(u,Tn(l));const qt=({menu:u})=>{const{formatMessage:l}=(0,W.useIntl)(),f=hn(u).map(p=>Jt(It({},p),{title:p.intlLabel,links:p.links.map(I=>Jt(It({},I),{title:I.intlLabel,name:I.id}))})),b=l({id:"global.settings",defaultMessage:"Settings"});return e.createElement(ht.SubNav,{ariaLabel:b},e.createElement(ht.SubNavHeader,{label:b}),e.createElement(ht.SubNavSections,null,f.map(p=>e.createElement(ht.SubNavSection,{key:p.id,label:l(p.intlLabel)},p.links.map(I=>e.createElement(ht.SubNavLink,{as:r.NavLink,withBullet:I.hasNotification,to:I.to,key:I.id},l(I.intlLabel)))))))};qt.propTypes={menu:y().array.isRequired};const On=qt;function _t(){const{settingId:u}=(0,r.useParams)(),{settings:l}=(0,C.useStrapiApp)(),{formatMessage:d}=(0,W.useIntl)(),{isLoading:f,menu:b}=(0,Te.Te)(),p=(0,e.useMemo)(()=>(0,pe.WW)(Sn.map(({to:v,Component:x,exact:Se})=>(0,pe.ot)(x,v,Se))),[]),I=gn(l);if(f)return e.createElement(C.LoadingIndicatorPage,null);if(!u)return e.createElement(r.Redirect,{to:"/settings/application-infos"});const R=d({id:"global.settings",defaultMessage:"Settings"});return e.createElement(K.Layout,{sideNav:e.createElement(On,{menu:b})},e.createElement(Le.Helmet,{title:R}),e.createElement(r.Switch,null,e.createElement(r.Route,{path:"/settings/application-infos",component:Qn,exact:!0}),p,I))}const Rn=(0,e.memo)(_t)},16329:(fe,D,a)=>{a.d(D,{Z:()=>K});var e=a(32735),C=a(5141);const K=()=>e.createElement(C.Redirect,{to:"/404"})},49466:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!0},35123:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!0},18318:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!0},52124:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!0},61526:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!0},95349:(fe,D,a)=>{a.d(D,{Z:()=>Ja});var e=a(32735),C=a(60216),r=a.n(C),K=a(88425),W=a(81700),Le=a(23973),Te=a.n(Le),pe=a(86834),we=a.n(pe),Q=a(5636),M=a(9808),P=a(19615),Z=a(98978),me=a.n(Z),U=a(39515),J=a(67793),Je=a.n(J),Xe=a(31476),Ue=a.n(Xe),Ee=a(35980),H=a(19192),y=a(33795),le=a.n(y),ke=a(9086),Ve=a.n(ke),ee=a(45861),ce=a(42258),de=a.n(ce),Ze=a(44526);const Ye=P.default.div`
|
|
10
|
-
position: relative;
|
|
11
|
-
|
|
12
|
-
${({hasConditions:o,disabled:t,theme:n})=>o&&`
|
|
13
|
-
&:before {
|
|
14
|
-
content: '';
|
|
15
|
-
position: absolute;
|
|
16
|
-
top: -3px;
|
|
17
|
-
left: -10px;
|
|
18
|
-
width: 6px;
|
|
19
|
-
height: 6px;
|
|
20
|
-
border-radius: ${20/16}rem;;
|
|
21
|
-
background: ${t?n.colors.neutral100:n.colors.primary600};
|
|
22
|
-
}
|
|
23
|
-
`}
|
|
24
|
-
`,qe=({onClick:o,className:t,hasConditions:n,variant:s})=>{const{formatMessage:i}=(0,Q.useIntl)();return e.createElement(Ye,{hasConditions:n,className:t},e.createElement(Ze.Button,{variant:s,startIcon:e.createElement(de(),null),onClick:o},i({id:"global.settings",defaultMessage:"Settings"})))};qe.defaultProps={className:null,hasConditions:!1,variant:"tertiary"},qe.propTypes={onClick:r().func.isRequired,className:r().string,hasConditions:r().bool,variant:r().string};const je=(0,P.default)(qe)``;var Ae=a(27635),Ge=a(90662),it=a(4122),oe=a(71657),L=a(95602),te=a(49415),A=a(81346),_=a.n(A),ae=a(23940),G=a.n(ae),se=a(16584),z=a(15685),k=a(25716);const ne=`${120/16}rem`,xe=`${200/16}rem`,ze=`${53/16}rem`;function Ke(o,t){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(o);t&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),n.push.apply(n,s)}return n}function rt(o){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ke(Object(n),!0).forEach(function(s){(0,se.Z)(o,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach(function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(n,s))})}return o}var _e=function(){return window&&window.strapi&&window.strapi.isEE?a(56899).Z:a(49466).Z}(),j=(0,P.default)(H.Flex).withConfig({displayName:"ActionRow__FlexWrapper",componentId:"sc-1bqpgdl-0"})(["height:",";"],ze),re=function(t){var n=t.arrayOfOptionsGroupedByCategory,s=t.isFormDisabled,i=t.isGrey,c=t.label,m=t.name,g=t.onChange,E=t.value,S=(0,Q.useIntl)(),T=S.formatMessage,F=n.reduce(function(w,N){var O=(0,U.Z)(N,2),B=O[0],X=O[1],ie={label:G()(B),children:X.map(function(Oe){return{label:Oe.displayName,value:Oe.id}})};return[].concat((0,z.Z)(w),[ie])},[]),$=Object.values(E).map(function(w){return Object.entries(w).filter(function(N){var O=(0,U.Z)(N,2),B=O[1];return B}).map(function(N){var O=(0,U.Z)(N,1),B=O[0];return B})}).flat(),q=function(N){var O=(0,U.Z)(n,1),B=(0,U.Z)(O[0],2),X=B[1],ie=X.reduce(function(Oe,ve){return rt((0,se.Z)({},ve.id,N.includes(ve.id)),Oe)},{});g(m,ie)};return e.createElement(j,{as:"li",background:i?"neutral100":"neutral0"},e.createElement(H.Flex,{paddingLeft:6,style:{width:180}},e.createElement(L.Typography,{variant:"sigma",textColor:"neutral600"},T({id:"Settings.permissions.conditions.can",defaultMessage:"Can"}),"\xA0"),e.createElement(L.Typography,{variant:"sigma",title:c,textColor:"primary600",ellipsis:!0},T({id:"Settings.roles.form.permissions.".concat(c.toLowerCase()),defaultMessage:c})),e.createElement(L.Typography,{variant:"sigma",textColor:"neutral600"},"\xA0",T({id:"Settings.permissions.conditions.when",defaultMessage:"When"}))),e.createElement(M.Box,{style:{maxWidth:430,width:"100%"}},e.createElement(k.MultiSelectNested,{id:m,customizeContent:function(N){return"".concat(N.length," currently selected")},onChange:q,value:$,options:F,disabled:s||_e})))};re.propTypes={arrayOfOptionsGroupedByCategory:r().array.isRequired,isFormDisabled:r().bool.isRequired,isGrey:r().bool.isRequired,label:r().string.isRequired,name:r().string.isRequired,value:r().object.isRequired,onChange:r().func.isRequired};const V=re;var h=a(92891);const Ne=(o,t)=>o.reduce((n,s)=>(n[s.id]=(0,h.get)(t,s.id,!1),n),{}),We=(o,t)=>o.reduce((n,s)=>{const[i,c]=s,m=Ne(c,t);return n[i]=m,n},{}),Y=(o,t,n)=>o.reduce((s,i)=>{const c=(0,h.get)(t,[...i.pathToConditionsObject,"conditions"],{}),m=We(n,c);return s[i.pathToConditionsObject.join("..")]=m,s},{});var he=Object.defineProperty,be=Object.getOwnPropertySymbols,tn=Object.prototype.hasOwnProperty,nn=Object.prototype.propertyIsEnumerable,on=(o,t,n)=>t in o?he(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Bt=(o,t)=>{for(var n in t||(t={}))tn.call(t,n)&&on(o,n,t[n]);if(be)for(var n of be(t))nn.call(t,n)&&on(o,n,t[n]);return o};const wt=({actions:o,headerBreadCrumbs:t,isFormDisabled:n,onClosed:s,onToggle:i})=>{const{formatMessage:c}=(0,Q.useIntl)(),{availableConditions:m,modifiedData:g,onChangeConditions:E}=(0,ee.$_)(),S=(0,e.useMemo)(()=>Object.entries(_()(m,"category")),[m]),T=o.filter(({isDisplayed:O,hasSomeActionsSelected:B,hasAllActionsSelected:X})=>O&&(B||X)),F=(0,e.useMemo)(()=>Y(T,g,S),[T,g,S]),[$,q]=(0,e.useState)(F),w=(O,B)=>{q((0,te.default)(X=>{X[O]||(X[O]={}),X[O].default||(X[O].default={}),X[O].default=B}))},N=()=>{const O=Object.entries($).reduce((B,X)=>{const[ie,Oe]=X,ve=Object.values(Oe).reduce((Re,Ie)=>Bt(Bt({},Re),Ie),{});return B[ie]=ve,B},{});E(O),i()};return e.createElement(it.ModalLayout,{labelledBy:"condition-modal-breadcrumbs",onClose:s},e.createElement(it.ModalHeader,null,e.createElement(oe.Breadcrumbs,{id:"condition-modal-breadcrumbs",label:t.join(", ")},t.map(O=>e.createElement(oe.Crumb,{key:O},G()(c({id:O,defaultMessage:O})))))),e.createElement(M.Box,{padding:8},e.createElement(Ge.Stack,{spacing:6},e.createElement(L.Typography,{variant:"beta",as:"h2"},c({id:"Settings.permissions.conditions.define-conditions",defaultMessage:"Define conditions"})),e.createElement(M.Box,null,e.createElement(Ae.Divider,null)),e.createElement(M.Box,null,T.length===0&&e.createElement(L.Typography,null,c({id:"Settings.permissions.conditions.no-actions",defaultMessage:"You first need to select actions (create, read, update, ...) before defining conditions on them."})),e.createElement("ul",null,T.map(({actionId:O,label:B,pathToConditionsObject:X},ie)=>{const Oe=X.join("..");return e.createElement(V,{key:O,arrayOfOptionsGroupedByCategory:S,label:B,isFormDisabled:n,isGrey:ie%2===0,name:Oe,onChange:w,value:le()($,Oe,{})})}))))),e.createElement(it.ModalFooter,{startActions:e.createElement(Ze.Button,{variant:"tertiary",onClick:i},c({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(Ze.Button,{onClick:N},c({id:"Settings.permissions.conditions.apply",defaultMessage:"Apply"}))}))};wt.propTypes={actions:r().arrayOf(r().shape({actionId:r().string.isRequired,checkboxName:r().string,hasSomeActionsSelected:r().bool.isRequired,hasAllActionsSelected:r().bool,isDisplayed:r().bool.isRequired,label:r().string})).isRequired,headerBreadCrumbs:r().arrayOf(r().string).isRequired,isFormDisabled:r().bool.isRequired,onClosed:r().func.isRequired,onToggle:r().func.isRequired};const Et=wt,ut=P.default.div`
|
|
25
|
-
width: ${ne};
|
|
26
|
-
`,nt=(0,P.default)(H.Flex)`
|
|
27
|
-
padding-right: ${({theme:o})=>o.spaces[2]};
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
flex: 1;
|
|
30
|
-
${({isCollapsable:o})=>o&&"cursor: pointer;"}
|
|
31
|
-
`;var jt=Object.defineProperty,Nt=Object.getOwnPropertySymbols,Tt=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable,an=(o,t,n)=>t in o?jt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,sn=(o,t)=>{for(var n in t||(t={}))Tt.call(t,n)&&an(o,n,t[n]);if(Nt)for(var n of Nt(t))kn.call(t,n)&&an(o,n,t[n]);return o};const pt=({children:o,isCollapsable:t,isActive:n,isFormDisabled:s,label:i,onChange:c,onClick:m,checkboxName:g,someChecked:E,value:S})=>{const{formatMessage:T}=(0,Q.useIntl)();return e.createElement(H.Flex,{alignItems:"center",paddingLeft:6,style:{width:xe,flexShrink:0}},e.createElement(M.Box,{paddingRight:2},e.createElement(Ee.BaseCheckbox,{name:g,"aria-label":T({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:i}),disabled:s,onValueChange:F=>c({target:{name:g,value:F}}),indeterminate:E,value:S})),e.createElement(nt,sn({title:i,alignItems:"center",isCollapsable:t},t&&{onClick:m,"aria-expanded":n,onKeyDown:({key:F})=>(F==="Enter"||F===" ")&&m(),tabIndex:0,role:"button"}),e.createElement(L.Typography,{fontWeight:n?"bold":"",textColor:n?"primary600":"neutral800",ellipsis:!0},G()(i)),o))};pt.defaultProps={children:null,checkboxName:"",onChange:()=>{},value:!1,someChecked:!1,isCollapsable:!1},pt.propTypes={checkboxName:r().string,children:r().node,label:r().string.isRequired,isCollapsable:r().bool,isFormDisabled:r().bool.isRequired,onChange:r().func,onClick:r().func.isRequired,someChecked:r().bool,value:r().bool,isActive:r().bool.isRequired};const Wt=(0,e.memo)(pt),bt=o=>(0,h.isObject)(o)?(0,h.flattenDeep)(Object.values(o).map(t=>(0,h.isObject)(t)?bt(t):t)):[],mt=bt,At=o=>o?Object.keys(o).reduce((t,n)=>(n!=="conditions"&&(t[n]=o[n]),t),{}):null,ct=o=>{const t=At(o),n=mt(t);if(!n.length)return{hasAllActionsSelected:!1,hasSomeActionsSelected:!1};const s=n.every(c=>c),i=n.some(c=>c)&&!s;return{hasAllActionsSelected:s,hasSomeActionsSelected:i}},Ot=(o,t,n)=>o.map(({actionId:s,isDisplayed:i,applyToProperties:c,label:m})=>{if(!i)return{actionId:s,hasSomeActionsSelected:!1,isDisplayed:i};const g=[...n.split(".."),s],E=(0,h.isEmpty)(c)?[...g,"properties","enabled"]:g,S=E.join(".."),T=(0,h.get)(t,[...g,"conditions"],null),F=mt(T).some(N=>N);if((0,h.isEmpty)(c)){const N=(0,h.get)(t,E,!1);return{actionId:s,checkboxName:S,hasAllActionsSelected:N,hasConditions:F,hasSomeActionsSelected:N,isDisplayed:i,isParentCheckbox:!1,label:m,pathToConditionsObject:g}}const $=(0,h.get)(t,E,null),{hasAllActionsSelected:q,hasSomeActionsSelected:w}=ct($);return{actionId:s,checkboxName:S,hasAllActionsSelected:q,hasConditions:F,hasSomeActionsSelected:w,isDisplayed:i,isParentCheckbox:!0,label:m,pathToConditionsObject:g}});var rn=a(60672),$t=a.n(rn);const gt=(0,P.default)($t())`
|
|
32
|
-
display: none;
|
|
33
|
-
width: ${10/16}rem;
|
|
34
|
-
transform: rotate(${({$isActive:o})=>o?"180":"0"}deg);
|
|
35
|
-
margin-left: ${({theme:o})=>o.spaces[2]};
|
|
36
|
-
`,ft=o=>`
|
|
37
|
-
${L.Typography} {
|
|
38
|
-
color: ${o.colors.primary600};
|
|
39
|
-
font-weight: ${o.fontWeights.bold}
|
|
40
|
-
}
|
|
41
|
-
${gt} {
|
|
42
|
-
display: block;
|
|
43
|
-
path {
|
|
44
|
-
fill: ${o.colors.primary600}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
`;var Ut=function(){return window&&window.strapi&&window.strapi.isEE?a(68464).Z:a(35123).Z}(),Rt=function o(t,n){return`
|
|
48
|
-
`.concat(kt,` {
|
|
49
|
-
background-color: `).concat(t.colors.primary100,`;
|
|
50
|
-
color: `).concat(t.colors.primary600,`;
|
|
51
|
-
border-radius: `).concat(n?"2px 2px 0 0":"2px",`;
|
|
52
|
-
}
|
|
53
|
-
`).concat(Vt,` {
|
|
54
|
-
display: flex;
|
|
55
|
-
}
|
|
56
|
-
`).concat(je,` {
|
|
57
|
-
display: block;
|
|
58
|
-
}
|
|
59
|
-
&:hover {
|
|
60
|
-
`).concat(ft(t),`
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&:focus-within {
|
|
64
|
-
`).concat(function(s){var i=s.theme,c=s.isActive;return o(i,c)},`
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
`)},kt=P.default.div.withConfig({displayName:"Collapse__Wrapper",componentId:"sc-132fji1-0"})(["flex:1;display:flex;align-items:center;height:",";background-color:",";border:1px solid transparent;"],ze,function(o){var t=o.isGrey,n=o.theme;return t?n.colors.neutral100:n.colors.neutral0}),ln=P.default.div.withConfig({displayName:"Collapse__BoxWrapper",componentId:"sc-132fji1-1"})(["display:inline-flex;min-width:100%;","{display:none;}"," &:hover{","}"],je,function(o){var t=o.isActive,n=o.theme;return t&&Rt(n,t)},function(o){var t=o.theme,n=o.isActive;return Rt(t,n)}),Dt=(0,P.default)(H.Flex).withConfig({displayName:"Collapse__Cell",componentId:"sc-132fji1-2"})(["width:",";position:relative;"],ne),Vt=(0,P.default)(M.Box).withConfig({displayName:"Collapse__Chevron",componentId:"sc-132fji1-3"})(["display:none;svg{width:11px;}*{fill:",";}"],function(o){var t=o.theme;return t.colors.primary600}),Zt=P.default.span.withConfig({displayName:"Collapse__TinyDot",componentId:"sc-132fji1-4"})(["position:absolute;top:-6px;left:37px;width:6px;height:6px;border-radius:20px;background:",";"],function(o){var t=o.theme;return t.colors.primary600}),Hn=(0,P.default)(M.Box).withConfig({displayName:"Collapse__AbsoluteBox",componentId:"sc-132fji1-5"})(["position:absolute;right:9px;transform:translateY(10px);"]),xt=function(t){var n=t.availableActions,s=t.isActive,i=t.isGrey,c=t.isFormDisabled,m=t.label,g=t.onClickToggle,E=t.pathToData,S=(0,e.useState)(!1),T=(0,U.Z)(S,2),F=T[0],$=T[1],q=(0,Q.useIntl)(),w=q.formatMessage,N=(0,ee.$_)(),O=N.modifiedData,B=N.onChangeParentCheckbox,X=N.onChangeSimpleCheckbox,ie=function(){$(function(Pe){return!Pe})},Oe=function(){$(!1)},ve=le()(O,E.split(".."),{}),Re=(0,e.useMemo)(function(){return Object.keys(ve).reduce(function(ue,Pe){return ue[Pe]=Ve()(ve[Pe],"conditions"),ue},{})},[ve]),Ie=ct(Re),Me=Ie.hasAllActionsSelected,vt=Ie.hasSomeActionsSelected,Ce=(0,e.useMemo)(function(){return Ot(n,O,E)},[n,O,E]),Fe=Ce.some(function(ue){var Pe=ue.hasConditions;return Pe});return e.createElement(ln,{isActive:s},e.createElement(kt,{isGrey:i},e.createElement(Wt,{isCollapsable:!0,isFormDisabled:c,label:m,checkboxName:E,onChange:B,onClick:g,someChecked:vt,value:Me,isActive:s},e.createElement(Vt,{paddingLeft:2},s?e.createElement(Ue(),null):e.createElement(Je(),null))),e.createElement(H.Flex,{style:{flex:1}},Ce.map(function(ue){var Pe=ue.actionId,De=ue.hasConditions,Be=ue.hasAllActionsSelected,$e=ue.hasSomeActionsSelected,dt=ue.isDisplayed,He=ue.isParentCheckbox,lt=ue.checkboxName,St=ue.label;return dt?He?e.createElement(Dt,{key:Pe,justifyContent:"center",alignItems:"center"},De&&e.createElement(Zt,null),e.createElement(Ee.BaseCheckbox,{disabled:c||Ut,name:lt,"aria-label":w({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(St," ").concat(m)}),onValueChange:function(Ct){B({target:{name:lt,value:Ct}})},indeterminate:$e,value:Be})):e.createElement(Dt,{key:Pe,justifyContent:"center",alignItems:"center"},De&&e.createElement(Zt,null),e.createElement(Ee.BaseCheckbox,{disabled:c||Ut,indeterminate:De,name:lt,onValueChange:function(Ct){X({target:{name:lt,value:Ct}})},value:Be})):e.createElement(ut,{key:Pe})})),F&&e.createElement(Et,{headerBreadCrumbs:[m,"app.components.LeftMenuLinkContainer.settings"],actions:Ce,isFormDisabled:c,onClosed:Oe,onToggle:ie})),e.createElement(Hn,null,e.createElement(je,{onClick:ie,hasConditions:Fe})))};xt.propTypes={availableActions:r().array.isRequired,isActive:r().bool.isRequired,isGrey:r().bool.isRequired,isFormDisabled:r().bool.isRequired,label:r().string.isRequired,onClickToggle:r().func.isRequired,pathToData:r().string.isRequired};const Gt=xt,cn=(o,t)=>o.map(n=>{const s=Array.isArray(n.applyToProperties)&&n.applyToProperties.indexOf(t)!==-1&&n.isDisplayed;return{label:n.label,actionId:n.actionId,isActionRelatedToCurrentProperty:s}}),dn=(0,P.default)(H.Flex)`
|
|
68
|
-
width: ${ne};
|
|
69
|
-
flex-shrink: 0;
|
|
70
|
-
`,un=(0,P.default)(H.Flex)`
|
|
71
|
-
width: ${xe};
|
|
72
|
-
height: ${ze};
|
|
73
|
-
flex-shrink: 0;
|
|
74
|
-
`,zt=({headers:o,label:t})=>{const{formatMessage:n}=(0,Q.useIntl)(),s=n({id:"Settings.roles.form.permission.property-label",defaultMessage:"{label} permissions"},{label:t});return e.createElement(H.Flex,null,e.createElement(un,{alignItems:"center",paddingLeft:6},e.createElement(L.Typography,{variant:"sigma",textColor:"neutral500"},s)),o.map(i=>i.isActionRelatedToCurrentProperty?e.createElement(dn,{justifyContent:"center",key:i.label},e.createElement(L.Typography,{variant:"sigma",textColor:"neutral500"},n({id:`Settings.roles.form.permissions.${i.label.toLowerCase()}`,defaultMessage:i.label}))):e.createElement(dn,{key:i.label})))};zt.propTypes={headers:r().arrayOf(r().shape({label:r().string.isRequired,isActionRelatedToCurrentProperty:r().bool.isRequired})).isRequired,label:r().string.isRequired};const pn=zt,Yn=P.default.span`
|
|
75
|
-
color: ${({theme:o})=>o.colors.danger700};
|
|
76
|
-
padding-left: ${({theme:o})=>o.spaces[1]}px;
|
|
77
|
-
`,Kt=()=>e.createElement(Yn,null,"*");var mn=Object.defineProperty,Jn=Object.defineProperties,gn=Object.getOwnPropertyDescriptors,fn=Object.getOwnPropertySymbols,hn=Object.prototype.hasOwnProperty,Ht=Object.prototype.propertyIsEnumerable,et=(o,t,n)=>t in o?mn(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,yn=(o,t)=>{for(var n in t||(t={}))hn.call(t,n)&&et(o,n,t[n]);if(fn)for(var n of fn(t))Ht.call(t,n)&&et(o,n,t[n]);return o},ye=(o,t)=>Jn(o,gn(t));const Cn=(o,t)=>o.map(n=>{const s=Array.isArray(n.subjects)&&n.subjects.indexOf(t)!==-1;return ye(yn({},n),{isDisplayed:s})});var En=a(41925),bn=Object.defineProperty,Xt=Object.getOwnPropertySymbols,Sn=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable,Yt=(o,t,n)=>t in o?bn(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Pn=(o,t)=>{for(var n in t||(t={}))Sn.call(t,n)&&Yt(o,n,t[n]);if(Xt)for(var n of Xt(t))ht.call(t,n)&&Yt(o,n,t[n]);return o};const Tn=(0,P.default)(M.Box)`
|
|
78
|
-
transform: translate(-4px, -12px);
|
|
79
|
-
|
|
80
|
-
&:before {
|
|
81
|
-
content: '';
|
|
82
|
-
width: ${4/16}rem;
|
|
83
|
-
height: ${12/16}rem;
|
|
84
|
-
background: ${({theme:o})=>o.colors.primary200};
|
|
85
|
-
display: block;
|
|
86
|
-
}
|
|
87
|
-
`,Qt=P.default.svg`
|
|
88
|
-
position: relative;
|
|
89
|
-
flex-shrink: 0;
|
|
90
|
-
transform: translate(-0.5px, -1px);
|
|
91
|
-
|
|
92
|
-
* {
|
|
93
|
-
fill: ${({theme:o,color:t})=>o.colors[t]};
|
|
94
|
-
}
|
|
95
|
-
`,Mt=o=>e.createElement(Tn,null,e.createElement(Qt,Pn({width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.02477 14.7513C8.65865 17.0594 11.6046 18.6059 17.5596 18.8856C18.6836 18.9384 19.5976 19.8435 19.5976 20.9688V20.9688C19.5976 22.0941 18.6841 23.0125 17.5599 22.9643C10.9409 22.6805 6.454 20.9387 3.75496 17.1258C0.937988 13.1464 0.486328 7.39309 0.486328 0.593262H4.50974C4.50974 7.54693 5.06394 11.9813 7.02477 14.7513Z",fill:"#D9D8FF"})));Mt.defaultProps={fill:"primary200"},Mt.propTypes={fill:r().string};const An=(0,e.memo)(Mt);var Lt=function(){return window&&window.strapi&&window.strapi.isEE?a(19665).Z:a(52124).Z}(),It=(0,P.default)(H.Flex).withConfig({displayName:"SubActionRow__Cell",componentId:"sc-7y8yzq-0"})(["width:",";position:relative;"],ne),Jt=(0,P.default)(H.Flex).withConfig({displayName:"SubActionRow__RowWrapper",componentId:"sc-7y8yzq-1"})(["height:",";"],ze),qt=(0,P.default)(M.Box).withConfig({displayName:"SubActionRow__Wrapper",componentId:"sc-7y8yzq-2"})(["padding-left:","rem;"],31/16),On=(0,P.default)(M.Box).withConfig({displayName:"SubActionRow__LeftBorderTimeline",componentId:"sc-7y8yzq-3"})(["border-left:",";"],function(o){var t=o.isVisible,n=o.theme;return t?"4px solid ".concat(n.colors.primary200):"4px solid transparent"}),_t=(0,P.default)(H.Flex).withConfig({displayName:"SubActionRow__RowStyle",componentId:"sc-7y8yzq-4"})(["padding-left:",";width:","px;"," ",";"],function(o){var t=o.theme;return t.spaces[4]},function(o){var t=o.level;return 145-t*36},function(o){var t=o.isCollapsable,n=o.theme;return t&&`
|
|
96
|
-
`.concat(gt,` {
|
|
97
|
-
display: block;
|
|
98
|
-
color: `).concat(n.colors.neutral100,`;
|
|
99
|
-
}
|
|
100
|
-
&:hover {
|
|
101
|
-
`).concat(ft(n),`
|
|
102
|
-
}
|
|
103
|
-
`)},function(o){var t=o.isActive,n=o.theme;return t&&ft(n)}),Rn=P.default.div.withConfig({displayName:"SubActionRow__TopTimeline",componentId:"sc-7y8yzq-5"})(["padding-top:",";margin-top:",";width:","rem;background-color:",";border-top-left-radius:2px;border-top-right-radius:2px;"],function(o){var t=o.theme;return t.spaces[2]},function(o){var t=o.theme;return t.spaces[2]},4/16,function(o){var t=o.theme;return t.colors.primary200}),u=function o(t){var n=t.childrenForm,s=t.isFormDisabled,i=t.recursiveLevel,c=t.pathToDataFromActionRow,m=t.propertyActions,g=t.parentName,E=t.propertyName,S=(0,Q.useIntl)(),T=S.formatMessage,F=(0,ee.$_)(),$=F.modifiedData,q=F.onChangeParentCheckbox,w=F.onChangeSimpleCheckbox,N=(0,e.useState)(null),O=(0,U.Z)(N,2),B=O[0],X=O[1],ie=function(Re){X(function(Ie){return Ie===Re?null:Re})},Oe=(0,e.useMemo)(function(){return B?n.find(function(ve){var Re=ve.value;return Re===B}):null},[B,n]);return e.createElement(qt,null,e.createElement(Rn,null),n.map(function(ve,Re){var Ie=ve.label,Me=ve.value,vt=ve.required,Ce=ve.children,Fe=Re+1<n.length,ue=Array.isArray(Ce),Pe=B===Me;return e.createElement(On,{key:Me,isVisible:Fe},e.createElement(Jt,null,e.createElement(An,{color:"primary200"}),e.createElement(H.Flex,{style:{flex:1}},e.createElement(_t,{level:i,isActive:Pe,isCollapsable:ue},e.createElement(nt,(0,En.Z)({alignItems:"center",isCollapsable:ue},ue&&{onClick:function(){return ie(Me)},"aria-expanded":Pe,onKeyDown:function(Be){var $e=Be.key;return($e==="Enter"||$e===" ")&&ie(Me)},tabIndex:0,role:"button"},{title:Ie}),e.createElement(L.Typography,{ellipsis:!0},G()(Ie)),vt&&e.createElement(Kt,null),e.createElement(gt,{$isActive:Pe}))),e.createElement(H.Flex,{style:{flex:1}},m.map(function(De){var Be=De.actionId,$e=De.label,dt=De.isActionRelatedToCurrentProperty;if(!dt)return e.createElement(ut,{key:Be});var He=[].concat((0,z.Z)(c.split("..")),[Be,"properties",E],(0,z.Z)(g.split("..")),[Me]),lt=le()($,He,!1);if(!Ce)return e.createElement(It,{key:$e,justifyContent:"center",alignItems:"center"},e.createElement(Ee.BaseCheckbox,{disabled:s||Lt,name:He.join(".."),"aria-label":T({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(g," ").concat(Ie," ").concat($e)}),onValueChange:function(Ft){w({target:{name:He.join(".."),value:Ft}})},value:lt}));var St=ct(lt),Pt=St.hasAllActionsSelected,Ct=St.hasSomeActionsSelected;return e.createElement(It,{key:$e,justifyContent:"center",alignItems:"center"},e.createElement(Ee.BaseCheckbox,{key:$e,disabled:s||Lt,name:He.join(".."),"aria-label":T({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(g," ").concat(Ie," ").concat($e)}),onValueChange:function(Ft){q({target:{name:He.join(".."),value:Ft}})},value:Pt,indeterminate:Ct}))})))),Oe&&Pe&&e.createElement(M.Box,{paddingBottom:2},e.createElement(o,{isFormDisabled:s,parentName:"".concat(g,"..").concat(Me),pathToDataFromActionRow:c,propertyActions:m,propertyName:E,recursiveLevel:i+1,childrenForm:Oe.children})))}))};u.propTypes={childrenForm:r().array.isRequired,isFormDisabled:r().bool.isRequired,parentName:r().string.isRequired,pathToDataFromActionRow:r().string.isRequired,propertyActions:r().array.isRequired,propertyName:r().string.isRequired,recursiveLevel:r().number.isRequired};const l=(0,e.memo)(u),d=o=>o.reduce((n,s)=>(s.isActionRelatedToCurrentProperty&&n.push(s.actionId),n),[]),b=(o,t,n,s,i)=>{const m=d(o).reduce((g,E)=>{const S=[...n.split(".."),E,"properties",s,i],T=(0,h.get)(t,S,!1);return g[E]=T,g},{});return ct(m)};var p=function(){return window&&window.strapi&&window.strapi.isEE?a(32741).Z:a(18318).Z}(),I=(0,P.default)(H.Flex).withConfig({displayName:"ActionRow__Cell",componentId:"sc-4agenc-0"})(["width:",";position:relative;"],ne),R=(0,P.default)(H.Flex).withConfig({displayName:"ActionRow__Wrapper",componentId:"sc-4agenc-1"})(["height:",";flex:1;"," ",";"],ze,function(o){var t=o.isCollapsable,n=o.theme;return t&&`
|
|
104
|
-
`.concat(gt,` {
|
|
105
|
-
display: block;
|
|
106
|
-
color: `).concat(n.colors.neutral100,`;
|
|
107
|
-
}
|
|
108
|
-
&:hover {
|
|
109
|
-
`).concat(ft(n),`
|
|
110
|
-
}
|
|
111
|
-
`)},function(o){var t=o.isActive,n=o.theme;return t&&ft(n)}),v=function(t){var n=t.childrenForm,s=t.label,i=t.isFormDisabled,c=t.name,m=t.required,g=t.pathToData,E=t.propertyActions,S=t.propertyName,T=t.isOdd,F=(0,Q.useIntl)(),$=F.formatMessage,q=(0,e.useState)(null),w=(0,U.Z)(q,2),N=w[0],O=w[1],B=(0,ee.$_)(),X=B.modifiedData,ie=B.onChangeCollectionTypeLeftActionRowCheckbox,Oe=B.onChangeParentCheckbox,ve=B.onChangeSimpleCheckbox,Re=N===c,Ie=(0,e.useMemo)(function(){return Array.isArray(n)?n:[]},[n]),Me=Ie.length>0,vt=(0,e.useCallback)(function(){Me&&O(function(De){return De===c?null:c})},[Me,c]),Ce=function(Be){var $e=Be.target.value;ie(g,S,c,$e)},Fe=(0,e.useMemo)(function(){return b(E,X,g,S,c)},[E,X,g,S,c]),ue=Fe.hasAllActionsSelected,Pe=Fe.hasSomeActionsSelected;return e.createElement(e.Fragment,null,e.createElement(R,{alignItems:"center",isCollapsable:Me,isActive:Re,background:T?"neutral100":"neutral0"},e.createElement(H.Flex,null,e.createElement(Wt,{onChange:Ce,onClick:vt,isCollapsable:Me,isFormDisabled:i,label:s,someChecked:Pe,value:ue,isActive:Re},m&&e.createElement(Kt,null),e.createElement(gt,{$isActive:Re})),e.createElement(H.Flex,null,E.map(function(De){var Be=De.label,$e=De.isActionRelatedToCurrentProperty,dt=De.actionId;if(!$e)return e.createElement(ut,{key:Be});var He=[].concat((0,z.Z)(g.split("..")),[dt,"properties",S,c]);if(!Me){var lt=le()(X,He,!1);return e.createElement(I,{key:dt,justifyContent:"center",alignItems:"center"},e.createElement(Ee.BaseCheckbox,{disabled:i||p,name:He.join(".."),"aria-label":$({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(c," ").concat(Be)}),onValueChange:function(Wn){ve({target:{name:He.join(".."),value:Wn}})},value:lt}))}var St=le()(X,He,{}),Pt=ct(St),Ct=Pt.hasAllActionsSelected,Nn=Pt.hasSomeActionsSelected;return e.createElement(I,{key:Be,justifyContent:"center",alignItems:"center"},e.createElement(Ee.BaseCheckbox,{disabled:i||p,name:He.join(".."),onValueChange:function(Wn){Oe({target:{name:He.join(".."),value:Wn}})},"aria-label":$({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(c," ").concat(Be)}),value:Ct,indeterminate:Nn}))})))),Re&&e.createElement(l,{childrenForm:Ie,isFormDisabled:i,parentName:c,pathToDataFromActionRow:g,propertyName:S,propertyActions:E,recursiveLevel:0}))};v.defaultProps={childrenForm:[],required:!1},v.propTypes={childrenForm:r().array,label:r().string.isRequired,isFormDisabled:r().bool.isRequired,name:r().string.isRequired,pathToData:r().string.isRequired,propertyActions:r().array.isRequired,propertyName:r().string.isRequired,required:r().bool,isOdd:r().bool.isRequired};const x=(0,e.memo)(v),Se=P.default.div`
|
|
112
|
-
display: inline-flex;
|
|
113
|
-
flex-direction: column;
|
|
114
|
-
min-width: 0;
|
|
115
|
-
`,ge=({availableActions:o,childrenForm:t,isFormDisabled:n,label:s,pathToData:i,propertyName:c})=>{const m=(0,e.useMemo)(()=>cn(o,c),[o,c]);return e.createElement(Se,null,e.createElement(pn,{label:s,headers:m}),e.createElement(M.Box,null,t.map(({children:g,label:E,value:S,required:T},F)=>e.createElement(x,{childrenForm:g,key:S,label:E,isFormDisabled:n,name:S,required:T,propertyActions:m,pathToData:i,propertyName:c,isOdd:F%2===0}))))};ge.propTypes={childrenForm:r().array.isRequired,availableActions:r().array.isRequired,isFormDisabled:r().bool.isRequired,label:r().string.isRequired,pathToData:r().string.isRequired,propertyName:r().string.isRequired};const tt=ge,yt=P.default.div`
|
|
116
|
-
flex-direction: column;
|
|
117
|
-
display: inline-flex;
|
|
118
|
-
min-width: 100%;
|
|
119
|
-
${({theme:o,isActive:t})=>t&&`border: 1px solid ${o.colors.primary600};`}
|
|
120
|
-
`,ot=({allActions:o,contentTypeName:t,label:n,index:s,isActive:i,isFormDisabled:c,onClickToggleCollapse:m,pathToData:g,properties:E})=>{const S=(0,e.useCallback)(()=>{m(t)},[t,m]),T=(0,e.useMemo)(()=>Cn(o,t),[o,t]);return e.createElement(yt,{isActive:i},e.createElement(Gt,{availableActions:T,isActive:i,isGrey:s%2===0,isFormDisabled:c,label:n,onClickToggle:S,pathToData:g}),i&&E.map(({label:F,value:$,children:q})=>e.createElement(tt,{availableActions:T,childrenForm:q,isFormDisabled:c,label:F,pathToData:g,propertyName:$,key:$})))};ot.propTypes={allActions:r().array.isRequired,contentTypeName:r().string.isRequired,index:r().number.isRequired,isActive:r().bool.isRequired,isFormDisabled:r().bool.isRequired,label:r().string.isRequired,onClickToggleCollapse:r().func.isRequired,pathToData:r().string.isRequired,properties:r().array.isRequired};const at=ot,st=({actions:o,isFormDisabled:t,pathToData:n,subjects:s})=>{const[i,c]=(0,e.useState)(null),m=g=>{c(i===g?null:g)};return s.map(({uid:g,label:E,properties:S},T)=>e.createElement(at,{allActions:o,key:g,contentTypeName:g,label:E,isActive:i===g,isFormDisabled:t,index:T,onClickToggleCollapse:m,pathToData:`${n}..${g}`,properties:S}))};st.defaultProps={actions:[],subjects:[]},st.propTypes={actions:r().array.isRequired,isFormDisabled:r().bool.isRequired,pathToData:r().string.isRequired,subjects:r().arrayOf(r().shape({uid:r().string.isRequired,label:r().string.isRequired,properties:r().array.isRequired}))};const No=(0,e.memo)(st),Wo=o=>o.filter(({subjects:t})=>t&&t.length);var $o=Object.defineProperty,qn=Object.getOwnPropertySymbols,Uo=Object.prototype.hasOwnProperty,ko=Object.prototype.propertyIsEnumerable,_n=(o,t,n)=>t in o?$o(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,eo=(o,t)=>{for(var n in t||(t={}))Uo.call(t,n)&&_n(o,n,t[n]);if(qn)for(var n of qn(t))ko.call(t,n)&&_n(o,n,t[n]);return o};const Vo=o=>o.map(({actionId:t})=>t),Zo=(o,t)=>o.reduce((n,s)=>(Object.keys(t).forEach(i=>{const c=(0,h.get)(t,[i,s],{}),m={[i]:At(c)};n[s]?n[s]=eo(eo({},n[s]),m):n[s]=m}),n),{}),Go=(o,t)=>{const n=Vo(o),s=Zo(n,t);return Object.keys(s).reduce((c,m)=>(c[m]=ct(s[m]),c),{})};var zo=function(){return window&&window.strapi&&window.strapi.isEE?a(36950).Z:a(61526).Z}(),Ko=(0,P.default)(Ge.Stack).withConfig({displayName:"GlobalActions__CenteredStack",componentId:"sc-1vxwsjr-0"})(["align-items:center;justify-content:center;width:",";flex-shrink:0;"],ne),Dn=function(t){var n=t.actions,s=t.isFormDisabled,i=t.kind,c=(0,Q.useIntl)(),m=c.formatMessage,g=(0,ee.$_)(),E=g.modifiedData,S=g.onChangeCollectionTypeGlobalActionCheckbox,T=(0,e.useMemo)(function(){return Wo(n)},[n]),F=(0,e.useMemo)(function(){return Go(T,E[i])},[E,T,i]);return e.createElement(M.Box,{paddingBottom:4,paddingTop:6,style:{paddingLeft:xe}},e.createElement(Ge.Stack,{horizontal:!0,spacing:0},T.map(function($){var q=$.label,w=$.actionId;return e.createElement(Ko,{key:w,spacing:3},e.createElement(L.Typography,{variant:"sigma",textColor:"neutral500"},m({id:"Settings.roles.form.permissions.".concat(q.toLowerCase()),defaultMessage:q})),e.createElement(Ee.BaseCheckbox,{disabled:s||zo,onValueChange:function(O){S(i,w,O)},name:w,"aria-label":m({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:m({id:"Settings.roles.form.permissions.".concat(q.toLowerCase()),defaultMessage:q})}),value:le()(F,[w,"hasAllActionsSelected"],!1),indeterminate:le()(F,[w,"hasSomeActionsSelected"],!1)}))})))};Dn.defaultProps={actions:[]},Dn.propTypes={actions:r().arrayOf(r().shape({label:r().string.isRequired,actionId:r().string.isRequired,subjects:r().array.isRequired})),isFormDisabled:r().bool.isRequired,kind:r().string.isRequired};const Ho=(0,e.memo)(Dn),Xo=(0,P.default)(M.Box)`
|
|
121
|
-
overflow-x: auto;
|
|
122
|
-
`,to=({isFormDisabled:o,kind:t,layout:{actions:n,subjects:s}})=>{const i=me()([...s],"label");return e.createElement(Xo,{background:"neutral0"},e.createElement(Ho,{actions:n,kind:t,isFormDisabled:o}),e.createElement(No,{actions:n,isFormDisabled:o,pathToData:t,subjects:i}))};to.propTypes={isFormDisabled:r().bool.isRequired,kind:r().string.isRequired,layout:r().shape({actions:r().array,subjects:r().arrayOf(r().shape({uid:r().string.isRequired,label:r().string.isRequired,properties:r().array.isRequired}))}).isRequired};const no=(0,e.memo)(to);var Yo=a(66694);const oo=({children:o,value:t})=>e.createElement(Yo.$l.Provider,{value:t},o);oo.propTypes={children:r().node.isRequired,value:r().exact({availableConditions:r().array.isRequired,modifiedData:r().object.isRequired,onChangeCollectionTypeLeftActionRowCheckbox:r().func.isRequired,onChangeConditions:r().func.isRequired,onChangeSimpleCheckbox:r().func.isRequired,onChangeParentCheckbox:r().func.isRequired,onChangeCollectionTypeGlobalActionCheckbox:r().func.isRequired}).isRequired};const Qo=oo;var xn=a(12001),ao=a(78330),so=a(52111),Jo=Object.defineProperty,qo=Object.defineProperties,_o=Object.getOwnPropertyDescriptors,ro=Object.getOwnPropertySymbols,ea=Object.prototype.hasOwnProperty,ta=Object.prototype.propertyIsEnumerable,io=(o,t,n)=>t in o?Jo(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,na=(o,t)=>{for(var n in t||(t={}))ea.call(t,n)&&io(o,n,t[n]);if(ro)for(var n of ro(t))ta.call(t,n)&&io(o,n,t[n]);return o},oa=(o,t)=>qo(o,_o(t));const aa=(o,t,n)=>o.map(s=>{const i=[...n,s.action,"properties","enabled"],c=(0,h.get)(t,i,!1),m=(0,h.get)(t,[...n,s.action,"conditions"],{}),g=mt(m).some(E=>E);return oa(na({},s),{isDisplayed:c,checkboxName:i.join(".."),hasSomeActionsSelected:c,value:c,hasConditions:g,label:s.displayName,actionId:s.action,pathToConditionsObject:[...n,s.action]})}),sa=o=>{const t=Object.entries(o).reduce((s,i)=>{const[c,{conditions:m}]=i;return s[c]=m,s},{});return mt(t).some(s=>s)};var Mn=function(){return window&&window.strapi&&window.strapi.isEE?a(96556).Z:a(16437).Z}(),ra=P.default.div.withConfig({displayName:"SubCategory__Border",componentId:"sc-akgczm-0"})(["flex:1;align-self:center;border-top:1px solid ",";"],function(o){var t=o.theme;return t.colors.neutral150}),ia=P.default.div.withConfig({displayName:"SubCategory__CheckboxWrapper",componentId:"sc-akgczm-1"})(["position:relative;word-break:keep-all;",""],function(o){var t=o.hasConditions,n=o.disabled,s=o.theme;return t&&`
|
|
123
|
-
&:before {
|
|
124
|
-
content: '';
|
|
125
|
-
position: absolute;
|
|
126
|
-
top: `.concat(-4/16,`rem;
|
|
127
|
-
left: `).concat(-8/16,`rem;
|
|
128
|
-
width: `).concat(6/16,`rem;
|
|
129
|
-
height: `).concat(6/16,`rem;
|
|
130
|
-
border-radius: `).concat(20/16,`rem;
|
|
131
|
-
background: `).concat(n?s.colors.neutral100:s.colors.primary600,`;
|
|
132
|
-
}
|
|
133
|
-
`)}),lo=function(t){var n=t.categoryName,s=t.isFormDisabled,i=t.subCategoryName,c=t.actions,m=t.pathToData,g=(0,e.useState)(!1),E=(0,U.Z)(g,2),S=E[0],T=E[1],F=(0,ee.$_)(),$=F.modifiedData,q=F.onChangeParentCheckbox,w=F.onChangeSimpleCheckbox,N=(0,Q.useIntl)(),O=N.formatMessage,B=le()($,m,{}),X=(0,e.useMemo)(function(){return Object.keys(B).reduce(function(Ce,Fe){return Ce[Fe]=At(B[Fe]),Ce},{})},[B]),ie=ct(X),Oe=ie.hasAllActionsSelected,ve=ie.hasSomeActionsSelected,Re=function(){T(function(Fe){return!Fe})},Ie=function(){T(!1)},Me=aa(c,$,m),vt=sa(le()($,(0,z.Z)(m),{}));return e.createElement(e.Fragment,null,e.createElement(M.Box,null,e.createElement(H.Flex,{justifyContent:"space-between",alignItems:"center"},e.createElement(M.Box,{paddingRight:4},e.createElement(L.Typography,{variant:"sigma",textColor:"neutral600"},i)),e.createElement(ra,null),e.createElement(M.Box,{paddingLeft:4},e.createElement(so.Checkbox,{name:m.join(".."),disabled:s||Mn,onValueChange:function(Fe){q({target:{name:m.join(".."),value:Fe}})},indeterminate:ve,value:Oe},O({id:"app.utils.select-all",defaultMessage:"Select all"})))),e.createElement(H.Flex,{paddingTop:6,paddingBottom:6},e.createElement(ao.Grid,{gap:2,style:{flex:1}},Me.map(function(Ce){var Fe=Ce.checkboxName,ue=Ce.value,Pe=Ce.action,De=Ce.displayName,Be=Ce.hasConditions;return e.createElement(ao.GridItem,{col:3,key:Pe},e.createElement(ia,{disabled:s||Mn,hasConditions:Be},e.createElement(so.Checkbox,{name:Fe,disabled:s||Mn,onValueChange:function(dt){w({target:{name:Fe,value:dt}})},value:ue},De)))})),e.createElement(je,{hasConditions:vt,onClick:Re}))),S&&e.createElement(Et,{headerBreadCrumbs:[n,i],actions:Me,isFormDisabled:s,onClosed:Ie,onToggle:Re}))};lo.propTypes={actions:r().array.isRequired,categoryName:r().string.isRequired,isFormDisabled:r().bool.isRequired,subCategoryName:r().string.isRequired,pathToData:r().array.isRequired};const la=lo,Ln=({childrenForm:o,kind:t,name:n,isOpen:s,isFormDisabled:i,isWhite:c,onOpenCategory:m,pathToData:g})=>{const{formatMessage:E}=(0,Q.useIntl)(),S=()=>{m(n)},T=(0,e.useMemo)(()=>n.split("::").pop(),[n]);return e.createElement(xn.Accordion,{expanded:s,onToggle:S,id:`accordion-${n}`,variant:c?"primary":"secondary"},e.createElement(xn.AccordionToggle,{title:G()(T),description:`${E({id:"Settings.permissions.category"},{category:T})} ${t==="plugins"?"plugin":t}`}),e.createElement(xn.AccordionContent,null,e.createElement(M.Box,{padding:6},o.map(({actions:F,subCategoryName:$,subCategoryId:q})=>e.createElement(la,{key:$,actions:F,categoryName:T,isFormDisabled:i,subCategoryName:$,pathToData:[...g,q]})))))};Ln.defaultProps={},Ln.propTypes={childrenForm:r().array.isRequired,isOpen:r().bool.isRequired,isFormDisabled:r().bool.isRequired,isWhite:r().bool.isRequired,kind:r().string.isRequired,name:r().string.isRequired,onOpenCategory:r().func.isRequired,pathToData:r().array.isRequired};const ca=Ln,co=({isFormDisabled:o,kind:t,layout:n})=>{const[s,i]=(0,e.useState)(null),c=m=>{i(m===s?null:m)};return e.createElement(M.Box,{padding:6,background:"neutral0"},n.map(({category:m,categoryId:g,childrenForm:E},S)=>e.createElement(ca,{key:m,childrenForm:E,kind:t,isFormDisabled:o,isOpen:s===m,isWhite:S%2===1,name:m,onOpenCategory:c,pathToData:[t,g]})))};co.propTypes={isFormDisabled:r().bool.isRequired,kind:r().string.isRequired,layout:r().arrayOf(r().shape({category:r().string.isRequired,categoryId:r().string.isRequired,childrenForm:r().arrayOf(r().shape({actions:r().array.isRequired})).isRequired}).isRequired).isRequired};const uo=co,po=(o,t,n)=>o.find(s=>s.action===t&&s.subject===n);var da=Object.defineProperty,ua=Object.defineProperties,pa=Object.getOwnPropertyDescriptors,mo=Object.getOwnPropertySymbols,ma=Object.prototype.hasOwnProperty,ga=Object.prototype.propertyIsEnumerable,go=(o,t,n)=>t in o?da(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,fo=(o,t)=>{for(var n in t||(t={}))ma.call(t,n)&&go(o,n,t[n]);if(mo)for(var n of mo(t))ga.call(t,n)&&go(o,n,t[n]);return o},ho=(o,t)=>ua(o,pa(t));const yo=(o,t=[])=>o.reduce((n,s)=>(n[s.id]=t.indexOf(s.id)!==-1,n),{}),vo=({children:o},t,n="")=>o.reduce((s,i)=>{if(i.children)return ho(fo({},s),{[i.value]:vo(i,t,`${n}${i.value}.`)});const c=t.indexOf(`${n}${i.value}`)!==-1;return s[i.value]=c,s},{}),fa=(o,t,n)=>o.reduce((s,i)=>{const c=t.properties.find(({value:m})=>m===i);if(c){const m=(0,h.get)(n,["properties",c.value],[]),g=vo(c,m);s.properties[i]=g}return s},{properties:{}}),ha=(o,t)=>t.reduce((n,s)=>{const i=o.find(({uid:c})=>c===s)||null;return i&&(n[s]=i),n},{}),Co=({subjects:o},t,n,s=[])=>t.reduce((i,c)=>{const m=c.subjects,g=ha(o,m);if((0,h.isEmpty)(g))return i;const E=Object.keys(g).reduce((S,T)=>{const{actionId:F,applyToProperties:$}=c,N=g[T].properties.map(({value:ie})=>ie).every(ie=>($||[]).indexOf(ie)===-1),O=po(s,F,T),B=yo(n,(0,h.get)(O,"conditions",[]));if((0,h.isEmpty)($)||N)return(0,h.set)(S,[T,F],{properties:{enabled:O!==void 0},conditions:B}),S;const X=fa($,g[T],O);return(0,h.set)(S,[T,F],ho(fo({},X),{conditions:B})),S},{});return(0,h.merge)(i,E)},{}),ya=(o,t,n)=>o.reduce((s,i)=>{const c=po(n,i.action,null);return s[i.action]={properties:{enabled:c!==void 0},conditions:yo(t,(0,h.get)(c,"conditions",[]))},s},{}),va=(o,t,n)=>o.reduce((s,i)=>(s[i.subCategoryId]=ya(i.actions,t,n),s),{}),Eo=(o,t,n=[])=>o.reduce((s,{categoryId:i,childrenForm:c})=>{const m=va(c,t,n);return s[i]=m,s},{}),bo=o=>o.split(" ").join("-"),So=(o,t)=>(0,h.chain)(o).groupBy(t).map((n,s)=>({category:s,categoryId:bo(s),childrenForm:(0,h.chain)(n).groupBy("subCategory").map((i,c)=>({subCategoryName:c,subCategoryId:bo(c),actions:i})).value()})).value(),Ca=(o,t)=>{const{conditions:n,sections:{collectionTypes:s,singleTypes:i,plugins:c,settings:m}}=o,g={collectionTypes:s,singleTypes:i,plugins:So(c,"plugin"),settings:So(m,"category")},E={collectionTypes:Co(s,s.actions||[],n,t),singleTypes:Co(i,i.actions||[],n,t),plugins:Eo(g.plugins,n,t),settings:Eo(g.settings,n,t)};return{initialData:E,modifiedData:E,layouts:g}};var Ea=Object.defineProperty,ba=Object.defineProperties,Sa=Object.getOwnPropertyDescriptors,Po=Object.getOwnPropertySymbols,Pa=Object.prototype.hasOwnProperty,Ta=Object.prototype.propertyIsEnumerable,To=(o,t,n)=>t in o?Ea(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,In=(o,t)=>{for(var n in t||(t={}))Pa.call(t,n)&&To(o,n,t[n]);if(Po)for(var n of Po(t))Ta.call(t,n)&&To(o,n,t[n]);return o},Fn=(o,t)=>ba(o,Sa(t));const Ao=o=>Object.keys(o).reduce((t,n)=>{const s=o[n];if((0,h.isObject)(s)&&!(0,h.has)(s,"conditions"))return Fn(In({},t),{[n]:Ao(s)});if((0,h.isObject)(s)&&(0,h.has)(s,"conditions")&&!mt((0,h.omit)(s,"conditions")).some(c=>c)){const c=Object.keys(s.conditions).reduce((m,g)=>(m[g]=!1,m),{});return Fn(In({},t),{[n]:Fn(In({},s),{conditions:c})})}return t[n]=s,t},{}),Bn=Ao;var Aa=Object.defineProperty,Oa=Object.defineProperties,Ra=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Da=Object.prototype.hasOwnProperty,xa=Object.prototype.propertyIsEnumerable,Ro=(o,t,n)=>t in o?Aa(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Ma=(o,t)=>{for(var n in t||(t={}))Da.call(t,n)&&Ro(o,n,t[n]);if(Oo)for(var n of Oo(t))xa.call(t,n)&&Ro(o,n,t[n]);return o},La=(o,t)=>Oa(o,Ra(t));const Do=(o,t)=>Object.keys(o).reduce((n,s)=>{const i=o[s];return s==="conditions"?(n[s]=i,n):(0,h.isObject)(i)?La(Ma({},n),{[s]:Do(i,t)}):(n[s]=t,n)},{}),en=Do;var Ia=Object.defineProperty,Fa=Object.defineProperties,Ba=Object.getOwnPropertyDescriptors,xo=Object.getOwnPropertySymbols,wa=Object.prototype.hasOwnProperty,ja=Object.prototype.propertyIsEnumerable,Mo=(o,t,n)=>t in o?Ia(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Na=(o,t)=>{for(var n in t||(t={}))wa.call(t,n)&&Mo(o,n,t[n]);if(xo)for(var n of xo(t))ja.call(t,n)&&Mo(o,n,t[n]);return o},Wa=(o,t)=>Fa(o,Ba(t));const $a={initialData:{},modifiedData:{},layouts:{}},Ua=(o,t)=>(0,te.default)(o,n=>{switch(t.type){case"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX":{const{collectionTypeKind:s,actionId:i,value:c}=t,m=["modifiedData",s];Object.keys((0,h.get)(o,m)).forEach(g=>{const E=(0,h.get)(o,[...m,g,i],void 0);if(E){let S=en(E,c);if(!c&&S.conditions){const T=en(S.conditions,!1);S=Wa(Na({},S),{conditions:T})}(0,h.set)(n,[...m,g,i],S)}});break}case"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX":{const{pathToCollectionType:s,propertyName:i,rowName:c,value:m}=t;let g=(0,h.cloneDeep)(o.modifiedData);const E=s.split(".."),S=(0,h.get)(g,E,{});Object.keys(S).forEach(T=>{if((0,h.has)(S[T],`properties.${i}`)){const F=(0,h.get)(S,[T,"properties",i,c]),$=[...E,T,"properties",i,c];if(!(0,h.isObject)(F))(0,h.set)(g,$,m);else{const q=en(F,m);(0,h.set)(g,$,q)}}}),m||(g=Bn(g)),(0,h.set)(n,"modifiedData",g);break}case"ON_CHANGE_CONDITIONS":{Object.entries(t.conditions).forEach(s=>{const[i,c]=s;(0,h.set)(n,["modifiedData",...i.split(".."),"conditions"],c)});break}case"ON_CHANGE_SIMPLE_CHECKBOX":{let s=(0,h.cloneDeep)(o.modifiedData);(0,h.set)(s,[...t.keys.split("..")],t.value),t.value||(s=Bn(s)),(0,h.set)(n,"modifiedData",s);break}case"ON_CHANGE_TOGGLE_PARENT_CHECKBOX":{const{keys:s,value:i}=t,c=[...s.split("..")];let m=(0,h.cloneDeep)(o.modifiedData);const g=(0,h.get)(m,c,{}),E=en(g,i);(0,h.set)(m,c,E),i||(m=Bn(m)),(0,h.set)(n,["modifiedData"],m);break}case"RESET_FORM":{n.modifiedData=o.initialData;break}case"SET_FORM_AFTER_SUBMIT":{n.initialData=o.modifiedData;break}default:return n}}),wn=o=>Object.entries(o).filter(([,t])=>t).map(([t])=>t),ka=o=>{const[t,{conditions:n}]=o;return{action:t,subject:null,conditions:wn(n),properties:{}}},Va=o=>Object.values(o).reduce((t,n)=>{const s=Object.entries(n).reduce((i,c)=>{const[,{properties:{enabled:m}}]=c;if(!m)return i;const g=ka(c);return i.push(g),i},[]);return[...t,...s]},[]),Lo=o=>Object.values(o).reduce((t,n)=>{const s=Va(n);return[...t,...s]},[]),Io=(o,t="")=>Object.entries(o).reduce((n,s)=>{const[i,c]=s;return(0,h.isObject)(c)?[...n,...Io(c,`${t}${i}.`)]:(c&&!(0,h.isObject)(c)&&n.push(`${t}${i}`),n)},[]),Za=(o,t,{conditions:n,properties:s})=>Object.entries(s).reduce((i,c)=>{const[m,g]=c;return i.properties[m]=Io(g),i},{action:o,subject:t,conditions:wn(n),properties:{}}),Ga=(o,t,{conditions:n})=>({action:o,subject:t,properties:{},conditions:wn(n)}),za=(o,t)=>Object.entries(t).reduce((s,i)=>{const[c,m]=i;if(!mt(m).some(S=>S))return s;if(!(0,h.has)(m,"properties.enabled")){const S=Za(c,o,m);return[...s,S]}if(!m.properties.enabled)return s;const E=Ga(c,o,m);return s.push(E),s},[]),Fo=o=>Object.entries(o).reduce((n,s)=>{const[i,c]=s,m=za(i,c);return[...n,...m]},[]),Ka=o=>{const t=Lo(o.plugins),n=Lo(o.settings),s=Fo(o.collectionTypes),i=Fo(o.singleTypes);return[...t,...n,...s,...i]},Ha=[{labelId:"app.components.LeftMenuLinkContainer.collectionTypes",defaultMessage:"Collection Types",id:"collectionTypes"},{labelId:"app.components.LeftMenuLinkContainer.singleTypes",id:"singleTypes",defaultMessage:"Single Types"},{labelId:"app.components.LeftMenuLinkContainer.plugins",defaultMessage:"Plugins",id:"plugins"},{labelId:"app.components.LeftMenuLinkContainer.settings",defaultMessage:"Settings",id:"settings"}];var Xa=Object.defineProperty,Bo=Object.getOwnPropertySymbols,Ya=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,wo=(o,t,n)=>t in o?Xa(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,jo=(o,t)=>{for(var n in t||(t={}))Ya.call(t,n)&&wo(o,n,t[n]);if(Bo)for(var n of Bo(t))Qa.call(t,n)&&wo(o,n,t[n]);return o};const jn=(0,e.forwardRef)(({layout:o,isFormDisabled:t,permissions:n},s)=>{const[{initialData:i,layouts:c,modifiedData:m},g]=(0,e.useReducer)(Ua,$a,()=>Ca(o,n)),{formatMessage:E}=(0,Q.useIntl)();(0,e.useImperativeHandle)(s,()=>({getPermissions:()=>{const w=(0,K.difference)(i.collectionTypes,m.collectionTypes),N=(0,K.difference)(i.singleTypes,m.singleTypes),O=jo(jo({},w),N);let B;return we()(O)?B=!1:B=Object.values(O).some(X=>Object.values(X).some(ie=>Te()(ie,"conditions"))),{permissionsToSend:Ka(m),didUpdateConditions:B}},resetForm:()=>{g({type:"RESET_FORM"})},setFormAfterSubmit:()=>{g({type:"SET_FORM_AFTER_SUBMIT"})}}));const S=(w,N,O,B)=>{g({type:"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX",pathToCollectionType:w,propertyName:N,rowName:O,value:B})},T=(w,N,O)=>{g({type:"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX",collectionTypeKind:w,actionId:N,value:O})},F=w=>{g({type:"ON_CHANGE_CONDITIONS",conditions:w})},$=(0,e.useCallback)(({target:{name:w,value:N}})=>{g({type:"ON_CHANGE_SIMPLE_CHECKBOX",keys:w,value:N})},[]),q=(0,e.useCallback)(({target:{name:w,value:N}})=>{g({type:"ON_CHANGE_TOGGLE_PARENT_CHECKBOX",keys:w,value:N})},[]);return e.createElement(Qo,{value:{availableConditions:o.conditions,modifiedData:m,onChangeConditions:F,onChangeSimpleCheckbox:$,onChangeParentCheckbox:q,onChangeCollectionTypeLeftActionRowCheckbox:S,onChangeCollectionTypeGlobalActionCheckbox:T}},e.createElement(W.TabGroup,{id:"tabs",label:E({id:"Settings.permissions.users.tabs.label",defaultMessage:"Tabs Permissions"})},e.createElement(W.Tabs,null,Ha.map(w=>e.createElement(W.Tab,{key:w.id},E({id:w.labelId,defaultMessage:w.defaultMessage})))),e.createElement(W.TabPanels,{style:{position:"relative"}},e.createElement(W.TabPanel,null,e.createElement(no,{layout:c.collectionTypes,kind:"collectionTypes",isFormDisabled:t})),e.createElement(W.TabPanel,null,e.createElement(no,{layout:c.singleTypes,kind:"singleTypes",isFormDisabled:t})),e.createElement(W.TabPanel,null,e.createElement(uo,{layout:c.plugins,kind:"plugins",isFormDisabled:t})),e.createElement(W.TabPanel,null,e.createElement(uo,{layout:c.settings,kind:"settings",isFormDisabled:t})))))});jn.defaultProps={permissions:[],layout:{conditions:[],sections:{collectionTypes:{},singleTypes:{actions:[]},settings:[],plugins:[]}}},jn.propTypes={layout:r().object,isFormDisabled:r().bool.isRequired,permissions:r().array};const Ja=(0,e.memo)(jn)},16437:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!0},78522:(fe,D,a)=>{a.d(D,{Z:()=>e});const e=()=>"todo empty role"},80779:(fe,D,a)=>{a.d(D,{Z:()=>Ve});var e=a(32735),C=a(60216),r=a.n(C),K=a(9808),W=a.n(K),Le=a(19192),Te=a.n(Le),pe=a(53214),we=a.n(pe),Q=a(95602),M=a.n(Q),P=a(20763),Z=a.n(P),me=a(88425),U=a.n(me),J=a(5636),Je=a.n(J),Xe=Object.defineProperty,Ue=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,y=(ee,ce,de)=>ce in ee?Xe(ee,ce,{enumerable:!0,configurable:!0,writable:!0,value:de}):ee[ce]=de,le=(ee,ce)=>{for(var de in ce||(ce={}))Ee.call(ce,de)&&y(ee,de,ce[de]);if(Ue)for(var de of Ue(ce))H.call(ce,de)&&y(ee,de,ce[de]);return ee};const ke=({id:ee,name:ce,description:de,usersCount:Ze,icons:Ye})=>{const{formatMessage:qe}=(0,J.useIntl)(),je=qe({id:"Roles.RoleRow.user-count",defaultMessage:"{number, plural, =0 {# user} one {# user} other {# users}}"},{number:Ze});return e.createElement(pe.Tr,le({key:ee},(0,me.onRowClick)({fn:Ye[1].onClick})),e.createElement(pe.Td,{maxWidth:(0,me.pxToRem)(130)},e.createElement(Q.Typography,{ellipsis:!0,textColor:"neutral800"},ce)),e.createElement(pe.Td,{maxWidth:(0,me.pxToRem)(250)},e.createElement(Q.Typography,{ellipsis:!0,textColor:"neutral800"},de)),e.createElement(pe.Td,null,e.createElement(Q.Typography,{textColor:"neutral800"},je)),e.createElement(pe.Td,null,e.createElement(Le.Flex,le({justifyContent:"flex-end"},me.stopPropagation),Ye.map((Ae,Ge)=>Ae?e.createElement(K.Box,{key:Ae.label,paddingLeft:Ge===0?0:1},e.createElement(P.IconButton,{onClick:Ae.onClick,label:Ae.label,noBorder:!0,icon:Ae.icon})):null))))};ke.propTypes={id:r().number.isRequired,name:r().string.isRequired,description:r().string.isRequired,usersCount:r().number.isRequired,icons:r().array.isRequired};const Ve=ke},45677:(fe,D,a)=>{a.d(D,{Z:()=>_e});var e=a(32735),C=a(88425),r=a(72041),K=a(58469),W=a(59290),Le=a.n(W),Te=a(76470),pe=a.n(Te),we=a(95717),Q=a.n(we),M=a(68192),P=a.n(M),Z=a(44526),me=a(11856),U=a(53214),J=a(95602),Je=a(16540),Xe=a(28004),Ue=a(5636),Ee=a(5141),H=a(80779),y=a(78522),le=a(60216),ke=a.n(le),Ve=a(19615),ee=a(64410),ce=a(54742),de=a(20763),Ze=a(61541),Ye=a(9808),qe=a(19192),je=a(90662),Ae=a(82372),Ge=a.n(Ae),it=a(94009),oe=a.n(it);const L=a.p+"c3de6118ef47086ad05c.png",te=a.p+"bd81ba6c07827282255d.png",A=Ve.default.div`
|
|
134
|
-
position: absolute;
|
|
135
|
-
z-index: 3;
|
|
136
|
-
inset: 0;
|
|
137
|
-
background: ${({theme:j})=>(0,C.setHexOpacity)(j.colors.neutral800,.2)};
|
|
138
|
-
padding: 0 ${({theme:j})=>j.spaces[8]};
|
|
139
|
-
`,_=(0,Ve.default)(qe.Flex)`
|
|
140
|
-
position: relative;
|
|
141
|
-
max-width: ${830/16}rem;
|
|
142
|
-
height: ${415/16}rem;
|
|
143
|
-
margin: 0 auto;
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
margin-top: 10%;
|
|
146
|
-
padding-left: ${64/16}rem;
|
|
147
|
-
|
|
148
|
-
img:first-of-type {
|
|
149
|
-
position: absolute;
|
|
150
|
-
right: 0;
|
|
151
|
-
top: 0;
|
|
152
|
-
max-width: ${360/16}rem;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
img:not(:first-of-type) {
|
|
156
|
-
width: ${130/16}rem;
|
|
157
|
-
margin-left: 12%;
|
|
158
|
-
margin-right: ${20/16}rem;
|
|
159
|
-
z-index: 0;
|
|
160
|
-
}
|
|
161
|
-
`,ae=(0,Ve.default)(je.Stack)`
|
|
162
|
-
align-items: flex-start;
|
|
163
|
-
max-width: ${400/16}rem;
|
|
164
|
-
z-index: 0;
|
|
165
|
-
`,G=(0,Ve.default)(Ye.Box)`
|
|
166
|
-
position: absolute;
|
|
167
|
-
right: ${({theme:j})=>j.spaces[4]};
|
|
168
|
-
top: ${({theme:j})=>j.spaces[4]};
|
|
169
|
-
`,se=({onClose:j,isOpen:re})=>{(0,C.useLockScroll)(re);const{formatMessage:V}=(0,Ue.useIntl)();return re?e.createElement(ee.Portal,null,e.createElement(A,{onClick:j},e.createElement(ce.FocusTrap,{onEscape:j},e.createElement(_,{onClick:h=>h.stopPropagation(),"aria-labelledby":"upgrade-plan",background:"neutral0",hasRadius:!0},e.createElement("img",{src:L,alt:"air-balloon"}),e.createElement(G,null,e.createElement(de.IconButton,{onClick:j,"aria-label":"Close",icon:e.createElement(oe(),null)})),e.createElement(ae,{spacing:6},e.createElement(J.Typography,{fontWeight:"bold",textColor:"primary600"},V({id:"app.components.UpgradePlanModal.text-ce",defaultMessage:"COMMUNITY EDITION"})),e.createElement(je.Stack,{spacing:2},e.createElement(J.Typography,{variant:"alpha",as:"h2",id:"upgrade-plan"},V({id:"app.components.UpgradePlanModal.limit-reached",defaultMessage:"You have reached the limit"})),e.createElement(J.Typography,null,V({id:"app.components.UpgradePlanModal.text-power",defaultMessage:"Unlock the full power of Strapi by upgrading your plan to the Enterprise Edition"}))),e.createElement(Ze.LinkButton,{href:"https://strapi.io/pricing-self-hosted",isExternal:!0,endIcon:e.createElement(Ge(),null)},V({id:"app.components.UpgradePlanModal.button",defaultMessage:"Learn more"}))),e.createElement("img",{src:te,alt:"upgrade-arrow"}))))):null};se.propTypes={onClose:ke().func.isRequired,isOpen:ke().bool.isRequired};const z=se;var k=a(45861);const ne=()=>{const{roles:j,isLoading:re}=(0,k.bF)(),V=(0,C.useQuery)(),h=decodeURIComponent(V.get("_q")||""),Ne=(0,K.ZP)(j,h,{keys:["name","description"]});return{isLoading:re,sortedRoles:Ne}},xe=()=>{const{formatMessage:j}=(0,Ue.useIntl)(),[re,V]=(0,e.useState)(!1),{trackUsage:h}=(0,C.useTracking)(),{push:Ne}=(0,Ee.useHistory)(),We=(0,e.useCallback)(be=>{Ne(`/settings/roles/${be}`)},[Ne]),Qe=(0,e.useCallback)(()=>{V(be=>!be)},[]),Y=(0,e.useCallback)(()=>{h("didShowRBACUpgradeModal"),V(!0)},[h]),he=(0,e.useCallback)(be=>[{onClick:Qe,label:j({id:"app.utils.duplicate",defaultMessage:"Duplicate"}),icon:e.createElement(P(),null)},{onClick:()=>We(be.id),label:j({id:"app.utils.edit",defaultMessage:"Edit"}),icon:e.createElement(Q(),null)},{onClick:Qe,label:j({id:"global.delete",defaultMessage:"Delete"}),icon:e.createElement(pe(),null)}],[j,Qe,We]);return{isModalOpen:re,handleToggleModalForCreatingRole:Y,handleToggle:Qe,getIcons:he}},Ke=()=>{const{formatMessage:j}=(0,Ue.useIntl)();(0,C.useFocusWhenNavigate)();const{sortedRoles:re,isLoading:V}=ne(),{isModalOpen:h,handleToggle:Ne,handleToggleModalForCreatingRole:We,getIcons:Qe}=xe(),Y=re.length+1,he=5;return e.createElement(Je.Main,null,e.createElement(C.SettingsPageTitle,{name:"Roles"}),e.createElement(me.HeaderLayout,{primaryAction:e.createElement(Z.Button,{onClick:We,startIcon:e.createElement(Le(),null),size:"L"},j({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})),title:j({id:"global.roles",defaultMessage:"roles"}),subtitle:j({id:"Settings.roles.list.description",defaultMessage:"List of roles"})}),e.createElement(me.ContentLayout,null,e.createElement(U.Table,{colCount:he,rowCount:Y,footer:e.createElement(U.TFooter,{onClick:We,icon:e.createElement(Le(),null)},j({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"}))},e.createElement(U.Thead,null,e.createElement(U.Tr,null,e.createElement(U.Th,null,e.createElement(J.Typography,{variant:"sigma",textColor:"neutral600"},j({id:"global.name",defaultMessage:"Name"}))),e.createElement(U.Th,null,e.createElement(J.Typography,{variant:"sigma",textColor:"neutral600"},j({id:"global.description",defaultMessage:"Description"}))),e.createElement(U.Th,null,e.createElement(J.Typography,{variant:"sigma",textColor:"neutral600"},j({id:"global.users",defaultMessage:"Users"}))),e.createElement(U.Th,null,e.createElement(Xe.VisuallyHidden,null,j({id:"global.actions",defaultMessage:"Actions"}))))),e.createElement(U.Tbody,null,re==null?void 0:re.map(be=>e.createElement(H.Z,{key:be.id,id:be.id,name:be.name,description:be.description,usersCount:be.usersCount,icons:Qe(be)})))),!Y&&!V&&e.createElement(y.Z,null)),e.createElement(z,{isOpen:h,onClose:Ne}))},_e=()=>e.createElement(C.CheckPagePermissions,{permissions:r.Z.settings.roles.main},e.createElement(Ke,null))},75936:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=[]},20178:(fe,D,a)=>{a.d(D,{Z:()=>it});var e=a(32735),C=a(53806),r=a.n(C),K=a(88425),W=a(9808),Le=a(44526),Te=a(11856),pe=a(78330),we=a(16540),Q=a(19192),M=a(90662),P=a(95602),Z=a(37178),me=a(90353),U=a(98599),J=a.n(U),Je=a(83281),Xe=a(33795),Ue=a.n(Xe),Ee=a(86834),H=a.n(Ee),y=a(5636),le=a(5141),ke=a(19615),Ve=a(95349),ee=a(45861),ce=a(72041),de=a(5173);const Ye=de.Ry().shape({name:de.Z_().required(K.translatedErrors.required),description:de.Z_().required(K.translatedErrors.required)});var qe=a(98399),je=(oe,L,te)=>new Promise((A,_)=>{var ae=z=>{try{se(te.next(z))}catch(k){_(k)}},G=z=>{try{se(te.throw(z))}catch(k){_(k)}},se=z=>z.done?A(z.value):Promise.resolve(z.value).then(ae,G);se((te=te.apply(oe,L)).next())});const Ae=ke.default.div`
|
|
170
|
-
border: 1px solid ${({theme:oe})=>oe.colors.primary200};
|
|
171
|
-
background: ${({theme:oe})=>oe.colors.primary100};
|
|
172
|
-
padding: ${({theme:oe})=>`${oe.spaces[2]} ${oe.spaces[4]}`};
|
|
173
|
-
color: ${({theme:oe})=>oe.colors.primary600};
|
|
174
|
-
border-radius: ${({theme:oe})=>oe.borderRadius};
|
|
175
|
-
font-size: ${12/16}rem;
|
|
176
|
-
font-width: bold;
|
|
177
|
-
`,Ge=()=>{const oe=(0,K.useNotification)(),{lockApp:L,unlockApp:te}=(0,K.useOverlayBlocker)(),{formatMessage:A}=(0,y.useIntl)(),[_,ae]=(0,e.useState)(!1),{replace:G}=(0,le.useHistory)(),se=(0,e.useRef)(),{trackUsage:z}=(0,K.useTracking)(),k=(0,le.useRouteMatch)("/settings/roles/duplicate/:id"),ne=Ue()(k,"params.id",null),{isLoading:xe,data:ze}=(0,ee.U_)(),{permissions:Ke,isLoading:rt}=(0,ee.Dq)(ne),_e=re=>{L(),ae(!0),z(ne?"willDuplicateRole":"willCreateNewRole"),Promise.resolve((0,K.request)("/admin/roles",{method:"POST",body:re})).then(V=>je(void 0,null,function*(){const{permissionsToSend:h}=se.current.getPermissions();return z(ne?"didDuplicateRole":"didCreateNewRole"),V.data.id&&!H()(h)&&(yield(0,K.request)(`/admin/roles/${V.data.id}/permissions`,{method:"PUT",body:{permissions:h}})),V})).then(V=>{ae(!1),oe({type:"success",message:{id:"Settings.roles.created",defaultMessage:"created"}}),G(`/settings/roles/${V.data.id}`)}).catch(V=>{qe.error(V),ae(!1),oe({type:"warning",message:{id:"notification.error"}})}).finally(()=>{te()})},j=`${A({id:"Settings.roles.form.created",defaultMessage:"Created"})} ${r()().format("LL")}`;return e.createElement(we.Main,null,e.createElement(K.SettingsPageTitle,{name:"Roles"}),e.createElement(Je.Formik,{initialValues:{name:"",description:j},onSubmit:_e,validationSchema:Ye,validateOnChange:!1},({handleSubmit:re,values:V,errors:h,handleReset:Ne,handleChange:We})=>e.createElement(K.Form,{noValidate:!0},e.createElement(e.Fragment,null,e.createElement(Te.HeaderLayout,{primaryAction:e.createElement(M.Stack,{horizontal:!0,spacing:2},e.createElement(Le.Button,{variant:"secondary",onClick:()=>{Ne(),se.current.resetForm()},size:"L"},A({id:"app.components.Button.reset",defaultMessage:"Reset"})),e.createElement(Le.Button,{onClick:re,loading:_,size:"L"},A({id:"global.save",defaultMessage:"Save"}))),title:A({id:"Settings.roles.create.title",defaultMessage:"Create a role"}),subtitle:A({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(K.Link,{startIcon:e.createElement(J(),null),to:"/settings/roles"},A({id:"global.back",defaultMessage:"Back"}))}),e.createElement(Te.ContentLayout,null,e.createElement(M.Stack,{spacing:6},e.createElement(W.Box,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(M.Stack,{spacing:4},e.createElement(Q.Flex,{justifyContent:"space-between"},e.createElement(W.Box,null,e.createElement(W.Box,null,e.createElement(P.Typography,{fontWeight:"bold"},A({id:"global.details",defaultMessage:"Details"}))),e.createElement(W.Box,null,e.createElement(P.Typography,{variant:"pi",textColor:"neutral600"},A({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(Ae,null,A({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:0}))),e.createElement(pe.Grid,{gap:4},e.createElement(pe.GridItem,{col:6},e.createElement(Z.TextInput,{name:"name",error:h.name&&A({id:h.name}),label:A({id:"global.name",defaultMessage:"Name"}),onChange:We,value:V.name})),e.createElement(pe.GridItem,{col:6},e.createElement(me.Textarea,{label:A({id:"global.description",defaultMessage:"Description"}),name:"description",error:h.description&&A({id:h.description}),onChange:We},V.description))))),!xe&&!rt?e.createElement(W.Box,{shadow:"filterShadow",hasRadius:!0},e.createElement(Ve.Z,{isFormDisabled:!1,ref:se,permissions:Ke,layout:ze})):e.createElement(W.Box,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(K.LoadingIndicatorPage,null))))))))},it=()=>e.createElement(K.CheckPagePermissions,{permissions:ce.Z.settings.roles.create},e.createElement(Ge,null))},56899:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!1},68464:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!1},32741:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!1},19665:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!1},36950:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!1},96556:(fe,D,a)=>{a.d(D,{Z:()=>C});const C=!1},51899:(fe,D,a)=>{a.d(D,{Z:()=>oe});var e=a(32735),C=a(88425),r=a(72041),K=a(59290),W=a.n(K),Le=a(76470),Te=a.n(Le),pe=a(68192),we=a.n(pe),Q=a(95717),M=a.n(Q),P=a(44526),Z=a(11856),me=a(28004),U=a(16540),J=a(53214),Je=a(95602),Xe=a(92891),Ue=a(58469),Ee=a(5636),H=a(5141),y=a(17247),le=a(45861),ke=a(78522),Ve=a(80779),ee=a(49415);const ce={roleToDelete:null,showModalConfirmButtonLoading:!1,shouldRefetchData:!1},Ze=(L,te)=>(0,ee.default)(L,A=>{switch(te.type){case"ON_REMOVE_ROLES":{A.showModalConfirmButtonLoading=!0;break}case"ON_REMOVE_ROLES_SUCCEEDED":{A.shouldRefetchData=!0,A.roleToDelete=null;break}case"RESET_DATA_TO_DELETE":{A.shouldRefetchData=!1,A.roleToDelete=null,A.showModalConfirmButtonLoading=!1;break}case"SET_ROLE_TO_DELETE":{A.roleToDelete=te.id;break}default:return A}});var Ye=(L,te,A)=>new Promise((_,ae)=>{var G=k=>{try{z(A.next(k))}catch(ne){ae(ne)}},se=k=>{try{z(A.throw(k))}catch(ne){ae(ne)}},z=k=>k.done?_(k.value):Promise.resolve(k.value).then(G,se);z((A=A.apply(L,te)).next())});const qe=()=>{(0,C.useFocusWhenNavigate)();const{isLoading:L,allowedActions:{canCreate:te,canDelete:A,canRead:_,canUpdate:ae}}=(0,C.useRBAC)(r.Z.settings.roles),{getData:G,roles:se,isLoading:z}=(0,le.bF)(!1),[{query:k}]=(0,C.useQueryParams)(),ne=(k==null?void 0:k._q)||"",xe=(0,Ue.ZP)(se,ne,{keys:["name","description"]});return(0,e.useEffect)(()=>{!L&&_&&G()},[L,_,G]),{isLoadingForPermissions:L,canCreate:te,canDelete:A,canRead:_,canUpdate:ae,isLoading:z,getData:G,sortedRoles:xe,roles:se}},je=({getData:L,canCreate:te,canDelete:A,canUpdate:_})=>{const{formatMessage:ae}=(0,Ee.useIntl)(),G=(0,C.useNotification)(),[se,z]=(0,e.useState)(!1),{push:k}=(0,H.useHistory)(),[{selectedRoles:ne,showModalConfirmButtonLoading:xe,roleToDelete:ze},Ke]=(0,e.useReducer)(Ze,ce),rt=()=>Ye(void 0,null,function*(){try{Ke({type:"ON_REMOVE_ROLES"}),yield y.be.post("/admin/roles/batch-delete",{ids:[ze]}),yield L(),Ke({type:"RESET_DATA_TO_DELETE"})}catch(Y){const he=(0,Xe.get)(Y,["response","payload","data","ids"],null);if(he&&Array.isArray(he)){const be=he.join(`
|
|
178
|
-
`);G({type:"warning",message:be})}else G({type:"warning",message:{id:"notification.error"}})}V()}),_e=(0,e.useCallback)(Y=>{k(`/settings/roles/duplicate/${Y}`)},[k]),j=()=>k("/settings/roles/new"),re=(0,e.useCallback)(Y=>{Ke({type:"SET_ROLE_TO_DELETE",id:Y}),V()},[]),V=()=>z(Y=>!Y),h=(0,e.useCallback)(Y=>{k(`/settings/roles/${Y}`)},[k]),Ne=(0,e.useCallback)((Y,he)=>{Y.preventDefault(),Y.stopPropagation(),he.usersCount?G({type:"info",message:{id:"Roles.ListPage.notification.delete-not-allowed"}}):re(he.id)},[G,re]),We=(0,e.useCallback)((Y,he)=>{Y.preventDefault(),Y.stopPropagation(),_e(he.id)},[_e]),Qe=(0,e.useCallback)(Y=>[...te?[{onClick:he=>We(he,Y),label:ae({id:"app.utils.duplicate",defaultMessage:"Duplicate"}),icon:e.createElement(we(),null)}]:[],..._?[{onClick:()=>h(Y.id),label:ae({id:"app.utils.edit",defaultMessage:"Edit"}),icon:e.createElement(M(),null)}]:[],...A?[{onClick:he=>Ne(he,Y),label:ae({id:"global.delete",defaultMessage:"Delete"}),icon:e.createElement(Te(),null)}]:[]],[ae,Ne,We,h,te,_,A]);return{handleNewRoleClick:j,getIcons:Qe,selectedRoles:ne,isWarningDeleteAllOpened:se,showModalConfirmButtonLoading:xe,handleToggleModal:V,handleDeleteData:rt}},Ge=()=>{const{formatMessage:L}=(0,Ee.useIntl)(),{isLoadingForPermissions:te,canCreate:A,canRead:_,canDelete:ae,canUpdate:G,isLoading:se,getData:z,sortedRoles:k}=qe(),{handleNewRoleClick:ne,getIcons:xe,isWarningDeleteAllOpened:ze,showModalConfirmButtonLoading:Ke,handleToggleModal:rt,handleDeleteData:_e}=je({getData:z,canCreate:A,canDelete:ae,canUpdate:G}),j=k.length+1,re=6;if(te)return e.createElement(U.Main,null,e.createElement(C.LoadingIndicatorPage,null));const V=L({id:"global.roles",defaultMessage:"roles"});return e.createElement(U.Main,null,e.createElement(C.SettingsPageTitle,{name:"Roles"}),e.createElement(Z.HeaderLayout,{primaryAction:A?e.createElement(P.Button,{onClick:ne,startIcon:e.createElement(W(),null),size:"L"},L({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null,title:V,subtitle:L({id:"Settings.roles.list.description",defaultMessage:"List of roles"}),as:"h2"}),_&&e.createElement(Z.ActionLayout,{startActions:e.createElement(C.SearchURLQuery,{label:L({id:"app.component.search.label",defaultMessage:"Search for {target}"},{target:V})})}),_&&e.createElement(Z.ContentLayout,null,e.createElement(J.Table,{colCount:re,rowCount:j,footer:A?e.createElement(J.TFooter,{onClick:ne,icon:e.createElement(W(),null)},L({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null},e.createElement(J.Thead,null,e.createElement(J.Tr,null,e.createElement(J.Th,null,e.createElement(Je.Typography,{variant:"sigma",textColor:"neutral600"},L({id:"global.name",defaultMessage:"Name"}))),e.createElement(J.Th,null,e.createElement(Je.Typography,{variant:"sigma",textColor:"neutral600"},L({id:"global.description",defaultMessage:"Description"}))),e.createElement(J.Th,null,e.createElement(Je.Typography,{variant:"sigma",textColor:"neutral600"},L({id:"global.users",defaultMessage:"Users"}))),e.createElement(J.Th,null,e.createElement(me.VisuallyHidden,null,L({id:"global.actions",defaultMessage:"Actions"}))))),e.createElement(J.Tbody,null,k==null?void 0:k.map(h=>e.createElement(Ve.Z,{key:h.id,id:h.id,name:h.name,description:h.description,usersCount:h.usersCount,icons:xe(h)})))),!j&&!se&&e.createElement(ke.Z,null)),e.createElement(C.ConfirmDialog,{isOpen:ze,onConfirm:_e,isConfirmButtonLoading:Ke,onToggleDialog:rt}))},oe=()=>e.createElement(C.CheckPagePermissions,{permissions:r.Z.settings.roles.main},e.createElement(Ge,null))},63775:(fe,D,a)=>{a.d(D,{Z:()=>K});var e=(W,Le,Te)=>new Promise((pe,we)=>{var Q=Z=>{try{P(Te.next(Z))}catch(me){we(me)}},M=Z=>{try{P(Te.throw(Z))}catch(me){we(me)}},P=Z=>Z.done?pe(Z.value):Promise.resolve(Z.value).then(Q,M);P((Te=Te.apply(W,Le)).next())});const K=[...strapi.features.isEnabled(strapi.features.SSO)?[{Component:()=>e(void 0,null,function*(){return yield a.e(302).then(a.bind(a,49851))}),to:"/settings/single-sign-on",exact:!0}]:[]]}}]);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[4263],{34669:(V,v,e)=>{e.r(v),e.d(v,{default:()=>ye});var t=e(32735),s=e(88425),o=e(5141),p=e(92891),_=e(72041),l=e(41925),I=e(52136),i=e(72142),P=e.n(i),c=e(5636),D=e(60216),L=e.n(D),Y=e(88423),K=e.n(Y),F=e(33795),S=e.n(F),G=e(9086),Z=e.n(G),C=e(84968),z=e(83281),E=e(9808),M=e(44526),u=e(78330),A=e(11856),U=e(95602),X=e(16540),O=e(90662),n=e(98599),a=e.n(n),r=e(88677),q=e.n(r),b=e(7602),x=e(17247),re=(B,R,m)=>new Promise((H,d)=>{var Q=W=>{try{J(m.next(W))}catch(w){d(w)}},N=W=>{try{J(m.throw(W))}catch(w){d(w)}},J=W=>W.done?H(W.value):Promise.resolve(W.value).then(Q,N);J((m=m.apply(B,R)).next())});const Ee=B=>re(void 0,null,function*(){const{data:R}=yield x.be.get(`/admin/users/${B}`);return R.data}),ge=(B,R)=>re(void 0,null,function*(){const{data:m}=yield x.be.put(`/admin/users/${B}`,R);return m.data}),fe=[[{intlLabel:{id:"Auth.form.firstname.label",defaultMessage:"First name"},name:"firstname",placeholder:{id:"Auth.form.firstname.placeholder",defaultMessage:"e.g. Kai"},type:"text",size:{col:6,xs:12},required:!0},{intlLabel:{id:"Auth.form.lastname.label",defaultMessage:"Last name"},name:"lastname",placeholder:{id:"Auth.form.lastname.placeholder",defaultMessage:"e.g. Doe"},type:"text",size:{col:6,xs:12}}],[{intlLabel:{id:"Auth.form.email.label",defaultMessage:"Email"},name:"email",placeholder:{id:"Auth.form.email.placeholder",defaultMessage:"e.g. kai.doe@strapi.io"},type:"email",size:{col:6,xs:12},required:!0},{intlLabel:{id:"Auth.form.username.label",defaultMessage:"Username"},name:"username",placeholder:{id:"Auth.form.username.placeholder",defaultMessage:"e.g. Kai_Doe"},type:"email",size:{col:6,xs:12}}],[{intlLabel:{id:"global.password",defaultMessage:"Password"},name:"password",type:"password",size:{col:6,xs:12}},{intlLabel:{id:"Auth.form.confirmPassword.label",defaultMessage:"Password confirmation"},name:"confirmPassword",type:"password",size:{col:6,xs:12}}],[{intlLabel:{id:"Auth.form.active.label",defaultMessage:"Active"},name:"isActive",type:"bool",size:{col:6,xs:12}}]];var ve=e(1057),Pe=e(4397),Me=e(98399),Oe=function(){return window&&window.strapi&&window.strapi.isEE?e(28890).Z:e(16325).Z}(),ne=["email","firstname","lastname","username","isActive","roles"],oe=function(R){var m=R.canUpdate,H=(0,c.useIntl)(),d=H.formatMessage,Q=(0,o.useRouteMatch)("/settings/users/:id"),N=Q.params.id,J=(0,o.useHistory)(),W=J.push,w=(0,s.useAppInfos)(),De=w.setUserDisplayName,ae=(0,s.useNotification)(),le=(0,s.useOverlayBlocker)(),Le=le.lockApp,Ae=le.unlockApp;(0,s.useFocusWhenNavigate)();var ie=(0,C.useQuery)(["user",N],function(){return Ee(N)},{retry:!1,keepPreviousData:!1,staleTime:1e3*20,onError:function(g){var f=g.response.status;f===403&&(ae({type:"info",message:{id:"notification.permission.not-allowed-read",defaultMessage:"You are not allowed to see this document"}}),W("/")),Me.log(g.response.status)}}),Te=ie.status,T=ie.data,_e=function(){var h=(0,I.Z)(P().mark(function g(f,j){var k,te,$,se,ue;return P().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return Le(),y.prev=1,y.next=4,ge(N,Z()(f,"confirmPassword"));case 4:k=y.sent,ae({type:"success",message:d({id:"notification.success.saved",defaultMessage:"Saved"})}),te=s.auth.getUserInfo(),N.toString()===te.id.toString()&&(s.auth.setUserInfo(k),$=S()(f,"username")||(0,b.Pp)(f.firstname,f.lastname),De($)),j.setValues(K()(f,ne)),y.next=17;break;case 11:y.prev=11,y.t0=y.catch(1),se=(0,b.Iz)(y.t0.response.data),ue=Object.keys(se).reduce(function(me,pe){return me[pe]=se[pe].id,me},{}),j.setErrors(ue),ae({type:"warning",message:S()(y.t0,"response.data.message","notification.error")});case 17:Ae();case 18:case"end":return y.stop()}},g,null,[[1,11]])}));return function(f,j){return h.apply(this,arguments)}}(),de=Te!=="success",Ie=de?{id:"app.containers.Users.EditPage.header.label-loading",defaultMessage:"Edit user"}:{id:"app.containers.Users.EditPage.header.label",defaultMessage:"Edit {name}"},ee=Object.keys(K()(T,ne)).reduce(function(h,g){return g==="roles"?(h[g]=((T==null?void 0:T.roles)||[]).map(function(f){var j=f.id;return j}),h):(h[g]=T==null?void 0:T[g],h)},{}),Ce=ee.username||(0,b.Pp)(ee.firstname,ee.lastname),ce=d(Ie,{name:Ce});return de?t.createElement(X.Main,{"aria-busy":"true"},t.createElement(s.SettingsPageTitle,{name:"Users"}),t.createElement(A.HeaderLayout,{primaryAction:t.createElement(M.Button,{disabled:!0,startIcon:t.createElement(q(),null),type:"button",size:"L"},d({id:"global.save",defaultMessage:"Save"})),title:ce,navigationAction:t.createElement(s.Link,{startIcon:t.createElement(a(),null),to:"/settings/users?pageSize=10&page=1&sort=firstname"},d({id:"global.back",defaultMessage:"Back"}))}),t.createElement(A.ContentLayout,null,t.createElement(s.LoadingIndicatorPage,null))):t.createElement(X.Main,null,t.createElement(s.SettingsPageTitle,{name:"Users"}),t.createElement(z.Formik,{onSubmit:_e,initialValues:ee,validateOnChange:!1,validationSchema:ve.YM},function(h){var g=h.errors,f=h.values,j=h.handleChange,k=h.isSubmitting;return t.createElement(s.Form,null,t.createElement(A.HeaderLayout,{primaryAction:t.createElement(M.Button,{disabled:k||!m,startIcon:t.createElement(q(),null),loading:k,type:"submit",size:"L"},d({id:"global.save",defaultMessage:"Save"})),title:ce,navigationAction:t.createElement(s.Link,{startIcon:t.createElement(a(),null),to:"/settings/users?pageSize=10&page=1&sort=firstname"},d({id:"global.back",defaultMessage:"Back"}))}),t.createElement(A.ContentLayout,null,(T==null?void 0:T.registrationToken)&&t.createElement(E.Box,{paddingBottom:6},t.createElement(Oe,{registrationToken:T.registrationToken})),t.createElement(O.Stack,{spacing:7},t.createElement(E.Box,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},t.createElement(O.Stack,{spacing:4},t.createElement(U.Typography,{variant:"delta",as:"h2"},d({id:"app.components.Users.ModalCreateBody.block-title.details",defaultMessage:"Details"})),t.createElement(u.Grid,{gap:5},fe.map(function(te){return te.map(function($){return t.createElement(u.GridItem,(0,l.Z)({key:$.name},$.size),t.createElement(s.GenericInput,(0,l.Z)({},$,{disabled:!m,error:g[$.name],onChange:j,value:f[$.name]||""})))})})))),t.createElement(E.Box,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},t.createElement(O.Stack,{spacing:4},t.createElement(U.Typography,{variant:"delta",as:"h2"},d({id:"global.roles",defaultMessage:"User's role"})),t.createElement(u.Grid,{gap:5},t.createElement(u.GridItem,{col:6,xs:12},t.createElement(Pe.Z,{disabled:!m,error:g.roles,onChange:j,value:f.roles}))))))))}))};oe.propTypes={canUpdate:L().bool.isRequired};const he=oe,ye=()=>{const B=(0,s.useNotification)(),R=(0,t.useMemo)(()=>({read:_.Z.settings.users.read,update:_.Z.settings.users.update}),[]),{isLoading:m,allowedActions:{canRead:H,canUpdate:d}}=(0,s.useRBAC)(R),{state:Q}=(0,o.useLocation)(),N=(0,p.get)(Q,"from","/");return(0,t.useEffect)(()=>{m||!H&&!d&&B({type:"info",message:{id:"notification.permission.not-allowed-read",defaultMessage:"You are not allowed to see this document"}})},[m,H,d,B]),m?t.createElement(s.LoadingIndicatorPage,null):!H&&!d?t.createElement(o.Redirect,{to:N}):t.createElement(he,{canUpdate:d})}},76779:(V,v,e)=>{e.d(v,{Z:()=>S});var t=e(32735),s=e(60216),o=e.n(s),p=e(20763),_=e.n(p),l=e(88425),I=e.n(l),i=e(68192),P=e.n(i),c=e(59087),D=e.n(c),L=e(5636),Y=e.n(L);const K=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg"},t.createElement("text",{transform:"translate(-23 -9)",fill:"#4B515A",fillRule:"evenodd",fontSize:"32",fontFamily:"AppleColorEmoji, Apple Color Emoji"},t.createElement("tspan",{x:"23",y:"36"},"\u2709\uFE0F"))),F=({children:G,target:Z})=>{const C=(0,l.useNotification)(),{formatMessage:z}=(0,L.useIntl)(),E=()=>{C({type:"info",message:{id:"notification.link-copied"}})},M=z({id:"app.component.CopyToClipboard.label",defaultMessage:"Copy to clipboard"});return t.createElement(l.ContentBox,{endAction:t.createElement(c.CopyToClipboard,{onCopy:E,text:Z},t.createElement(p.IconButton,{label:M,noBorder:!0,icon:t.createElement(P(),null)})),title:Z,titleEllipsis:!0,subtitle:G,icon:t.createElement(K,null),iconBackground:"neutral100"})};F.propTypes={children:o().oneOfType([o().element,o().string]).isRequired,target:o().string.isRequired};const S=F},16325:(V,v,e)=>{e.d(v,{Z:()=>P});var t=e(32735),s=e(5636),o=e.n(s),p=e(60216),_=e.n(p),l=e(463),I=e(76779);const i=({registrationToken:c})=>{const{formatMessage:D}=(0,s.useIntl)(),L=`${window.location.origin}${l.Z}auth/register?registrationToken=${c}`;return t.createElement(I.Z,{target:L},D({id:"app.components.Users.MagicLink.connect",defaultMessage:"Copy and share this link to give access to this user"}))};i.defaultProps={registrationToken:""},i.propTypes={registrationToken:_().string};const P=i},4397:(V,v,e)=>{e.d(v,{Z:()=>z});var t=e(32735),s=e(60216),o=e.n(s),p=e(5636),_=e.n(p),l=e(25716),I=e.n(l),i=e(84968),P=e.n(i),c=e(19615),D=e(103),L=e.n(D),Y=e(17247),K=(E,M,u)=>new Promise((A,U)=>{var X=a=>{try{n(u.next(a))}catch(r){U(r)}},O=a=>{try{n(u.throw(a))}catch(r){U(r)}},n=a=>a.done?A(a.value):Promise.resolve(a.value).then(X,O);n((u=u.apply(E,M)).next())});const F=c.keyframes`
|
|
2
|
-
from {
|
|
3
|
-
transform: rotate(0deg);
|
|
4
|
-
}
|
|
5
|
-
to {
|
|
6
|
-
transform: rotate(359deg);
|
|
7
|
-
}
|
|
8
|
-
`,S=c.default.div`
|
|
9
|
-
animation: ${F} 2s infinite linear;
|
|
10
|
-
`,G=()=>t.createElement(S,null,t.createElement(L(),null)),Z=()=>K(void 0,null,function*(){const{data:E}=yield Y.be.get("/admin/roles");return E.data}),C=({disabled:E,error:M,onChange:u,value:A})=>{const{status:U,data:X}=(0,i.useQuery)(["roles"],Z,{staleTime:5e4}),{formatMessage:O}=(0,p.useIntl)(),n=M?O({id:M,defaultMessage:M}):"",a=O({id:"app.components.Users.ModalCreateBody.block-title.roles",defaultMessage:"User's roles"}),r=O({id:"app.components.Users.ModalCreateBody.block-title.roles.description",defaultMessage:"A user can have one or several roles"}),q=O({id:"app.components.Select.placeholder",defaultMessage:"Select"}),b=U==="loading"?t.createElement(G,null):void 0;return t.createElement(l.Select,{id:"roles",disabled:E,error:n,hint:r,label:a,name:"roles",onChange:x=>{u({target:{name:"roles",value:x}})},placeholder:q,multi:!0,startIcon:b,value:A,withTags:!0,required:!0},(X||[]).map(x=>t.createElement(l.Option,{key:x.id,value:x.id},x.name)))};C.defaultProps={disabled:!1,error:void 0},C.propTypes={disabled:o().bool,error:o().string,onChange:o().func.isRequired,value:o().array.isRequired};const z=C},1057:(V,v,e)=>{e.d(v,{YM:()=>O,Rw:()=>K});var t=e(5173),s=e(88425),o=Object.defineProperty,p=Object.defineProperties,_=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,P=(n,a,r)=>a in n?o(n,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[a]=r,c=(n,a)=>{for(var r in a||(a={}))I.call(a,r)&&P(n,r,a[r]);if(l)for(var r of l(a))i.call(a,r)&&P(n,r,a[r]);return n},D=(n,a)=>p(n,_(a));const L={firstname:t.nK().required(s.translatedErrors.required),lastname:t.nK(),email:t.Z_().email(s.translatedErrors.email).lowercase().required(s.translatedErrors.required),username:t.Z_().nullable(),password:t.Z_().min(8,s.translatedErrors.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number"),confirmPassword:t.Z_().min(8,s.translatedErrors.minLength).oneOf([t.iH("password"),null],"components.Input.error.password.noMatch").when("password",(n,a)=>n?a.required(s.translatedErrors.required):a)},K=D(c({},L),{currentPassword:t.Z_().when(["password","confirmPassword"],(n,a,r)=>n||a?r.required(s.translatedErrors.required):r),preferedLanguage:t.Z_().nullable()}),S={roles:t.IX().min(1,s.translatedErrors.required).required(s.translatedErrors.required)};var G=Object.defineProperty,Z=Object.defineProperties,C=Object.getOwnPropertyDescriptors,z=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,u=(n,a,r)=>a in n?G(n,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[a]=r,A=(n,a)=>{for(var r in a||(a={}))E.call(a,r)&&u(n,r,a[r]);if(z)for(var r of z(a))M.call(a,r)&&u(n,r,a[r]);return n},U=(n,a)=>Z(n,C(a));const O=t.Ry().shape(A(U(A({},L),{isActive:t.Xg()}),S))},28890:(V,v,e)=>{e.d(v,{Z:()=>P});var t=e(32735),s=e(5636),o=e.n(s),p=e(60216),_=e.n(p),l=e(463),I=e(76779);const i=({registrationToken:c})=>{const{formatMessage:D}=(0,s.useIntl)();return c?t.createElement(I.Z,{target:`${window.location.origin}${l.Z}auth/register?registrationToken=${c}`},D({id:"app.components.Users.MagicLink.connect",defaultMessage:"Copy and share this link to give access to this user"})):t.createElement(I.Z,{target:`${window.location.origin}${l.Z}auth/login`},D({id:"app.components.Users.MagicLink.connect.sso",defaultMessage:"Send this link to the user, the first login can be made via a SSO provider."}))};i.defaultProps={registrationToken:""},i.propTypes={registrationToken:_().string};const P=i}}]);
|