@strapi/admin 4.2.0-beta.3 → 4.3.0-beta.1
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/ConfigurationsProvider/index.js +51 -0
- package/admin/src/components/ConfigurationsProvider/reducer.js +28 -0
- package/admin/src/components/LeftMenu/index.js +12 -2
- package/admin/src/components/Providers/index.js +8 -4
- package/admin/src/components/UnauthenticatedLogo/index.js +4 -2
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +3 -3
- package/admin/src/content-manager/components/SelectMany/index.js +2 -4
- package/admin/src/content-manager/components/SelectWrapper/index.js +1 -13
- package/admin/src/hooks/useFetchMarketplaceProviders/index.js +23 -0
- package/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js +11 -0
- package/admin/src/pages/App/index.js +7 -2
- package/admin/src/pages/MarketplacePage/components/{EmptyPluginSearch/EmptyPluginGrid.js → EmptyNpmPackageSearch/EmptyNpmPackageGrid.js} +1 -1
- package/admin/src/pages/MarketplacePage/components/{EmptyPluginSearch → EmptyNpmPackageSearch}/index.js +6 -4
- package/admin/src/pages/MarketplacePage/components/{PluginCard → NpmPackageCard}/InstallPluginButton.js +0 -0
- package/admin/src/pages/MarketplacePage/components/{PluginCard → NpmPackageCard}/index.js +22 -10
- package/admin/src/pages/MarketplacePage/components/NpmPackagesGrid/index.js +42 -0
- package/admin/src/pages/MarketplacePage/components/PageHeader/index.js +12 -5
- package/admin/src/pages/MarketplacePage/index.js +99 -37
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/Form/index.js +85 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/Form/init.js +13 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/Form/reducer.js +43 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoInput/index.js +118 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoInput/reducer.js +28 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoInput/stepper.js +25 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/AddLogoDialog.js +67 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/FromComputerForm.js +176 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/FromUrlForm.js +86 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/ImageCardAsset.js +51 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/PendingLogoDialog.js +97 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/index.js +85 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/reducer.js +28 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +153 -91
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/api.js +16 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/constants.js +3 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/getFormData.js +17 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/parseFileMetadatas.js +76 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/prefixAllUrls.js +17 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/urlToFile.js +21 -0
- package/admin/src/translations/en.json +33 -3
- package/admin/src/translations/pl.json +264 -12
- package/admin/src/translations/vi.json +17 -17
- package/admin/src/tsconfig.json +1 -1
- package/build/1820.ca954075.chunk.js +503 -0
- package/build/1856.6a94980b.chunk.js +172 -0
- package/build/20.9e5a98b6.chunk.js +308 -0
- package/build/2077.5456ccd1.chunk.js +194 -0
- package/build/3531.231e0eb6.chunk.js +10 -0
- package/build/{4073.41ac1235.chunk.js → 4073.e144a91a.chunk.js} +1 -1
- package/build/413.d5986568.chunk.js +284 -0
- package/build/4715.4588fdf5.chunk.js +385 -0
- package/build/{210.014495c1.chunk.js → 472.d43be8bb.chunk.js} +58 -58
- package/build/4800.d3ebc81d.chunk.js +1 -0
- package/build/5250.24040688.chunk.js +11 -0
- package/build/6229.53b33cf0.chunk.js +194 -0
- package/build/7418.6db737ce.chunk.js +112 -0
- package/build/8773.54a26ded.chunk.js +327 -0
- package/build/9066.2847fdff.chunk.js +101 -0
- package/build/9262.25aa12a5.chunk.js +1 -0
- package/build/9420.ba035f29.chunk.js +508 -0
- package/build/Admin-authenticatedApp.52f3c150.chunk.js +80 -0
- package/build/{Admin_homePage.f157e33e.chunk.js → Admin_homePage.0ac648e8.chunk.js} +2 -2
- package/build/Admin_marketplace.71c66b49.chunk.js +11 -0
- package/build/{Admin_profilePage.62c203ad.chunk.js → Admin_profilePage.27191ed2.chunk.js} +1 -1
- package/build/Admin_settingsPage.021da806.chunk.js +178 -0
- package/build/{admin-edit-roles-page.94e1403b.chunk.js → admin-edit-roles-page.fb374555.chunk.js} +1 -1
- package/build/admin-edit-users.a360deaf.chunk.js +10 -0
- package/build/admin-users.47d06d24.chunk.js +11 -0
- package/build/api-tokens-create-page.698f132d.chunk.js +1 -0
- package/build/api-tokens-edit-page.afece2fe.chunk.js +1 -0
- package/build/{api-tokens-list-page.340750a6.chunk.js → api-tokens-list-page.46d96dee.chunk.js} +1 -1
- package/build/content-manager.afcc3624.chunk.js +1182 -0
- package/build/email-settings-page.8871dfe8.chunk.js +103 -0
- package/build/en-json.0a5ba154.chunk.js +1 -0
- package/build/i18n-settings-page.dfb4eb01.chunk.js +101 -0
- package/build/index.html +1 -1
- package/build/main.ca3856ed.js +8640 -0
- package/build/pl-json.f65302c2.chunk.js +1 -0
- package/build/{runtime~main.e7611418.js → runtime~main.48a46dd2.js} +1 -1
- package/build/{sso-settings-page.e9034e22.chunk.js → sso-settings-page.dfb0b917.chunk.js} +1 -1
- package/build/upload-settings.8d8c672a.chunk.js +101 -0
- package/build/upload-translation-de-json.745613c0.chunk.js +1 -0
- package/build/upload-translation-dk-json.cb25dcf0.chunk.js +1 -0
- package/build/upload-translation-en-json.e78688a0.chunk.js +1 -0
- package/build/upload-translation-es-json.1f344b53.chunk.js +1 -0
- package/build/upload-translation-fr-json.e21c0c7a.chunk.js +1 -0
- package/build/upload-translation-he-json.4ce77b7b.chunk.js +1 -0
- package/build/upload-translation-it-json.5ce11e0b.chunk.js +1 -0
- package/build/upload-translation-ja-json.22afae44.chunk.js +1 -0
- package/build/upload-translation-ko-json.9a2c21cb.chunk.js +1 -0
- package/build/upload-translation-ms-json.0605d6da.chunk.js +1 -0
- package/build/upload-translation-pl-json.e534b676.chunk.js +1 -0
- package/build/upload-translation-pt-BR-json.95686cfb.chunk.js +1 -0
- package/build/upload-translation-ru-json.37bd1546.chunk.js +1 -0
- package/build/upload-translation-sk-json.b03d4904.chunk.js +1 -0
- package/build/upload-translation-th-json.64dd70ce.chunk.js +1 -0
- package/build/upload-translation-uk-json.1328cb3e.chunk.js +1 -0
- package/build/{upload-translation-zh-Hans-json.c9622577.chunk.js → upload-translation-zh-Hans-json.6832ff81.chunk.js} +1 -1
- package/build/upload-translation-zh-json.ee8fba96.chunk.js +1 -0
- package/build/upload.5622b777.chunk.js +7 -0
- package/build/users-advanced-settings-page.4af9e241.chunk.js +101 -0
- package/build/users-email-settings-page.d69c0d87.chunk.js +101 -0
- package/build/users-providers-settings-page.fc1fda6d.chunk.js +101 -0
- package/build/vi-json.bf3424be.chunk.js +1 -0
- package/build/webhook-edit-page.a7ae6e3b.chunk.js +23 -0
- package/build/webhook-list-page.057f396c.chunk.js +133 -0
- package/index.js +2 -8
- package/package.json +10 -9
- package/scripts/build.js +3 -1
- package/server/config/admin-actions.js +14 -0
- package/server/controllers/admin.js +40 -2
- package/server/routes/admin.js +28 -1
- package/server/services/index.js +1 -0
- package/server/services/project-settings.js +173 -0
- package/server/utils/index.d.ts +2 -0
- package/server/validation/project-settings.js +39 -0
- package/utils/create-cache-dir.js +6 -36
- package/utils/get-custom-app-config-file.js +7 -2
- package/utils/get-plugins-path.js +1 -1
- package/admin/src/content-manager/components/SelectWrapper/ClearIndicator.js +0 -18
- package/admin/src/content-manager/components/SelectWrapper/DropdownIndicator.js +0 -24
- package/admin/src/content-manager/components/SelectWrapper/IconBox.js +0 -20
- package/admin/src/content-manager/components/SelectWrapper/IndicatorSeparator.js +0 -3
- package/admin/src/content-manager/components/SelectWrapper/utils/getSelectStyles.js +0 -92
- package/build/1709.ceed0e18.chunk.js +0 -503
- package/build/1856.521a99fd.chunk.js +0 -172
- package/build/20.cf744c35.chunk.js +0 -308
- package/build/2077.51485bfb.chunk.js +0 -194
- package/build/2135.95ee6de1.chunk.js +0 -162
- package/build/2524.688d0355.chunk.js +0 -1
- package/build/2912.79c2b3c8.chunk.js +0 -253
- package/build/4715.77e04177.chunk.js +0 -385
- package/build/4761.3eabdf46.chunk.js +0 -101
- package/build/6229.a5cca9f2.chunk.js +0 -194
- package/build/6281.f10a7e3a.chunk.js +0 -1
- package/build/7009.79fce86d.chunk.js +0 -164
- package/build/7191.3bde3cbf.chunk.js +0 -335
- package/build/7841.f0e7d629.chunk.js +0 -253
- package/build/7863.bc7a8f3a.chunk.js +0 -112
- package/build/9420.cb0b75e8.chunk.js +0 -508
- package/build/Admin-authenticatedApp.4ce8d292.chunk.js +0 -80
- package/build/Admin_marketplace.1e3393c9.chunk.js +0 -11
- package/build/Admin_settingsPage.924a7816.chunk.js +0 -170
- package/build/admin-edit-users.6c2bf718.chunk.js +0 -10
- package/build/admin-users.e03db115.chunk.js +0 -11
- package/build/api-tokens-create-page.787ab302.chunk.js +0 -1
- package/build/api-tokens-edit-page.e4010c0c.chunk.js +0 -1
- package/build/content-manager.6cdcfb6e.chunk.js +0 -1204
- package/build/email-settings-page.f67d13b2.chunk.js +0 -103
- package/build/en-json.3e1a222e.chunk.js +0 -1
- package/build/i18n-settings-page.6b67cb75.chunk.js +0 -101
- package/build/main.45472ea9.js +0 -8404
- package/build/pl-json.94f05d2c.chunk.js +0 -1
- package/build/upload-settings.3db55de0.chunk.js +0 -101
- package/build/upload-translation-de-json.b642da08.chunk.js +0 -1
- package/build/upload-translation-dk-json.fc61df13.chunk.js +0 -1
- package/build/upload-translation-en-json.59269508.chunk.js +0 -1
- package/build/upload-translation-es-json.8ec935ef.chunk.js +0 -1
- package/build/upload-translation-fr-json.eb9b4f84.chunk.js +0 -1
- package/build/upload-translation-he-json.c226f2dc.chunk.js +0 -1
- package/build/upload-translation-it-json.8e58456e.chunk.js +0 -1
- package/build/upload-translation-ja-json.1378a2e7.chunk.js +0 -1
- package/build/upload-translation-ko-json.5e06e112.chunk.js +0 -1
- package/build/upload-translation-ms-json.dc3bf0d7.chunk.js +0 -1
- package/build/upload-translation-pl-json.6071e38c.chunk.js +0 -1
- package/build/upload-translation-pt-BR-json.7e8d9550.chunk.js +0 -1
- package/build/upload-translation-ru-json.da2529f3.chunk.js +0 -1
- package/build/upload-translation-sk-json.bfdf4f09.chunk.js +0 -1
- package/build/upload-translation-th-json.6a48b826.chunk.js +0 -1
- package/build/upload-translation-uk-json.6fb09148.chunk.js +0 -1
- package/build/upload-translation-zh-json.711f804b.chunk.js +0 -1
- package/build/upload.070c189b.chunk.js +0 -105
- package/build/users-advanced-settings-page.a23cda17.chunk.js +0 -101
- package/build/users-email-settings-page.0a096388.chunk.js +0 -1
- package/build/users-providers-settings-page.bfe7755a.chunk.js +0 -1
- package/build/vi-json.3d14e91e.chunk.js +0 -1
- package/build/webhook-edit-page.2fa94db3.chunk.js +0 -23
- package/build/webhook-list-page.b594db49.chunk.js +0 -133
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[801],{72331:(H,C,n)=>{n.r(C),n.d(C,{default:()=>en});var e=n(32735),i=n(10938),N=n(84968),P=n(33795),X=n.n(P);const M=JSON.parse('{"i8":"4.2.0-beta.3"}');var $=n(41072),d=n(5141),b=n(4409),L=n(74506),K=n(51968),W=n(88311),G=n.n(W),O=n(52846),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),Ne=n(20763),oe=n(44526),be=n(55633),Ge=n.n(be);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:c}=(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:p=>p.stopPropagation()},e.createElement(g.Flex,{justifyContent:"flex-end"},e.createElement(Ne.IconButton,{onClick:t,"aria-label":c({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},c({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(59838),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(59872),Ve=n(99378);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 j=n(56565),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:c,stepIndex:p,hasSectionAfter:f})=>{const{formatMessage:y}=(0,l.useIntl)(),h=c>0,m=p>0,D=c+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:j.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:c+1,type:m?j.hx:j.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:j.hx}),m&&e.createElement(ce,{number:D+1,type:j.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:j.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:c,setSkipped:p}=(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:F}=(0,i.useTracking)();(0,e.useEffect)(()=>{if(!t){y(!1);return}const[x]=G()(a,t);y(!x&&c)},[t,a,c]),(0,e.useEffect)(()=>{if(t){const[x]=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:x,newSectionIndex:ae,newStepIndex:Y,newHasSectionAfter:tn,newHasStepAfter:nn})}},[t,a]);const u=()=>{s(t,!0),F(h.trackingEvent),o(null)},I=()=>{p(!0),o(null),F("didSkipGuidedtour")};return f&&h?e.createElement(Fe,{hideSkip:!V&&!B,onSkip:I,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(49795),ot=n.n(at),st=n(76805),rt=n.n(st),it=n(44485);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)(d.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,c]=(0,e.useState)(!1),{menuLogo:p}=(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=()=>c(u=>!u),V=()=>{i.auth.clearAppStorage(),B()},z=u=>{var I,x;!u.currentTarget.contains(u.relatedTarget)&&((x=(I=u.relatedTarget)==null?void 0:I.parentElement)==null?void 0:x.id)!=="main-nav-user-button"&&c(!1)},F=m({id:"app.components.LeftMenu.navbrand.title",defaultMessage:"Strapi Dashboard"});return e.createElement(A.MainNav,{condensed:f},e.createElement(A.NavBrand,{as:d.NavLink,workplace:m({id:"app.components.LeftMenu.navbrand.workplace",defaultMessage:"Workplace"}),title:F,icon:e.createElement("img",{src:p,alt:F})}),e.createElement(nt.Divider,null),e.createElement(A.NavSections,null,e.createElement(A.NavLink,{as:d.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 I=u.icon;return e.createElement(A.NavLink,{as:d.NavLink,to:u.to,key:u.to,icon:e.createElement(I,null)},m(u.intlLabel))})):null,t.length>0?e.createElement(A.NavSection,{label:"General"},t.map(u=>{const I=u.icon;return e.createElement(A.NavLink,{as:d.NavLink,badgeContent:u.notificationsCount>0&&u.notificationsCount.toString()||void 0,to:u.to,key:u.to,icon:e.createElement(I,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(13271),mt=n(83563),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 c=[{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"}],p=()=>{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:p},!t&&e.createElement(ee.G,{icon:ve.faQuestion}),t&&e.createElement(ee.G,{icon:ve.faTimes})),t&&e.createElement(E.FocusTrap,{onEscape:p},e.createElement(ht,{background:"neutral0",hasRadius:!0,shadow:"tableShadow",paddingBottom:2,paddingTop:2},c.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(6281),n.e(7191),n.e(994)]).then(n.bind(n,7659))),Tt=(0,e.lazy)(()=>Promise.all([n.e(2524),n.e(3981)]).then(n.bind(n,40279))),Pt=(0,e.lazy)(()=>n.e(3677).then(n.bind(n,46789))),Ct=(0,e.lazy)(()=>Promise.all([n.e(8469),n.e(5516)]).then(n.bind(n,51141))),Te=(0,e.lazy)(()=>Promise.resolve().then(n.bind(n,24578))),Mt=(0,e.lazy)(()=>n.e(4073).then(n.bind(n,34073))),Ot=(0,e.lazy)(()=>n.e(9497).then(n.bind(n,10902))),Pe=(0,e.lazy)(()=>Promise.all([n.e(8469),n.e(9420),n.e(20),n.e(6281),n.e(2135),n.e(5895)]).then(n.bind(n,95291))),Rt=()=>{const{trackUsage:t}=(0,i.useTracking)(),a=(0,b.I0)(),o=(0,b.v9)(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)(),c=(0,e.useMemo)(()=>s.filter(p=>p.Component).map(({to:p,Component:f,exact:y})=>(0,ye.ot)(f,p,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(d.Switch,null,e.createElement(d.Route,{path:"/",component:Tt,exact:!0}),e.createElement(d.Route,{path:"/me",component:Ot,exact:!0}),e.createElement(d.Route,{path:"/content-manager",component:vt}),c,e.createElement(d.Route,{path:"/settings/:settingId",component:Pe}),e.createElement(d.Route,{path:"/settings",component:Pe,exact:!0}),e.createElement(d.Route,{path:"/marketplace"},e.createElement(Ct,null)),e.createElement(d.Route,{path:"/list-plugins",exact:!0},e.createElement(Pt,null)),e.createElement(d.Route,{path:"/404",component:Te}),e.createElement(d.Route,{path:"/500",component:Mt}),e.createElement(d.Route,{path:"",component:Te}))),e.createElement(tt,null),e.createElement(yt,null)))};var At=Object.defineProperty,Ce=Object.getOwnPropertySymbols,It=Object.prototype.hasOwnProperty,xt=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={}))It.call(a,o)&&Me(t,o,a[o]);if(Ce)for(var o of Ce(a))xt.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),Nt=n.n(Bt);const Oe={plugins:null},bt=(t=Oe,a)=>(0,re.default)(t,o=>{switch(a.type){case"SET_PLUGIN_READY":{Nt()(o,["plugins",a.pluginId,"isReady"],!0);break}default:return o}}),Gt=()=>{const{plugins:t}=(0,i.useStrapiApp)(),[{plugins:a},o]=(0,e.useReducer)(bt,Oe,()=>Dt(t)),s=(0,e.useRef)(p=>{o({type:"SET_PLUGIN_READY",pluginId:p})});if(Object.keys(a).some(p=>a[p].isReady===!1)){const p=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,p,e.createElement(i.LoadingIndicatorPage,null))}return e.createElement(St,null)};var Re=n(59157);const Ut=()=>({type:Re.l}),Ft=t=>({type:Re.m,permissions:t}),Se=({children:t,permissions:a,refetchPermissions:o})=>{const{allPermissions:s}=(0,b.v9)(p=>p.rbacProvider),c=(0,b.I0)();return(0,e.useEffect)(()=>(c(Ft(a)),()=>{c(Ut())}),[a,c]),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(43653),$t=n.n(jt),Kt=n(55593),te=n.n(Kt);const Ae=(t,a)=>!te().valid(t)||!te().valid(a)?!1:te().lt(t,a);var ne=n(16558),k=(t,a,o)=>new Promise((s,c)=>{var p=h=>{try{y(o.next(h))}catch(m){c(m)}},f=h=>{try{y(o.throw(h))}catch(m){c(m)}},y=h=>h.done?s(h.value):Promise.resolve(h.value).then(p,f);y((o=o.apply(t,a)).next())});const Ie=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(Ie,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 Ie}}),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,xe=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(xe)for(var o of xe(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(),c=X()(s,"username")||(0,ye.Pp)(s.firstname,s.lastname),[p,f]=(0,e.useState)(c),{showReleaseNotification:y}=(0,$.um)(),[{data:h,status:m},{data:D,isLoading:B},{data:V,status:z,refetch:F,isFetched:u,isFetching:I},{data:x}]=(0,N.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)(()=>{x&&x.find(({code:Y})=>Y==="strapi-super-admin")&&o.current(!0)},[x]),B||(I&&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:p})},e.createElement(Wt,{permissions:V,refetchPermissions:F},e.createElement(Gt,null)))}},59872:(H,C,n)=>{n.d(C,{Z:()=>r});var e=n(32735),i=n(60216),N=n.n(i),P=n(10938),X=n.n(P),M=n(9808),$=n.n(M),d=n(56565),b=Object.defineProperty,L=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,G=(l,v,E)=>v in l?b(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))W.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&&W.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===d.VM?"neutral300":"primary500",hasRadius:!0},g))};U.defaultProps={type:d.VM},U.propTypes={type:N().oneOf([d.lW,d.hx,d.VM])};const r=U},99378:(H,C,n)=>{n.d(C,{Z:()=>U});var e=n(32735),i=n(60216),N=n.n(i),P=n(10938),X=n.n(P),M=n(19192),$=n.n(M),d=n(95602),b=n.n(d),L=n(78752),K=n.n(L),W=n(98221),G=n.n(W),O=n(56565);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(d.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(d.Typography,{fontWeight:"semiBold",textColor:"neutral600"},l));T.defaultProps={number:void 0,type:O.VM},T.propTypes={number:N().number,type:N().oneOf([O.lW,O.hx,O.VM])};const U=T},56565:(H,C,n)=>{n.d(C,{lW:()=>e,hx:()=>i,VM:()=>N});const e="isActive",i="isDone",N="isNotDone"},52846:(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,11 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5516],{60799:(h,E,o)=>{"use strict";o.d(E,{Z:()=>a});var r=o(84968),s=o(10938),l=o(16558),n=(i,c,g)=>new Promise((y,T)=>{var O=f=>{try{R(g.next(f))}catch(j){T(j)}},S=f=>{try{R(g.throw(f))}catch(j){T(j)}},R=f=>f.done?y(f.value):Promise.resolve(f.value).then(O,S);R((g=g.apply(i,c)).next())});const e=()=>n(void 0,null,function*(){const{data:i}=yield l.be.get("/admin/plugins");return i}),a=i=>{const c=(0,s.useNotification)();return(0,r.useQuery)("list-installed-plugins",()=>e(),{onSuccess:()=>{i&&i()},onError:()=>{c({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})}},51141:(h,E,o)=>{"use strict";o.r(E),o.d(E,{MarketPlacePage:()=>G,default:()=>ze});var r=o(32735),s=o(5636),l=o(99357),n=o(84968),e=o(58469),t=o(10938),a=o(78330),i=o(11856),c=o(16540),g=o(89978),y=o(9808),T=o(29270),O=o(95602),S=o(19192),R=o(60216),f=o.n(R),j=o(19615),Q=o(90662),I=o(61541),B=o(78752),L=o(44826),Y=o(74885),F=o.n(Y),K=o(51574),J=o.n(K),X=o(77016),q=o(59087),_=o(98221),ee=o.n(_),te=o(74382),ne=o.n(te),re=o(44526);const N=({isInstalled:u,isInDevelopmentMode:d,commandToCopy:p})=>{const M=(0,t.useNotification)(),{formatMessage:m}=(0,s.useIntl)(),{trackUsage:P}=(0,t.useTracking)();return u?r.createElement(y.Box,{paddingLeft:4},r.createElement(B.Icon,{as:ee(),marginRight:2,width:12,height:12,color:"success600"}),r.createElement(O.Typography,{variant:"omega",textColor:"success600",fontWeight:"bold"},m({id:"admin.pages.MarketPlacePage.plugin.installed",defaultMessage:"Installed"}))):d?r.createElement(q.CopyToClipboard,{onCopy:()=>{P("willInstallPlugin"),M({type:"success",message:{id:"admin.pages.MarketPlacePage.plugin.copy.success"}})},text:p},r.createElement(re.Button,{size:"S",startIcon:r.createElement(ne(),null),variant:"secondary"},m({id:"admin.pages.MarketPlacePage.plugin.copy",defaultMessage:"Copy install command"}))):null};N.propTypes={isInstalled:f().bool.isRequired,isInDevelopmentMode:f().bool.isRequired,commandToCopy:f().string.isRequired};const ae=N,oe=(0,j.default)(O.Typography)`
|
|
2
|
-
/* stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
3
|
-
display: -webkit-box;
|
|
4
|
-
-webkit-box-orient: vertical;
|
|
5
|
-
-webkit-line-clamp: 2;
|
|
6
|
-
/* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
`,C=({plugin:u,installedPluginNames:d,useYarn:p,isInDevelopmentMode:M})=>{const{attributes:m}=u,{formatMessage:P}=(0,s.useIntl)(),{trackUsage:k}=(0,t.useTracking)(),b=d.includes(m.npmPackageName),v=p?`yarn add ${m.npmPackageName}`:`npm install ${m.npmPackageName}`,x=P({id:"admin.pages.MarketPlacePage.plugin.tooltip.madeByStrapi",defaultMessage:"Made by Strapi"});return r.createElement(S.Flex,{direction:"column",justifyContent:"space-between",paddingTop:4,paddingRight:4,paddingBottom:4,paddingLeft:4,hasRadius:!0,background:"neutral0",shadow:"tableShadow",height:"100%",alignItems:"normal"},r.createElement(y.Box,null,r.createElement(y.Box,{as:"img",src:m.logo.url,alt:`${m.name} logo`,hasRadius:!0,width:11,height:11}),r.createElement(y.Box,{paddingTop:4},r.createElement(O.Typography,{as:"h3",variant:"delta"},r.createElement(S.Flex,{alignItems:"center"},m.name,m.validated&&!m.madeByStrapi&&r.createElement(L.Tooltip,{description:P({id:"admin.pages.MarketPlacePage.plugin.tooltip.verified",defaultMessage:"Plugin verified by Strapi"})},r.createElement(S.Flex,null,r.createElement(B.Icon,{as:J(),marginLeft:2,color:"success600"}))),m.madeByStrapi&&r.createElement(L.Tooltip,{description:x},r.createElement(S.Flex,null,r.createElement(y.Box,{as:"img",src:X,alt:x,marginLeft:1,width:6,height:"auto"})))))),r.createElement(y.Box,{paddingTop:2},r.createElement(oe,{as:"p",variant:"omega",textColor:"neutral600"},m.description))),r.createElement(Q.Stack,{horizontal:!0,spacing:2,style:{alignSelf:"flex-end"},paddingTop:6},r.createElement(I.LinkButton,{size:"S",href:`https://market.strapi.io/plugins/${m.slug}`,isExternal:!0,endIcon:r.createElement(F(),null),"aria-label":P({id:"admin.pages.MarketPlacePage.plugin.info.label",defaultMessage:"Learn more about {pluginName}"},{pluginName:m.name}),variant:"tertiary",onClick:()=>k("didPluginLearnMore")},P({id:"admin.pages.MarketPlacePage.plugin.info.text",defaultMessage:"Learn more"})),r.createElement(ae,{isInstalled:b,isInDevelopmentMode:M,commandToCopy:v})))};C.defaultProps={isInDevelopmentMode:!1},C.propTypes={plugin:f().shape({id:f().string.isRequired,attributes:f().shape({name:f().string.isRequired,description:f().string.isRequired,slug:f().string.isRequired,npmPackageName:f().string.isRequired,npmPackageUrl:f().string.isRequired,repositoryUrl:f().string.isRequired,logo:f().object.isRequired,developerName:f().string.isRequired,validated:f().bool.isRequired,madeByStrapi:f().bool.isRequired,strapiCompatibility:f().oneOf(["v3","v4"]).isRequired}).isRequired}).isRequired,installedPluginNames:f().arrayOf(f().string).isRequired,useYarn:f().bool.isRequired,isInDevelopmentMode:f().bool};const le=C;var ie=o(7219),se=o.n(ie);const ue=(0,j.default)(y.Box)`
|
|
9
|
-
background: ${({theme:u})=>`linear-gradient(180deg, rgba(234, 234, 239, 0) 0%, ${u.colors.neutral150} 100%)`};
|
|
10
|
-
opacity: 0.33;
|
|
11
|
-
`,ce=()=>r.createElement(i.GridLayout,null,Array(12).fill(null).map((u,d)=>r.createElement(ue,{key:`empty-plugin-card-${d}`,height:"234px",hasRadius:!0}))),z=({content:u})=>r.createElement(y.Box,{position:"relative"},r.createElement(ce,null),r.createElement(y.Box,{position:"absolute",top:11,width:"100%"},r.createElement(S.Flex,{alignItems:"center",justifyContent:"center",direction:"column"},r.createElement(B.Icon,{as:se(),color:"",width:"160px",height:"88px"}),r.createElement(y.Box,{paddingTop:6},r.createElement(O.Typography,{variant:"delta",as:"p",textColor:"neutral600"},u)))));z.propTypes={content:f().string.isRequired};var de=o(13316),pe=o.n(de);const H=({isOnline:u})=>{const{formatMessage:d}=(0,s.useIntl)(),{trackUsage:p}=(0,t.useTracking)();return r.createElement(i.HeaderLayout,{title:d({id:"global.marketplace",defaultMessage:"Marketplace"}),subtitle:d({id:"admin.pages.MarketPlacePage.subtitle",defaultMessage:"Get more out of Strapi"}),primaryAction:u&&r.createElement(I.LinkButton,{startIcon:r.createElement(pe(),null),variant:"tertiary",href:"https://market.strapi.io/submit-plugin",onClick:()=>p("didSubmitPlugin"),isExternal:!0},d({id:"admin.pages.MarketPlacePage.submit.plugin.link",defaultMessage:"Submit your plugin"}))})},A=H;H.propTypes={isOnline:f().bool.isRequired};var fe=o(16558),ge=(u,d,p)=>new Promise((M,m)=>{var P=v=>{try{b(p.next(v))}catch(x){m(x)}},k=v=>{try{b(p.throw(v))}catch(x){m(x)}},b=v=>v.done?M(v.value):Promise.resolve(v.value).then(P,k);b((p=p.apply(u,d)).next())});const me=()=>ge(void 0,null,function*(){const{data:u}=yield fe.be.get("/admin/information");return u});var ve=o(60799),he=o(43653),ye=o.n(he),Pe=Object.defineProperty,be=Object.defineProperties,Ee=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,Me=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable,U=(u,d,p)=>d in u?Pe(u,d,{enumerable:!0,configurable:!0,writable:!0,value:p}):u[d]=p,Oe=(u,d)=>{for(var p in d||(d={}))Me.call(d,p)&&U(u,p,d[p]);if(D)for(var p of D(d))xe.call(d,p)&&U(u,p,d[p]);return u},Se=(u,d)=>be(u,Ee(d)),ke=(u,d,p)=>new Promise((M,m)=>{var P=v=>{try{b(p.next(v))}catch(x){m(x)}},k=v=>{try{b(p.throw(v))}catch(x){m(x)}},b=v=>v.done?M(v.value):Promise.resolve(v.value).then(P,k);b((p=p.apply(u,d)).next())});const je="https://market-api.strapi.io",we=()=>ke(void 0,null,function*(){const{data:u}=yield ye().get(`${je}/plugins`);return Se(Oe({},u),{data:u.data.filter(p=>p.attributes.strapiCompatibility==="v4")})}),Re=u=>{const d=(0,t.useNotification)();return(0,n.useQuery)("list-marketplace-plugins",()=>we(),{onSuccess:()=>{u&&u()},onError:()=>{d({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})};var Te=o(2805),Be=o(72661);const Ce=()=>{const u=typeof navigator!="undefined"&&typeof navigator.onLine=="boolean"?navigator.onLine:!0,[d,p]=(0,r.useState)(u),M=()=>p(!0),m=()=>p(!1);return(0,r.useEffect)(()=>(window.addEventListener("online",M),window.addEventListener("offline",m),()=>{window.removeEventListener("online",M),window.removeEventListener("offline",m)}),[]),d};var Ie=o(33533),Le=o.n(Ie);const Fe=()=>{const{formatMessage:u}=(0,s.useIntl)(),{trackUsage:d}=(0,t.useTracking)();return r.createElement("a",{href:"https://strapi.canny.io/plugin-requests",target:"_blank",rel:"noopener noreferrer nofollow",style:{textDecoration:"none"},onClick:()=>d("didMissMarketplacePlugin")},r.createElement(t.ContentBox,{title:u({id:"admin.pages.MarketPlacePage.missingPlugin.title",defaultMessage:"Documentation"}),subtitle:u({id:"admin.pages.MarketPlacePage.missingPlugin.description",defaultMessage:"Tell us what plugin you are looking for and we'll let our community plugin developers know in case they are in search for inspiration!"}),icon:r.createElement(Le(),null),iconBackground:"alternative100",endAction:r.createElement(B.Icon,{as:F(),color:"neutral600",width:3,height:3,marginLeft:2})}))},Ne=(u,d)=>(0,e.ZP)(u,d,{keys:[{threshold:e.ZP.rankings.WORD_STARTS_WITH,key:"attributes.name"},{threshold:e.ZP.rankings.WORD_STARTS_WITH,key:"attributes.description"}]}),G=()=>{const{formatMessage:u}=(0,s.useIntl)(),{trackUsage:d}=(0,t.useTracking)(),{notifyStatus:p}=(0,T.useNotifyAT)(),M=(0,r.useRef)(d),m=(0,t.useNotification)(),[P,k]=(0,r.useState)(""),{autoReload:b}=(0,t.useAppInfos)(),v=Ce();(0,t.useFocusWhenNavigate)();const x=u({id:"global.marketplace",defaultMessage:"Marketplace"}),He=()=>{p(u({id:"app.utils.notify.data-loaded",defaultMessage:"The {target} has loaded"},{target:x}))},{status:W,data:Ae}=Re(He),{status:V,data:De}=(0,ve.Z)(),{data:Ue,status:$}=(0,n.useQuery)("app-information",me,{onError:()=>{m({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}}),Ge=[W,V,$].includes("loading"),We=[W,V,$].includes("error");if((0,r.useEffect)(()=>{M.current("didGoToMarketplace")},[]),(0,r.useEffect)(()=>{b||m({type:"info",message:{id:"admin.pages.MarketPlacePage.production",defaultMessage:"Manage plugins from the development environment"},blockTransition:!0})},[m,b]),!v)return r.createElement(i.Layout,null,r.createElement(c.Main,null,r.createElement(A,{isOnline:v}),r.createElement(S.Flex,{width:"100%",direction:"column",alignItems:"center",justifyContent:"center",style:{paddingTop:"120px"}},r.createElement(y.Box,{paddingBottom:2},r.createElement(O.Typography,{textColor:"neutral700",variant:"alpha"},u({id:"admin.pages.MarketPlacePage.offline.title",defaultMessage:"You are offline"}))),r.createElement(y.Box,{paddingBottom:6},r.createElement(O.Typography,{textColor:"neutral700",variant:"epsilon"},u({id:"admin.pages.MarketPlacePage.offline.subtitle",defaultMessage:"You need to be connected to the Internet to access Strapi Market."}))),r.createElement("img",{src:Be,alt:"offline",style:{width:"88px",height:"88px"}}))));if(We)return r.createElement(i.Layout,null,r.createElement(i.ContentLayout,null,r.createElement(y.Box,{paddingTop:8},r.createElement(t.AnErrorOccurred,null))));if(Ge)return r.createElement(i.Layout,null,r.createElement(c.Main,{"aria-busy":!0},r.createElement(t.LoadingIndicatorPage,null)));const Z=Ne(Ae.data,P),Ve=De.plugins.map(w=>w.packageName);return r.createElement(i.Layout,null,r.createElement(c.Main,null,r.createElement(l.Helmet,{title:u({id:"admin.pages.MarketPlacePage.helmet",defaultMessage:"Marketplace - Plugins"})}),r.createElement(A,{isOnline:v}),r.createElement(i.ContentLayout,null,r.createElement(y.Box,{width:"25%",paddingBottom:4},r.createElement(g.Searchbar,{name:"searchbar",onClear:()=>k(""),value:P,onChange:w=>k(w.target.value),clearLabel:u({id:"admin.pages.MarketPlacePage.search.clear",defaultMessage:"Clear the plugin search"}),placeholder:u({id:"admin.pages.MarketPlacePage.search.placeholder",defaultMessage:"Search for a plugin"})},u({id:"admin.pages.MarketPlacePage.search.placeholder",defaultMessage:"Search for a plugin"}))),P.length>0&&!Z.length?r.createElement(z,{content:u({id:"admin.pages.MarketPlacePage.search.empty",defaultMessage:'No result for "{target}"'},{target:P})}):r.createElement(a.Grid,{gap:4},Z.map(w=>r.createElement(a.GridItem,{col:4,s:6,xs:12,style:{height:"100%"},key:w.id},r.createElement(le,{plugin:w,installedPluginNames:Ve,useYarn:Ue.data.useYarn,isInDevelopmentMode:b})))),r.createElement(y.Box,{paddingTop:7},r.createElement(Fe,null)))))},ze=()=>r.createElement(t.CheckPagePermissions,{permissions:Te.Z.marketplace.main},r.createElement(G,null))},51574:function(h,E,o){(function(r,s){h.exports=s(o(32735))})(this,function(r){return function(s){var l={};function n(e){if(l[e])return l[e].exports;var t=l[e]={i:e,l:!1,exports:{}};return s[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=s,n.c=l,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e=="object"&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&typeof e!="string")for(var i in e)n.d(a,i,function(c){return e[c]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=25)}({0:function(s,l){s.exports=r},25:function(s,l,n){"use strict";n.r(l);var e=n(0);function t(){return(t=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var c=arguments[i];for(var g in c)Object.prototype.hasOwnProperty.call(c,g)&&(a[g]=c[g])}return a}).apply(this,arguments)}l.default=function(a){return e.createElement("svg",t({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12zm-1.438-11.066L16.158 7.5 18 9.245l-7.438 7.18-4.462-4.1 1.84-1.745 2.622 2.354z",fill:"#212134"}))}}})})},74382:function(h,E,o){(function(r,s){h.exports=s(o(32735))})(this,function(r){return function(s){var l={};function n(e){if(l[e])return l[e].exports;var t=l[e]={i:e,l:!1,exports:{}};return s[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=s,n.c=l,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e=="object"&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&typeof e!="string")for(var i in e)n.d(a,i,function(c){return e[c]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=56)}({0:function(s,l){s.exports=r},56:function(s,l,n){"use strict";n.r(l);var e=n(0);function t(){return(t=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var c=arguments[i];for(var g in c)Object.prototype.hasOwnProperty.call(c,g)&&(a[g]=c[g])}return a}).apply(this,arguments)}l.default=function(a){return e.createElement("svg",t({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),e.createElement("path",{d:"M1.056 24h15.906c.583 0 1.056-.473 1.056-1.056V7.028c0-.583-.473-1.056-1.056-1.056H1.056C.473 5.972 0 6.445 0 7.028v15.916C0 23.527.473 24 1.056 24z",fill:"#212134"}),e.createElement("path",{d:"M8.094 2.111h13.795v13.795h-1.127v2.112h2.182A1.056 1.056 0 0024 16.962V1.056A1.056 1.056 0 0022.944 0H7.038a1.056 1.056 0 00-1.056 1.056v2.252h2.112V2.11z",fill:"#212134"}))}}})})},7219:function(h,E,o){(function(r,s){h.exports=s(o(32735))})(this,function(r){return function(s){var l={};function n(e){if(l[e])return l[e].exports;var t=l[e]={i:e,l:!1,exports:{}};return s[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=s,n.c=l,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e=="object"&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&typeof e!="string")for(var i in e)n.d(a,i,function(c){return e[c]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=63)}({0:function(s,l){s.exports=r},63:function(s,l,n){"use strict";n.r(l);var e=n(0);function t(){return(t=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var c=arguments[i];for(var g in c)Object.prototype.hasOwnProperty.call(c,g)&&(a[g]=c[g])}return a}).apply(this,arguments)}l.default=function(a){return e.createElement("svg",t({width:"1em",height:"1em",viewBox:"0 0 216 120",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),e.createElement("g",{opacity:.84,clipPath:"url(#EmptyDocuments_svg__clip0_1142_57509)"},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M189.25 19.646a7.583 7.583 0 010 15.166h-43.333a7.583 7.583 0 010 15.167h23.833a7.583 7.583 0 010 15.167h-11.022c-5.28 0-9.561 3.395-9.561 7.583 0 1.956 1.063 3.782 3.19 5.48 2.017 1.608 4.824 1.817 7.064 3.096a7.583 7.583 0 01-3.754 14.174H65.75a7.583 7.583 0 010-15.166H23.5a7.583 7.583 0 110-15.167h43.333a7.583 7.583 0 100-15.167H39.75a7.583 7.583 0 110-15.166h43.333a7.583 7.583 0 010-15.167H189.25zm0 30.333a7.583 7.583 0 110 15.166 7.583 7.583 0 010-15.166z",fill:"#D9D8FF",fillOpacity:.8}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M132.561 19.646l10.077 73.496.906 7.374a4.334 4.334 0 01-3.773 4.829l-63.44 7.789a4.333 4.333 0 01-4.83-3.772l-9.767-79.547a2.166 2.166 0 011.91-2.417l5.262-.59 63.655-7.162zM73.162 26.33l4.97-.557-4.97.557z",fill:"#fff"}),e.createElement("path",{d:"M73.162 26.33l4.97-.557m54.429-6.127l10.077 73.496.906 7.374a4.334 4.334 0 01-3.773 4.829l-63.44 7.789a4.333 4.333 0 01-4.83-3.772l-9.767-79.547a2.166 2.166 0 011.91-2.417l5.262-.59 63.655-7.162z",stroke:"#7B79FF",strokeWidth:2.5}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M129.818 24.27l9.122 66.608.82 6.682c.264 2.153-1.246 4.11-3.373 4.371l-56.812 6.976c-2.127.261-4.066-1.272-4.33-3.425l-8.83-71.908a2.167 2.167 0 011.887-2.415l7.028-.863",fill:"#F0F0FF"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M135.331 5.833H85.978a2.97 2.97 0 00-2.107.873A2.97 2.97 0 0083 8.813v82.333c0 .823.333 1.567.872 2.106a2.97 2.97 0 002.107.873h63.917a2.97 2.97 0 002.106-.873 2.97 2.97 0 00.873-2.106V23.367a2.98 2.98 0 00-.873-2.107L137.437 6.705a2.98 2.98 0 00-2.106-.872z",fill:"#fff",stroke:"#7B79FF",strokeWidth:2.5}),e.createElement("path",{d:"M135.811 7.082v12.564a3.25 3.25 0 003.25 3.25h8.595M94.644 78.146h28.167m-28.167-55.25h28.167-28.167zm0 13h46.584-46.584zm0 14.083h46.584-46.584zm0 14.084h46.584-46.584z",stroke:"#7B79FF",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round"})),e.createElement("defs",null,e.createElement("clipPath",{id:"EmptyDocuments_svg__clip0_1142_57509"},e.createElement("path",{fill:"#fff",d:"M0 0h216v120H0z"}))))}}})})},74885:function(h,E,o){(function(r,s){h.exports=s(o(32735))})(this,function(r){return function(s){var l={};function n(e){if(l[e])return l[e].exports;var t=l[e]={i:e,l:!1,exports:{}};return s[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=s,n.c=l,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e=="object"&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&typeof e!="string")for(var i in e)n.d(a,i,function(c){return e[c]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=72)}({0:function(s,l){s.exports=r},72:function(s,l,n){"use strict";n.r(l);var e=n(0);function t(){return(t=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var c=arguments[i];for(var g in c)Object.prototype.hasOwnProperty.call(c,g)&&(a[g]=c[g])}return a}).apply(this,arguments)}l.default=function(a){return e.createElement("svg",t({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),e.createElement("path",{d:"M16.235 2.824a1.412 1.412 0 010-2.824h6.353C23.368 0 24 .633 24 1.412v6.353a1.412 1.412 0 01-2.823 0V4.82l-8.179 8.178a1.412 1.412 0 01-1.996-1.996l8.178-8.178h-2.945zm4.942 10.588a1.412 1.412 0 012.823 0v9.176c0 .78-.632 1.412-1.412 1.412H1.412C.632 24 0 23.368 0 22.588V1.412C0 .632.632 0 1.412 0h9.176a1.412 1.412 0 010 2.824H2.824v18.353h18.353v-7.765z",fill:"#32324D"}))}}})})},33533:function(h,E,o){(function(r,s){h.exports=s(o(32735))})(this,function(r){return function(s){var l={};function n(e){if(l[e])return l[e].exports;var t=l[e]={i:e,l:!1,exports:{}};return s[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=s,n.c=l,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e=="object"&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&typeof e!="string")for(var i in e)n.d(a,i,function(c){return e[c]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=86)}({0:function(s,l){s.exports=r},86:function(s,l,n){"use strict";n.r(l);var e=n(0);function t(){return(t=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var c=arguments[i];for(var g in c)Object.prototype.hasOwnProperty.call(c,g)&&(a[g]=c[g])}return a}).apply(this,arguments)}l.default=function(a){return e.createElement("svg",t({width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),e.createElement("path",{d:"M0 4a4 4 0 014-4h24a4 4 0 014 4v24a4 4 0 01-4 4H4a4 4 0 01-4-4V4z",fill:"#AC73E6"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.027 13.839c-3.19-.836-6.305-1.064-10.18-.608-1.215.152-1.063 1.975.076 2.203.304.836.456 2.355.912 3.267.987 2.279 5.622 1.975 7.369.835 1.14-.683 1.443-2.279 1.9-3.494.227-.684 1.595-.684 1.822 0 .38 1.215.76 2.81 1.9 3.494 1.747 1.14 6.381 1.444 7.369-.835.456-.912.607-2.431.911-3.267 1.14-.228 1.216-2.051.076-2.203-3.874-.456-6.989-.228-10.18.608-.455.075-1.519.075-1.975 0z",fill:"#fff"}))}}})})},13316:function(h,E,o){(function(r,s){h.exports=s(o(32735))})(this,function(r){return function(s){var l={};function n(e){if(l[e])return l[e].exports;var t=l[e]={i:e,l:!1,exports:{}};return s[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=s,n.c=l,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e=="object"&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&typeof e!="string")for(var i in e)n.d(a,i,function(c){return e[c]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=187)}({0:function(s,l){s.exports=r},187:function(s,l,n){"use strict";n.r(l);var e=n(0);function t(){return(t=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var c=arguments[i];for(var g in c)Object.prototype.hasOwnProperty.call(c,g)&&(a[g]=c[g])}return a}).apply(this,arguments)}l.default=function(a){return e.createElement("svg",t({width:"1em",height:"1em",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.571 18.272H10.43v-8.47H2.487a.2.2 0 01-.14-.343L11.858.058a.2.2 0 01.282 0l9.513 9.4a.2.2 0 01-.14.343H13.57v8.47zM2.2 21.095a.2.2 0 00-.2.2v2.424c0 .11.09.2.2.2h19.6a.2.2 0 00.2-.2v-2.424a.2.2 0 00-.2-.2H2.2z",fill:"#212134"}))}}})})},77016:(h,E,o)=>{"use strict";h.exports=o.p+"90f49a385afb000fb1d4.svg"},72661:(h,E,o)=>{"use strict";h.exports=o.p+"a6b842e0b6d2b61135d1.svg"}}]);
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5895],{95291:(X,T,a)=>{a.r(T),a.d(T,{SettingsPage:()=>Se,default:()=>Ve});var e=a(32735),v=a(10938),r=a(5141),j=a(11856),W=a(5636),ye=a(99357),ve=a(41072),ne=a(13271),Ie=a(16540),$=a(9808),I=a(78330),b=a(95602),se=a(90662),oe=a(14983),V=a(74885),U=a.n(V);const We=()=>{const{formatMessage:y}=(0,W.useIntl)();(0,v.useFocusWhenNavigate)();const m=(0,v.useAppInfos)(),{shouldUpdateStrapi:g,latestStrapiReleaseTag:f,strapiVersion:d}=m,p=m.communityEdition?"app.components.UpgradePlanModal.text-ce":"app.components.UpgradePlanModal.text-ee";return e.createElement(j.Layout,null,e.createElement(v.SettingsPageTitle,{name:"Application"}),e.createElement(Ie.Main,null,e.createElement(j.HeaderLayout,{title:y({id:"Settings.application.title",defaultMessage:"Overview"}),subtitle:y({id:"Settings.application.description",defaultMessage:"Administration panel\u2019s global information"})}),e.createElement(j.ContentLayout,null,e.createElement($.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",paddingTop:7,paddingBottom:7,paddingRight:6,paddingLeft:6},e.createElement(se.Stack,{spacing:5},e.createElement(b.Typography,{variant:"delta",as:"h3"},y({id:"global.details",defaultMessage:"Details"})),e.createElement(I.Grid,{paddingTop:1},e.createElement(I.GridItem,{col:6,s:12},e.createElement(b.Typography,{variant:"sigma",textColor:"neutral600"},y({id:"Settings.application.strapiVersion",defaultMessage:"strapi version"})),e.createElement(b.Typography,{as:"p"},"v",d),e.createElement(oe.Link,{href:m.communityEdition?"https://discord.strapi.io":"https://support.strapi.io/support/home",isExternal:!0,endIcon:e.createElement(U(),null)},y({id:"Settings.application.get-help",defaultMessage:"Get help"}))),e.createElement(I.GridItem,{col:6,s:12},e.createElement(b.Typography,{variant:"sigma",textColor:"neutral600"},y({id:"Settings.application.edition-title",defaultMessage:"current plan"})),e.createElement(b.Typography,{as:"p"},y({id:p,defaultMessage:`${m.communityEdition?"Community Edition":"Enterprise Edition"}`})))),e.createElement(I.Grid,{paddingTop:1},e.createElement(I.GridItem,{col:6,s:12},g&&e.createElement(oe.Link,{href:`https://github.com/strapi/strapi/releases/tag/${f}`,isExternal:!0,endIcon:e.createElement(U(),null)},y({id:"Settings.application.link-upgrade",defaultMessage:"Upgrade your admin panel"}))),e.createElement(I.GridItem,{col:6,s:12},e.createElement(oe.Link,{href:"https://strapi.io/pricing-self-hosted",isExternal:!0,endIcon:e.createElement(U(),null)},y({id:"Settings.application.link-pricing",defaultMessage:"See all pricing plans"})))),e.createElement($.Box,{paddingTop:1},e.createElement(b.Typography,{variant:"sigma",textColor:"neutral600"},y({id:"Settings.application.node-version",defaultMessage:"node version"})),e.createElement(b.Typography,{as:"p"},m.nodeVersion)))))))};var Re=a(3704),de=a.n(Re);const je=y=>de()(y,g=>g.links).map(g=>(0,ne.ot)(g.Component,g.to,g.exact||!1)),Me=y=>y.filter(m=>!m.links.every(g=>g.isDisplayed===!1));var Te=a(85580),F=a(10613),ee=a(71745),x=a.n(ee),Fe=function(){return window&&window.strapi&&window.strapi.isEE?a(55315).Z:a(59811).Z}(),Ne=function(){return window&&window.strapi&&window.strapi.isEE?a(45936).Z:a(50898).Z}(),Be=[{Component:function(){return{default:Ne}},to:"/settings/roles",exact:!0},{Component:function(){return{default:Fe}},to:"/settings/roles/duplicate/:id",exact:!0},{Component:function(){return{default:Fe}},to:"/settings/roles/new",exact:!0},{Component:function(){var y=(0,F.Z)(x().mark(function g(){var f;return x().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(2544).then(a.bind(a,39199));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},g)}));function m(){return y.apply(this,arguments)}return m}(),to:"/settings/roles/:id",exact:!0},{Component:function(){var y=(0,F.Z)(x().mark(function g(){var f;return x().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(5199).then(a.bind(a,58812));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},g)}));function m(){return y.apply(this,arguments)}return m}(),to:"/settings/users",exact:!0},{Component:function(){var y=(0,F.Z)(x().mark(function g(){var f;return x().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(4263).then(a.bind(a,29527));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},g)}));function m(){return y.apply(this,arguments)}return m}(),to:"/settings/users/:id",exact:!0},{Component:function(){var y=(0,F.Z)(x().mark(function g(){var f;return x().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,12935));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},g)}));function m(){return y.apply(this,arguments)}return m}(),to:"/settings/webhooks/create",exact:!0},{Component:function(){var y=(0,F.Z)(x().mark(function g(){var f;return x().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,91849));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},g)}));function m(){return y.apply(this,arguments)}return m}(),to:"/settings/webhooks/:id",exact:!0},{Component:function(){var y=(0,F.Z)(x().mark(function g(){var f;return x().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(4121).then(a.bind(a,54999));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},g)}));function m(){return y.apply(this,arguments)}return m}(),to:"/settings/webhooks",exact:!0},{Component:function(){var y=(0,F.Z)(x().mark(function g(){var f;return x().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(8056).then(a.bind(a,69837));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},g)}));function m(){return y.apply(this,arguments)}return m}(),to:"/settings/api-tokens",exact:!0},{Component:function(){var y=(0,F.Z)(x().mark(function g(){var f;return x().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(4299).then(a.bind(a,10606));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},g)}));function m(){return y.apply(this,arguments)}return m}(),to:"/settings/api-tokens/create",exact:!0},{Component:function(){var y=(0,F.Z)(x().mark(function g(){var f;return x().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,a.e(92).then(a.bind(a,30421));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},g)}));function m(){return y.apply(this,arguments)}return m}(),to:"/settings/api-tokens/:id",exact:!0}];const Ae=Be;var De=function(){return window&&window.strapi&&window.strapi.isEE?a(10226).Z:a(50772).Z}();const we=[].concat((0,Te.Z)(De),(0,Te.Z)(Ae));var Ze=a(60216),Y=a.n(Ze),A=a(89420),z=Object.defineProperty,S=Object.defineProperties,ae=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,B=(y,m,g)=>m in y?z(y,m,{enumerable:!0,configurable:!0,writable:!0,value:g}):y[m]=g,w=(y,m)=>{for(var g in m||(m={}))K.call(m,g)&&B(y,g,m[g]);if(Q)for(var g of Q(m))J.call(m,g)&&B(y,g,m[g]);return y},H=(y,m)=>S(y,ae(m));const Ce=({menu:y})=>{const{formatMessage:m}=(0,W.useIntl)(),f=Me(y).map(p=>H(w({},p),{title:p.intlLabel,links:p.links.map(q=>H(w({},q),{title:q.intlLabel,name:q.id}))})),d=m({id:"global.settings",defaultMessage:"Settings"});return e.createElement(A.SubNav,{ariaLabel:d},e.createElement(A.SubNavHeader,{label:d}),e.createElement(A.SubNavSections,null,f.map(p=>e.createElement(A.SubNavSection,{key:p.id,label:m(p.intlLabel)},p.links.map(q=>e.createElement(A.SubNavLink,{as:r.NavLink,withBullet:q.hasNotification,to:q.to,key:q.id},m(q.intlLabel)))))))};Ce.propTypes={menu:Y().array.isRequired};const xe=Ce;function Se(){const{settingId:y}=(0,r.useParams)(),{settings:m}=(0,v.useStrapiApp)(),{formatMessage:g}=(0,W.useIntl)(),{isLoading:f,menu:d}=(0,ve.Te)(),p=(0,e.useMemo)(()=>(0,ne.WW)(we.map(({to:Z,Component:ie,exact:ue})=>(0,ne.ot)(ie,Z,ue))),[]),q=je(m);if(f)return e.createElement(v.LoadingIndicatorPage,null);if(!y)return e.createElement(r.Redirect,{to:"/settings/application-infos"});const $e=g({id:"global.settings",defaultMessage:"Settings"});return e.createElement(j.Layout,{sideNav:e.createElement(xe,{menu:d})},e.createElement(ye.Helmet,{title:$e}),e.createElement(r.Switch,null,e.createElement(r.Route,{path:"/settings/application-infos",component:We,exact:!0}),p,q))}const Ve=(0,e.memo)(Se)},59811:(X,T,a)=>{a.d(T,{Z:()=>j});var e=a(32735),v=a(5141);const j=()=>e.createElement(v.Redirect,{to:"/404"})},58622:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!0},27263:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!0},44404:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!0},43489:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!0},63857:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!0},23360:(X,T,a)=>{a.d(T,{Z:()=>$a});var e=a(32735),v=a(60216),r=a.n(v),j=a(10938),W=a(81700),ye=a(23973),ve=a.n(ye),ne=a(86834),Ie=a.n(ne),$=a(5636),I=a(9808),b=a(19615),se=a(98978),oe=a.n(se),V=a(20278),U=a(92423),ke=a.n(U),We=a(76844),Re=a.n(We),de=a(35980),k=a(19192),je=a(33795),re=a.n(je),Me=a(9086),Te=a.n(Me),F=a(41072),ee=a(66343),x=a.n(ee),Fe=a(44526);const Ne=b.default.div`
|
|
2
|
-
position: relative;
|
|
3
|
-
|
|
4
|
-
${({hasConditions:o,disabled:t,theme:n})=>o&&`
|
|
5
|
-
&:before {
|
|
6
|
-
content: '';
|
|
7
|
-
position: absolute;
|
|
8
|
-
top: -3px;
|
|
9
|
-
left: -10px;
|
|
10
|
-
width: 6px;
|
|
11
|
-
height: 6px;
|
|
12
|
-
border-radius: ${20/16}rem;;
|
|
13
|
-
background: ${t?n.colors.neutral100:n.colors.primary600};
|
|
14
|
-
}
|
|
15
|
-
`}
|
|
16
|
-
`,Be=({onClick:o,className:t,hasConditions:n,variant:s})=>{const{formatMessage:i}=(0,$.useIntl)();return e.createElement(Ne,{hasConditions:n,className:t},e.createElement(Fe.Button,{variant:s,startIcon:e.createElement(x(),null),onClick:o},i({id:"global.settings",defaultMessage:"Settings"})))};Be.defaultProps={className:null,hasConditions:!1,variant:"tertiary"},Be.propTypes={onClick:r().func.isRequired,className:r().string,hasConditions:r().bool,variant:r().string};const Ae=(0,b.default)(Be)``;var De=a(27635),we=a(90662),Ze=a(4122),Y=a(71657),A=a(95602),z=a(49415),S=a(81346),ae=a.n(S),Q=a(23940),K=a.n(Q),J=a(55656),B=a(85580),w=a(25716);const H=`${120/16}rem`,Ce=`${200/16}rem`,xe=`${53/16}rem`;function Se(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 Ve(o){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Se(Object(n),!0).forEach(function(s){(0,J.Z)(o,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):Se(Object(n)).forEach(function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(n,s))})}return o}var y=function(){return window&&window.strapi&&window.strapi.isEE?a(20628).Z:a(58622).Z}(),m=(0,b.default)(k.Flex).withConfig({displayName:"ActionRow__FlexWrapper",componentId:"sc-1bqpgdl-0"})(["height:",";"],xe),g=function(t){var n=t.arrayOfOptionsGroupedByCategory,s=t.isFormDisabled,i=t.isGrey,l=t.label,c=t.name,u=t.onChange,h=t.value,C=(0,$.useIntl)(),E=C.formatMessage,O=n.reduce(function(D,L){var P=(0,V.Z)(L,2),R=P[0],N=P[1],_={label:K()(R),children:N.map(function(me){return{label:me.displayName,value:me.id}})};return[].concat((0,B.Z)(D),[_])},[]),M=Object.values(h).map(function(D){return Object.entries(D).filter(function(L){var P=(0,V.Z)(L,2),R=P[1];return R}).map(function(L){var P=(0,V.Z)(L,1),R=P[0];return R})}).flat(),G=function(L){var P=(0,V.Z)(n,1),R=(0,V.Z)(P[0],2),N=R[1],_=N.reduce(function(me,le){return Ve((0,J.Z)({},le.id,L.includes(le.id)),me)},{});u(c,_)};return e.createElement(m,{as:"li",background:i?"neutral100":"neutral0"},e.createElement(k.Flex,{paddingLeft:6,style:{width:180}},e.createElement(A.Typography,{variant:"sigma",textColor:"neutral600"},E({id:"Settings.permissions.conditions.can",defaultMessage:"Can"}),"\xA0"),e.createElement(A.Typography,{variant:"sigma",title:l,textColor:"primary600",ellipsis:!0},E({id:"Settings.roles.form.permissions.".concat(l.toLowerCase()),defaultMessage:l})),e.createElement(A.Typography,{variant:"sigma",textColor:"neutral600"},"\xA0",E({id:"Settings.permissions.conditions.when",defaultMessage:"When"}))),e.createElement(I.Box,{style:{maxWidth:430,width:"100%"}},e.createElement(w.MultiSelectNested,{id:c,customizeContent:function(L){return"".concat(L.length," currently selected")},onChange:G,value:M,options:O,disabled:s||y})))};g.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 f=g;var d=a(92891);const p=(o,t)=>o.reduce((n,s)=>(n[s.id]=(0,d.get)(t,s.id,!1),n),{}),q=(o,t)=>o.reduce((n,s)=>{const[i,l]=s,c=p(l,t);return n[i]=c,n},{}),Z=(o,t,n)=>o.reduce((s,i)=>{const l=(0,d.get)(t,[...i.pathToConditionsObject,"conditions"],{}),c=q(n,l);return s[i.pathToConditionsObject.join("..")]=c,s},{});var ie=Object.defineProperty,ue=Object.getOwnPropertySymbols,Fn=Object.prototype.hasOwnProperty,Bn=Object.prototype.propertyIsEnumerable,vt=(o,t,n)=>t in o?ie(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Ct=(o,t)=>{for(var n in t||(t={}))Fn.call(t,n)&&vt(o,n,t[n]);if(ue)for(var n of ue(t))Bn.call(t,n)&&vt(o,n,t[n]);return o};const Et=({actions:o,headerBreadCrumbs:t,isFormDisabled:n,onClosed:s,onToggle:i})=>{const{formatMessage:l}=(0,$.useIntl)(),{availableConditions:c,modifiedData:u,onChangeConditions:h}=(0,F.$_)(),C=(0,e.useMemo)(()=>Object.entries(ae()(c,"category")),[c]),E=o.filter(({isDisplayed:P,hasSomeActionsSelected:R,hasAllActionsSelected:N})=>P&&(R||N)),O=(0,e.useMemo)(()=>Z(E,u,C),[E,u,C]),[M,G]=(0,e.useState)(O),D=(P,R)=>{G((0,z.default)(N=>{N[P]||(N[P]={}),N[P].default||(N[P].default={}),N[P].default=R}))},L=()=>{const P=Object.entries(M).reduce((R,N)=>{const[_,me]=N,le=Object.values(me).reduce((ge,Ee)=>Ct(Ct({},ge),Ee),{});return R[_]=le,R},{});h(P),i()};return e.createElement(Ze.ModalLayout,{labelledBy:"condition-modal-breadcrumbs",onClose:s},e.createElement(Ze.ModalHeader,null,e.createElement(Y.Breadcrumbs,{id:"condition-modal-breadcrumbs",label:t.join(", ")},t.map(P=>e.createElement(Y.Crumb,{key:P},K()(l({id:P,defaultMessage:P})))))),e.createElement(I.Box,{padding:8},e.createElement(we.Stack,{spacing:6},e.createElement(A.Typography,{variant:"beta",as:"h2"},l({id:"Settings.permissions.conditions.define-conditions",defaultMessage:"Define conditions"})),e.createElement(I.Box,null,e.createElement(De.Divider,null)),e.createElement(I.Box,null,E.length===0&&e.createElement(A.Typography,null,l({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,E.map(({actionId:P,label:R,pathToConditionsObject:N},_)=>{const me=N.join("..");return e.createElement(f,{key:P,arrayOfOptionsGroupedByCategory:C,label:R,isFormDisabled:n,isGrey:_%2===0,name:me,onChange:D,value:re()(M,me,{})})}))))),e.createElement(Ze.ModalFooter,{startActions:e.createElement(Fe.Button,{variant:"tertiary",onClick:i},l({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(Fe.Button,{onClick:L},l({id:"Settings.permissions.conditions.apply",defaultMessage:"Apply"}))}))};Et.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 bt=Et,tt=b.default.div`
|
|
17
|
-
width: ${H};
|
|
18
|
-
`,Pt=(0,b.default)(k.Flex)`
|
|
19
|
-
padding-right: ${({theme:o})=>o.spaces[2]};
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
flex: 1;
|
|
22
|
-
${({isCollapsable:o})=>o&&"cursor: pointer;"}
|
|
23
|
-
`;var wn=Object.defineProperty,Tt=Object.getOwnPropertySymbols,jn=Object.prototype.hasOwnProperty,Nn=Object.prototype.propertyIsEnumerable,At=(o,t,n)=>t in o?wn(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,kn=(o,t)=>{for(var n in t||(t={}))jn.call(t,n)&&At(o,n,t[n]);if(Tt)for(var n of Tt(t))Nn.call(t,n)&&At(o,n,t[n]);return o};const nt=({children:o,isCollapsable:t,isActive:n,isFormDisabled:s,label:i,onChange:l,onClick:c,checkboxName:u,someChecked:h,value:C})=>{const{formatMessage:E}=(0,$.useIntl)();return e.createElement(k.Flex,{alignItems:"center",paddingLeft:6,style:{width:Ce,flexShrink:0}},e.createElement(I.Box,{paddingRight:2},e.createElement(de.BaseCheckbox,{name:u,"aria-label":E({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:i}),disabled:s,onValueChange:O=>l({target:{name:u,value:O}}),indeterminate:h,value:C})),e.createElement(Pt,kn({title:i,alignItems:"center",isCollapsable:t},t&&{onClick:c,"aria-expanded":n,onKeyDown:({key:O})=>(O==="Enter"||O===" ")&&c(),tabIndex:0,role:"button"}),e.createElement(A.Typography,{fontWeight:n?"bold":"",textColor:n?"primary600":"neutral800",ellipsis:!0},K()(i)),o))};nt.defaultProps={children:null,checkboxName:"",onChange:()=>{},value:!1,someChecked:!1,isCollapsable:!1},nt.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 St=(0,e.memo)(nt),Ot=o=>(0,d.isObject)(o)?(0,d.flattenDeep)(Object.values(o).map(t=>(0,d.isObject)(t)?Ot(t):t)):[],ze=Ot,ot=o=>o?Object.keys(o).reduce((t,n)=>(n!=="conditions"&&(t[n]=o[n]),t),{}):null,Ke=o=>{const t=ot(o),n=ze(t);if(!n.length)return{hasAllActionsSelected:!1,hasSomeActionsSelected:!1};const s=n.every(l=>l),i=n.some(l=>l)&&!s;return{hasAllActionsSelected:s,hasSomeActionsSelected:i}},Wn=(o,t,n)=>o.map(({actionId:s,isDisplayed:i,applyToProperties:l,label:c})=>{if(!i)return{actionId:s,hasSomeActionsSelected:!1,isDisplayed:i};const u=[...n.split(".."),s],h=(0,d.isEmpty)(l)?[...u,"properties","enabled"]:u,C=h.join(".."),E=(0,d.get)(t,[...u,"conditions"],null),O=ze(E).some(L=>L);if((0,d.isEmpty)(l)){const L=(0,d.get)(t,h,!1);return{actionId:s,checkboxName:C,hasAllActionsSelected:L,hasConditions:O,hasSomeActionsSelected:L,isDisplayed:i,isParentCheckbox:!1,label:c,pathToConditionsObject:u}}const M=(0,d.get)(t,h,null),{hasAllActionsSelected:G,hasSomeActionsSelected:D}=Ke(M);return{actionId:s,checkboxName:C,hasAllActionsSelected:G,hasConditions:O,hasSomeActionsSelected:D,isDisplayed:i,isParentCheckbox:!0,label:c,pathToConditionsObject:u}});var $n=a(75120),Zn=a.n($n);const Je=(0,b.default)(Zn())`
|
|
24
|
-
display: none;
|
|
25
|
-
width: ${10/16}rem;
|
|
26
|
-
transform: rotate(${({$isActive:o})=>o?"180":"0"}deg);
|
|
27
|
-
margin-left: ${({theme:o})=>o.spaces[2]};
|
|
28
|
-
`,qe=o=>`
|
|
29
|
-
${A.Typography} {
|
|
30
|
-
color: ${o.colors.primary600};
|
|
31
|
-
font-weight: ${o.fontWeights.bold}
|
|
32
|
-
}
|
|
33
|
-
${Je} {
|
|
34
|
-
display: block;
|
|
35
|
-
path {
|
|
36
|
-
fill: ${o.colors.primary600}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
`;var Rt=function(){return window&&window.strapi&&window.strapi.isEE?a(95489).Z:a(27263).Z}(),Dt=function o(t,n){return`
|
|
40
|
-
`.concat(xt,` {
|
|
41
|
-
background-color: `).concat(t.colors.primary100,`;
|
|
42
|
-
color: `).concat(t.colors.primary600,`;
|
|
43
|
-
border-radius: `).concat(n?"2px 2px 0 0":"2px",`;
|
|
44
|
-
}
|
|
45
|
-
`).concat(It,` {
|
|
46
|
-
display: flex;
|
|
47
|
-
}
|
|
48
|
-
`).concat(Ae,` {
|
|
49
|
-
display: block;
|
|
50
|
-
}
|
|
51
|
-
&:hover {
|
|
52
|
-
`).concat(qe(t),`
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
&:focus-within {
|
|
56
|
-
`).concat(function(s){var i=s.theme,l=s.isActive;return o(i,l)},`
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
`)},xt=b.default.div.withConfig({displayName:"Collapse__Wrapper",componentId:"sc-132fji1-0"})(["flex:1;display:flex;align-items:center;height:",";background-color:",";border:1px solid transparent;"],xe,function(o){var t=o.isGrey,n=o.theme;return t?n.colors.neutral100:n.colors.neutral0}),Vn=b.default.div.withConfig({displayName:"Collapse__BoxWrapper",componentId:"sc-132fji1-1"})(["display:inline-flex;min-width:100%;","{display:none;}"," &:hover{","}"],Ae,function(o){var t=o.isActive,n=o.theme;return t&&Dt(n,t)},function(o){var t=o.theme,n=o.isActive;return Dt(t,n)}),Lt=(0,b.default)(k.Flex).withConfig({displayName:"Collapse__Cell",componentId:"sc-132fji1-2"})(["width:",";position:relative;"],H),It=(0,b.default)(I.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}),Mt=b.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}),Un=(0,b.default)(I.Box).withConfig({displayName:"Collapse__AbsoluteBox",componentId:"sc-132fji1-5"})(["position:absolute;right:9px;transform:translateY(10px);"]),Ft=function(t){var n=t.availableActions,s=t.isActive,i=t.isGrey,l=t.isFormDisabled,c=t.label,u=t.onClickToggle,h=t.pathToData,C=(0,e.useState)(!1),E=(0,V.Z)(C,2),O=E[0],M=E[1],G=(0,$.useIntl)(),D=G.formatMessage,L=(0,F.$_)(),P=L.modifiedData,R=L.onChangeParentCheckbox,N=L.onChangeSimpleCheckbox,_=function(){M(function(pe){return!pe})},me=function(){M(!1)},le=re()(P,h.split(".."),{}),ge=(0,e.useMemo)(function(){return Object.keys(le).reduce(function(te,pe){return te[pe]=Te()(le[pe],"conditions"),te},{})},[le]),Ee=Ke(ge),he=Ee.hasAllActionsSelected,He=Ee.hasSomeActionsSelected,ce=(0,e.useMemo)(function(){return Wn(n,P,h)},[n,P,h]),be=ce.some(function(te){var pe=te.hasConditions;return pe});return e.createElement(Vn,{isActive:s},e.createElement(xt,{isGrey:i},e.createElement(St,{isCollapsable:!0,isFormDisabled:l,label:c,checkboxName:h,onChange:R,onClick:u,someChecked:He,value:he,isActive:s},e.createElement(It,{paddingLeft:2},s?e.createElement(Re(),null):e.createElement(ke(),null))),e.createElement(k.Flex,{style:{flex:1}},ce.map(function(te){var pe=te.actionId,fe=te.hasConditions,Pe=te.hasAllActionsSelected,Oe=te.hasSomeActionsSelected,Ge=te.isDisplayed,Le=te.isParentCheckbox,Ue=te.checkboxName,Ye=te.label;return Ge?Le?e.createElement(Lt,{key:pe,justifyContent:"center",alignItems:"center"},fe&&e.createElement(Mt,null),e.createElement(de.BaseCheckbox,{disabled:l||Rt,name:Ue,"aria-label":D({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(Ye," ").concat(c)}),onValueChange:function(Xe){R({target:{name:Ue,value:Xe}})},indeterminate:Oe,value:Pe})):e.createElement(Lt,{key:pe,justifyContent:"center",alignItems:"center"},fe&&e.createElement(Mt,null),e.createElement(de.BaseCheckbox,{disabled:l||Rt,indeterminate:fe,name:Ue,onValueChange:function(Xe){N({target:{name:Ue,value:Xe}})},value:Pe})):e.createElement(tt,{key:pe})})),O&&e.createElement(bt,{headerBreadCrumbs:[c,"app.components.LeftMenuLinkContainer.settings"],actions:ce,isFormDisabled:l,onClosed:me,onToggle:_})),e.createElement(Un,null,e.createElement(Ae,{onClick:_,hasConditions:be})))};Ft.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 Gn=Ft,Kn=(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}}),Bt=(0,b.default)(k.Flex)`
|
|
60
|
-
width: ${H};
|
|
61
|
-
flex-shrink: 0;
|
|
62
|
-
`,Hn=(0,b.default)(k.Flex)`
|
|
63
|
-
width: ${Ce};
|
|
64
|
-
height: ${xe};
|
|
65
|
-
flex-shrink: 0;
|
|
66
|
-
`,wt=({headers:o,label:t})=>{const{formatMessage:n}=(0,$.useIntl)(),s=n({id:"Settings.roles.form.permission.property-label",defaultMessage:"{label} permissions"},{label:t});return e.createElement(k.Flex,null,e.createElement(Hn,{alignItems:"center",paddingLeft:6},e.createElement(A.Typography,{variant:"sigma",textColor:"neutral500"},s)),o.map(i=>i.isActionRelatedToCurrentProperty?e.createElement(Bt,{justifyContent:"center",key:i.label},e.createElement(A.Typography,{variant:"sigma",textColor:"neutral500"},n({id:`Settings.roles.form.permissions.${i.label.toLowerCase()}`,defaultMessage:i.label}))):e.createElement(Bt,{key:i.label})))};wt.propTypes={headers:r().arrayOf(r().shape({label:r().string.isRequired,isActionRelatedToCurrentProperty:r().bool.isRequired})).isRequired,label:r().string.isRequired};const Xn=wt,zn=b.default.span`
|
|
67
|
-
color: ${({theme:o})=>o.colors.danger700};
|
|
68
|
-
padding-left: ${({theme:o})=>o.spaces[1]}px;
|
|
69
|
-
`,jt=()=>e.createElement(zn,null,"*");var Yn=Object.defineProperty,Qn=Object.defineProperties,Jn=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertySymbols,qn=Object.prototype.hasOwnProperty,_n=Object.prototype.propertyIsEnumerable,kt=(o,t,n)=>t in o?Yn(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,eo=(o,t)=>{for(var n in t||(t={}))qn.call(t,n)&&kt(o,n,t[n]);if(Nt)for(var n of Nt(t))_n.call(t,n)&&kt(o,n,t[n]);return o},to=(o,t)=>Qn(o,Jn(t));const no=(o,t)=>o.map(n=>{const s=Array.isArray(n.subjects)&&n.subjects.indexOf(t)!==-1;return to(eo({},n),{isDisplayed:s})});var oo=a(64106),ao=Object.defineProperty,Wt=Object.getOwnPropertySymbols,so=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable,$t=(o,t,n)=>t in o?ao(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,io=(o,t)=>{for(var n in t||(t={}))so.call(t,n)&&$t(o,n,t[n]);if(Wt)for(var n of Wt(t))ro.call(t,n)&&$t(o,n,t[n]);return o};const lo=(0,b.default)(I.Box)`
|
|
70
|
-
transform: translate(-4px, -12px);
|
|
71
|
-
|
|
72
|
-
&:before {
|
|
73
|
-
content: '';
|
|
74
|
-
width: ${4/16}rem;
|
|
75
|
-
height: ${12/16}rem;
|
|
76
|
-
background: ${({theme:o})=>o.colors.primary200};
|
|
77
|
-
display: block;
|
|
78
|
-
}
|
|
79
|
-
`,co=b.default.svg`
|
|
80
|
-
position: relative;
|
|
81
|
-
flex-shrink: 0;
|
|
82
|
-
transform: translate(-0.5px, -1px);
|
|
83
|
-
|
|
84
|
-
* {
|
|
85
|
-
fill: ${({theme:o,color:t})=>o.colors[t]};
|
|
86
|
-
}
|
|
87
|
-
`,at=o=>e.createElement(lo,null,e.createElement(co,io({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"})));at.defaultProps={fill:"primary200"},at.propTypes={fill:r().string};const uo=(0,e.memo)(at);var Zt=function(){return window&&window.strapi&&window.strapi.isEE?a(25684).Z:a(43489).Z}(),Vt=(0,b.default)(k.Flex).withConfig({displayName:"SubActionRow__Cell",componentId:"sc-7y8yzq-0"})(["width:",";position:relative;"],H),po=(0,b.default)(k.Flex).withConfig({displayName:"SubActionRow__RowWrapper",componentId:"sc-7y8yzq-1"})(["height:",";"],xe),mo=(0,b.default)(I.Box).withConfig({displayName:"SubActionRow__Wrapper",componentId:"sc-7y8yzq-2"})(["padding-left:","rem;"],31/16),go=(0,b.default)(I.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"}),fo=(0,b.default)(k.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&&`
|
|
88
|
-
`.concat(Je,` {
|
|
89
|
-
display: block;
|
|
90
|
-
color: `).concat(n.colors.neutral100,`;
|
|
91
|
-
}
|
|
92
|
-
&:hover {
|
|
93
|
-
`).concat(qe(n),`
|
|
94
|
-
}
|
|
95
|
-
`)},function(o){var t=o.isActive,n=o.theme;return t&&qe(n)}),ho=b.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}),Ut=function o(t){var n=t.childrenForm,s=t.isFormDisabled,i=t.recursiveLevel,l=t.pathToDataFromActionRow,c=t.propertyActions,u=t.parentName,h=t.propertyName,C=(0,$.useIntl)(),E=C.formatMessage,O=(0,F.$_)(),M=O.modifiedData,G=O.onChangeParentCheckbox,D=O.onChangeSimpleCheckbox,L=(0,e.useState)(null),P=(0,V.Z)(L,2),R=P[0],N=P[1],_=function(ge){N(function(Ee){return Ee===ge?null:ge})},me=(0,e.useMemo)(function(){return R?n.find(function(le){var ge=le.value;return ge===R}):null},[R,n]);return e.createElement(mo,null,e.createElement(ho,null),n.map(function(le,ge){var Ee=le.label,he=le.value,He=le.required,ce=le.children,be=ge+1<n.length,te=Array.isArray(ce),pe=R===he;return e.createElement(go,{key:he,isVisible:be},e.createElement(po,null,e.createElement(uo,{color:"primary200"}),e.createElement(k.Flex,{style:{flex:1}},e.createElement(fo,{level:i,isActive:pe,isCollapsable:te},e.createElement(Pt,(0,oo.Z)({alignItems:"center",isCollapsable:te},te&&{onClick:function(){return _(he)},"aria-expanded":pe,onKeyDown:function(Pe){var Oe=Pe.key;return(Oe==="Enter"||Oe===" ")&&_(he)},tabIndex:0,role:"button"},{title:Ee}),e.createElement(A.Typography,{ellipsis:!0},K()(Ee)),He&&e.createElement(jt,null),e.createElement(Je,{$isActive:pe}))),e.createElement(k.Flex,{style:{flex:1}},c.map(function(fe){var Pe=fe.actionId,Oe=fe.label,Ge=fe.isActionRelatedToCurrentProperty;if(!Ge)return e.createElement(tt,{key:Pe});var Le=[].concat((0,B.Z)(l.split("..")),[Pe,"properties",h],(0,B.Z)(u.split("..")),[he]),Ue=re()(M,Le,!1);if(!ce)return e.createElement(Vt,{key:Oe,justifyContent:"center",alignItems:"center"},e.createElement(de.BaseCheckbox,{disabled:s||Zt,name:Le.join(".."),"aria-label":E({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(u," ").concat(Ee," ").concat(Oe)}),onValueChange:function(_e){D({target:{name:Le.join(".."),value:_e}})},value:Ue}));var Ye=Ke(Ue),Qe=Ye.hasAllActionsSelected,Xe=Ye.hasSomeActionsSelected;return e.createElement(Vt,{key:Oe,justifyContent:"center",alignItems:"center"},e.createElement(de.BaseCheckbox,{key:Oe,disabled:s||Zt,name:Le.join(".."),"aria-label":E({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(u," ").concat(Ee," ").concat(Oe)}),onValueChange:function(_e){G({target:{name:Le.join(".."),value:_e}})},value:Qe,indeterminate:Xe}))})))),me&&pe&&e.createElement(I.Box,{paddingBottom:2},e.createElement(o,{isFormDisabled:s,parentName:"".concat(u,"..").concat(he),pathToDataFromActionRow:l,propertyActions:c,propertyName:h,recursiveLevel:i+1,childrenForm:me.children})))}))};Ut.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 yo=(0,e.memo)(Ut),vo=o=>o.reduce((n,s)=>(s.isActionRelatedToCurrentProperty&&n.push(s.actionId),n),[]),Co=(o,t,n,s,i)=>{const c=vo(o).reduce((u,h)=>{const C=[...n.split(".."),h,"properties",s,i],E=(0,d.get)(t,C,!1);return u[h]=E,u},{});return Ke(c)};var Gt=function(){return window&&window.strapi&&window.strapi.isEE?a(58630).Z:a(44404).Z}(),Kt=(0,b.default)(k.Flex).withConfig({displayName:"ActionRow__Cell",componentId:"sc-4agenc-0"})(["width:",";position:relative;"],H),Eo=(0,b.default)(k.Flex).withConfig({displayName:"ActionRow__Wrapper",componentId:"sc-4agenc-1"})(["height:",";flex:1;"," ",";"],xe,function(o){var t=o.isCollapsable,n=o.theme;return t&&`
|
|
96
|
-
`.concat(Je,` {
|
|
97
|
-
display: block;
|
|
98
|
-
color: `).concat(n.colors.neutral100,`;
|
|
99
|
-
}
|
|
100
|
-
&:hover {
|
|
101
|
-
`).concat(qe(n),`
|
|
102
|
-
}
|
|
103
|
-
`)},function(o){var t=o.isActive,n=o.theme;return t&&qe(n)}),st=function(t){var n=t.childrenForm,s=t.label,i=t.isFormDisabled,l=t.name,c=t.required,u=t.pathToData,h=t.propertyActions,C=t.propertyName,E=t.isOdd,O=(0,$.useIntl)(),M=O.formatMessage,G=(0,e.useState)(null),D=(0,V.Z)(G,2),L=D[0],P=D[1],R=(0,F.$_)(),N=R.modifiedData,_=R.onChangeCollectionTypeLeftActionRowCheckbox,me=R.onChangeParentCheckbox,le=R.onChangeSimpleCheckbox,ge=L===l,Ee=(0,e.useMemo)(function(){return Array.isArray(n)?n:[]},[n]),he=Ee.length>0,He=(0,e.useCallback)(function(){he&&P(function(fe){return fe===l?null:l})},[he,l]),ce=function(Pe){var Oe=Pe.target.value;_(u,C,l,Oe)},be=(0,e.useMemo)(function(){return Co(h,N,u,C,l)},[h,N,u,C,l]),te=be.hasAllActionsSelected,pe=be.hasSomeActionsSelected;return e.createElement(e.Fragment,null,e.createElement(Eo,{alignItems:"center",isCollapsable:he,isActive:ge,background:E?"neutral100":"neutral0"},e.createElement(k.Flex,null,e.createElement(St,{onChange:ce,onClick:He,isCollapsable:he,isFormDisabled:i,label:s,someChecked:pe,value:te,isActive:ge},c&&e.createElement(jt,null),e.createElement(Je,{$isActive:ge})),e.createElement(k.Flex,null,h.map(function(fe){var Pe=fe.label,Oe=fe.isActionRelatedToCurrentProperty,Ge=fe.actionId;if(!Oe)return e.createElement(tt,{key:Pe});var Le=[].concat((0,B.Z)(u.split("..")),[Ge,"properties",C,l]);if(!he){var Ue=re()(N,Le,!1);return e.createElement(Kt,{key:Ge,justifyContent:"center",alignItems:"center"},e.createElement(de.BaseCheckbox,{disabled:i||Gt,name:Le.join(".."),"aria-label":M({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(l," ").concat(Pe)}),onValueChange:function(yt){le({target:{name:Le.join(".."),value:yt}})},value:Ue}))}var Ye=re()(N,Le,{}),Qe=Ke(Ye),Xe=Qe.hasAllActionsSelected,ht=Qe.hasSomeActionsSelected;return e.createElement(Kt,{key:Pe,justifyContent:"center",alignItems:"center"},e.createElement(de.BaseCheckbox,{disabled:i||Gt,name:Le.join(".."),onValueChange:function(yt){me({target:{name:Le.join(".."),value:yt}})},"aria-label":M({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(l," ").concat(Pe)}),value:Xe,indeterminate:ht}))})))),ge&&e.createElement(yo,{childrenForm:Ee,isFormDisabled:i,parentName:l,pathToDataFromActionRow:u,propertyName:C,propertyActions:h,recursiveLevel:0}))};st.defaultProps={childrenForm:[],required:!1},st.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 bo=(0,e.memo)(st),Po=b.default.div`
|
|
104
|
-
display: inline-flex;
|
|
105
|
-
flex-direction: column;
|
|
106
|
-
min-width: 0;
|
|
107
|
-
`,Ht=({availableActions:o,childrenForm:t,isFormDisabled:n,label:s,pathToData:i,propertyName:l})=>{const c=(0,e.useMemo)(()=>Kn(o,l),[o,l]);return e.createElement(Po,null,e.createElement(Xn,{label:s,headers:c}),e.createElement(I.Box,null,t.map(({children:u,label:h,value:C,required:E},O)=>e.createElement(bo,{childrenForm:u,key:C,label:h,isFormDisabled:n,name:C,required:E,propertyActions:c,pathToData:i,propertyName:l,isOdd:O%2===0}))))};Ht.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 To=Ht,Ao=b.default.div`
|
|
108
|
-
flex-direction: column;
|
|
109
|
-
display: inline-flex;
|
|
110
|
-
min-width: 100%;
|
|
111
|
-
${({theme:o,isActive:t})=>t&&`border: 1px solid ${o.colors.primary600};`}
|
|
112
|
-
`,Xt=({allActions:o,contentTypeName:t,label:n,index:s,isActive:i,isFormDisabled:l,onClickToggleCollapse:c,pathToData:u,properties:h})=>{const C=(0,e.useCallback)(()=>{c(t)},[t,c]),E=(0,e.useMemo)(()=>no(o,t),[o,t]);return e.createElement(Ao,{isActive:i},e.createElement(Gn,{availableActions:E,isActive:i,isGrey:s%2===0,isFormDisabled:l,label:n,onClickToggle:C,pathToData:u}),i&&h.map(({label:O,value:M,children:G})=>e.createElement(To,{availableActions:E,childrenForm:G,isFormDisabled:l,label:O,pathToData:u,propertyName:M,key:M})))};Xt.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 So=Xt,rt=({actions:o,isFormDisabled:t,pathToData:n,subjects:s})=>{const[i,l]=(0,e.useState)(null),c=u=>{l(i===u?null:u)};return s.map(({uid:u,label:h,properties:C},E)=>e.createElement(So,{allActions:o,key:u,contentTypeName:u,label:h,isActive:i===u,isFormDisabled:t,index:E,onClickToggleCollapse:c,pathToData:`${n}..${u}`,properties:C}))};rt.defaultProps={actions:[],subjects:[]},rt.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 Oo=(0,e.memo)(rt),Ro=o=>o.filter(({subjects:t})=>t&&t.length);var Do=Object.defineProperty,zt=Object.getOwnPropertySymbols,xo=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,Yt=(o,t,n)=>t in o?Do(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Qt=(o,t)=>{for(var n in t||(t={}))xo.call(t,n)&&Yt(o,n,t[n]);if(zt)for(var n of zt(t))Lo.call(t,n)&&Yt(o,n,t[n]);return o};const Io=o=>o.map(({actionId:t})=>t),Mo=(o,t)=>o.reduce((n,s)=>(Object.keys(t).forEach(i=>{const l=(0,d.get)(t,[i,s],{}),c={[i]:ot(l)};n[s]?n[s]=Qt(Qt({},n[s]),c):n[s]=c}),n),{}),Fo=(o,t)=>{const n=Io(o),s=Mo(n,t);return Object.keys(s).reduce((l,c)=>(l[c]=Ke(s[c]),l),{})};var Bo=function(){return window&&window.strapi&&window.strapi.isEE?a(26891).Z:a(63857).Z}(),wo=(0,b.default)(we.Stack).withConfig({displayName:"GlobalActions__CenteredStack",componentId:"sc-1vxwsjr-0"})(["align-items:center;justify-content:center;width:",";flex-shrink:0;"],H),it=function(t){var n=t.actions,s=t.isFormDisabled,i=t.kind,l=(0,$.useIntl)(),c=l.formatMessage,u=(0,F.$_)(),h=u.modifiedData,C=u.onChangeCollectionTypeGlobalActionCheckbox,E=(0,e.useMemo)(function(){return Ro(n)},[n]),O=(0,e.useMemo)(function(){return Fo(E,h[i])},[h,E,i]);return e.createElement(I.Box,{paddingBottom:4,paddingTop:6,style:{paddingLeft:Ce}},e.createElement(we.Stack,{horizontal:!0,spacing:0},E.map(function(M){var G=M.label,D=M.actionId;return e.createElement(wo,{key:D,spacing:3},e.createElement(A.Typography,{variant:"sigma",textColor:"neutral500"},c({id:"Settings.roles.form.permissions.".concat(G.toLowerCase()),defaultMessage:G})),e.createElement(de.BaseCheckbox,{disabled:s||Bo,onValueChange:function(P){C(i,D,P)},name:D,"aria-label":c({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:c({id:"Settings.roles.form.permissions.".concat(G.toLowerCase()),defaultMessage:G})}),value:re()(O,[D,"hasAllActionsSelected"],!1),indeterminate:re()(O,[D,"hasSomeActionsSelected"],!1)}))})))};it.defaultProps={actions:[]},it.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 jo=(0,e.memo)(it),No=(0,b.default)(I.Box)`
|
|
113
|
-
overflow-x: auto;
|
|
114
|
-
`,Jt=({isFormDisabled:o,kind:t,layout:{actions:n,subjects:s}})=>{const i=oe()([...s],"label");return e.createElement(No,{background:"neutral0"},e.createElement(jo,{actions:n,kind:t,isFormDisabled:o}),e.createElement(Oo,{actions:n,isFormDisabled:o,pathToData:t,subjects:i}))};Jt.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 qt=(0,e.memo)(Jt);var ko=a(87951);const _t=({children:o,value:t})=>e.createElement(ko.$l.Provider,{value:t},o);_t.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 Wo=_t;var lt=a(12001),en=a(78330),tn=a(52111),$o=Object.defineProperty,Zo=Object.defineProperties,Vo=Object.getOwnPropertyDescriptors,nn=Object.getOwnPropertySymbols,Uo=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable,on=(o,t,n)=>t in o?$o(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Ko=(o,t)=>{for(var n in t||(t={}))Uo.call(t,n)&&on(o,n,t[n]);if(nn)for(var n of nn(t))Go.call(t,n)&&on(o,n,t[n]);return o},Ho=(o,t)=>Zo(o,Vo(t));const Xo=(o,t,n)=>o.map(s=>{const i=[...n,s.action,"properties","enabled"],l=(0,d.get)(t,i,!1),c=(0,d.get)(t,[...n,s.action,"conditions"],{}),u=ze(c).some(h=>h);return Ho(Ko({},s),{isDisplayed:l,checkboxName:i.join(".."),hasSomeActionsSelected:l,value:l,hasConditions:u,label:s.displayName,actionId:s.action,pathToConditionsObject:[...n,s.action]})}),zo=o=>{const t=Object.entries(o).reduce((s,i)=>{const[l,{conditions:c}]=i;return s[l]=c,s},{});return ze(t).some(s=>s)};var ct=function(){return window&&window.strapi&&window.strapi.isEE?a(96855).Z:a(44827).Z}(),Yo=b.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}),Qo=b.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&&`
|
|
115
|
-
&:before {
|
|
116
|
-
content: '';
|
|
117
|
-
position: absolute;
|
|
118
|
-
top: `.concat(-4/16,`rem;
|
|
119
|
-
left: `).concat(-8/16,`rem;
|
|
120
|
-
width: `).concat(6/16,`rem;
|
|
121
|
-
height: `).concat(6/16,`rem;
|
|
122
|
-
border-radius: `).concat(20/16,`rem;
|
|
123
|
-
background: `).concat(n?s.colors.neutral100:s.colors.primary600,`;
|
|
124
|
-
}
|
|
125
|
-
`)}),an=function(t){var n=t.categoryName,s=t.isFormDisabled,i=t.subCategoryName,l=t.actions,c=t.pathToData,u=(0,e.useState)(!1),h=(0,V.Z)(u,2),C=h[0],E=h[1],O=(0,F.$_)(),M=O.modifiedData,G=O.onChangeParentCheckbox,D=O.onChangeSimpleCheckbox,L=(0,$.useIntl)(),P=L.formatMessage,R=re()(M,c,{}),N=(0,e.useMemo)(function(){return Object.keys(R).reduce(function(ce,be){return ce[be]=ot(R[be]),ce},{})},[R]),_=Ke(N),me=_.hasAllActionsSelected,le=_.hasSomeActionsSelected,ge=function(){E(function(be){return!be})},Ee=function(){E(!1)},he=Xo(l,M,c),He=zo(re()(M,(0,B.Z)(c),{}));return e.createElement(e.Fragment,null,e.createElement(I.Box,null,e.createElement(k.Flex,{justifyContent:"space-between",alignItems:"center"},e.createElement(I.Box,{paddingRight:4},e.createElement(A.Typography,{variant:"sigma",textColor:"neutral600"},i)),e.createElement(Yo,null),e.createElement(I.Box,{paddingLeft:4},e.createElement(tn.Checkbox,{name:c.join(".."),disabled:s||ct,onValueChange:function(be){G({target:{name:c.join(".."),value:be}})},indeterminate:le,value:me},P({id:"app.utils.select-all",defaultMessage:"Select all"})))),e.createElement(k.Flex,{paddingTop:6,paddingBottom:6},e.createElement(en.Grid,{gap:2,style:{flex:1}},he.map(function(ce){var be=ce.checkboxName,te=ce.value,pe=ce.action,fe=ce.displayName,Pe=ce.hasConditions;return e.createElement(en.GridItem,{col:3,key:pe},e.createElement(Qo,{disabled:s||ct,hasConditions:Pe},e.createElement(tn.Checkbox,{name:be,disabled:s||ct,onValueChange:function(Ge){D({target:{name:be,value:Ge}})},value:te},fe)))})),e.createElement(Ae,{hasConditions:He,onClick:ge}))),C&&e.createElement(bt,{headerBreadCrumbs:[n,i],actions:he,isFormDisabled:s,onClosed:Ee,onToggle:ge}))};an.propTypes={actions:r().array.isRequired,categoryName:r().string.isRequired,isFormDisabled:r().bool.isRequired,subCategoryName:r().string.isRequired,pathToData:r().array.isRequired};const Jo=an,dt=({childrenForm:o,kind:t,name:n,isOpen:s,isFormDisabled:i,isWhite:l,onOpenCategory:c,pathToData:u})=>{const{formatMessage:h}=(0,$.useIntl)(),C=()=>{c(n)},E=(0,e.useMemo)(()=>n.split("::").pop(),[n]);return e.createElement(lt.Accordion,{expanded:s,onToggle:C,id:`accordion-${n}`,variant:l?"primary":"secondary"},e.createElement(lt.AccordionToggle,{title:K()(E),description:`${h({id:"Settings.permissions.category"},{category:E})} ${t==="plugins"?"plugin":t}`}),e.createElement(lt.AccordionContent,null,e.createElement(I.Box,{padding:6},o.map(({actions:O,subCategoryName:M,subCategoryId:G})=>e.createElement(Jo,{key:M,actions:O,categoryName:E,isFormDisabled:i,subCategoryName:M,pathToData:[...u,G]})))))};dt.defaultProps={},dt.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 qo=dt,sn=({isFormDisabled:o,kind:t,layout:n})=>{const[s,i]=(0,e.useState)(null),l=c=>{i(c===s?null:c)};return e.createElement(I.Box,{padding:6,background:"neutral0"},n.map(({category:c,categoryId:u,childrenForm:h},C)=>e.createElement(qo,{key:c,childrenForm:h,kind:t,isFormDisabled:o,isOpen:s===c,isWhite:C%2===1,name:c,onOpenCategory:l,pathToData:[t,u]})))};sn.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 rn=sn,ln=(o,t,n)=>o.find(s=>s.action===t&&s.subject===n);var _o=Object.defineProperty,ea=Object.defineProperties,ta=Object.getOwnPropertyDescriptors,cn=Object.getOwnPropertySymbols,na=Object.prototype.hasOwnProperty,oa=Object.prototype.propertyIsEnumerable,dn=(o,t,n)=>t in o?_o(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,un=(o,t)=>{for(var n in t||(t={}))na.call(t,n)&&dn(o,n,t[n]);if(cn)for(var n of cn(t))oa.call(t,n)&&dn(o,n,t[n]);return o},pn=(o,t)=>ea(o,ta(t));const mn=(o,t=[])=>o.reduce((n,s)=>(n[s.id]=t.indexOf(s.id)!==-1,n),{}),gn=({children:o},t,n="")=>o.reduce((s,i)=>{if(i.children)return pn(un({},s),{[i.value]:gn(i,t,`${n}${i.value}.`)});const l=t.indexOf(`${n}${i.value}`)!==-1;return s[i.value]=l,s},{}),aa=(o,t,n)=>o.reduce((s,i)=>{const l=t.properties.find(({value:c})=>c===i);if(l){const c=(0,d.get)(n,["properties",l.value],[]),u=gn(l,c);s.properties[i]=u}return s},{properties:{}}),sa=(o,t)=>t.reduce((n,s)=>{const i=o.find(({uid:l})=>l===s)||null;return i&&(n[s]=i),n},{}),fn=({subjects:o},t,n,s=[])=>t.reduce((i,l)=>{const c=l.subjects,u=sa(o,c);if((0,d.isEmpty)(u))return i;const h=Object.keys(u).reduce((C,E)=>{const{actionId:O,applyToProperties:M}=l,L=u[E].properties.map(({value:_})=>_).every(_=>(M||[]).indexOf(_)===-1),P=ln(s,O,E),R=mn(n,(0,d.get)(P,"conditions",[]));if((0,d.isEmpty)(M)||L)return(0,d.set)(C,[E,O],{properties:{enabled:P!==void 0},conditions:R}),C;const N=aa(M,u[E],P);return(0,d.set)(C,[E,O],pn(un({},N),{conditions:R})),C},{});return(0,d.merge)(i,h)},{}),ra=(o,t,n)=>o.reduce((s,i)=>{const l=ln(n,i.action,null);return s[i.action]={properties:{enabled:l!==void 0},conditions:mn(t,(0,d.get)(l,"conditions",[]))},s},{}),ia=(o,t,n)=>o.reduce((s,i)=>(s[i.subCategoryId]=ra(i.actions,t,n),s),{}),hn=(o,t,n=[])=>o.reduce((s,{categoryId:i,childrenForm:l})=>{const c=ia(l,t,n);return s[i]=c,s},{}),yn=o=>o.split(" ").join("-"),vn=(o,t)=>(0,d.chain)(o).groupBy(t).map((n,s)=>({category:s,categoryId:yn(s),childrenForm:(0,d.chain)(n).groupBy("subCategory").map((i,l)=>({subCategoryName:l,subCategoryId:yn(l),actions:i})).value()})).value(),la=(o,t)=>{const{conditions:n,sections:{collectionTypes:s,singleTypes:i,plugins:l,settings:c}}=o,u={collectionTypes:s,singleTypes:i,plugins:vn(l,"plugin"),settings:vn(c,"category")},h={collectionTypes:fn(s,s.actions||[],n,t),singleTypes:fn(i,i.actions||[],n,t),plugins:hn(u.plugins,n,t),settings:hn(u.settings,n,t)};return{initialData:h,modifiedData:h,layouts:u}};var ca=Object.defineProperty,da=Object.defineProperties,ua=Object.getOwnPropertyDescriptors,Cn=Object.getOwnPropertySymbols,pa=Object.prototype.hasOwnProperty,ma=Object.prototype.propertyIsEnumerable,En=(o,t,n)=>t in o?ca(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,ut=(o,t)=>{for(var n in t||(t={}))pa.call(t,n)&&En(o,n,t[n]);if(Cn)for(var n of Cn(t))ma.call(t,n)&&En(o,n,t[n]);return o},pt=(o,t)=>da(o,ua(t));const bn=o=>Object.keys(o).reduce((t,n)=>{const s=o[n];if((0,d.isObject)(s)&&!(0,d.has)(s,"conditions"))return pt(ut({},t),{[n]:bn(s)});if((0,d.isObject)(s)&&(0,d.has)(s,"conditions")&&!ze((0,d.omit)(s,"conditions")).some(l=>l)){const l=Object.keys(s.conditions).reduce((c,u)=>(c[u]=!1,c),{});return pt(ut({},t),{[n]:pt(ut({},s),{conditions:l})})}return t[n]=s,t},{}),mt=bn;var ga=Object.defineProperty,fa=Object.defineProperties,ha=Object.getOwnPropertyDescriptors,Pn=Object.getOwnPropertySymbols,ya=Object.prototype.hasOwnProperty,va=Object.prototype.propertyIsEnumerable,Tn=(o,t,n)=>t in o?ga(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Ca=(o,t)=>{for(var n in t||(t={}))ya.call(t,n)&&Tn(o,n,t[n]);if(Pn)for(var n of Pn(t))va.call(t,n)&&Tn(o,n,t[n]);return o},Ea=(o,t)=>fa(o,ha(t));const An=(o,t)=>Object.keys(o).reduce((n,s)=>{const i=o[s];return s==="conditions"?(n[s]=i,n):(0,d.isObject)(i)?Ea(Ca({},n),{[s]:An(i,t)}):(n[s]=t,n)},{}),et=An;var ba=Object.defineProperty,Pa=Object.defineProperties,Ta=Object.getOwnPropertyDescriptors,Sn=Object.getOwnPropertySymbols,Aa=Object.prototype.hasOwnProperty,Sa=Object.prototype.propertyIsEnumerable,On=(o,t,n)=>t in o?ba(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Oa=(o,t)=>{for(var n in t||(t={}))Aa.call(t,n)&&On(o,n,t[n]);if(Sn)for(var n of Sn(t))Sa.call(t,n)&&On(o,n,t[n]);return o},Ra=(o,t)=>Pa(o,Ta(t));const Da={initialData:{},modifiedData:{},layouts:{}},xa=(o,t)=>(0,z.default)(o,n=>{switch(t.type){case"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX":{const{collectionTypeKind:s,actionId:i,value:l}=t,c=["modifiedData",s];Object.keys((0,d.get)(o,c)).forEach(u=>{const h=(0,d.get)(o,[...c,u,i],void 0);if(h){let C=et(h,l);if(!l&&C.conditions){const E=et(C.conditions,!1);C=Ra(Oa({},C),{conditions:E})}(0,d.set)(n,[...c,u,i],C)}});break}case"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX":{const{pathToCollectionType:s,propertyName:i,rowName:l,value:c}=t;let u=(0,d.cloneDeep)(o.modifiedData);const h=s.split(".."),C=(0,d.get)(u,h,{});Object.keys(C).forEach(E=>{if((0,d.has)(C[E],`properties.${i}`)){const O=(0,d.get)(C,[E,"properties",i,l]),M=[...h,E,"properties",i,l];if(!(0,d.isObject)(O))(0,d.set)(u,M,c);else{const G=et(O,c);(0,d.set)(u,M,G)}}}),c||(u=mt(u)),(0,d.set)(n,"modifiedData",u);break}case"ON_CHANGE_CONDITIONS":{Object.entries(t.conditions).forEach(s=>{const[i,l]=s;(0,d.set)(n,["modifiedData",...i.split(".."),"conditions"],l)});break}case"ON_CHANGE_SIMPLE_CHECKBOX":{let s=(0,d.cloneDeep)(o.modifiedData);(0,d.set)(s,[...t.keys.split("..")],t.value),t.value||(s=mt(s)),(0,d.set)(n,"modifiedData",s);break}case"ON_CHANGE_TOGGLE_PARENT_CHECKBOX":{const{keys:s,value:i}=t,l=[...s.split("..")];let c=(0,d.cloneDeep)(o.modifiedData);const u=(0,d.get)(c,l,{}),h=et(u,i);(0,d.set)(c,l,h),i||(c=mt(c)),(0,d.set)(n,["modifiedData"],c);break}case"RESET_FORM":{n.modifiedData=o.initialData;break}case"SET_FORM_AFTER_SUBMIT":{n.initialData=o.modifiedData;break}default:return n}}),gt=o=>Object.entries(o).filter(([,t])=>t).map(([t])=>t),La=o=>{const[t,{conditions:n}]=o;return{action:t,subject:null,conditions:gt(n),properties:{}}},Ia=o=>Object.values(o).reduce((t,n)=>{const s=Object.entries(n).reduce((i,l)=>{const[,{properties:{enabled:c}}]=l;if(!c)return i;const u=La(l);return i.push(u),i},[]);return[...t,...s]},[]),Rn=o=>Object.values(o).reduce((t,n)=>{const s=Ia(n);return[...t,...s]},[]),Dn=(o,t="")=>Object.entries(o).reduce((n,s)=>{const[i,l]=s;return(0,d.isObject)(l)?[...n,...Dn(l,`${t}${i}.`)]:(l&&!(0,d.isObject)(l)&&n.push(`${t}${i}`),n)},[]),Ma=(o,t,{conditions:n,properties:s})=>Object.entries(s).reduce((i,l)=>{const[c,u]=l;return i.properties[c]=Dn(u),i},{action:o,subject:t,conditions:gt(n),properties:{}}),Fa=(o,t,{conditions:n})=>({action:o,subject:t,properties:{},conditions:gt(n)}),Ba=(o,t)=>Object.entries(t).reduce((s,i)=>{const[l,c]=i;if(!ze(c).some(C=>C))return s;if(!(0,d.has)(c,"properties.enabled")){const C=Ma(l,o,c);return[...s,C]}if(!c.properties.enabled)return s;const h=Fa(l,o,c);return s.push(h),s},[]),xn=o=>Object.entries(o).reduce((n,s)=>{const[i,l]=s,c=Ba(i,l);return[...n,...c]},[]),wa=o=>{const t=Rn(o.plugins),n=Rn(o.settings),s=xn(o.collectionTypes),i=xn(o.singleTypes);return[...t,...n,...s,...i]},ja=[{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 Na=Object.defineProperty,Ln=Object.getOwnPropertySymbols,ka=Object.prototype.hasOwnProperty,Wa=Object.prototype.propertyIsEnumerable,In=(o,t,n)=>t in o?Na(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Mn=(o,t)=>{for(var n in t||(t={}))ka.call(t,n)&&In(o,n,t[n]);if(Ln)for(var n of Ln(t))Wa.call(t,n)&&In(o,n,t[n]);return o};const ft=(0,e.forwardRef)(({layout:o,isFormDisabled:t,permissions:n},s)=>{const[{initialData:i,layouts:l,modifiedData:c},u]=(0,e.useReducer)(xa,Da,()=>la(o,n)),{formatMessage:h}=(0,$.useIntl)();(0,e.useImperativeHandle)(s,()=>({getPermissions:()=>{const D=(0,j.difference)(i.collectionTypes,c.collectionTypes),L=(0,j.difference)(i.singleTypes,c.singleTypes),P=Mn(Mn({},D),L);let R;return Ie()(P)?R=!1:R=Object.values(P).some(N=>Object.values(N).some(_=>ve()(_,"conditions"))),{permissionsToSend:wa(c),didUpdateConditions:R}},resetForm:()=>{u({type:"RESET_FORM"})},setFormAfterSubmit:()=>{u({type:"SET_FORM_AFTER_SUBMIT"})}}));const C=(D,L,P,R)=>{u({type:"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX",pathToCollectionType:D,propertyName:L,rowName:P,value:R})},E=(D,L,P)=>{u({type:"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX",collectionTypeKind:D,actionId:L,value:P})},O=D=>{u({type:"ON_CHANGE_CONDITIONS",conditions:D})},M=(0,e.useCallback)(({target:{name:D,value:L}})=>{u({type:"ON_CHANGE_SIMPLE_CHECKBOX",keys:D,value:L})},[]),G=(0,e.useCallback)(({target:{name:D,value:L}})=>{u({type:"ON_CHANGE_TOGGLE_PARENT_CHECKBOX",keys:D,value:L})},[]);return e.createElement(Wo,{value:{availableConditions:o.conditions,modifiedData:c,onChangeConditions:O,onChangeSimpleCheckbox:M,onChangeParentCheckbox:G,onChangeCollectionTypeLeftActionRowCheckbox:C,onChangeCollectionTypeGlobalActionCheckbox:E}},e.createElement(W.TabGroup,{id:"tabs",label:h({id:"Settings.permissions.users.tabs.label",defaultMessage:"Tabs Permissions"})},e.createElement(W.Tabs,null,ja.map(D=>e.createElement(W.Tab,{key:D.id},h({id:D.labelId,defaultMessage:D.defaultMessage})))),e.createElement(W.TabPanels,{style:{position:"relative"}},e.createElement(W.TabPanel,null,e.createElement(qt,{layout:l.collectionTypes,kind:"collectionTypes",isFormDisabled:t})),e.createElement(W.TabPanel,null,e.createElement(qt,{layout:l.singleTypes,kind:"singleTypes",isFormDisabled:t})),e.createElement(W.TabPanel,null,e.createElement(rn,{layout:l.plugins,kind:"plugins",isFormDisabled:t})),e.createElement(W.TabPanel,null,e.createElement(rn,{layout:l.settings,kind:"settings",isFormDisabled:t})))))});ft.defaultProps={permissions:[],layout:{conditions:[],sections:{collectionTypes:{},singleTypes:{actions:[]},settings:[],plugins:[]}}},ft.propTypes={layout:r().object,isFormDisabled:r().bool.isRequired,permissions:r().array};const $a=(0,e.memo)(ft)},44827:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!0},34829:(X,T,a)=>{a.d(T,{Z:()=>e});const e=()=>"todo empty role"},65497:(X,T,a)=>{a.d(T,{Z:()=>Te});var e=a(32735),v=a(60216),r=a.n(v),j=a(9808),W=a.n(j),ye=a(19192),ve=a.n(ye),ne=a(53214),Ie=a.n(ne),$=a(95602),I=a.n($),b=a(20763),se=a.n(b),oe=a(10938),V=a.n(oe),U=a(5636),ke=a.n(U),We=Object.defineProperty,Re=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,je=(F,ee,x)=>ee in F?We(F,ee,{enumerable:!0,configurable:!0,writable:!0,value:x}):F[ee]=x,re=(F,ee)=>{for(var x in ee||(ee={}))de.call(ee,x)&&je(F,x,ee[x]);if(Re)for(var x of Re(ee))k.call(ee,x)&&je(F,x,ee[x]);return F};const Me=({id:F,name:ee,description:x,usersCount:Fe,icons:Ne})=>{const{formatMessage:Be}=(0,U.useIntl)(),Ae=Be({id:"Roles.RoleRow.user-count",defaultMessage:"{number, plural, =0 {# user} one {# user} other {# users}}"},{number:Fe});return e.createElement(ne.Tr,re({key:F},(0,oe.onRowClick)({fn:Ne[1].onClick})),e.createElement(ne.Td,{maxWidth:(0,oe.pxToRem)(130)},e.createElement($.Typography,{ellipsis:!0,textColor:"neutral800"},ee)),e.createElement(ne.Td,{maxWidth:(0,oe.pxToRem)(250)},e.createElement($.Typography,{ellipsis:!0,textColor:"neutral800"},x)),e.createElement(ne.Td,null,e.createElement($.Typography,{textColor:"neutral800"},Ae)),e.createElement(ne.Td,null,e.createElement(ye.Flex,re({justifyContent:"flex-end"},oe.stopPropagation),Ne.map((De,we)=>De?e.createElement(j.Box,{key:De.label,paddingLeft:we===0?0:1},e.createElement(b.IconButton,{onClick:De.onClick,label:De.label,noBorder:!0,icon:De.icon})):null))))};Me.propTypes={id:r().number.isRequired,name:r().string.isRequired,description:r().string.isRequired,usersCount:r().number.isRequired,icons:r().array.isRequired};const Te=Me},50898:(X,T,a)=>{a.d(T,{Z:()=>y});var e=a(32735),v=a(10938),r=a(2805),j=a(58469),W=a(32365),ye=a.n(W),ve=a(22081),ne=a.n(ve),Ie=a(97642),$=a.n(Ie),I=a(74382),b=a.n(I),se=a(44526),oe=a(11856),V=a(53214),U=a(95602),ke=a(16540),We=a(28004),Re=a(5636),de=a(5141),k=a(65497),je=a(34829),re=a(60216),Me=a.n(re),Te=a(19615),F=a(64410),ee=a(54742),x=a(20763),Fe=a(61541),Ne=a(9808),Be=a(19192),Ae=a(90662),De=a(74885),we=a.n(De),Ze=a(55633),Y=a.n(Ze),A=a(378),z=a(19337);const S=Te.default.div`
|
|
126
|
-
position: absolute;
|
|
127
|
-
z-index: 3;
|
|
128
|
-
inset: 0;
|
|
129
|
-
background: ${({theme:m})=>(0,v.setHexOpacity)(m.colors.neutral800,.2)};
|
|
130
|
-
padding: 0 ${({theme:m})=>m.spaces[8]};
|
|
131
|
-
`,ae=(0,Te.default)(Be.Flex)`
|
|
132
|
-
position: relative;
|
|
133
|
-
max-width: ${830/16}rem;
|
|
134
|
-
height: ${415/16}rem;
|
|
135
|
-
margin: 0 auto;
|
|
136
|
-
overflow: hidden;
|
|
137
|
-
margin-top: 10%;
|
|
138
|
-
padding-left: ${64/16}rem;
|
|
139
|
-
|
|
140
|
-
img:first-of-type {
|
|
141
|
-
position: absolute;
|
|
142
|
-
right: 0;
|
|
143
|
-
top: 0;
|
|
144
|
-
max-width: ${360/16}rem;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
img:not(:first-of-type) {
|
|
148
|
-
width: ${130/16}rem;
|
|
149
|
-
margin-left: 12%;
|
|
150
|
-
margin-right: ${20/16}rem;
|
|
151
|
-
z-index: 0;
|
|
152
|
-
}
|
|
153
|
-
`,Q=(0,Te.default)(Ae.Stack)`
|
|
154
|
-
align-items: flex-start;
|
|
155
|
-
max-width: ${400/16}rem;
|
|
156
|
-
z-index: 0;
|
|
157
|
-
`,K=(0,Te.default)(Ne.Box)`
|
|
158
|
-
position: absolute;
|
|
159
|
-
right: ${({theme:m})=>m.spaces[4]};
|
|
160
|
-
top: ${({theme:m})=>m.spaces[4]};
|
|
161
|
-
`,J=({onClose:m,isOpen:g})=>{(0,v.useLockScroll)(g);const{formatMessage:f}=(0,Re.useIntl)();return g?e.createElement(F.Portal,null,e.createElement(S,{onClick:m},e.createElement(ee.FocusTrap,{onEscape:m},e.createElement(ae,{onClick:d=>d.stopPropagation(),"aria-labelledby":"upgrade-plan",background:"neutral0",hasRadius:!0},e.createElement("img",{src:A,alt:"air-balloon"}),e.createElement(K,null,e.createElement(x.IconButton,{onClick:m,"aria-label":"Close",icon:e.createElement(Y(),null)})),e.createElement(Q,{spacing:6},e.createElement(U.Typography,{fontWeight:"bold",textColor:"primary600"},f({id:"app.components.UpgradePlanModal.text-ce",defaultMessage:"COMMUNITY EDITION"})),e.createElement(Ae.Stack,{spacing:2},e.createElement(U.Typography,{variant:"alpha",as:"h2",id:"upgrade-plan"},f({id:"app.components.UpgradePlanModal.limit-reached",defaultMessage:"You have reached the limit"})),e.createElement(U.Typography,null,f({id:"app.components.UpgradePlanModal.text-power",defaultMessage:"Unlock the full power of Strapi by upgrading your plan to the Enterprise Edition"}))),e.createElement(Fe.LinkButton,{href:"https://strapi.io/pricing-self-hosted",isExternal:!0,endIcon:e.createElement(we(),null)},f({id:"app.components.UpgradePlanModal.button",defaultMessage:"Learn more"}))),e.createElement("img",{src:z,alt:"upgrade-arrow"}))))):null};J.propTypes={onClose:Me().func.isRequired,isOpen:Me().bool.isRequired};const B=J;var w=a(41072);const H=()=>{const{roles:m,isLoading:g}=(0,w.bF)(),f=(0,v.useQuery)(),d=decodeURIComponent(f.get("_q")||""),p=(0,j.ZP)(m,d,{keys:["name","description"]});return{isLoading:g,sortedRoles:p}},Ce=()=>{const{formatMessage:m}=(0,Re.useIntl)(),[g,f]=(0,e.useState)(!1),{trackUsage:d}=(0,v.useTracking)(),{push:p}=(0,de.useHistory)(),q=(0,e.useCallback)(ue=>{p(`/settings/roles/${ue}`)},[p]),$e=(0,e.useCallback)(()=>{f(ue=>!ue)},[]),Z=(0,e.useCallback)(()=>{d("didShowRBACUpgradeModal"),f(!0)},[d]),ie=(0,e.useCallback)(ue=>[{onClick:$e,label:m({id:"app.utils.duplicate",defaultMessage:"Duplicate"}),icon:e.createElement(b(),null)},{onClick:()=>q(ue.id),label:m({id:"app.utils.edit",defaultMessage:"Edit"}),icon:e.createElement($(),null)},{onClick:$e,label:m({id:"global.delete",defaultMessage:"Delete"}),icon:e.createElement(ne(),null)}],[m,$e,q]);return{isModalOpen:g,handleToggleModalForCreatingRole:Z,handleToggle:$e,getIcons:ie}},Se=()=>{const{formatMessage:m}=(0,Re.useIntl)();(0,v.useFocusWhenNavigate)();const{sortedRoles:g,isLoading:f}=H(),{isModalOpen:d,handleToggle:p,handleToggleModalForCreatingRole:q,getIcons:$e}=Ce(),Z=g.length+1,ie=5;return e.createElement(ke.Main,null,e.createElement(v.SettingsPageTitle,{name:"Roles"}),e.createElement(oe.HeaderLayout,{primaryAction:e.createElement(se.Button,{onClick:q,startIcon:e.createElement(ye(),null),size:"L"},m({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})),title:m({id:"global.roles",defaultMessage:"roles"}),subtitle:m({id:"Settings.roles.list.description",defaultMessage:"List of roles"})}),e.createElement(oe.ContentLayout,null,e.createElement(V.Table,{colCount:ie,rowCount:Z,footer:e.createElement(V.TFooter,{onClick:q,icon:e.createElement(ye(),null)},m({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"}))},e.createElement(V.Thead,null,e.createElement(V.Tr,null,e.createElement(V.Th,null,e.createElement(U.Typography,{variant:"sigma",textColor:"neutral600"},m({id:"global.name",defaultMessage:"Name"}))),e.createElement(V.Th,null,e.createElement(U.Typography,{variant:"sigma",textColor:"neutral600"},m({id:"global.description",defaultMessage:"Description"}))),e.createElement(V.Th,null,e.createElement(U.Typography,{variant:"sigma",textColor:"neutral600"},m({id:"global.users",defaultMessage:"Users"}))),e.createElement(V.Th,null,e.createElement(We.VisuallyHidden,null,m({id:"global.actions",defaultMessage:"Actions"}))))),e.createElement(V.Tbody,null,g==null?void 0:g.map(ue=>e.createElement(k.Z,{key:ue.id,id:ue.id,name:ue.name,description:ue.description,usersCount:ue.usersCount,icons:$e(ue)})))),!Z&&!f&&e.createElement(je.Z,null)),e.createElement(B,{isOpen:d,onClose:p}))},y=()=>e.createElement(v.CheckPagePermissions,{permissions:r.Z.settings.roles.main},e.createElement(Se,null))},50772:(X,T,a)=>{a.d(T,{Z:()=>v});const v=[]},55315:(X,T,a)=>{a.d(T,{Z:()=>Ze});var e=a(32735),v=a(53806),r=a.n(v),j=a(10938),W=a(9808),ye=a(44526),ve=a(11856),ne=a(78330),Ie=a(16540),$=a(19192),I=a(90662),b=a(95602),se=a(37178),oe=a(90353),V=a(59716),U=a.n(V),ke=a(83281),We=a(33795),Re=a.n(We),de=a(86834),k=a.n(de),je=a(5636),re=a(5141),Me=a(19615),Te=a(23360),F=a(41072),ee=a(2805),x=a(5173);const Ne=x.Ry().shape({name:x.Z_().required(j.translatedErrors.required),description:x.Z_().required(j.translatedErrors.required)});var Be=a(98399),Ae=(Y,A,z)=>new Promise((S,ae)=>{var Q=B=>{try{J(z.next(B))}catch(w){ae(w)}},K=B=>{try{J(z.throw(B))}catch(w){ae(w)}},J=B=>B.done?S(B.value):Promise.resolve(B.value).then(Q,K);J((z=z.apply(Y,A)).next())});const De=Me.default.div`
|
|
162
|
-
border: 1px solid ${({theme:Y})=>Y.colors.primary200};
|
|
163
|
-
background: ${({theme:Y})=>Y.colors.primary100};
|
|
164
|
-
padding: ${({theme:Y})=>`${Y.spaces[2]} ${Y.spaces[4]}`};
|
|
165
|
-
color: ${({theme:Y})=>Y.colors.primary600};
|
|
166
|
-
border-radius: ${({theme:Y})=>Y.borderRadius};
|
|
167
|
-
font-size: ${12/16}rem;
|
|
168
|
-
font-width: bold;
|
|
169
|
-
`,we=()=>{const Y=(0,j.useNotification)(),{lockApp:A,unlockApp:z}=(0,j.useOverlayBlocker)(),{formatMessage:S}=(0,je.useIntl)(),[ae,Q]=(0,e.useState)(!1),{replace:K}=(0,re.useHistory)(),J=(0,e.useRef)(),{trackUsage:B}=(0,j.useTracking)(),w=(0,re.useRouteMatch)("/settings/roles/duplicate/:id"),H=Re()(w,"params.id",null),{isLoading:Ce,data:xe}=(0,F.U_)(),{permissions:Se,isLoading:Ve}=(0,F.Dq)(H),y=g=>{A(),Q(!0),B(H?"willDuplicateRole":"willCreateNewRole"),Promise.resolve((0,j.request)("/admin/roles",{method:"POST",body:g})).then(f=>Ae(void 0,null,function*(){const{permissionsToSend:d}=J.current.getPermissions();return B(H?"didDuplicateRole":"didCreateNewRole"),f.data.id&&!k()(d)&&(yield(0,j.request)(`/admin/roles/${f.data.id}/permissions`,{method:"PUT",body:{permissions:d}})),f})).then(f=>{Q(!1),Y({type:"success",message:{id:"Settings.roles.created",defaultMessage:"created"}}),K(`/settings/roles/${f.data.id}`)}).catch(f=>{Be.error(f),Q(!1),Y({type:"warning",message:{id:"notification.error"}})}).finally(()=>{z()})},m=`${S({id:"Settings.roles.form.created",defaultMessage:"Created"})} ${r()().format("LL")}`;return e.createElement(Ie.Main,null,e.createElement(j.SettingsPageTitle,{name:"Roles"}),e.createElement(ke.Formik,{initialValues:{name:"",description:m},onSubmit:y,validationSchema:Ne,validateOnChange:!1},({handleSubmit:g,values:f,errors:d,handleReset:p,handleChange:q})=>e.createElement(j.Form,{noValidate:!0},e.createElement(e.Fragment,null,e.createElement(ve.HeaderLayout,{primaryAction:e.createElement(I.Stack,{horizontal:!0,spacing:2},e.createElement(ye.Button,{variant:"secondary",onClick:()=>{p(),J.current.resetForm()},size:"L"},S({id:"app.components.Button.reset",defaultMessage:"Reset"})),e.createElement(ye.Button,{onClick:g,loading:ae,size:"L"},S({id:"global.save",defaultMessage:"Save"}))),title:S({id:"Settings.roles.create.title",defaultMessage:"Create a role"}),subtitle:S({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(j.Link,{startIcon:e.createElement(U(),null),to:"/settings/roles"},S({id:"global.back",defaultMessage:"Back"}))}),e.createElement(ve.ContentLayout,null,e.createElement(I.Stack,{spacing:6},e.createElement(W.Box,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(I.Stack,{spacing:4},e.createElement($.Flex,{justifyContent:"space-between"},e.createElement(W.Box,null,e.createElement(W.Box,null,e.createElement(b.Typography,{fontWeight:"bold"},S({id:"global.details",defaultMessage:"Details"}))),e.createElement(W.Box,null,e.createElement(b.Typography,{variant:"pi",textColor:"neutral600"},S({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(De,null,S({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:0}))),e.createElement(ne.Grid,{gap:4},e.createElement(ne.GridItem,{col:6},e.createElement(se.TextInput,{name:"name",error:d.name&&S({id:d.name}),label:S({id:"global.name",defaultMessage:"Name"}),onChange:q,value:f.name})),e.createElement(ne.GridItem,{col:6},e.createElement(oe.Textarea,{label:S({id:"global.description",defaultMessage:"Description"}),name:"description",error:d.description&&S({id:d.description}),onChange:q},f.description))))),!Ce&&!Ve?e.createElement(W.Box,{shadow:"filterShadow",hasRadius:!0},e.createElement(Te.Z,{isFormDisabled:!1,ref:J,permissions:Se,layout:xe})):e.createElement(W.Box,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(j.LoadingIndicatorPage,null))))))))},Ze=()=>e.createElement(j.CheckPagePermissions,{permissions:ee.Z.settings.roles.create},e.createElement(we,null))},20628:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!1},95489:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!1},58630:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!1},25684:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!1},26891:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!1},96855:(X,T,a)=>{a.d(T,{Z:()=>v});const v=!1},45936:(X,T,a)=>{a.d(T,{Z:()=>Y});var e=a(32735),v=a(10938),r=a(2805),j=a(32365),W=a.n(j),ye=a(22081),ve=a.n(ye),ne=a(74382),Ie=a.n(ne),$=a(97642),I=a.n($),b=a(44526),se=a(11856),oe=a(28004),V=a(16540),U=a(53214),ke=a(95602),We=a(92891),Re=a(58469),de=a(5636),k=a(5141),je=a(16558),re=a(41072),Me=a(34829),Te=a(65497),F=a(49415);const ee={roleToDelete:null,showModalConfirmButtonLoading:!1,shouldRefetchData:!1},Fe=(A,z)=>(0,F.default)(A,S=>{switch(z.type){case"ON_REMOVE_ROLES":{S.showModalConfirmButtonLoading=!0;break}case"ON_REMOVE_ROLES_SUCCEEDED":{S.shouldRefetchData=!0,S.roleToDelete=null;break}case"RESET_DATA_TO_DELETE":{S.shouldRefetchData=!1,S.roleToDelete=null,S.showModalConfirmButtonLoading=!1;break}case"SET_ROLE_TO_DELETE":{S.roleToDelete=z.id;break}default:return S}});var Ne=(A,z,S)=>new Promise((ae,Q)=>{var K=w=>{try{B(S.next(w))}catch(H){Q(H)}},J=w=>{try{B(S.throw(w))}catch(H){Q(H)}},B=w=>w.done?ae(w.value):Promise.resolve(w.value).then(K,J);B((S=S.apply(A,z)).next())});const Be=()=>{(0,v.useFocusWhenNavigate)();const{isLoading:A,allowedActions:{canCreate:z,canDelete:S,canRead:ae,canUpdate:Q}}=(0,v.useRBAC)(r.Z.settings.roles),{getData:K,roles:J,isLoading:B}=(0,re.bF)(!1),[{query:w}]=(0,v.useQueryParams)(),H=(w==null?void 0:w._q)||"",Ce=(0,Re.ZP)(J,H,{keys:["name","description"]});return(0,e.useEffect)(()=>{!A&&ae&&K()},[A,ae,K]),{isLoadingForPermissions:A,canCreate:z,canDelete:S,canRead:ae,canUpdate:Q,isLoading:B,getData:K,sortedRoles:Ce,roles:J}},Ae=({getData:A,canCreate:z,canDelete:S,canUpdate:ae})=>{const{formatMessage:Q}=(0,de.useIntl)(),K=(0,v.useNotification)(),[J,B]=(0,e.useState)(!1),{push:w}=(0,k.useHistory)(),[{selectedRoles:H,showModalConfirmButtonLoading:Ce,roleToDelete:xe},Se]=(0,e.useReducer)(Fe,ee),Ve=()=>Ne(void 0,null,function*(){try{Se({type:"ON_REMOVE_ROLES"}),yield je.be.post("/admin/roles/batch-delete",{ids:[xe]}),yield A(),Se({type:"RESET_DATA_TO_DELETE"})}catch(Z){const ie=(0,We.get)(Z,["response","payload","data","ids"],null);if(ie&&Array.isArray(ie)){const ue=ie.join(`
|
|
170
|
-
`);K({type:"warning",message:ue})}else K({type:"warning",message:{id:"notification.error"}})}f()}),y=(0,e.useCallback)(Z=>{w(`/settings/roles/duplicate/${Z}`)},[w]),m=()=>w("/settings/roles/new"),g=(0,e.useCallback)(Z=>{Se({type:"SET_ROLE_TO_DELETE",id:Z}),f()},[]),f=()=>B(Z=>!Z),d=(0,e.useCallback)(Z=>{w(`/settings/roles/${Z}`)},[w]),p=(0,e.useCallback)((Z,ie)=>{Z.preventDefault(),Z.stopPropagation(),ie.usersCount?K({type:"info",message:{id:"Roles.ListPage.notification.delete-not-allowed"}}):g(ie.id)},[K,g]),q=(0,e.useCallback)((Z,ie)=>{Z.preventDefault(),Z.stopPropagation(),y(ie.id)},[y]),$e=(0,e.useCallback)(Z=>[...z?[{onClick:ie=>q(ie,Z),label:Q({id:"app.utils.duplicate",defaultMessage:"Duplicate"}),icon:e.createElement(Ie(),null)}]:[],...ae?[{onClick:()=>d(Z.id),label:Q({id:"app.utils.edit",defaultMessage:"Edit"}),icon:e.createElement(I(),null)}]:[],...S?[{onClick:ie=>p(ie,Z),label:Q({id:"global.delete",defaultMessage:"Delete"}),icon:e.createElement(ve(),null)}]:[]],[Q,p,q,d,z,ae,S]);return{handleNewRoleClick:m,getIcons:$e,selectedRoles:H,isWarningDeleteAllOpened:J,showModalConfirmButtonLoading:Ce,handleToggleModal:f,handleDeleteData:Ve}},we=()=>{const{formatMessage:A}=(0,de.useIntl)(),{isLoadingForPermissions:z,canCreate:S,canRead:ae,canDelete:Q,canUpdate:K,isLoading:J,getData:B,sortedRoles:w}=Be(),{handleNewRoleClick:H,getIcons:Ce,isWarningDeleteAllOpened:xe,showModalConfirmButtonLoading:Se,handleToggleModal:Ve,handleDeleteData:y}=Ae({getData:B,canCreate:S,canDelete:Q,canUpdate:K}),m=w.length+1,g=6;if(z)return e.createElement(V.Main,null,e.createElement(v.LoadingIndicatorPage,null));const f=A({id:"global.roles",defaultMessage:"roles"});return e.createElement(V.Main,null,e.createElement(v.SettingsPageTitle,{name:"Roles"}),e.createElement(se.HeaderLayout,{primaryAction:S?e.createElement(b.Button,{onClick:H,startIcon:e.createElement(W(),null),size:"L"},A({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null,title:f,subtitle:A({id:"Settings.roles.list.description",defaultMessage:"List of roles"}),as:"h2"}),ae&&e.createElement(se.ActionLayout,{startActions:e.createElement(v.SearchURLQuery,{label:A({id:"app.component.search.label",defaultMessage:"Search for {target}"},{target:f})})}),ae&&e.createElement(se.ContentLayout,null,e.createElement(U.Table,{colCount:g,rowCount:m,footer:S?e.createElement(U.TFooter,{onClick:H,icon:e.createElement(W(),null)},A({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null},e.createElement(U.Thead,null,e.createElement(U.Tr,null,e.createElement(U.Th,null,e.createElement(ke.Typography,{variant:"sigma",textColor:"neutral600"},A({id:"global.name",defaultMessage:"Name"}))),e.createElement(U.Th,null,e.createElement(ke.Typography,{variant:"sigma",textColor:"neutral600"},A({id:"global.description",defaultMessage:"Description"}))),e.createElement(U.Th,null,e.createElement(ke.Typography,{variant:"sigma",textColor:"neutral600"},A({id:"global.users",defaultMessage:"Users"}))),e.createElement(U.Th,null,e.createElement(oe.VisuallyHidden,null,A({id:"global.actions",defaultMessage:"Actions"}))))),e.createElement(U.Tbody,null,w==null?void 0:w.map(d=>e.createElement(Te.Z,{key:d.id,id:d.id,name:d.name,description:d.description,usersCount:d.usersCount,icons:Ce(d)})))),!m&&!J&&e.createElement(Me.Z,null)),e.createElement(v.ConfirmDialog,{isOpen:xe,onConfirm:y,isConfirmButtonLoading:Se,onToggleDialog:Ve}))},Y=()=>e.createElement(v.CheckPagePermissions,{permissions:r.Z.settings.roles.main},e.createElement(we,null))},10226:(X,T,a)=>{a.d(T,{Z:()=>j});var e=(W,ye,ve)=>new Promise((ne,Ie)=>{var $=se=>{try{b(ve.next(se))}catch(oe){Ie(oe)}},I=se=>{try{b(ve.throw(se))}catch(oe){Ie(oe)}},b=se=>se.done?ne(se.value):Promise.resolve(se.value).then($,I);b((ve=ve.apply(W,ye)).next())});const j=[...strapi.features.isEnabled(strapi.features.SSO)?[{Component:()=>e(void 0,null,function*(){return yield a.e(302).then(a.bind(a,84363))}),to:"/settings/single-sign-on",exact:!0}]:[]]},378:(X,T,a)=>{X.exports=a.p+"c3de6118ef47086ad05c.png"},19337:(X,T,a)=>{X.exports=a.p+"bd81ba6c07827282255d.png"}}]);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[4263],{29527:($,v,e)=>{"use strict";e.r(v),e.d(v,{default:()=>ye});var t=e(32735),r=e(10938),d=e(5141),o=e(92891),n=e(2805),s=e(64106),c=e(10613),u=e(71745),m=e.n(u),p=e(5636),_=e(60216),A=e.n(_),X=e(88423),K=e.n(X),F=e(33795),S=e.n(F),w=e(9086),z=e.n(w),C=e(84968),Z=e(83281),P=e(9808),O=e(44526),E=e(78330),T=e(11856),U=e(95602),G=e(16540),y=e(90662),i=e(59716),a=e.n(i),l=e(98221),q=e.n(l),V=e(13271),x=e(16558),ne=(B,R,g)=>new Promise((H,f)=>{var Y=W=>{try{Q(g.next(W))}catch(J){f(J)}},j=W=>{try{Q(g.throw(W))}catch(J){f(J)}},Q=W=>W.done?H(W.value):Promise.resolve(W.value).then(Y,j);Q((g=g.apply(B,R)).next())});const fe=B=>ne(void 0,null,function*(){const{data:R}=yield x.be.get(`/admin/users/${B}`);return R.data}),Ee=(B,R)=>ne(void 0,null,function*(){const{data:g}=yield x.be.put(`/admin/users/${B}`,R);return g.data}),ge=[[{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(10127),Pe=e(26750),Me=e(98399),he=function(){return window&&window.strapi&&window.strapi.isEE?e(24870).Z:e(93264).Z}(),se=["email","firstname","lastname","username","isActive","roles"],oe=function(R){var g=R.canUpdate,H=(0,p.useIntl)(),f=H.formatMessage,Y=(0,d.useRouteMatch)("/settings/users/:id"),j=Y.params.id,Q=(0,d.useHistory)(),W=Q.push,J=(0,r.useAppInfos)(),De=J.setUserDisplayName,ae=(0,r.useNotification)(),le=(0,r.useOverlayBlocker)(),Le=le.lockApp,_e=le.unlockApp;(0,r.useFocusWhenNavigate)();var ie=(0,C.useQuery)(["user",j],function(){return fe(j)},{retry:!1,keepPreviousData:!1,staleTime:1e3*20,onError:function(M){var h=M.response.status;h===403&&(ae({type:"info",message:{id:"notification.permission.not-allowed-read",defaultMessage:"You are not allowed to see this document"}}),W("/")),Me.log(M.response.status)}}),Ae=ie.status,I=ie.data,Te=function(){var D=(0,c.Z)(m().mark(function M(h,b){var k,te,N,re,ce;return m().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return Le(),L.prev=1,L.next=4,Ee(j,z()(h,"confirmPassword"));case 4:k=L.sent,ae({type:"success",message:f({id:"notification.success.saved",defaultMessage:"Saved"})}),te=r.auth.getUserInfo(),j.toString()===te.id.toString()&&(r.auth.setUserInfo(k),N=S()(h,"username")||(0,V.Pp)(h.firstname,h.lastname),De(N)),b.setValues(K()(h,se)),L.next=17;break;case 11:L.prev=11,L.t0=L.catch(1),re=(0,V.Iz)(L.t0.response.data),ce=Object.keys(re).reduce(function(me,pe){return me[pe]=re[pe].id,me},{}),b.setErrors(ce),ae({type:"warning",message:S()(L.t0,"response.data.message","notification.error")});case 17:_e();case 18:case"end":return L.stop()}},M,null,[[1,11]])}));return function(h,b){return D.apply(this,arguments)}}(),de=Ae!=="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()(I,se)).reduce(function(D,M){return M==="roles"?(D[M]=((I==null?void 0:I.roles)||[]).map(function(h){var b=h.id;return b}),D):(D[M]=I==null?void 0:I[M],D)},{}),Ce=ee.username||(0,V.Pp)(ee.firstname,ee.lastname),ue=f(Ie,{name:Ce});return de?t.createElement(G.Main,{"aria-busy":"true"},t.createElement(r.SettingsPageTitle,{name:"Users"}),t.createElement(T.HeaderLayout,{primaryAction:t.createElement(O.Button,{disabled:!0,startIcon:t.createElement(q(),null),type:"button",size:"L"},f({id:"global.save",defaultMessage:"Save"})),title:ue,navigationAction:t.createElement(r.Link,{startIcon:t.createElement(a(),null),to:"/settings/users?pageSize=10&page=1&sort=firstname"},f({id:"global.back",defaultMessage:"Back"}))}),t.createElement(T.ContentLayout,null,t.createElement(r.LoadingIndicatorPage,null))):t.createElement(G.Main,null,t.createElement(r.SettingsPageTitle,{name:"Users"}),t.createElement(Z.Formik,{onSubmit:Te,initialValues:ee,validateOnChange:!1,validationSchema:ve.YM},function(D){var M=D.errors,h=D.values,b=D.handleChange,k=D.isSubmitting;return t.createElement(r.Form,null,t.createElement(T.HeaderLayout,{primaryAction:t.createElement(O.Button,{disabled:k||!g,startIcon:t.createElement(q(),null),loading:k,type:"submit",size:"L"},f({id:"global.save",defaultMessage:"Save"})),title:ue,navigationAction:t.createElement(r.Link,{startIcon:t.createElement(a(),null),to:"/settings/users?pageSize=10&page=1&sort=firstname"},f({id:"global.back",defaultMessage:"Back"}))}),t.createElement(T.ContentLayout,null,(I==null?void 0:I.registrationToken)&&t.createElement(P.Box,{paddingBottom:6},t.createElement(he,{registrationToken:I.registrationToken})),t.createElement(y.Stack,{spacing:7},t.createElement(P.Box,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},t.createElement(y.Stack,{spacing:4},t.createElement(U.Typography,{variant:"delta",as:"h2"},f({id:"app.components.Users.ModalCreateBody.block-title.details",defaultMessage:"Details"})),t.createElement(E.Grid,{gap:5},ge.map(function(te){return te.map(function(N){return t.createElement(E.GridItem,(0,s.Z)({key:N.name},N.size),t.createElement(r.GenericInput,(0,s.Z)({},N,{disabled:!g,error:M[N.name],onChange:b,value:h[N.name]||""})))})})))),t.createElement(P.Box,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},t.createElement(y.Stack,{spacing:4},t.createElement(U.Typography,{variant:"delta",as:"h2"},f({id:"global.roles",defaultMessage:"User's role"})),t.createElement(E.Grid,{gap:5},t.createElement(E.GridItem,{col:6,xs:12},t.createElement(Pe.Z,{disabled:!g,error:M.roles,onChange:b,value:h.roles}))))))))}))};oe.propTypes={canUpdate:A().bool.isRequired};const Oe=oe,ye=()=>{const B=(0,r.useNotification)(),R=(0,t.useMemo)(()=>({read:n.Z.settings.users.read,update:n.Z.settings.users.update}),[]),{isLoading:g,allowedActions:{canRead:H,canUpdate:f}}=(0,r.useRBAC)(R),{state:Y}=(0,d.useLocation)(),j=(0,o.get)(Y,"from","/");return(0,t.useEffect)(()=>{g||!H&&!f&&B({type:"info",message:{id:"notification.permission.not-allowed-read",defaultMessage:"You are not allowed to see this document"}})},[g,H,f,B]),g?t.createElement(r.LoadingIndicatorPage,null):!H&&!f?t.createElement(d.Redirect,{to:j}):t.createElement(Oe,{canUpdate:f})}},67814:($,v,e)=>{"use strict";e.d(v,{Z:()=>S});var t=e(32735),r=e(60216),d=e.n(r),o=e(20763),n=e.n(o),s=e(10938),c=e.n(s),u=e(74382),m=e.n(u),p=e(59087),_=e.n(p),A=e(5636),X=e.n(A);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:w,target:z})=>{const C=(0,s.useNotification)(),{formatMessage:Z}=(0,A.useIntl)(),P=()=>{C({type:"info",message:{id:"notification.link-copied"}})},O=Z({id:"app.component.CopyToClipboard.label",defaultMessage:"Copy to clipboard"});return t.createElement(s.ContentBox,{endAction:t.createElement(p.CopyToClipboard,{onCopy:P,text:z},t.createElement(o.IconButton,{label:O,noBorder:!0,icon:t.createElement(m(),null)})),title:z,titleEllipsis:!0,subtitle:w,icon:t.createElement(K,null),iconBackground:"neutral100"})};F.propTypes={children:d().oneOfType([d().element,d().string]).isRequired,target:d().string.isRequired};const S=F},93264:($,v,e)=>{"use strict";e.d(v,{Z:()=>m});var t=e(32735),r=e(5636),d=e.n(r),o=e(60216),n=e.n(o),s=e(29624),c=e(67814);const u=({registrationToken:p})=>{const{formatMessage:_}=(0,r.useIntl)(),A=`${window.location.origin}${s.Z}auth/register?registrationToken=${p}`;return t.createElement(c.Z,{target:A},_({id:"app.components.Users.MagicLink.connect",defaultMessage:"Copy and share this link to give access to this user"}))};u.defaultProps={registrationToken:""},u.propTypes={registrationToken:n().string};const m=u},26750:($,v,e)=>{"use strict";e.d(v,{Z:()=>Z});var t=e(32735),r=e(60216),d=e.n(r),o=e(5636),n=e.n(o),s=e(25716),c=e.n(s),u=e(84968),m=e.n(u),p=e(19615),_=e(22301),A=e.n(_),X=e(16558),K=(P,O,E)=>new Promise((T,U)=>{var G=a=>{try{i(E.next(a))}catch(l){U(l)}},y=a=>{try{i(E.throw(a))}catch(l){U(l)}},i=a=>a.done?T(a.value):Promise.resolve(a.value).then(G,y);i((E=E.apply(P,O)).next())});const F=p.keyframes`
|
|
2
|
-
from {
|
|
3
|
-
transform: rotate(0deg);
|
|
4
|
-
}
|
|
5
|
-
to {
|
|
6
|
-
transform: rotate(359deg);
|
|
7
|
-
}
|
|
8
|
-
`,S=p.default.div`
|
|
9
|
-
animation: ${F} 2s infinite linear;
|
|
10
|
-
`,w=()=>t.createElement(S,null,t.createElement(A(),null)),z=()=>K(void 0,null,function*(){const{data:P}=yield X.be.get("/admin/roles");return P.data}),C=({disabled:P,error:O,onChange:E,value:T})=>{const{status:U,data:G}=(0,u.useQuery)(["roles"],z,{staleTime:5e4}),{formatMessage:y}=(0,o.useIntl)(),i=O?y({id:O,defaultMessage:O}):"",a=y({id:"app.components.Users.ModalCreateBody.block-title.roles",defaultMessage:"User's roles"}),l=y({id:"app.components.Users.ModalCreateBody.block-title.roles.description",defaultMessage:"A user can have one or several roles"}),q=y({id:"app.components.Select.placeholder",defaultMessage:"Select"}),V=U==="loading"?t.createElement(w,null):void 0;return t.createElement(s.Select,{id:"roles",disabled:P,error:i,hint:l,label:a,name:"roles",onChange:x=>{E({target:{name:"roles",value:x}})},placeholder:q,multi:!0,startIcon:V,value:T,withTags:!0,required:!0},(G||[]).map(x=>t.createElement(s.Option,{key:x.id,value:x.id},x.name)))};C.defaultProps={disabled:!1,error:void 0},C.propTypes={disabled:d().bool,error:d().string,onChange:d().func.isRequired,value:d().array.isRequired};const Z=C},10127:($,v,e)=>{"use strict";e.d(v,{YM:()=>y,Rw:()=>K});var t=e(5173),r=e(10938),d=Object.defineProperty,o=Object.defineProperties,n=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,m=(i,a,l)=>a in i?d(i,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[a]=l,p=(i,a)=>{for(var l in a||(a={}))c.call(a,l)&&m(i,l,a[l]);if(s)for(var l of s(a))u.call(a,l)&&m(i,l,a[l]);return i},_=(i,a)=>o(i,n(a));const A={firstname:t.nK().required(r.translatedErrors.required),lastname:t.nK(),email:t.Z_().email(r.translatedErrors.email).lowercase().required(r.translatedErrors.required),username:t.Z_().nullable(),password:t.Z_().min(8,r.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,r.translatedErrors.minLength).oneOf([t.iH("password"),null],"components.Input.error.password.noMatch").when("password",(i,a)=>i?a.required(r.translatedErrors.required):a)},K=_(p({},A),{currentPassword:t.Z_().when(["password","confirmPassword"],(i,a,l)=>i||a?l.required(r.translatedErrors.required):l),preferedLanguage:t.Z_().nullable()}),S={roles:t.IX().min(1,r.translatedErrors.required).required(r.translatedErrors.required)};var w=Object.defineProperty,z=Object.defineProperties,C=Object.getOwnPropertyDescriptors,Z=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,E=(i,a,l)=>a in i?w(i,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[a]=l,T=(i,a)=>{for(var l in a||(a={}))P.call(a,l)&&E(i,l,a[l]);if(Z)for(var l of Z(a))O.call(a,l)&&E(i,l,a[l]);return i},U=(i,a)=>z(i,C(a));const y=t.Ry().shape(T(U(T({},A),{isActive:t.Xg()}),S))},24870:($,v,e)=>{"use strict";e.d(v,{Z:()=>m});var t=e(32735),r=e(5636),d=e.n(r),o=e(60216),n=e.n(o),s=e(29624),c=e(67814);const u=({registrationToken:p})=>{const{formatMessage:_}=(0,r.useIntl)();return p?t.createElement(c.Z,{target:`${window.location.origin}${s.Z}auth/register?registrationToken=${p}`},_({id:"app.components.Users.MagicLink.connect",defaultMessage:"Copy and share this link to give access to this user"})):t.createElement(c.Z,{target:`${window.location.origin}${s.Z}auth/login`},_({id:"app.components.Users.MagicLink.connect.sso",defaultMessage:"Send this link to the user, the first login can be made via a SSO provider."}))};u.defaultProps={registrationToken:""},u.propTypes={registrationToken:n().string};const m=u},22301:function($,v,e){(function(t,r){$.exports=r(e(32735))})(this,function(t){return function(r){var d={};function o(n){if(d[n])return d[n].exports;var s=d[n]={i:n,l:!1,exports:{}};return r[n].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=r,o.c=d,o.d=function(n,s,c){o.o(n,s)||Object.defineProperty(n,s,{enumerable:!0,get:c})},o.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},o.t=function(n,s){if(1&s&&(n=o(n)),8&s||4&s&&typeof n=="object"&&n&&n.__esModule)return n;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:n}),2&s&&typeof n!="string")for(var u in n)o.d(c,u,function(m){return n[m]}.bind(null,u));return c},o.n=function(n){var s=n&&n.__esModule?function(){return n.default}:function(){return n};return o.d(s,"a",s),s},o.o=function(n,s){return Object.prototype.hasOwnProperty.call(n,s)},o.p="",o(o.s=108)}({0:function(r,d){r.exports=t},108:function(r,d,o){"use strict";o.r(d);var n=o(0);function s(){return(s=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var m=arguments[u];for(var p in m)Object.prototype.hasOwnProperty.call(m,p)&&(c[p]=m[p])}return c}).apply(this,arguments)}d.default=function(c){return n.createElement("svg",s({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.057 18c.552 0 1 .451 1 .997v4.006a1 1 0 01-.941.995l-.059.002c-.552 0-1-.451-1-.997v-4.006a1 1 0 01.941-.995l.06-.002zm-3.06-.736l.055.03c.478.276.64.89.367 1.364l-2.002 3.468a1 1 0 01-1.31.394l-.055-.03a1.002 1.002 0 01-.368-1.363l2.003-3.469a1 1 0 011.31-.394zm7.42.394l2.002 3.468a1 1 0 01-.314 1.331l-.053.033a1.002 1.002 0 01-1.365-.363l-2.003-3.469a1 1 0 01.314-1.33l.054-.034a1.002 1.002 0 011.364.364zm-9.548-2.66l.033.054c.276.478.11 1.091-.364 1.364L3.07 18.42a1 1 0 01-1.331-.314l-.033-.053a1.001 1.001 0 01.364-1.365l3.468-2.003a1 1 0 011.33.314zm11.79-.313l3.468 2.002a1 1 0 01.393 1.31l-.03.055c-.276.478-.89.64-1.363.367l-3.469-2.003a1 1 0 01-.394-1.309l.03-.055c.276-.479.89-.64 1.364-.367zm4.344-3.628a1 1 0 01.995.941l.002.06c0 .551-.451 1-.997 1h-4.006a1 1 0 01-.995-.942L18 12.057c0-.552.451-1 .997-1h4.006zm-18 0a1 1 0 01.995.941l.002.06c0 .551-.451 1-.998 1H.998a1 1 0 01-.996-.942L0 12.057c0-.552.451-1 .998-1h4.004zm17.454-5.059l.033.054c.277.478.11 1.091-.363 1.365l-3.469 2.002a1 1 0 01-1.33-.314l-.034-.053a1.002 1.002 0 01.364-1.365l3.468-2.003a1 1 0 011.331.314zM3.07 5.684l3.468 2.003a1 1 0 01.394 1.31l-.03.055c-.276.478-.89.64-1.364.367L2.07 7.417a1 1 0 01-.394-1.31l.03-.055c.276-.479.89-.64 1.364-.368zm14.926-4.008l.056.03c.478.276.64.89.367 1.364l-2.003 3.468a1 1 0 01-1.309.394l-.055-.03a1.002 1.002 0 01-.367-1.364l2.002-3.468a1 1 0 011.31-.394zm-10.58.394L9.42 5.538a1 1 0 01-.314 1.33l-.053.034a1.002 1.002 0 01-1.365-.364L5.684 3.07a1 1 0 01.314-1.331l.054-.033a1.002 1.002 0 011.365.364zM12.058 0c.552 0 1 .451 1 .998v4.004a1 1 0 01-.941.996L12.057 6c-.552 0-1-.451-1-.998V.998a1 1 0 01.941-.996l.06-.002z",fill:"#212134"}))}}})})}}]);
|