@strapi/admin 4.12.0 → 4.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/components/LeftMenu/index.js +1 -1
- package/admin/src/components/PluginsInitializer/index.js +23 -0
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +9 -14
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/cleanData.js +1 -1
- package/admin/src/content-manager/components/InputUID/index.js +2 -3
- package/admin/src/content-manager/components/RelationInput/RelationInput.js +1 -1
- package/admin/src/content-manager/components/RelationInputDataManager/utils/getRelationLink.js +1 -3
- package/admin/src/content-manager/components/RelationInputDataManager/utils/select.js +4 -6
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +7 -9
- package/admin/src/content-manager/pages/App/utils/getContentTypeLinks.js +1 -3
- package/admin/src/content-manager/pages/EditSettingsView/index.js +31 -18
- package/admin/src/content-manager/pages/ListSettingsView/components/EditFieldForm.js +1 -3
- package/admin/src/content-manager/pages/ListSettingsView/components/Settings.js +1 -3
- package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +14 -32
- package/admin/src/content-manager/pages/ListSettingsView/index.js +50 -40
- package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/SelectedEntriesModal/index.js +7 -2
- package/admin/src/content-manager/pages/ListView/components/CellContent/RelationMultiple/index.js +2 -2
- package/admin/src/content-manager/pages/ListView/index.js +10 -4
- package/admin/src/content-manager/sharedReducers/crudReducer/reducer.js +1 -1
- package/admin/src/content-manager/utils/checkIfAttributeIsDisplayable.js +2 -4
- package/admin/src/content-manager/utils/index.js +0 -1
- package/admin/src/hooks/index.js +0 -3
- package/admin/src/hooks/useAdminRolePermissions/__mocks__/index.js +5 -0
- package/admin/src/hooks/useAdminRolePermissions/index.js +34 -0
- package/admin/src/hooks/useAdminRoles/__mocks__/index.js +5 -0
- package/admin/src/hooks/useAdminRoles/index.js +40 -0
- package/admin/src/pages/AuthPage/components/Register/index.js +4 -0
- package/admin/src/pages/AuthPage/constants.js +2 -2
- package/admin/src/pages/InstalledPluginsPage/Plugins.js +2 -2
- package/admin/src/pages/InstalledPluginsPage/hooks/usePlugins/index.js +29 -0
- package/admin/src/pages/MarketplacePage/hooks/useFetchMarketplacePlugins/index.js +44 -0
- package/admin/src/pages/MarketplacePage/hooks/useFetchMarketplaceProviders/index.js +44 -0
- package/admin/src/pages/MarketplacePage/utils/useMarketplaceData.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/CreatePage/index.js +24 -9
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RoleForm/index.js +1 -0
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/index.js +34 -20
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/index.js +31 -84
- package/admin/src/pages/SettingsPage/pages/Roles/hooks/useAdminRolePermissionLayout/index.js +23 -0
- package/admin/src/translations/ar.json +9 -3
- package/admin/src/translations/ca.json +8 -2
- package/admin/src/translations/de.json +8 -2
- package/admin/src/translations/dk.json +8 -2
- package/admin/src/translations/en.json +9 -3
- package/admin/src/translations/es.json +9 -3
- package/admin/src/translations/eu.json +8 -2
- package/admin/src/translations/fr.json +9 -2
- package/admin/src/translations/gu.json +8 -2
- package/admin/src/translations/hi.json +9 -3
- package/admin/src/translations/hu.json +9 -3
- package/admin/src/translations/ja.json +12 -6
- package/admin/src/translations/ko.json +12 -6
- package/admin/src/translations/ml.json +8 -2
- package/admin/src/translations/nl.json +8 -2
- package/admin/src/translations/pl.json +8 -2
- package/admin/src/translations/pt-BR.json +8 -2
- package/admin/src/translations/ru.json +8 -2
- package/admin/src/translations/sa.json +9 -3
- package/admin/src/translations/sk.json +8 -2
- package/admin/src/translations/sv.json +7 -2
- package/admin/src/translations/tr.json +8 -2
- package/admin/src/translations/zh-Hans.json +8 -2
- package/admin/src/translations/zh.json +8 -2
- package/admin/src/utils/index.js +0 -1
- package/build/1049.f76cb14b.chunk.js +1 -0
- package/build/1386.879bcd90.chunk.js +7 -0
- package/build/{2225.15d1df72.chunk.js → 2225.c6244756.chunk.js} +1 -1
- package/build/2379.f1641312.chunk.js +1 -0
- package/build/2395.46f8d0c1.chunk.js +26 -0
- package/build/2801.5cef5ec8.chunk.js +1 -0
- package/build/{3483.e2ee2547.chunk.js → 3483.03c24f96.chunk.js} +1 -1
- package/build/3929.5632f24d.chunk.js +114 -0
- package/build/4546.cfafae68.chunk.js +1 -0
- package/build/6691.4985ef22.chunk.js +105 -0
- package/build/7464.3e64a1d5.chunk.js +1 -0
- package/build/8276.10a3f883.chunk.js +26 -0
- package/build/{9806.aa25371d.chunk.js → 9806.3392505e.chunk.js} +2 -2
- package/build/{Admin-authenticatedApp.376233ff.chunk.js → Admin-authenticatedApp.3c585a0d.chunk.js} +3 -3
- package/build/{Admin_marketplace.f0b87fce.chunk.js → Admin_marketplace.dde9c148.chunk.js} +6 -6
- package/build/Admin_pluginsPage.bbe79434.chunk.js +6 -0
- package/build/{Admin_profilePage.a968035f.chunk.js → Admin_profilePage.192edc52.chunk.js} +1 -1
- package/build/{Admin_settingsPage.8c600d1a.chunk.js → Admin_settingsPage.97cb9d41.chunk.js} +1 -1
- package/build/admin-app.91898385.chunk.js +36 -0
- package/build/admin-edit-roles-page.6d567273.chunk.js +267 -0
- package/build/{admin-edit-users.67704088.chunk.js → admin-edit-users.79eeb125.chunk.js} +1 -1
- package/build/admin-roles-list.23ddff26.chunk.js +22 -0
- package/build/{admin-users.3279ffb0.chunk.js → admin-users.123aa08e.chunk.js} +1 -1
- package/build/ar-json.74e40bc7.chunk.js +1 -0
- package/build/{ca-json.a53c10b6.chunk.js → ca-json.fc6001d3.chunk.js} +1 -1
- package/build/content-manager.2af15f57.chunk.js +1099 -0
- package/build/{de-json.b3be02c7.chunk.js → de-json.e72545cf.chunk.js} +1 -1
- package/build/dk-json.e77140ef.chunk.js +1 -0
- package/build/{en-json.e34140fc.chunk.js → en-json.08c05fcf.chunk.js} +1 -1
- package/build/es-json.b1f2284b.chunk.js +1 -0
- package/build/{eu-json.633025f0.chunk.js → eu-json.63d0a898.chunk.js} +1 -1
- package/build/{fr-json.aa8839d2.chunk.js → fr-json.33c6428b.chunk.js} +1 -1
- package/build/{gu-json.5bd62812.chunk.js → gu-json.7efe8cc2.chunk.js} +1 -1
- package/build/{hi-json.9104eb78.chunk.js → hi-json.0d633692.chunk.js} +1 -1
- package/build/{hu-json.9f4aae42.chunk.js → hu-json.c74b6a1e.chunk.js} +1 -1
- package/build/index.html +1 -1
- package/build/{ja-json.91286391.chunk.js → ja-json.e1959a1c.chunk.js} +1 -1
- package/build/{ko-json.fcf3ec4b.chunk.js → ko-json.ce5d6d94.chunk.js} +1 -1
- package/build/main.f13fc96c.js +2856 -0
- package/build/{ml-json.557aa14c.chunk.js → ml-json.940d7ace.chunk.js} +1 -1
- package/build/{nl-json.b2b16eea.chunk.js → nl-json.fe38f0fb.chunk.js} +1 -1
- package/build/{pl-json.f094a417.chunk.js → pl-json.d55e8e78.chunk.js} +1 -1
- package/build/{pt-BR-json.dec7fb01.chunk.js → pt-BR-json.ae0a0d2e.chunk.js} +1 -1
- package/build/review-workflows-settings-create-view.cb08cfa2.chunk.js +1 -0
- package/build/review-workflows-settings-edit-view.3c7cbe63.chunk.js +1 -0
- package/build/review-workflows-settings-list-view.1611dc1f.chunk.js +56 -0
- package/build/{ru-json.8193d8c4.chunk.js → ru-json.1c976644.chunk.js} +1 -1
- package/build/{runtime~main.58ec8df6.js → runtime~main.2902859a.js} +1 -1
- package/build/{sa-json.a56836f1.chunk.js → sa-json.2c03ef4e.chunk.js} +1 -1
- package/build/sk-json.b41847e8.chunk.js +1 -0
- package/build/sso-settings-page.12b6d8ae.chunk.js +1 -0
- package/build/{sv-json.fd0e86c6.chunk.js → sv-json.568cb7ae.chunk.js} +1 -1
- package/build/{tr-json.56c32cf6.chunk.js → tr-json.c9f22432.chunk.js} +1 -1
- package/build/upload-settings.7f93d4c0.chunk.js +14 -0
- package/build/upload.37488080.chunk.js +58 -0
- package/build/users-advanced-settings-page.f0760eb8.chunk.js +9 -0
- package/build/users-email-settings-page.ff4b32f3.chunk.js +9 -0
- package/build/users-providers-settings-page.48de0306.chunk.js +14 -0
- package/build/users-roles-settings-page.3f9f063e.chunk.js +30 -0
- package/build/{zh-Hans-json.36d81cdc.chunk.js → zh-Hans-json.937b395b.chunk.js} +1 -1
- package/build/{zh-json.1cc86ff0.chunk.js → zh-json.bfc2e036.chunk.js} +1 -1
- package/ee/admin/hooks/useAuthProviders/index.js +1 -3
- package/ee/admin/pages/AuthResponse/index.js +1 -3
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +35 -32
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/CreateView/CreateView.js +1 -7
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/EditView/EditView.js +16 -14
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/ListView/ListView.js +32 -31
- package/ee/admin/pages/SettingsPage/pages/SingleSignOn/index.js +16 -26
- package/ee/server/config/admin-actions.js +6 -6
- package/ee/server/services/review-workflows/entity-service-decorator.js +4 -3
- package/index.js +2 -0
- package/package.json +16 -16
- package/scripts/build.js +1 -0
- package/server/controllers/role.js +9 -1
- package/server/middlewares/rateLimit.js +6 -2
- package/server/services/role.js +3 -2
- package/server/services/transfer/token.js +27 -4
- package/server/validation/authentication/register.js +2 -2
- package/webpack.config.js +2 -1
- package/admin/src/content-manager/components/SingleTypeFormWrapper/utils/getRequestUrl.js +0 -5
- package/admin/src/content-manager/components/SingleTypeFormWrapper/utils/index.js +0 -2
- package/admin/src/content-manager/pages/EditSettingsView/utils/api.js +0 -16
- package/admin/src/content-manager/pages/ListSettingsView/init.js +0 -9
- package/admin/src/content-manager/utils/getRequestUrl.js +0 -4
- package/admin/src/hooks/marketplace/useFetchMarketplacePlugins/index.js +0 -44
- package/admin/src/hooks/marketplace/useFetchMarketplaceProviders/index.js +0 -44
- package/admin/src/hooks/useFetchEnabledPlugins/index.js +0 -24
- package/admin/src/hooks/useFetchEnabledPlugins/utils/api.js +0 -10
- package/admin/src/hooks/useFetchPermissionsLayout/index.js +0 -42
- package/admin/src/hooks/useFetchPermissionsLayout/reducer.js +0 -35
- package/admin/src/hooks/useFetchRole/index.js +0 -68
- package/admin/src/hooks/useFetchRole/reducer.js +0 -33
- package/admin/src/hooks/useRolesList/index.js +0 -58
- package/admin/src/hooks/useRolesList/init.js +0 -5
- package/admin/src/hooks/useRolesList/reducer.js +0 -31
- package/admin/src/utils/getRequestUrl.js +0 -3
- package/build/1049.758a01f5.chunk.js +0 -1
- package/build/1386.762d6eb8.chunk.js +0 -7
- package/build/2379.0ca87a89.chunk.js +0 -1
- package/build/2395.df7a044a.chunk.js +0 -26
- package/build/2801.b1140c9b.chunk.js +0 -1
- package/build/4546.ff9fdf30.chunk.js +0 -1
- package/build/6691.f880a0b6.chunk.js +0 -105
- package/build/7065.ec811562.chunk.js +0 -114
- package/build/7464.8a6c1e6c.chunk.js +0 -1
- package/build/8276.6c7b8e6e.chunk.js +0 -26
- package/build/Admin_pluginsPage.8728ff6e.chunk.js +0 -6
- package/build/admin-app.1c3f7fd6.chunk.js +0 -36
- package/build/admin-edit-roles-page.a49b9f4f.chunk.js +0 -267
- package/build/admin-roles-list.0c129e98.chunk.js +0 -23
- package/build/ar-json.f530bc3f.chunk.js +0 -1
- package/build/content-manager.e9205db1.chunk.js +0 -1103
- package/build/dk-json.842aa391.chunk.js +0 -1
- package/build/es-json.f57b5335.chunk.js +0 -1
- package/build/main.1e3b0985.js +0 -2856
- package/build/review-workflows-settings-create-view.05758184.chunk.js +0 -1
- package/build/review-workflows-settings-edit-view.c33f7c58.chunk.js +0 -1
- package/build/review-workflows-settings-list-view.f055e1be.chunk.js +0 -56
- package/build/sk-json.bf2f057a.chunk.js +0 -1
- package/build/sso-settings-page.7c9b2fd9.chunk.js +0 -1
- package/build/upload-settings.cac210a0.chunk.js +0 -14
- package/build/upload.cbfeefa5.chunk.js +0 -58
- package/build/users-advanced-settings-page.18379a56.chunk.js +0 -9
- package/build/users-email-settings-page.a87978e5.chunk.js +0 -9
- package/build/users-providers-settings-page.8876c1ee.chunk.js +0 -14
- package/build/users-roles-settings-page.0431f48c.chunk.js +0 -30
- /package/admin/src/{hooks/marketplace → pages/MarketplacePage}/constants.js +0 -0
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5538],{58917:function(G,y,t){"use strict";t.r(y),t.d(y,{default:function(){return Ds}});var e=t(32735),E=t(12301),P=t(65810),v=t(56784),m=t.n(v),h=t(93839),N=t.n(h),X=t(86349),O=t.n(X),oe=t(88423),z=t.n(oe),ge=t(74758),V=t(14911),$=t(47750),Ae="strapi-admin-language",i=t(19565),ke=t(60216),a=t.n(ke),pe=t(20108),fe=t(15062),R=t(76402),D=t(97889);const Y={menuLogo:null,authLogo:null};var ye=(o=Y,s)=>(0,D.ZP)(o,n=>{switch(s.type){case"UPDATE_PROJECT_SETTINGS":{Object.assign(n,s.values);break}default:return n}});const ie=({children:o,authLogo:s,menuLogo:n,showReleaseNotification:r,showTutorials:l})=>{const[{menuLogo:p,authLogo:g},f]=(0,e.useReducer)(ye,Y),A=(0,e.useCallback)(({menuLogo:j,authLogo:T})=>f({type:"UPDATE_PROJECT_SETTINGS",values:{menuLogo:j||n,authLogo:T||s}}),[s,n]),M=(0,e.useMemo)(()=>({logos:{menu:{custom:p,default:n},auth:{custom:g,default:s}},updateProjectSettings:A,showReleaseNotification:r,showTutorials:l}),[p,n,g,s,A,r,l]);return e.createElement(R._5.Provider,{value:M},o)};ie.propTypes={authLogo:a().string.isRequired,children:a().element.isRequired,menuLogo:a().string.isRequired,showReleaseNotification:a().bool.isRequired,showTutorials:a().bool.isRequired};var xe=ie,Oe=t(33795),Le=t.n(Oe),Ve=t(3040),je=t.n(Ve);const _e="GUIDED_TOUR_CURRENT_STEP",$e="GUIDED_TOUR_COMPLETED_STEPS",mt="GUIDED_TOUR_SKIPPED",et=JSON.parse,qe=JSON.stringify;var be={clear(){localStorage.removeItem(_e),localStorage.removeItem($e)},addCompletedStep(o){const s=et(localStorage.getItem($e))?.slice()||[];s.includes(o)||(s.push(o),localStorage.setItem($e,qe(s)))},addCurrentStep(o){localStorage.setItem(_e,qe(o))},setSkipped(o){localStorage.setItem(mt,qe(o))},get(o){return et(localStorage.getItem(o))}},gt=o=>{const s={...o},n=be.get($e),r=be.get(_e),l=be.get(mt);if(n&&n.forEach(p=>{const[g,f]=p.split(".");je()(s,["guidedTourState",g,f],!0)}),r){const[p,g]=r.split(".");je()(s,["guidedTourState",p,g],!0),be.addCompletedStep(r),be.addCurrentStep(null)}return l!==null&&je()(s,"isSkipped",l),s};const pt={currentStep:null,guidedTourState:{contentTypeBuilder:{create:!1,success:!1},contentManager:{create:!1,success:!1},apiTokens:{create:!1,success:!1}},isGuidedTourVisible:!1,isSkipped:!0};var tt=(o=pt,s)=>(0,D.ZP)(o,n=>{switch(s.type){case"SET_CURRENT_STEP":{n.currentStep=s.step;break}case"SET_STEP_STATE":{const[r,l]=s.currentStep.split(".");n.guidedTourState[r][l]=s.value;break}case"SET_SKIPPED":{n.isSkipped=s.value;break}case"SET_GUIDED_TOUR_VISIBILITY":{n.isGuidedTourVisible=s.value;break}default:return n}}),ft=(o,s)=>{const n=Object.entries(s),r=n.findIndex(([p])=>p===o);return n.slice(0,r).every(([,p])=>Object.values(p).every(Boolean))},ht=(o,s)=>{const n=o.split("."),r=n[1],l=Object.entries(s[n[0]]),p=l.findIndex(([f])=>f===r);return l.slice(0,p).every(([,f])=>f)};const st=({children:o})=>{const[{currentStep:s,guidedTourState:n,isGuidedTourVisible:r,isSkipped:l},p]=(0,e.useReducer)(tt,pt,gt),g=T=>{if(T!==null){const q=Le()(n,T),_=ht(T,n);if(q||l||!_)return null}return be.addCurrentStep(T),p({type:"SET_CURRENT_STEP",step:T})},f=T=>{p({type:"SET_GUIDED_TOUR_VISIBILITY",value:T})},A=(T,q)=>{be.addCompletedStep(T),p({type:"SET_STEP_STATE",currentStep:T,value:q})},M=T=>{const q=n[T];if(q){const _=ft(T,n),H=Object.keys(q)[0],de=q[H];if(_&&!s&&!de)return g(`${T}.${H}`)}return null},j=T=>{be.setSkipped(T),p({type:"SET_SKIPPED",value:T})};return e.createElement(i.Zc,{guidedTourState:n,currentStep:s,setCurrentStep:g,setGuidedTourVisibility:f,setSkipped:j,setStepState:A,startSection:M,isGuidedTourVisible:r,isSkipped:l},o)};st.propTypes={children:a().element.isRequired};var Et=st,nt=t(58732),Gt=t.n(nt),vt=t(78023),yt=t(33229);const Ze=({changeLocale:o,children:s,localeNames:n})=>e.createElement(yt.Z.Provider,{value:{changeLocale:o,localeNames:n}},s);Ze.propTypes={changeLocale:a().func.isRequired,children:a().element.isRequired,localeNames:a().object.isRequired};var Pt=Ze,Rt=o=>{const s=window.localStorage.getItem(Ae);return{locale:o[s]?s:"en",localeNames:o}};const at={localeNames:{en:"English"},locale:"en"};var St=(o=at,s)=>{switch(s.type){case"CHANGE_LOCALE":{const{locale:n}=s;return o.localeNames[n]?{...o,locale:n}:o}default:return o}};const At=({children:o,localeNames:s,messages:n})=>{const[{locale:r},l]=(0,e.useReducer)(St,at,()=>Rt(s));(0,e.useEffect)(()=>{window.localStorage.setItem(Ae,r),document.documentElement.setAttribute("lang",r)},[r]);const p=f=>{l({type:"CHANGE_LOCALE",locale:f})},g=Gt()(n[r],n.en);return e.createElement(vt.Z,{locale:r,defaultLocale:"en",messages:g,textComponent:"span"},e.createElement(Pt,{changeLocale:p,localeNames:s},o))};At.propTypes={children:a().element.isRequired,localeNames:a().objectOf(a().string).isRequired,messages:a().object.isRequired};var Mt=At,Lt=t(24854),De=t(67879),bt=t(2160),Be=t(8471),Dt=(0,Be.vJ)`
|
|
2
|
-
body {
|
|
3
|
-
background: ${({theme:o})=>o.colors.neutral100};
|
|
4
|
-
}
|
|
5
|
-
`;const It=({children:o})=>{const{currentTheme:s,themes:n}=(0,bt.M1)(),{locale:r}=(0,De.Z)();return e.createElement(Lt.h,{locale:r,theme:n[s]||n.light},o,e.createElement(Dt,null))};It.propTypes={children:a().element.isRequired};var kt=It;const ot="STRAPI_THEME",Ot=()=>{const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",s=localStorage.getItem(ot);return s||localStorage.setItem(ot,o),s||o},wt=({children:o,themes:s})=>{const[n,r]=(0,e.useState)(Ot()),l=(0,e.useCallback)(g=>{r(g),localStorage.setItem(ot,g)},[r]),p=(0,e.useMemo)(()=>({currentTheme:n,onChangeTheme:l,themes:s}),[n,l,s]);return e.createElement(R.Rj.Provider,{value:p},o)};wt.propTypes={children:a().node.isRequired,themes:a().shape({light:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,dark:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,custom:a().object}).isRequired};var jt=wt;const d=new pe.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),c=({authLogo:o,children:s,components:n,customFields:r,fields:l,getAdminInjectedComponents:p,getPlugin:g,localeNames:f,menu:A,menuLogo:M,messages:j,plugins:T,runHookParallel:q,runHookSeries:_,runHookWaterfall:H,settings:de,showReleaseNotification:S,showTutorials:Ke,store:ze,themes:J})=>e.createElement(Mt,{messages:j,localeNames:f},e.createElement(jt,{themes:J},e.createElement(kt,null,e.createElement(pe.QueryClientProvider,{client:d},e.createElement(fe.zt,{store:ze},e.createElement(R.ux.Provider,{value:{getAdminInjectedComponents:p}},e.createElement(xe,{authLogo:o,menuLogo:M,showReleaseNotification:S,showTutorials:Ke},e.createElement(i._Y,{getPlugin:g,menu:A,plugins:T,runHookParallel:q,runHookWaterfall:H,runHookSeries:_,settings:de},e.createElement(i.rt,{components:n,fields:l},e.createElement(i.MG,{customFields:r},e.createElement(i.m$,null,e.createElement(i.w7,null,e.createElement(Et,null,e.createElement(i.N$,null,s))))))))))))));c.propTypes={authLogo:a().oneOfType([a().string,a().any]).isRequired,children:a().element.isRequired,components:a().object.isRequired,customFields:a().object.isRequired,fields:a().object.isRequired,getAdminInjectedComponents:a().func.isRequired,getPlugin:a().func.isRequired,localeNames:a().objectOf(a().string).isRequired,menu:a().arrayOf(a().shape({to:a().string.isRequired,icon:a().func.isRequired,intlLabel:a().shape({id:a().string.isRequired,defaultMessage:a().string.isRequired}).isRequired,permissions:a().array,Component:a().func})).isRequired,menuLogo:a().oneOfType([a().string,a().any]).isRequired,messages:a().object.isRequired,plugins:a().object.isRequired,runHookParallel:a().func.isRequired,runHookWaterfall:a().func.isRequired,runHookSeries:a().func.isRequired,settings:a().object.isRequired,showReleaseNotification:a().bool.isRequired,showTutorials:a().bool.isRequired,store:a().object.isRequired,themes:a().shape({light:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,dark:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,custom:a().object}).isRequired};var u=c,C=t(59883),L=t(6680);const I=(o,s)=>{let n=L.compose;const r=[];o.forEach(p=>{r.push(p())});const l=(0,L.createStore)(U(s,{}),{},n((0,L.applyMiddleware)(...r)));return l.asyncReducers={},l.injectReducer=(p,g)=>{l.asyncReducers[p]=g,l.replaceReducer(U(s,l.asyncReducers))},l},U=(o,s)=>(0,L.combineReducers)({...o,...s});var k=I,K=t(35231),x=()=>{const o=[];return{register(s){o.push(s)},delete(s){o.splice(o.indexOf(s),1)},runWaterfall(s,n){return o.reduce((r,l)=>l(r,n),s)},async runWaterfallAsync(s,n){let r=s;for(const l of o)r=await l(r,n);return r},runSeries(...s){return o.map(n=>n(...s))},async runSeriesAsync(...s){const n=[];for(const r of o)n.push(await r(...s));return n},runParallel(...s){return Promise.all(o.map(n=>n(...s)))}}},W=t(66941),we="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAXVBMVEUAAABIRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9JRf9IRf9IRP5IRP5JRP9JRf////+Vk/+zsv++vf9mY/9taf9/fP+Jh//c3P9RTf/Ibar2AAAAFHRSTlMA/MJX+fPt48cahaff1dMaGqcahSpTPmAAAAEvSURBVFjD7dfNTsMwEATgXcf5cdKEtixtcYH3f0xEibIguba1g8Slc+58iqUedmhNaMbJzX3Xema5G2bfdv3iprE50s80g7Yqw0Oz1Z+cmOL2a38nxuy+BSfmuNv7BUhDRAMCDESBEYCDvsD6hmcMGGnCgIkcBjhaMGCmHgN66jCgoxYDWvIY4IkxgHFAkrmeU7kmfpkG4uUllXMtEE82QPs2QPs2QPs2QPs2QPsAoH0DoH0LoH0QeN3ydtnyXg38ok76MQ/gAfwf8JH8V18LQOljomBAFAyIkga4CGT7XAtEuQf4IpDri6e2BoiZA6OrAGLuxOnLQMweWXMRyPVlwQ/NAwZMNGLACJ/76ODYo5MHHl3o7EOHZ6BbjtbpG/5kfOv8P7ilbv7PX/M/rMVPqrI3XI3nd3sAAAAASUVORK5CYII=",Ye={admin:{tutorials:{links:[]}},contentManager:{editView:{informations:[],"right-links":[]},listView:{actions:[],deleteModalAdditionalInfos:[],publishModalAdditionalInfos:[],unpublishModalAdditionalInfos:[]}}},Ne=t(10728),le=t(53038);const We=({component:o,path:s,...n})=>{const{pathname:r,search:l}=(0,le.TH)();return e.createElement(le.AW,{path:s,render:p=>i.I8.getToken()!==null?e.createElement(o,{...n,...p}):e.createElement(le.l_,{to:{pathname:"/auth/login",search:r!=="/"&&`?redirectTo=${encodeURIComponent(`${r}${l}`)}`}})})};We.propTypes={component:a().any.isRequired,path:a().string.isRequired};var Ue=(0,e.memo)(We);const He={contentManager:{main:[],collectionTypesConfigurations:[{action:"plugin::content-manager.collection-types.configure-view",subject:null}],componentsConfigurations:[{action:"plugin::content-manager.components.configure-layout",subject:null}],singleTypesConfigurations:[{action:"plugin::content-manager.single-types.configure-view",subject:null}]},marketplace:{main:[{action:"admin::marketplace.read",subject:null}],read:[{action:"admin::marketplace.read",subject:null}]},settings:{roles:{main:[{action:"admin::roles.create",subject:null},{action:"admin::roles.update",subject:null},{action:"admin::roles.read",subject:null},{action:"admin::roles.delete",subject:null}],create:[{action:"admin::roles.create",subject:null}],delete:[{action:"admin::roles.delete",subject:null}],read:[{action:"admin::roles.read",subject:null}],update:[{action:"admin::roles.update",subject:null}]},users:{main:[{action:"admin::users.create",subject:null},{action:"admin::users.read",subject:null},{action:"admin::users.update",subject:null},{action:"admin::users.delete",subject:null}],create:[{action:"admin::users.create",subject:null}],delete:[{action:"admin::users.delete",subject:null}],read:[{action:"admin::users.read",subject:null}],update:[{action:"admin::users.update",subject:null}]},webhooks:{main:[{action:"admin::webhooks.create",subject:null},{action:"admin::webhooks.read",subject:null},{action:"admin::webhooks.update",subject:null},{action:"admin::webhooks.delete",subject:null}],create:[{action:"admin::webhooks.create",subject:null}],delete:[{action:"admin::webhooks.delete",subject:null}],read:[{action:"admin::webhooks.read",subject:null},{action:"admin::webhooks.update",subject:null},{action:"admin::webhooks.delete",subject:null}],update:[{action:"admin::webhooks.update",subject:null}]},"api-tokens":{main:[{action:"admin::api-tokens.access",subject:null}],create:[{action:"admin::api-tokens.create",subject:null}],delete:[{action:"admin::api-tokens.delete",subject:null}],read:[{action:"admin::api-tokens.read",subject:null}],update:[{action:"admin::api-tokens.update",subject:null}],regenerate:[{action:"admin::api-tokens.regenerate",subject:null}]},"transfer-tokens":{main:[{action:"admin::transfer.tokens.access",subject:null}],create:[{action:"admin::transfer.tokens.create",subject:null}],delete:[{action:"admin::transfer.tokens.delete",subject:null}],read:[{action:"admin::transfer.tokens.read",subject:null}],update:[{action:"admin::transfer.tokens.update",subject:null}],regenerate:[{action:"admin::transfer.tokens.regenerate",subject:null}]},"project-settings":{read:[{action:"admin::project-settings.read",subject:null}],update:[{action:"admin::project-settings.update",subject:null}]}}};var ue=t(9592),se=t(86209),ne=t(84306),ce=t(39935),Fe=t.n(ce),ns=t(9086),it=t.n(ns),as=t(51399),os=t(5074),ae=t(11060),rs=t(24436);const Ut=o=>e.createElement(ae.ZP,null,e.createElement(rs.Z,{...o}));Ut.defaultProps={onSubmit:o=>o.preventDefault()},Ut.propTypes={onSubmit:a().func};var w=t(24346),Je=t(27649),Ee=t(72850),ve=t(49372),Pe=t(87933),Ge=t(10369),lt=t(41415),xt=t(92802),Qe=t(73678);const Zt=({onSubmit:o,schema:s})=>{const{formatMessage:n}=(0,De.Z)();return e.createElement(ae.ZP,null,e.createElement(Je.o,null,e.createElement(ae.bU,null,e.createElement(xt.J9,{enableReinitialize:!0,initialValues:{email:""},onSubmit:o,validationSchema:s,validateOnChange:!1},({values:r,errors:l,handleChange:p})=>e.createElement(i.l0,{noValidate:!0},e.createElement(ae.sg,null,e.createElement(Qe.Z,null),e.createElement(Ee.x,{paddingTop:6,paddingBottom:7},e.createElement(ve.Z,{as:"h1",variant:"alpha"},n({id:"Auth.form.button.password-recovery",defaultMessage:"Password Recovery"}))),l.errorMessage&&e.createElement(ve.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},n({id:l.errorMessage,defaultMessage:"An error occurred"}))),e.createElement(Pe.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Ge.o,{error:l.email?n({id:l.email,defaultMessage:"This email is invalid."}):"",value:r.email,onChange:p,label:n({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:n({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),e.createElement(lt.z,{type:"submit",fullWidth:!0},n({id:"Auth.form.button.forgot-password",defaultMessage:"Send Email"})))))),e.createElement(Pe.k,{justifyContent:"center"},e.createElement(Ee.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},n({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};Zt.defaultProps={onSubmit:o=>o.preventDefault()},Zt.propTypes={onSubmit:a().func,schema:a().shape({type:a().string.isRequired}).isRequired};var is=Zt,ls=()=>{const{formatMessage:o}=(0,De.Z)();return e.createElement(ae.ZP,null,e.createElement(Je.o,null,e.createElement(ae.bU,null,e.createElement(ae.sg,null,e.createElement(Qe.Z,null),e.createElement(Ee.x,{paddingTop:6,paddingBottom:7},e.createElement(ve.Z,{as:"h1",variant:"alpha"},o({id:"app.containers.AuthPage.ForgotPasswordSuccess.title",defaultMessage:"Email sent"}))),e.createElement(ve.Z,null,o({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.email",defaultMessage:"It can take a few minutes to receive your password recovery link."})),e.createElement(Ee.x,{paddingTop:4},e.createElement(ve.Z,null,o({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.contact-admin",defaultMessage:"If you do not receive this link, please contact your administrator."}))))),e.createElement(Pe.k,{justifyContent:"center"},e.createElement(Ee.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},us=()=>{const{formatMessage:o}=(0,De.Z)(),n=(0,i.aM)().get("info")||o({id:"Auth.components.Oops.text",defaultMessage:"Your account has been suspended."});return e.createElement(ae.ZP,null,e.createElement(Je.o,null,e.createElement(ae.bU,null,e.createElement(ae.sg,null,e.createElement(Qe.Z,null),e.createElement(Ee.x,{paddingTop:6,paddingBottom:7},e.createElement(ve.Z,{as:"h1",variant:"alpha"},o({id:"Auth.components.Oops.title",defaultMessage:"Oops..."}))),e.createElement(ve.Z,null,n),e.createElement(Ee.x,{paddingTop:4},e.createElement(ve.Z,null,o({id:"Auth.components.Oops.text.admin",defaultMessage:"If this is a mistake, please contact your administrator."}))))),e.createElement(Pe.k,{justifyContent:"center"},e.createElement(Ee.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},cs=t(15335),zt=t(5803),ds=t(8284),ut=t(54894),ct=t(60492),dt=t(24018);const Vt=Be.ZP.a`
|
|
6
|
-
color: ${({theme:o})=>o.colors.primary600};
|
|
7
|
-
`,$t=(0,Be.ZP)(Ge.o)`
|
|
8
|
-
::-ms-reveal {
|
|
9
|
-
display: none;
|
|
10
|
-
}
|
|
11
|
-
`,Bt=({authType:o,fieldsToDisable:s,noSignin:n,onSubmit:r,schema:l})=>{const p=(0,i.lm)(),{push:g}=(0,le.k6)(),[f,A]=(0,e.useState)(!1),[M,j]=(0,e.useState)(!1),[T,q]=(0,e.useState)(0),[_,H]=(0,e.useState)({}),{trackUsage:de}=(0,i.rS)(),{formatMessage:S}=(0,De.Z)(),Ke=(0,i.aM)(),{formatAPIError:ze}=(0,i.So)(),{get:J}=(0,i.kY)(),ee=Ke.get("registrationToken");(0,e.useEffect)(()=>{ee&&(async()=>{try{const{data:{data:b}}=await J("/admin/registration-info",{params:{registrationToken:ee}});b&&H(b)}catch(b){const F=ze(b);p({type:"warning",message:F}),g(`/auth/oops?info=${encodeURIComponent(F)}`)}})()},[ee]);function Te(me){return Object.entries(me).reduce((b,[F,te])=>{let Ce=te;return!["password","confirmPassword"].includes(F)&&typeof te=="string"&&(Ce=Ce.trim()),b[F]=Ce,b},{})}return e.createElement(ae.ZP,null,e.createElement(ae.bU,null,e.createElement(xt.J9,{enableReinitialize:!0,initialValues:{firstname:_.firstname||"",lastname:_.lastname||"",email:_.email||"",password:"",confirmPassword:"",registrationToken:ee||void 0,news:!1},onSubmit:async(me,b)=>{const F=Te(me);try{await l.validate(F,{abortEarly:!1}),T>0&&o==="register-admin"&&de("didSubmitWithErrorsFirstAdmin",{count:T.toString()}),r(ee?{userInfo:it()(F,["registrationToken"]),registrationToken:ee}:F,b)}catch(te){const Ce=(0,i.CJ)(te);q(T+1),b.setErrors(Ce)}},validateOnChange:!1},({values:me,errors:b,handleChange:F})=>e.createElement(i.l0,{noValidate:!0},e.createElement(Je.o,null,e.createElement(Pe.k,{direction:"column",alignItems:"center",gap:3},e.createElement(Qe.Z,null),e.createElement(ve.Z,{as:"h1",variant:"alpha",textAlign:"center"},S({id:"Auth.form.welcome.title",defaultMessage:"Welcome to Strapi!"})),e.createElement(ve.Z,{variant:"epsilon",textColor:"neutral600",textAlign:"center"},S({id:"Auth.form.register.subtitle",defaultMessage:"Credentials are only used to authenticate in Strapi. All saved data will be stored in your database."}))),e.createElement(Pe.k,{direction:"column",alignItems:"stretch",gap:6,marginTop:7},e.createElement(cs.r,{gap:4},e.createElement(zt.P,{col:6},e.createElement(Ge.o,{name:"firstname",required:!0,value:me.firstname,error:b.firstname?S(b.firstname):void 0,onChange:F,label:S({id:"Auth.form.firstname.label",defaultMessage:"Firstname"})})),e.createElement(zt.P,{col:6},e.createElement(Ge.o,{name:"lastname",value:me.lastname,onChange:F,label:S({id:"Auth.form.lastname.label",defaultMessage:"Lastname"})}))),e.createElement(Ge.o,{name:"email",disabled:s.includes("email"),value:me.email,onChange:F,error:b.email?S(b.email):void 0,required:!0,label:S({id:"Auth.form.email.label",defaultMessage:"Email"}),type:"email"}),e.createElement($t,{name:"password",onChange:F,value:me.password,error:b.password?S(b.password):void 0,endAction:e.createElement(dt.Z,{onClick:te=>{te.preventDefault(),A(Ce=>!Ce)},label:S(f?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},f?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),hint:S({id:"Auth.form.password.hint",defaultMessage:"Must be at least 8 characters, 1 uppercase, 1 lowercase & 1 number"}),required:!0,label:S({id:"global.password",defaultMessage:"Password"}),type:f?"text":"password"}),e.createElement($t,{name:"confirmPassword",onChange:F,value:me.confirmPassword,error:b.confirmPassword?S(b.confirmPassword):void 0,endAction:e.createElement(dt.Z,{onClick:te=>{te.preventDefault(),j(Ce=>!Ce)},label:S(M?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},M?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),required:!0,label:S({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirm Password"}),type:M?"text":"password"}),e.createElement(ds.X,{onValueChange:te=>{F({target:{value:te,name:"news"}})},value:me.news,name:"news","aria-label":"news"},S({id:"Auth.form.register.news.label",defaultMessage:"Keep me updated about new features & upcoming improvements (by doing this you accept the {terms} and the {policy})."},{terms:e.createElement(Vt,{target:"_blank",href:"https://strapi.io/terms",rel:"noreferrer"},S({id:"Auth.privacy-policy-agreement.terms",defaultMessage:"terms"})),policy:e.createElement(Vt,{target:"_blank",href:"https://strapi.io/privacy",rel:"noreferrer"},S({id:"Auth.privacy-policy-agreement.policy",defaultMessage:"policy"}))})),e.createElement(lt.z,{fullWidth:!0,size:"L",type:"submit"},S({id:"Auth.form.button.register",defaultMessage:"Let's start"})))))),!n&&e.createElement(Ee.x,{paddingTop:4},e.createElement(Pe.k,{justifyContent:"center"},e.createElement(i.rU,{label:"Auth.link.signin",to:"/auth/login"},S({id:"Auth.link.signin.account",defaultMessage:"Already have an account?"}))))))};Bt.defaultProps={fieldsToDisable:[],noSignin:!1,onSubmit:o=>o.preventDefault()},Bt.propTypes={authType:a().string.isRequired,fieldsToDisable:a().array,noSignin:a().bool,onSubmit:a().func,schema:a().shape({validate:a().func.isRequired,type:a().string.isRequired}).isRequired};var Yt=Bt;const Jt=(0,Be.ZP)(Ge.o)`
|
|
12
|
-
::-ms-reveal {
|
|
13
|
-
display: none;
|
|
14
|
-
}
|
|
15
|
-
`,Nt=({onSubmit:o,schema:s})=>{const[n,r]=(0,e.useState)(!1),[l,p]=(0,e.useState)(!1),{formatMessage:g}=(0,De.Z)();return e.createElement(ae.ZP,null,e.createElement(Je.o,null,e.createElement(ae.bU,null,e.createElement(xt.J9,{enableReinitialize:!0,initialValues:{password:"",confirmPassword:""},onSubmit:o,validationSchema:s,validateOnChange:!1},({values:f,errors:A,handleChange:M})=>e.createElement(i.l0,{noValidate:!0},e.createElement(ae.sg,null,e.createElement(Qe.Z,null),e.createElement(Ee.x,{paddingTop:6,paddingBottom:7},e.createElement(ve.Z,{as:"h1",variant:"alpha"},g({id:"global.reset-password",defaultMessage:"Reset password"}))),A.errorMessage&&e.createElement(ve.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},g({id:A.errorMessage,defaultMessage:"An error occurred"}))),e.createElement(Pe.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Jt,{name:"password",onChange:M,value:f.password,error:A.password?g({id:A.password,defaultMessage:"This field is required."}):void 0,endAction:e.createElement(dt.Z,{onClick:j=>{j.preventDefault(),r(T=>!T)},label:g(n?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},n?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),hint:g({id:"Auth.form.password.hint",defaultMessage:"Password must contain at least 8 characters, 1 uppercase, 1 lowercase and 1 number"}),required:!0,label:g({id:"global.password",defaultMessage:"Password"}),type:n?"text":"password"}),e.createElement(Jt,{name:"confirmPassword",onChange:M,value:f.confirmPassword,error:A.confirmPassword?g({id:A.confirmPassword,defaultMessage:"This value is required."}):void 0,endAction:e.createElement(dt.Z,{onClick:j=>{j.preventDefault(),p(T=>!T)},label:g(n?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},l?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),required:!0,label:g({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirm Password"}),type:l?"text":"password"}),e.createElement(lt.z,{fullwidth:!0,type:"submit"},g({id:"global.change-password",defaultMessage:"Change password"})))))),e.createElement(Pe.k,{justifyContent:"center"},e.createElement(Ee.x,{paddingTop:4},e.createElement(i.rU,{to:"/auth/login"},g({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};Nt.defaultProps={onSubmit:o=>o.preventDefault()},Nt.propTypes={onSubmit:a().func,schema:a().shape({type:a().string.isRequired}).isRequired};var ms=Nt;const Qt={"forgot-password":{Component:is,endPoint:"forgot-password",fieldsToDisable:[],fieldsToOmit:[],schema:w.Ry().shape({email:w.Z_().email(i.I0.email).required(i.I0.required)}),inputsPrefix:""},"forgot-password-success":{Component:ls,endPoint:"",fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},login:{endPoint:"login",fieldsToDisable:[],fieldsToOmit:["rememberMe"],schema:w.Ry().shape({email:w.Z_().email(i.I0.email).required(i.I0.required),password:w.Z_().required(i.I0.required),rememberMe:w.Xg().nullable()}),inputsPrefix:""},oops:{Component:us,endPoint:null,fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},register:{Component:Yt,endPoint:"register",fieldsToDisable:["email"],fieldsToOmit:["userInfo.confirmPassword","userInfo.news","userInfo.email"],schema:w.Ry().shape({firstname:w.Z_().trim().required(i.I0.required),lastname:w.Z_(),password:w.Z_().min(8,i.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(i.I0.required),confirmPassword:w.Z_().oneOf([w.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required),registrationToken:w.Z_().required(i.I0.required)}),inputsPrefix:"userInfo."},"register-admin":{Component:Yt,endPoint:"register-admin",noSignin:!0,fieldsToDisable:[],fieldsToOmit:["confirmPassword","news"],schema:w.Ry().shape({firstname:w.Z_().trim().required(i.I0.required),lastname:w.Z_(),password:w.Z_().min(8,i.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(i.I0.required),email:w.Z_().email(i.I0.email).strict().lowercase(i.I0.lowercase).required(i.I0.required),confirmPassword:w.Z_().oneOf([w.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required)}),inputsPrefix:""},"reset-password":{Component:ms,endPoint:"reset-password",fieldsToDisable:[],fieldsToOmit:["confirmPassword"],schema:w.Ry().shape({password:w.Z_().min(8,i.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(i.I0.required),confirmPassword:w.Z_().oneOf([w.iH("password"),null],"components.Input.error.password.noMatch").required(i.I0.required)})}};var gs=o=>o;const Xt={formErrors:{},modifiedData:{},requestError:null},ps=(o,s)=>(0,D.ZP)(o,n=>{switch(s.type){case"ON_CHANGE":{je()(n.modifiedData,s.keys.split("."),s.value);break}case"RESET_PROPS":return Xt;case"SET_DATA":{n.modifiedData=s.data;break}case"SET_ERRORS":{n.formErrors=s.errors;break}case"SET_REQUEST_ERROR":{n.requestError={errorMessage:s.errorMessage,errorStatus:s.errorStatus};break}default:return n}}),Wt=({hasAdmin:o,setHasAdmin:s})=>{const{push:n,location:{search:r}}=(0,le.k6)(),{changeLocale:l}=(0,as.Z)(),{setSkipped:p}=(0,i.c1)(),{trackUsage:g}=(0,i.rS)(),{params:{authType:f}}=(0,le.$B)("/auth/:authType"),A=(0,i.aM)(),M=(0,ue.c)(Ut,async()=>(await t.e(2395).then(t.bind(t,82395))).LoginEE),j=(0,ue.c)(Qt,async()=>(await t.e(8276).then(t.bind(t,18276))).FORMS,{combine(Z,Q){return{...Z,...Q}},defaultValue:Qt}),[{formErrors:T,modifiedData:q,requestError:_},H]=(0,e.useReducer)(ps,Xt,gs),S=ne.default.CancelToken.source(),{endPoint:Ke,fieldsToDisable:ze,fieldsToOmit:J,inputsPrefix:ee,schema:Te,...me}=j?.[f]??{};(0,e.useEffect)(()=>()=>{S.cancel("Component unmounted")},[]);const{post:b}=(0,i.kY)();(0,e.useEffect)(()=>{H({type:"RESET_PROPS"})},[f]);const F=({target:{name:Z,value:Q}})=>{H({type:"ON_CHANGE",keys:Z,value:Q})},te=async(Z,{setSubmitting:Q,setErrors:Re})=>{Q(!0);const Ie=it()(Z,J),B=`/admin/${Ke}`;f==="login"&&await Is(Z,B,{setSubmitting:Q,setErrors:Re}),(f==="register"||f==="register-admin")&&await ks(Z,B,{setSubmitting:Q,setErrors:Re}),f==="forgot-password"&&await Ce(Ie,B,{setSubmitting:Q,setErrors:Re}),f==="reset-password"&&await Os(Ie,B,{setSubmitting:Q,setErrors:Re})},Ce=async(Z,Q,{setSubmitting:Re,setErrors:Ie})=>{try{await b(Q,Z,{cancelToken:S.token}),n("/auth/forgot-password-success")}catch(B){console.error(B),Ie({errorMessage:"notification.error"})}finally{Re(!1)}},Is=async(Z,Q,{setSubmitting:Re,setErrors:Ie})=>{try{const{data:{data:{token:B,user:re}}}=await b(Q,it()(Z,J),{cancelToken:S.token});re.preferedLanguage&&l(re.preferedLanguage),i.I8.setToken(B,Z.rememberMe),i.I8.setUserInfo(re,Z.rememberMe),_t()}catch(B){if(B.response){const re=Le()(B,["response","data","error","message"],"Something went wrong");if(Fe()(re).toLowerCase()==="usernotactive"){n("/auth/oops"),H({type:"RESET_PROPS"});return}Ie({errorMessage:re})}}finally{Re(!1)}},ks=async(Z,Q,{setSubmitting:Re,setErrors:Ie})=>{try{g("willCreateFirstAdmin");const{data:{data:{token:B,user:re}}}=await b(Q,it()(Z,J),{cancelToken:S.token});i.I8.setToken(B,!1),i.I8.setUserInfo(re,!1),Re(!1),s(!0);const{roles:Xe}=re;if(Xe&&Xe.find(({code:js})=>js==="strapi-super-admin")&&(be.setSkipped(!1),p(!1),g("didLaunchGuidedtour")),f==="register"&&Z.userInfo.news===!0||f==="register-admin"&&Z.news===!0){n({pathname:"/usecase",search:`?hasAdmin=${o}`});return}_t()}catch(B){if(g("didNotCreateFirstAdmin"),B.response){const{data:re}=B.response,Xe=(0,os.Z)(re);Ie({apiErrors:Xe})}}},Os=async(Z,Q,{setErrors:Re,setSubmitting:Ie})=>{try{const{data:{data:{token:B,user:re}}}=await b(Q,{...Z,resetPasswordToken:A.get("code")},{cancelToken:S.token});i.I8.setToken(B,!1),i.I8.setUserInfo(re,!1),n("/")}catch(B){if(B.response){const re=Le()(B,["response","data","message"],"Something went wrong"),Xe=Le()(B,["response","data","statusCode"],400);H({type:"SET_REQUEST_ERROR",errorMessage:re,errorStatus:Xe}),Re({errorMessage:re})}}finally{Ie(!1)}},_t=()=>{if(f==="login"){const Z=A.get("redirectTo"),Q=Z?decodeURIComponent(Z):"/";n(Q)}else n("/")};if(!j[f]||o&&f==="register-admin"||i.I8.getToken())return e.createElement(le.l_,{to:"/"});if(!o&&f!=="register-admin")return e.createElement(le.l_,{to:{pathname:"/auth/register-admin",search:r}});if(M&&(j.login.Component=M),!M)return null;const{Component:ws}=j?.[f]??{};return e.createElement(ws,{...me,authType:f,fieldsToDisable:ze,formErrors:T,inputsPrefix:ee,modifiedData:q,onChange:F,onSubmit:te,requestError:_,schema:Te})};Wt.defaultProps={hasAdmin:!1},Wt.propTypes={hasAdmin:a().bool,setHasAdmin:a().func.isRequired};var fs=Wt,hs=t(33248),Es=t(68465),vs=t(84967),ys=t(7563),Ps=t(33348);const Ts=[{intlLabel:{id:"Usecase.front-end",defaultMessage:"Front-end developer"},value:"front_end_developer"},{intlLabel:{id:"Usecase.back-end",defaultMessage:"Back-end developer"},value:"back_end_developer"},{intlLabel:{id:"Usecase.full-stack",defaultMessage:"Full-stack developer"},value:"full_stack_developer"},{intlLabel:{id:"global.content-manager",defaultMessage:"Content Manager"},value:"content_manager"},{intlLabel:{id:"Usecase.content-creator",defaultMessage:"Content Creator"},value:"content_creator"},{intlLabel:{id:"Usecase.other",defaultMessage:"Other"},value:"other"}],Rs=(0,Be.ZP)(ve.Z)`
|
|
16
|
-
text-align: center;
|
|
17
|
-
`;var Cs=()=>{const o=(0,i.lm)(),{push:s,location:n}=(0,le.k6)(),{formatMessage:r}=(0,De.Z)(),[l,p]=(0,e.useState)(),[g,f]=(0,e.useState)(""),{post:A}=(0,i.kY)(),{firstname:M,email:j}=i.I8.getUserInfo(),{hasAdmin:T}=(0,Ps.parse)(n?.search,{ignoreQueryPrefix:!0}),q=l==="other",_=async(H,de)=>{H.preventDefault();try{await A("https://analytics.strapi.io/register",{email:j,username:M,firstAdmin:Boolean(!T),persona:{role:de?void 0:l,otherRole:de?void 0:g}}),o({type:"success",message:{id:"Usecase.notification.success.project-created",defaultMessage:"Project has been successfully created"}}),s("/")}catch{}};return e.createElement(ae.ZP,null,e.createElement(Je.o,{labelledBy:"usecase-title"},e.createElement(ae.bU,null,e.createElement("form",{onSubmit:H=>_(H,!1)},e.createElement(Pe.k,{direction:"column",paddingBottom:7},e.createElement(Qe.Z,null),e.createElement(Ee.x,{paddingTop:6,paddingBottom:1,width:(0,i.Q1)(250)},e.createElement(Rs,{variant:"alpha",as:"h1",id:"usecase-title"},r({id:"Usecase.title",defaultMessage:"Tell us a bit more about yourself"})))),e.createElement(Pe.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Es.P,{id:"usecase","data-testid":"usecase",label:r({id:"Usecase.input.work-type",defaultMessage:"What type of work do you do?"}),onChange:p,value:l},Ts.map(({intlLabel:H,value:de})=>e.createElement(vs.W,{key:de,value:de},r(H)))),q&&e.createElement(Ge.o,{name:"other",label:r({id:"Usecase.other",defaultMessage:"Other"}),value:g,onChange:H=>f(H.target.value),"data-testid":"other"}),e.createElement(lt.z,{type:"submit",size:"L",fullWidth:!0,disabled:!l},r({id:"global.finish",defaultMessage:"Finish"}))))),e.createElement(Pe.k,{justifyContent:"center"},e.createElement(Ee.x,{paddingTop:4},e.createElement(ys.A,{onClick:()=>_(!0)},r({id:"Usecase.button.skip",defaultMessage:"Skip this question"}))))))},qt=t(4556);const Ss=(0,e.lazy)(()=>Promise.all([t.e(6691),t.e(801)]).then(t.bind(t,63546)));function As(){const o=(0,ue.c)(He,async()=>(await t.e(3100).then(t.bind(t,73100))).ADMIN_PERMISSIONS_EE,{combine(J,ee){return O()({},J,ee)},defaultValue:He}),s=(0,ue.c)(qt.y3,async()=>(await t.e(1386).then(t.bind(t,31386))).ROUTES_EE,{defaultValue:[]}),n=(0,i.lm)(),{updateProjectSettings:r}=(0,bt.um)(),{formatMessage:l}=(0,De.Z)(),[{isLoading:p,hasAdmin:g,uuid:f,deviceId:A},M]=(0,e.useState)({isLoading:!0,hasAdmin:!1}),j=(0,fe.I0)(),T=(0,i.L7)(),{get:q,post:_}=(0,i.kY)(),H=(0,e.useMemo)(()=>(0,se.WW)(s.map(({to:J,Component:ee,exact:Te})=>(0,se.ot)(ee,J,Te))),[s]),[de,S]=(0,e.useState)(null);(0,e.useEffect)(()=>{j({type:qt.XS,payload:o})},[o,j]),(0,e.useEffect)(()=>{const J=i.I8.getToken();J&&(async()=>{try{const{data:{data:{token:Te}}}=await _("/admin/renew-token",{token:J});i.I8.updateToken(Te)}catch{i.I8.clearAppStorage(),window.location.reload()}})()},[_]),(0,e.useEffect)(()=>{(async()=>{try{const{data:{data:{hasAdmin:ee,uuid:Te,menuLogo:me,authLogo:b}}}=await q("/admin/init");if(r({menuLogo:(0,i.CR)(me),authLogo:(0,i.CR)(b)}),Te){const{data:{data:F}}=await q("/admin/telemetry-properties",{validateStatus:te=>te<500});S(F);try{const te="didInitializeAdministration";await _("https://analytics.strapi.io/api/v2/track",{event:te,userId:"",deviceId:A,eventPropeties:{},userProperties:{environment:T.currentEnvironment},groupProperties:{...F,projectId:Te}},{headers:{"X-Strapi-Event":te}})}catch{}}M({isLoading:!1,hasAdmin:ee,uuid:Te,deviceId:A})}catch{n({type:"warning",message:{id:"app.containers.App.notification.error.init"}})}})()},[n,r]);const Ke=J=>M(ee=>({...ee,hasAdmin:J})),ze=(0,e.useMemo)(()=>({uuid:f,telemetryProperties:de,deviceId:A}),[f,de,A]);return p?e.createElement(i.dO,null):e.createElement(e.Suspense,{fallback:e.createElement(i.dO,null)},e.createElement(Ne.z,null,l({id:"skipToContent"})),e.createElement(i.L8,{value:ze},e.createElement(le.rs,null,H,e.createElement(le.AW,{path:"/auth/:authType",render:J=>e.createElement(fs,{...J,setHasAdmin:Ke,hasAdmin:g}),exact:!0}),e.createElement(Ue,{path:"/usecase",component:Cs}),e.createElement(Ue,{path:"/",component:Ss}),e.createElement(le.AW,{path:"",component:hs.default}))))}var Ms=As,Ls={ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",ca:"Catal\xE0",cs:"\u010Ce\u0161tina",de:"Deutsch",dk:"Dansk",en:"English",es:"Espa\xF1ol",eu:"Euskara",fr:"Fran\xE7ais",gu:"Gujarati",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",hu:"Magyar",id:"Indonesian",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4",ml:"Malayalam",ms:"Melayu",nl:"Nederlands",no:"Norwegian",pl:"Polski","pt-BR":"Portugu\xEAs (Brasil)",pt:"Portugu\xEAs (Portugal)",ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",sk:"Sloven\u010Dina",sv:"Swedish",th:"\u0E44\u0E17\u0E22",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",vi:"Ti\u1EBFng Vi\u1EC7t","zh-Hans":"\u4E2D\u6587 (\u7B80\u4F53)",zh:"\u4E2D\u6587 (\u7E41\u9AD4)",sa:"\u0938\u0902\u0938\u094D\u0915\u0943\u0924",hi:"\u0939\u093F\u0928\u094D\u0926\u0940"};class bs{constructor({adminConfig:s,appPlugins:n,library:r,middlewares:l,reducers:p}){this.customConfigurations=s.config,this.customBootstrapConfiguration=s.bootstrap,this.configurations={authLogo:$,head:{favicon:we},locales:["en"],menuLogo:$,notifications:{releases:!0},themes:{light:E.W,dark:P.$},translations:{},tutorials:!0},this.appPlugins=n||{},this.library=r,this.middlewares=l,this.plugins={},this.reducers=p,this.translations={},this.hooksDict={},this.admin={injectionZones:Ye},this.customFields=C.rh,this.menu=[],this.settings={global:{id:"global",intlLabel:{id:"Settings.global",defaultMessage:"Global Settings"},links:[]}}}addComponents=s=>{Array.isArray(s)?s.map(n=>this.library.components.add(n)):this.library.components.add(s)};addCorePluginMenuLink=s=>{const n=JSON.stringify(s);m()(s.to,`link.to should be defined for ${n}`),m()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),m()(["/plugins/content-type-builder","/plugins/upload"].includes(s.to),"This method is not available for your plugin"),m()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${n}`),this.menu.push(s)};addFields=s=>{Array.isArray(s)?s.map(n=>this.library.fields.add(n)):this.library.fields.add(s)};addMenuLink=s=>{const n=JSON.stringify(s);m()(s.to,`link.to should be defined for ${n}`),m()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),m()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${n}`),m()(s.Component&&typeof s.Component=="function","link.Component should be a valid React Component"),m()(s.icon&&typeof s.icon=="function","link.Icon should be a valid React Component"),this.menu.push(s)};addMiddlewares=s=>{s.forEach(n=>{this.middlewares.add(n)})};addReducers=s=>{Object.keys(s).forEach(n=>{this.reducers.add(n,s[n])})};addSettingsLink=(s,n)=>{m()(this.settings[s],"The section does not exist");const r=JSON.stringify(n);m()(n.id,`link.id should be defined for ${r}`),m()(n.intlLabel?.id&&n.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${r}`),m()(n.to,`link.to should be defined for ${r}`),m()(n.Component&&typeof n.Component=="function","link.Component should be a valid React Component"),this.settings[s].links.push(n)};addSettingsLinks=(s,n)=>{m()(this.settings[s],"The section does not exist"),m()(Array.isArray(n),"TypeError expected links to be an array"),n.forEach(r=>{this.addSettingsLink(s,r)})};async bootstrap(){Object.keys(this.appPlugins).forEach(s=>{const n=this.appPlugins[s].bootstrap;n&&n({addSettingsLink:this.addSettingsLink,addSettingsLinks:this.addSettingsLinks,getPlugin:this.getPlugin,injectContentManagerComponent:this.injectContentManagerComponent,injectAdminComponent:this.injectAdminComponent,registerHook:this.registerHook})}),N()(this.customBootstrapConfiguration)&&this.customBootstrapConfiguration({addComponents:this.addComponents,addFields:this.addFields,addMenuLink:this.addMenuLink,addReducers:this.addReducers,addSettingsLink:this.addSettingsLink,addSettingsLinks:this.addSettingsLinks,getPlugin:this.getPlugin,injectContentManagerComponent:this.injectContentManagerComponent,injectAdminComponent:this.injectAdminComponent,registerHook:this.registerHook})}bootstrapAdmin=async()=>(await this.createCustomConfigurations(),this.createHook(W.No),this.createHook(W.LK),this.createHook(W.dV),this.createHook(W.Eo),Promise.resolve());createCustomConfigurations=async()=>{if(this.customConfigurations?.locales&&(this.configurations.locales=["en",...this.customConfigurations.locales?.filter(s=>s!=="en")||[]]),this.customConfigurations?.auth?.logo&&(this.configurations.authLogo=this.customConfigurations.auth.logo),this.customConfigurations?.menu?.logo&&(this.configurations.menuLogo=this.customConfigurations.menu.logo),this.customConfigurations?.head?.favicon&&(this.configurations.head.favicon=this.customConfigurations.head.favicon),this.customConfigurations?.theme){const s=this.customConfigurations.theme.dark,n=this.customConfigurations.theme.light;!s&&!n&&(console.warn("[deprecated] In future versions, Strapi will stop supporting this theme customization syntax. The theme configuration accepts a light and a dark key to customize each theme separately. See https://docs.strapi.io/developer-docs/latest/development/admin-customization.html#theme-extension."),O()(this.configurations.themes.light,this.customConfigurations.theme)),n&&O()(this.configurations.themes.light,n),s&&O()(this.configurations.themes.dark,s)}this.customConfigurations?.notifications?.releases!==void 0&&(this.configurations.notifications.releases=this.customConfigurations.notifications.releases),this.customConfigurations?.tutorials!==void 0&&(this.configurations.tutorials=this.customConfigurations.tutorials)};createHook=s=>{this.hooksDict[s]=x()};createSettingSection=(s,n)=>{m()(s.id,"section.id should be defined"),m()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,"section.intlLabel should be defined"),m()(Array.isArray(n),"TypeError expected links to be an array"),m()(this.settings[s.id]===void 0,"A similar section already exists"),this.settings[s.id]={...s,links:[]},n.forEach(r=>{this.addSettingsLink(s.id,r)})};createStore=()=>k(this.middlewares.middlewares,this.reducers.reducers);getAdminInjectedComponents=(s,n,r)=>{try{return this.admin.injectionZones[s][n][r]||[]}catch(l){return console.error("Cannot get injected component",l),l}};getPlugin=s=>this.plugins[s];async initialize(){Object.keys(this.appPlugins).forEach(s=>{this.appPlugins[s].register(this)})}injectContentManagerComponent=(s,n,r)=>{m()(this.admin.injectionZones.contentManager[s]?.[n],`The ${s} ${n} zone is not defined in the content manager`),m()(r,"A Component must be provided"),this.admin.injectionZones.contentManager[s][n].push(r)};injectAdminComponent=(s,n,r)=>{m()(this.admin.injectionZones.admin[s]?.[n],`The ${s} ${n} zone is not defined in the admin`),m()(r,"A Component must be provided"),this.admin.injectionZones.admin[s][n].push(r)};async loadAdminTrads(){const s=this.configurations.locales.map(l=>t(48224)(`./${l}.json`).then(({default:p})=>({data:p,locale:l})).catch(()=>({data:null,locale:l})));return(await Promise.all(s)).reduce((l,p)=>(p.data&&(l[p.locale]=p.data),l),{})}async loadTrads(){const s=await this.loadAdminTrads(),n=Object.keys(this.appPlugins).map(g=>{const f=this.appPlugins[g].registerTrads;return f?f({locales:this.configurations.locales}):null}).filter(g=>g),l=(await Promise.all(n)).reduce((g,f)=>{const A=f.reduce((M,j)=>(M[j.locale]=j.data,M),{});return Object.keys(A).forEach(M=>{g[M]={...g[M],...A[M]}}),g},{}),p=this.configurations.locales.reduce((g,f)=>(g[f]={...s[f],...l[f]||{},...this.customConfigurations?.translations?.[f]},g),{});return this.configurations.translations=p,Promise.resolve()}registerHook=(s,n)=>{m()(this.hooksDict[s],`The hook ${s} is not defined. You are trying to register a hook that does not exist in the application.`),this.hooksDict[s].register(n)};registerPlugin=s=>{const n=(0,C.Sy)(s);this.plugins[n.pluginId]=n};runHookSeries=(s,n=!1)=>n?this.hooksDict[s].runSeriesAsync():this.hooksDict[s].runSeries();runHookWaterfall=(s,n,r=!1,l)=>r?this.hooksDict[s].runWaterfallAsync(n,l):this.hooksDict[s].runWaterfall(n,l);runHookParallel=s=>this.hooksDict[s].runParallel();render(){const s=this.createStore(),n=z()(Ls,this.configurations.locales||[]),{components:{components:r},fields:{fields:l}}=this.library;return e.createElement(u,{authLogo:this.configurations.authLogo,components:r,fields:l,customFields:this.customFields,localeNames:n,getAdminInjectedComponents:this.getAdminInjectedComponents,getPlugin:this.getPlugin,messages:this.configurations.translations,menu:this.menu,menuLogo:this.configurations.menuLogo,plugins:this.plugins,runHookParallel:this.runHookParallel,runHookWaterfall:(p,g,f=!1)=>this.runHookWaterfall(p,g,f,s),runHookSeries:this.runHookSeries,themes:this.configurations.themes,settings:this.settings,showTutorials:this.configurations.tutorials,showReleaseNotification:this.configurations.notifications.releases,store:s},e.createElement(e.Fragment,null,e.createElement(ge.q,{link:[{rel:"icon",type:"image/png",href:this.configurations.head.favicon}],htmlAttributes:{lang:localStorage.getItem(Ae)||"en"}}),e.createElement(V.VK,{basename:K.Z},e.createElement(Ms,{store:s}))))}}var Ds=({adminConfig:o={},appPlugins:s,library:n,middlewares:r,reducers:l})=>new bs({adminConfig:o,appPlugins:s,library:n,middlewares:r,reducers:l})},33229:function(G,y,t){"use strict";var e=t(32735);const E=(0,e.createContext)();y.Z=E},51399:function(G,y,t){"use strict";var e=t(32735),E=t(33229);const P=()=>{const{changeLocale:v,localeNames:m,messages:h}=(0,e.useContext)(E.Z);return{changeLocale:v,localeNames:m,messages:h}};y.Z=P},73678:function(G,y,t){"use strict";var e=t(32735),E=t(8471),P=t(2160);const v=E.ZP.img`
|
|
18
|
-
height: ${72/16}rem;
|
|
19
|
-
`,m=()=>{const{logos:{auth:h}}=(0,P.um)();return e.createElement(v,{src:h?.custom??h.default,"aria-hidden":!0,alt:""})};y.Z=m},76402:function(G,y,t){"use strict";t.d(y,{ux:function(){return P},_5:function(){return m},$l:function(){return N},Rj:function(){return O}});var e=t(32735),P=(0,e.createContext)({}),m=(0,e.createContext)({}),N=(0,e.createContext)({}),O=(0,e.createContext)({})},35231:function(G,y){"use strict";const t="/admin/".replace(window.location.origin,"");y.Z=t},66941:function(G,y,t){"use strict";t.d(y,{Eo:function(){return P},LK:function(){return E},No:function(){return e},dV:function(){return v}});const e="Admin/CM/pages/ListView/inject-column-in-table",E="Admin/CM/pages/App/mutate-collection-types-links",P="Admin/CM/pages/EditView/mutate-edit-view-layout",v="Admin/CM/pages/App/mutate-single-types-links"},2160:function(G,y,t){"use strict";t.d(y,{um:function(){return v},U_:function(){return ge},Dq:function(){return i},H9:function(){return je},$_:function(){return $e},rW:function(){return et},bF:function(){return ht},G4:function(){return Mt},Te:function(){return Ot},M1:function(){return jt}});var e=t(32735),E=t(76402),v=()=>(0,e.useContext)(E._5),m=t(90769),h=t(19565),N=t(97889);const X={data:{},error:null,isLoading:!0};var oe=(d,c)=>(0,N.ZP)(d,u=>{switch(c.type){case"GET_DATA":{u.isLoading=!0,u.data={},u.error=null;break}case"GET_DATA_SUCCEEDED":{u.data=c.data,u.isLoading=!1,u.error=null;break}case"GET_DATA_ERROR":{u.isLoading=!1,u.error=c.error;break}default:return u}}),ge=d=>{const[{data:c,error:u,isLoading:C},L]=(0,e.useReducer)(oe,X),{get:I}=(0,h.kY)();return(0,e.useEffect)(()=>{(async()=>{try{L({type:"GET_DATA"});const{data:{data:k}}=await I("/admin/permissions",{params:{role:d}});L({type:"GET_DATA_SUCCEEDED",data:k})}catch{}})()},[d,I]),{data:c,error:u,isLoading:C}};const V={role:{},permissions:{},isLoading:!0};var Se=(d,c)=>(0,N.ZP)(d,u=>{switch(c.type){case"GET_DATA_SUCCEEDED":{u.role=c.role,u.permissions=c.permissions,u.isLoading=!1;break}case"GET_DATA_ERROR":{u.isLoading=!1;break}case"ON_SUBMIT_SUCCEEDED":{u.role.name=c.name,u.role.description=c.description;break}default:return u}}),i=d=>{const c=(0,h.lm)(),[u,C]=(0,e.useReducer)(Se,V),{get:L}=(0,h.kY)();(0,e.useEffect)(()=>{d?(async k=>{try{const[{data:{data:K}},{data:{data:he}}]=await Promise.all([`roles/${k}`,`roles/${k}/permissions`].map(x=>L(`/admin/${x}`)));C({type:"GET_DATA_SUCCEEDED",role:K,permissions:he})}catch(K){console.error(K),C({type:"GET_DATA_ERROR"}),c({type:"warning",message:{id:"notification.error"}})}})(d):C({type:"GET_DATA_SUCCEEDED",role:{},permissions:[]})},[L,d,c]);const I=(0,e.useCallback)(U=>{C({type:"ON_SUBMIT_SUCCEEDED",...U})},[]);return{...u,onSubmitSucceeded:I}},ke=t(2287),a=t(36919),pe=t(45112),fe=t(15062),R=t(30305),D=t(99381),Y=t.n(D),ye=(d,c)=>c.map(({permissions:u})=>(0,h.qX)(d,u)),xe=async(d,c,u)=>{const C=ye(d,c),L=await Promise.all(C),I=c.filter((K,he)=>L[he]),U=I.findIndex(K=>K.to==="/settings");if(U===-1)return[];const k=Y()(I);return k[U].notificationsCount=u?1:0,k},Le=async(d,c)=>{const u=ye(d,c),C=await Promise.all(u);return c.filter((I,U)=>C[U])},je=()=>{const{allPermissions:d}=(0,h.vn)(),{shouldUpdateStrapi:c}=(0,h.L7)(),{menu:u}=(0,h.j1)(),C=(0,fe.v9)(R._),[L,I]=e.useState({generalSectionLinks:[{icon:ke.Z,intlLabel:{id:"global.plugins",defaultMessage:"Plugins"},to:"/list-plugins",permissions:C.marketplace.main},{icon:a.Z,intlLabel:{id:"global.marketplace",defaultMessage:"Marketplace"},to:"/marketplace",permissions:C.marketplace.main},{icon:pe.Z,intlLabel:{id:"global.settings",defaultMessage:"Settings"},to:"/settings",permissions:[],notificationsCount:0}],pluginsSectionLinks:[],isLoading:!0}),U=e.useRef(L.generalSectionLinks);return e.useEffect(()=>{async function k(){const K=await Le(d,u),he=await xe(d,U.current,c);I(x=>({...x,generalSectionLinks:he,pluginsSectionLinks:K,isLoading:!1}))}k()},[I,U,d,u,C,c]),L},$e=()=>(0,e.useContext)(E.$l),et=(d,c,u,C)=>{const[L,I]=(0,e.useState)(!1),U=(0,h.lm)(),{post:k}=(0,h.kY)(),{formatAPIError:K}=(0,h.So)();return{regenerateData:async()=>{try{const{data:{data:{accessKey:x}}}=await k(`${d}${c}/regenerate`);I(!1),u(x)}catch(x){I(!1),C?C(x):U({type:"warning",message:K(x)})}},isLoadingConfirmation:L}};const qe=!JSON.parse(localStorage.getItem("STRAPI_UPDATE_NOTIF")),es=()=>{const{latestStrapiReleaseTag:d,shouldUpdateStrapi:c}=useAppInfo(),u=useNotification();return useEffect(()=>{c&&qe&&u({type:"info",message:{id:"notification.version.update.message"},link:{url:`https://github.com/strapi/strapi/releases/tag/${d}`,label:{id:"global.see-more"}},blockTransition:!0,onClose:()=>localStorage.setItem("STRAPI_UPDATE_NOTIF",!0)})},[d,c,u]),null};var be=null,Ht=t(33795),gt=t.n(Ht),Ft=(d,c)=>({...d,isLoading:c});const tt={roles:[],isLoading:!0};var ft=(d,c)=>(0,N.ZP)(d,u=>{switch(c.type){case"GET_DATA":{u.isLoading=!0,u.roles=[];break}case"GET_DATA_SUCCEEDED":{u.roles=c.data,u.isLoading=!1;break}case"GET_DATA_ERROR":{u.isLoading=!1;break}default:return u}}),ht=(d=!0)=>{const c=(0,h.lm)(),[{roles:u,isLoading:C},L]=(0,e.useReducer)(ft,tt,()=>Ft(tt,d));(0,e.useEffect)(()=>{d&&I()},[d]);const I=(0,e.useCallback)(async()=>{const U=(0,h.tg)();try{L({type:"GET_DATA"});const{data:{data:k}}=await U.get("/admin/roles");L({type:"GET_DATA_SUCCEEDED",data:k})}catch(k){const K=gt()(k,["response","payload","message"],"An error occured");L({type:"GET_DATA_ERROR"}),K!=="Forbidden"&&c({type:"warning",message:K})}},[c]);return{roles:u,isLoading:C,getData:I}},st=t(9086),Et=t.n(st),nt=t(86209),vt=(d,c)=>({...d,fieldsToPick:c}),yt=t(88423),Ze=t.n(yt),Pt=t(3040),Tt=t.n(Pt),Rt=t(56236),at=t.n(Rt);const Ct={fieldsToPick:[],formErrors:{},initialData:{},isLoading:!0,modifiedData:{},showHeaderButtonLoader:!1,showHeaderLoader:!0},St=(d,c)=>(0,N.ZP)(d,u=>{switch(c.type){case"GET_DATA_SUCCEEDED":{u.isLoading=!1,u.showHeaderLoader=!1,u.initialData=Ze()(c.data,d.fieldsToPick),u.modifiedData=Ze()(c.data,d.fieldsToPick);break}case"ON_CANCEL":{u.modifiedData=d.initialData,u.formErrors={};break}case"ON_CHANGE":{c.inputType==="password"&&!c.value?at()(u.modifiedData,c.keys.split(".")):c.keys.includes("username")&&!c.value?Tt()(u.modifiedData,c.keys.split("."),null):Tt()(u.modifiedData,c.keys.split("."),c.value);break}case"ON_SUBMIT":{u.showHeaderButtonLoader=!0;break}case"ON_SUBMIT_SUCCEEDED":{u.initialData=Ze()(c.data,d.fieldsToPick),u.modifiedData=Ze()(c.data,d.fieldsToPick),u.showHeaderButtonLoader=!1;break}case"SET_ERRORS":{u.formErrors=c.errors,u.showHeaderButtonLoader=!1;break}default:return u}});var Mt=(d,c,u,C)=>{const[{formErrors:L,initialData:I,isLoading:U,modifiedData:k,showHeaderButtonLoader:K,showHeaderLoader:he},x]=(0,e.useReducer)(St,Ct,()=>vt(Ct,C)),W=(0,h.lm)(),{lockApp:we,unlockApp:rt}=(0,h.o1)(),{get:Ye,put:Ne}=(0,h.kY)();return(0,e.useEffect)(()=>{d&&(async()=>{try{const{data:{data:se}}=await Ye(d);x({type:"GET_DATA_SUCCEEDED",data:se,fieldsToPick:C})}catch(se){console.error(se.response),W({type:"warning",message:{id:"notification.error"}})}})()},[d]),[{formErrors:L,initialData:I,isLoading:U,modifiedData:k,showHeaderButtonLoader:K,showHeaderLoader:he},x,{handleCancel:()=>{x({type:"ON_CANCEL"})},handleChange:({target:{name:ue,value:se,type:ne}})=>{x({type:"ON_CHANGE",inputType:ne,keys:ue,value:se})},handleSubmit:async ue=>{ue.preventDefault();const se=await(0,nt.R6)(k,c);if(x({type:"SET_ERRORS",errors:se||{}}),!se)try{we(),x({type:"ON_SUBMIT"});const ne=Et()(k,["confirmPassword","registrationToken"]);ne.roles&&(ne.roles=ne.roles.map(Fe=>Fe.id)),ne.ssoLockedRoles&&(ne.ssoLockedRoles=[...new Set(ne.ssoLockedRoles)]);const{data:{data:ce}}=await Ne(d,ne);u(ce),x({type:"ON_SUBMIT_SUCCEEDED",data:ce}),W({type:"success",message:{id:"notification.success.saved"}})}catch(ne){const ce=ne?.response?.payload??{data:{}};ce?.data&&typeof ce.data=="string"?W({type:"warning",message:ce.data}):W({type:"warning",message:ce.message});const Fe=(0,nt.Iz)(ce);x({type:"SET_ERRORS",errors:Fe})}finally{rt()}},setField:(ue,se)=>{x({type:"ON_CHANGE",keys:ue,value:se})}}]},Lt=t(9592);const De={global:[{intlLabel:{id:"Settings.application.title",defaultMessage:"Overview"},to:"/settings/application-infos",id:"000-application-infos",permissions:[]},{intlLabel:{id:"Settings.webhooks.title",defaultMessage:"Webhooks"},to:"/settings/webhooks",id:"webhooks"},{intlLabel:{id:"Settings.apiTokens.title",defaultMessage:"API Tokens"},to:"/settings/api-tokens?sort=name:ASC",id:"api-tokens"},{intlLabel:{id:"Settings.transferTokens.title",defaultMessage:"Transfer Tokens"},to:"/settings/transfer-tokens?sort=name:ASC",id:"transfer-tokens"}],admin:[{intlLabel:{id:"global.roles",defaultMessage:"Roles"},to:"/settings/roles",id:"roles"},{intlLabel:{id:"global.users"},to:"/settings/users?pageSize=10&page=1&sort=firstname",id:"users"}]};var Be=d=>d.map(c=>{const u=c.links.map(C=>({...C,isDisplayed:!1}));return{...c,links:u}}),Kt=t(98978),Dt=t.n(Kt),kt=d=>Dt()(d,c=>c.id),Ot=()=>{const[{isLoading:d,menu:c},u]=(0,e.useState)({isLoading:!0,menu:[]}),{allPermissions:C}=(0,h.vn)(),{shouldUpdateStrapi:L}=(0,h.L7)(),{settings:I}=(0,h.j1)(),U=(0,fe.v9)(R._),{global:k,admin:K}=(0,Lt.c)(De,async()=>(await t.e(918).then(t.bind(t,50918))).LINKS_EE,{combine(W,we){return{admin:[...we.admin,...W.admin],global:[...W.global,...we.global]}},defaultValue:{admin:[],global:[]}}),he=(0,e.useCallback)(W=>{if(!W.id)throw new Error("The settings menu item must have an id attribute.");return{...W,permissions:U.settings?.[W.id]?.main}},[U.settings]);(0,e.useEffect)(()=>{const W=async()=>{const le=await(We=>Promise.all(We.reduce((Ue,He,ue)=>{const se=ne=>ne.map(async(ce,Fe)=>({hasPermission:await(0,h.qX)(C,ce.permissions),sectionIndex:ue,linkIndex:Fe}));return[...Ue,...se(He.links)]},[])))(Ye);u(We=>({...We,isLoading:!1,menu:Ye.map((Ue,He)=>({...Ue,links:Ue.links.map((ue,se)=>{const ne=le.find(ce=>ce.sectionIndex===He&&ce.linkIndex===se);return{...ue,isDisplayed:Boolean(ne.hasPermission)}})}))}))},{global:we,...rt}=I,Ye=Be([{...I.global,links:kt([...I.global.links,...k.map(he)]).map(Ne=>({...Ne,hasNotification:Ne.id==="000-application-infos"&&L}))},{id:"permissions",intlLabel:{id:"Settings.permissions",defaultMessage:"Administration Panel"},links:K.map(he)},...Object.values(rt)]);W()},[K,k,C,I,L,he]);const x=W=>({...W,links:W.links.filter(we=>we.isDisplayed)});return{isLoading:d,menu:c.map(x)}},jt=()=>(0,e.useContext)(E.Rj)},90769:function(G,y,t){"use strict";t.d(y,{G:function(){return P}});var e=t(19565),E=t(20108);function P(){const{get:v}=(0,e.kY)(),{formatAPIError:m}=(0,e.So)(),h=(0,e.lm)(),N=(0,E.useQueries)(["components","content-types"].map(V=>({queryKey:["content-manager",V],async queryFn(){const{data:{data:$}}=await v(`/content-manager/${V}`);return $},onError($){h({type:"warning",message:m($)})}}))),[X,O]=N,oe=X.isLoading||O.isLoading,z=(O?.data??[]).filter(V=>V.kind==="collectionType"&&V.isDisplayed),ge=(O?.data??[]).filter(V=>V.kind!=="collectionType"&&V.isDisplayed);return{isLoading:oe,components:X?.data??[],collectionTypes:z,singleTypes:ge}}},9592:function(G,y,t){"use strict";t.d(y,{c:function(){return v}});var e=t(32735),E=t(19565);function P(){return window.strapi.isEE}function v(m,h,{defaultValue:N=null,combine:X=(oe,z)=>z,enabled:O=!0}={}){const oe=(0,E.W6)(h),z=(0,E.W6)(X),[{data:ge},V]=e.useState({data:P()&&O?N:m});return e.useEffect(()=>{async function $(){const Se=await oe();V({data:z(m,Se)})}P()&&O&&$()},[m,oe,z,O]),ge}},11060:function(G,y,t){"use strict";t.d(y,{sg:function(){return V},bU:function(){return $},ZP:function(){return Ae}});var e=t(32735),E=t(72850),P=t(87933),v=t(60216),m=t.n(v),h=t(8471),N=t(77035),X=t(67879),O=t(51399),z=()=>{const{changeLocale:i,localeNames:ke}=(0,O.Z)(),{locale:a}=(0,X.Z)();return e.createElement(N.q4,{value:a,onChange:pe=>i(pe)},Object.entries(ke).map(([pe,fe])=>e.createElement(N.ag,{key:pe,value:pe},fe)))};const ge=(0,h.ZP)(E.x)`
|
|
20
|
-
margin: 0 auto;
|
|
21
|
-
width: 552px;
|
|
22
|
-
`,V=(0,h.ZP)(P.k)`
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
`,$=({children:i})=>e.createElement(ge,{shadow:"tableShadow",hasRadius:!0,paddingTop:9,paddingBottom:9,paddingLeft:10,paddingRight:10,background:"neutral0",justifyContent:"center"},i);$.propTypes={children:m().node.isRequired};const Se=({children:i})=>e.createElement("div",null,e.createElement(P.k,{as:"header",justifyContent:"flex-end"},e.createElement(E.x,{paddingTop:6,paddingRight:8},e.createElement(z,null))),e.createElement(E.x,{paddingTop:2,paddingBottom:11},i));Se.propTypes={children:m().node.isRequired};var Ae=Se},30305:function(G,y,t){"use strict";t.d(y,{_:function(){return v}});var e=t(98178),E=t(69891);const P=()=>m=>m.admin_app||E.E,v=(0,e.P1)(P(),m=>m.permissions)},24018:function(G,y,t){"use strict";var e=t(63642),E=t(8471);const P=(0,E.ZP)(e.E)`
|
|
25
|
-
svg {
|
|
26
|
-
height: 1rem;
|
|
27
|
-
width: 1rem;
|
|
28
|
-
path {
|
|
29
|
-
fill: ${({theme:v})=>v.colors.neutral600};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
`;y.Z=P},24436:function(G,y,t){"use strict";var e=t(32735),E=t(10369),P=t(27649),v=t(72850),m=t(49372),h=t(87933),N=t(8284),X=t(41415),O=t(19565),oe=t(54894),z=t(60492),ge=t(92802),V=t(60216),$=t.n(V),Se=t(67879),Ae=t(8471),i=t(73678),ke=t(11060),a=t(24018);const pe=(0,Ae.ZP)(E.o)`
|
|
33
|
-
::-ms-reveal {
|
|
34
|
-
display: none;
|
|
35
|
-
}
|
|
36
|
-
`,fe=({onSubmit:R,schema:D,children:Y})=>{const[Me,ye]=(0,e.useState)(!1),{formatMessage:ie}=(0,Se.Z)();return e.createElement(P.o,null,e.createElement(ke.bU,null,e.createElement(ge.J9,{enableReinitialize:!0,initialValues:{email:"",password:"",rememberMe:!1},onSubmit:R,validationSchema:D,validateOnChange:!1},({values:xe,errors:Oe,handleChange:Le})=>e.createElement(O.l0,{noValidate:!0},e.createElement(ke.sg,null,e.createElement(i.Z,null),e.createElement(v.x,{paddingTop:6,paddingBottom:1},e.createElement(m.Z,{variant:"alpha",as:"h1"},ie({id:"Auth.form.welcome.title",defaultMessage:"Welcome!"}))),e.createElement(v.x,{paddingBottom:7},e.createElement(m.Z,{variant:"epsilon",textColor:"neutral600"},ie({id:"Auth.form.welcome.subtitle",defaultMessage:"Log in to your Strapi account"}))),Oe.errorMessage&&e.createElement(m.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},Oe.errorMessage)),e.createElement(h.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(E.o,{error:Oe.email?ie({id:Oe.email,defaultMessage:"This value is required."}):"",value:xe.email,onChange:Le,label:ie({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:ie({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),e.createElement(pe,{error:Oe.password?ie({id:Oe.password,defaultMessage:"This value is required."}):"",onChange:Le,value:xe.password,label:ie({id:"global.password",defaultMessage:"Password"}),name:"password",type:Me?"text":"password",endAction:e.createElement(a.Z,{onClick:Ve=>{Ve.stopPropagation(),ye(je=>!je)},label:ie(Me?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},Me?e.createElement(oe.Z,null):e.createElement(z.Z,null)),required:!0}),e.createElement(N.X,{onValueChange:Ve=>{Le({target:{value:Ve,name:"rememberMe"}})},value:xe.rememberMe,"aria-label":"rememberMe",name:"rememberMe"},ie({id:"Auth.form.rememberMe.label",defaultMessage:"Remember me"})),e.createElement(X.z,{fullWidth:!0,type:"submit"},ie({id:"Auth.form.button.login",defaultMessage:"Login"}))))),Y),e.createElement(h.k,{justifyContent:"center"},e.createElement(v.x,{paddingTop:4},e.createElement(O.rU,{to:"/auth/forgot-password"},ie({id:"Auth.link.forgot-password",defaultMessage:"Forgot your password?"})))))};fe.defaultProps={children:null,onSubmit(){}},fe.propTypes={children:$().node,onSubmit:$().func,schema:$().shape({type:$().string.isRequired}).isRequired},y.Z=fe},33248:function(G,y,t){"use strict";t.r(y);var e=t(32735),E=t(27649),P=t(82055),v=t(17e3),m=t(9695),h=t(19565),N=t(8482),X=t(25386),O=t(67879);const oe=()=>{const{formatMessage:z}=(0,O.Z)();return(0,h.go)(),e.createElement(E.o,{labelledBy:"title"},e.createElement(P.T,{id:"title",title:z({id:"content-manager.pageNotFound",defaultMessage:"Page not found"})}),e.createElement(v.D,null,e.createElement(m.x,{action:e.createElement(h.Qj,{variant:"secondary",endIcon:e.createElement(N.Z,null),to:"/"},z({id:"app.components.NotFoundPage.back",defaultMessage:"Back to homepage"})),content:z({id:"app.page.not.found",defaultMessage:"Oops! We can't seem to find the page you're looging for..."}),hasRadius:!0,icon:e.createElement(X.Z,{width:"10rem"}),shadow:"tableShadow"})))};y.default=oe},5074:function(G,y){"use strict";const t=({data:e})=>{try{return Object.keys(e).reduce((E,P)=>{const v=e[P][0];return E[P]={id:v,defaultMessage:v},E},{})}catch{return{}}};y.Z=t},86209:function(G,y,t){"use strict";t.d(y,{R6:function(){return P},ot:function(){return oe},Iz:function(){return z.Z},Pp:function(){return ge},IF:function(){return $},Qy:function(){return fe},WW:function(){return Ae}});var e=t(19565),P=async(R,D)=>{let Y=null;try{await D.validate(R,{abortEarly:!1})}catch(Me){Y=(0,e.CJ)(Me)}return Y},v=t(32735),m=t(60216),h=t.n(m),N=t(53038);const X=({loadComponent:R})=>{const[D,Y]=(0,v.useState)(null);return(0,v.useEffect)(()=>{(async()=>{try{const ye=await R();Y(()=>ye.default)}catch(ye){console.log(ye)}})()},[R]),D?v.createElement(D,null):v.createElement(e.dO,null)},O=(R,D,Y)=>v.createElement(N.AW,{render:()=>v.createElement(X,{loadComponent:R}),key:D,path:D,exact:Y||!1});X.propTypes={loadComponent:h().func.isRequired};var oe=O,z=t(5074),ge=(R,D="")=>[R,D].filter(Y=>Y).join(" "),$=R=>`/admin/${R}`,Ae=R=>R.filter((D,Y,Me)=>Me.findIndex(ye=>ye.key===D.key)===Y),i=t(98978);const ke=R=>sortBy(R,D=>D.name);var a=null;const pe={bufferToHex(R){return[...new Uint8Array(R)].map(D=>D.toString(16).padStart(2,"0")).join("")},async digestMessage(R){const D=new TextEncoder().encode(R),Y=await crypto.subtle.digest("SHA-256",D);return this.bufferToHex(Y)}};async function fe(R){if(!R)return null;try{return await pe.digestMessage(R.email)}catch{return null}}},48224:function(G,y,t){var e={"./ar.json":[38677,7958],"./ca.json":[90169,3516],"./cs.json":[43186,7519],"./de.json":[8343,6901],"./dk.json":[65668,7898],"./en.json":[10329,320],"./es.json":[45445,8367],"./eu.json":[69511,8360],"./fr.json":[8399,8006],"./gu.json":[10182,2248],"./he.json":[21757,830],"./hi.json":[43206,6332],"./hu.json":[72320,5894],"./id.json":[74221,8897],"./it.json":[90685,6817],"./ja.json":[21727,1312],"./ko.json":[30986,1377],"./ml.json":[11309,9903],"./ms.json":[75973,3025],"./nl.json":[80381,2671],"./no.json":[82446,562],"./pl.json":[84008,7846],"./pt-BR.json":[91417,9647],"./pt.json":[41830,3340],"./ru.json":[57098,123],"./sa.json":[92900,9726],"./sk.json":[52204,606],"./sv.json":[43211,9303],"./th.json":[49582,749],"./tr.json":[99154,395],"./uk.json":[2987,7403],"./vi.json":[50576,3278],"./zh-Hans.json":[35964,2553],"./zh.json":[91999,1011]};function E(P){if(!t.o(e,P))return Promise.resolve().then(function(){var h=new Error("Cannot find module '"+P+"'");throw h.code="MODULE_NOT_FOUND",h});var v=e[P],m=v[0];return t.e(v[1]).then(function(){return t.t(m,19)})}E.keys=function(){return Object.keys(e)},E.id=48224,G.exports=E},47750:function(G,y,t){"use strict";G.exports=t.p+"70674f63fc3904c20de0.svg"}}]);
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[2544],{15570:function(X,B,r){"use strict";r.r(B),r.d(B,{CreatePage:function(){return Ee},default:function(){return $e}});var e=r(32735),b=r(27649),P=r(82055),R=r(87933),Z=r(41415),O=r(17e3),S=r(72850),x=r(49372),D=r(15335),q=r(5803),a=r(10369),H=r(33475),p=r(19565),A=r(29439),F=r(14723),f=r(92802),C=r(33795),w=r.n(C),ue=r(86834),ae=r.n(ue),ie=r(67879),y=r(15062),le=r(53038),Y=r(8471),G=r(2160),_=r(30305),xe=r(1283),me=r(24346),oe=me.Ry().shape({name:me.Z_().required(p.I0.required),description:me.Z_().required(p.I0.required)});const Pe=Y.ZP.div`
|
|
2
|
-
border: 1px solid ${({theme:T})=>T.colors.primary200};
|
|
3
|
-
background: ${({theme:T})=>T.colors.primary100};
|
|
4
|
-
padding: ${({theme:T})=>`${T.spaces[2]} ${T.spaces[4]}`};
|
|
5
|
-
color: ${({theme:T})=>T.colors.primary600};
|
|
6
|
-
border-radius: ${({theme:T})=>T.borderRadius};
|
|
7
|
-
font-size: ${12/16}rem;
|
|
8
|
-
font-weight: bold;
|
|
9
|
-
`,Ee=()=>{const T=(0,p.lm)(),{lockApp:ne,unlockApp:z}=(0,p.o1)(),{formatMessage:k}=(0,ie.Z)(),[Q,pe]=(0,e.useState)(!1),{replace:de}=(0,le.k6)(),ee=(0,e.useRef)(),{trackUsage:ce}=(0,p.rS)(),Ze=(0,le.$B)("/settings/roles/duplicate/:id"),Ae=w()(Ze,"params.id",null),{isLoading:Be,data:he}=(0,G.U_)(),{permissions:Oe,isLoading:De}=(0,G.Dq)(Ae),{post:Fe,put:je}=(0,p.kY)(),He=re=>{ne(),pe(!0),ce(Ae?"willDuplicateRole":"willCreateNewRole"),Promise.resolve(Fe("/admin/roles",re)).then(async({data:W})=>{const{permissionsToSend:U}=ee.current.getPermissions();return ce(Ae?"didDuplicateRole":"didCreateNewRole"),W.data.id&&!ae()(U)&&await je(`/admin/roles/${W.data.id}/permissions`,{permissions:U}),W}).then(W=>{pe(!1),T({type:"success",message:{id:"Settings.roles.created",defaultMessage:"created"}}),de(`/settings/roles/${W.data.id}`)}).catch(W=>{console.error(W),pe(!1),T({type:"warning",message:{id:"notification.error"}})}).finally(()=>{z()})},Le=`${k({id:"Settings.roles.form.created",defaultMessage:"Created"})} ${(0,F.Z)(new Date,"PPP")}`;return e.createElement(b.o,null,e.createElement(p.SL,{name:"Roles"}),e.createElement(f.J9,{initialValues:{name:"",description:Le},onSubmit:He,validationSchema:oe,validateOnChange:!1},({handleSubmit:re,values:W,errors:U,handleReset:ye,handleChange:Ce})=>e.createElement(p.l0,{noValidate:!0},e.createElement(e.Fragment,null,e.createElement(P.T,{primaryAction:e.createElement(R.k,{gap:2},e.createElement(Z.z,{variant:"secondary",onClick:()=>{ye(),ee.current.resetForm()},size:"L"},k({id:"app.components.Button.reset",defaultMessage:"Reset"})),e.createElement(Z.z,{onClick:re,loading:Q,size:"L"},k({id:"global.save",defaultMessage:"Save"}))),title:k({id:"Settings.roles.create.title",defaultMessage:"Create a role"}),subtitle:k({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(p.rU,{startIcon:e.createElement(A.Z,null),to:"/settings/roles"},k({id:"global.back",defaultMessage:"Back"}))}),e.createElement(O.D,null,e.createElement(R.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(S.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(R.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(R.k,{justifyContent:"space-between"},e.createElement(S.x,null,e.createElement(S.x,null,e.createElement(x.Z,{fontWeight:"bold"},k({id:"global.details",defaultMessage:"Details"}))),e.createElement(S.x,null,e.createElement(x.Z,{variant:"pi",textColor:"neutral600"},k({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(Pe,null,k({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:0}))),e.createElement(D.r,{gap:4},e.createElement(q.P,{col:6},e.createElement(a.o,{name:"name",error:U.name&&k({id:U.name}),label:k({id:"global.name",defaultMessage:"Name"}),onChange:Ce,value:W.name})),e.createElement(q.P,{col:6},e.createElement(H.g,{label:k({id:"global.description",defaultMessage:"Description"}),id:"description",error:U.description&&k({id:U.description}),onChange:Ce},W.description))))),!Be&&!De?e.createElement(S.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(xe.Z,{isFormDisabled:!1,ref:ee,permissions:Oe,layout:he})):e.createElement(S.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(p.dO,null))))))))};function $e(){const T=(0,y.v9)(_._);return e.createElement(p.O4,{permissions:T.settings.roles.create},e.createElement(Ee,null))}},1283:function(X,B,r){"use strict";r.d(B,{Z:function(){return es}});var e=r(32735),b=r(91215),P=r(90980),R=r(3653),Z=r(19565),O=r(23973),S=r.n(O),x=r(86834),D=r.n(x),q=r(60216),a=r.n(q),H=r(67879),p=r(72850),A=r(98978),F=r.n(A),f=r(8471),C=r(87933),w=r(82884),ue=r(15974),ae=r(96441),ie=r(33795),y=r.n(ie),le=r(9086),Y=r.n(le),G=r(2160),_=r(41415),xe=r(45112);const me=f.ZP.div`
|
|
10
|
-
position: relative;
|
|
11
|
-
|
|
12
|
-
${({hasConditions:t,disabled:n,theme:o})=>t&&`
|
|
13
|
-
&:before {
|
|
14
|
-
content: '';
|
|
15
|
-
position: absolute;
|
|
16
|
-
top: -3px;
|
|
17
|
-
left: -10px;
|
|
18
|
-
width: 6px;
|
|
19
|
-
height: 6px;
|
|
20
|
-
border-radius: ${20/16}rem;;
|
|
21
|
-
background: ${n?o.colors.neutral100:o.colors.primary600};
|
|
22
|
-
}
|
|
23
|
-
`}
|
|
24
|
-
`,Re=({onClick:t,className:n,hasConditions:o,variant:s})=>{const{formatMessage:i}=(0,H.Z)();return e.createElement(me,{hasConditions:o,className:n},e.createElement(_.z,{variant:s,startIcon:e.createElement(xe.Z,null),onClick:t},i({id:"global.settings",defaultMessage:"Settings"})))};Re.defaultProps={className:null,hasConditions:!1,variant:"tertiary"},Re.propTypes={onClick:a().func.isRequired,className:a().string,hasConditions:a().bool,variant:a().string};var oe=(0,f.ZP)(Re)``,Pe=r(85025),Ee=r(55225),$e=r(31600),T=r(49372),ne=r(11406),z=r(26858),k=r(51654),Q=r(97889),pe=r(81346),de=r.n(pe),ee=r(23940),ce=r.n(ee),Ze=r(27799);const Ae=t=>Object.values(t).map(n=>Object.entries(n).filter(([,o])=>o).map(([o])=>o)).flat(),Be=t=>t.reduce((n,[o,s])=>(n.push({label:ce()(o),children:s.map(i=>({label:i.displayName,value:i.id}))}),n),[]),he=(t,n)=>t.map(([,o])=>o).flat().reduce((o,s)=>({[s.id]:n.includes(s.id),...o}),{}),Oe=({arrayOfOptionsGroupedByCategory:t,isFormDisabled:n,isGrey:o,label:s,name:i,onChange:l,value:d})=>{const{formatMessage:c}=(0,H.Z)(),m=u=>{l(i,he(t,u))};return e.createElement(C.k,{as:"li",background:o?"neutral100":"neutral0",paddingBottom:3,paddingTop:3},e.createElement(C.k,{paddingLeft:6,style:{width:180}},e.createElement(T.Z,{variant:"sigma",textColor:"neutral600"},c({id:"Settings.permissions.conditions.can",defaultMessage:"Can"}),"\xA0"),e.createElement(T.Z,{variant:"sigma",title:s,textColor:"primary600",ellipsis:!0},c({id:`Settings.roles.form.permissions.${s.toLowerCase()}`,defaultMessage:s})),e.createElement(T.Z,{variant:"sigma",textColor:"neutral600"},"\xA0",c({id:"Settings.permissions.conditions.when",defaultMessage:"When"}))),e.createElement(p.x,{style:{maxWidth:430,width:"100%"}},e.createElement(Ze.Q,{id:i,customizeContent:u=>`${u.length} currently selected`,onChange:m,value:Ae(d),options:Be(t),disabled:n})))};Oe.propTypes={arrayOfOptionsGroupedByCategory:a().array.isRequired,isFormDisabled:a().bool.isRequired,isGrey:a().bool.isRequired,label:a().string.isRequired,name:a().string.isRequired,value:a().object.isRequired,onChange:a().func.isRequired};var De=Oe;const Fe=(t,n)=>t.reduce((o,s)=>(o[s.id]=y()(n,s.id,!1),o),{}),je=(t,n)=>t.reduce((o,s)=>{const[i,l]=s,d=Fe(l,n);return o[i]=d,o},{});var Le=(t,n,o)=>t.reduce((s,i)=>{const l=y()(n,[...i.pathToConditionsObject,"conditions"],{}),d=je(o,l);return s[i.pathToConditionsObject.join("..")]=d,s},{});const re=({actions:t,headerBreadCrumbs:n,isFormDisabled:o,onClosed:s,onToggle:i})=>{const{formatMessage:l}=(0,H.Z)(),{availableConditions:d,modifiedData:c,onChangeConditions:m}=(0,G.$_)(),u=(0,e.useMemo)(()=>Object.entries(de()(d,"category")),[d]),g=t.filter(({isDisplayed:h,hasSomeActionsSelected:L,hasAllActionsSelected:$})=>h&&(L||$)),v=(0,e.useMemo)(()=>Le(g,c,u),[g,c,u]),[M,N]=(0,e.useState)(v),j=(h,L)=>{N((0,Q.ZP)($=>{$[h]||($[h]={}),$[h].default||($[h].default={}),$[h].default=L}))},E=()=>{const h=Object.entries(M).reduce((L,$)=>{const[I,te]=$,K=Object.values(te).reduce((J,V)=>({...J,...V}),{});return L[I]=K,L},{});m(h),i()};return e.createElement(Pe.P,{labelledBy:"condition-modal-breadcrumbs",onClose:s},e.createElement(Ee.x,null,e.createElement(z.O,{id:"condition-modal-breadcrumbs",label:n.join(", ")},n.map((h,L,$)=>e.createElement(k.$,{isCurrent:L===$.length-1,key:h},ce()(l({id:h,defaultMessage:h})))))),e.createElement($e.f,null,g.length===0&&e.createElement(T.Z,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,g.map(({actionId:h,label:L,pathToConditionsObject:$},I)=>{const te=$.join("..");return e.createElement(De,{key:h,arrayOfOptionsGroupedByCategory:u,label:L,isFormDisabled:o,isGrey:I%2===0,name:te,onChange:j,value:y()(M,te,{})})}))),e.createElement(ne.m,{startActions:e.createElement(_.z,{variant:"tertiary",onClick:i},l({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(_.z,{onClick:E},l({id:"Settings.permissions.conditions.apply",defaultMessage:"Apply"}))}))};re.propTypes={actions:a().arrayOf(a().shape({actionId:a().string.isRequired,checkboxName:a().string,hasSomeActionsSelected:a().bool.isRequired,hasAllActionsSelected:a().bool,isDisplayed:a().bool.isRequired,label:a().string})).isRequired,headerBreadCrumbs:a().arrayOf(a().string).isRequired,isFormDisabled:a().bool.isRequired,onClosed:a().func.isRequired,onToggle:a().func.isRequired};var W=re;const U=`${120/16}rem`,ye=`${200/16}rem`,Ce=`${53/16}rem`;var Ue=f.ZP.div`
|
|
25
|
-
width: ${U};
|
|
26
|
-
`,ot=(0,f.ZP)(C.k)`
|
|
27
|
-
padding-right: ${({theme:t})=>t.spaces[2]};
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
flex: 1;
|
|
30
|
-
${({isCollapsable:t})=>t&&"cursor: pointer;"}
|
|
31
|
-
`;const Ke=({children:t,isCollapsable:n,isActive:o,isFormDisabled:s,label:i,onChange:l,onClick:d,checkboxName:c,someChecked:m,value:u})=>{const{formatMessage:g}=(0,H.Z)();return e.createElement(C.k,{alignItems:"center",paddingLeft:6,style:{width:ye,flexShrink:0}},e.createElement(p.x,{paddingRight:2},e.createElement(w.C,{name:c,"aria-label":g({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:i}),disabled:s,onValueChange:v=>l({target:{name:c,value:v}}),indeterminate:m,value:u})),e.createElement(ot,{title:i,alignItems:"center",isCollapsable:n,...n&&{onClick:d,"aria-expanded":o,onKeyDown:({key:v})=>(v==="Enter"||v===" ")&&d(),tabIndex:0,role:"button"}},e.createElement(T.Z,{fontWeight:o?"bold":"",textColor:o?"primary600":"neutral800",ellipsis:!0},ce()(i)),t))};Ke.defaultProps={children:null,checkboxName:"",onChange(){},value:!1,someChecked:!1,isCollapsable:!1},Ke.propTypes={checkboxName:a().string,children:a().node,label:a().string.isRequired,isCollapsable:a().bool,isFormDisabled:a().bool.isRequired,onChange:a().func,onClick:a().func.isRequired,someChecked:a().bool,value:a().bool,isActive:a().bool.isRequired};var rt=(0,e.memo)(Ke),Ft=r(72091),Nt=r.n(Ft),Wt=r(85973),be=r.n(Wt);const at=t=>be()(t)?Nt()(Object.values(t).map(n=>be()(n)?at(n):n)):[];var ke=at,ze=t=>t?Object.keys(t).reduce((n,o)=>(o!=="conditions"&&(n[o]=t[o]),n),{}):null,Te=t=>{const n=ze(t),o=ke(n);if(!o.length)return{hasAllActionsSelected:!1,hasSomeActionsSelected:!1};const s=o.every(l=>l),i=o.some(l=>l)&&!s;return{hasAllActionsSelected:s,hasSomeActionsSelected:i}},Vt=r(16899),Ne=(0,f.ZP)(Vt.Z)`
|
|
32
|
-
display: none;
|
|
33
|
-
width: ${10/16}rem;
|
|
34
|
-
transform: rotate(${({$isActive:t})=>t?"180":"0"}deg);
|
|
35
|
-
margin-left: ${({theme:t})=>t.spaces[2]};
|
|
36
|
-
`,We=t=>`
|
|
37
|
-
${T.Z} {
|
|
38
|
-
color: ${t.colors.primary600};
|
|
39
|
-
font-weight: ${t.fontWeights.bold}
|
|
40
|
-
}
|
|
41
|
-
${Ne} {
|
|
42
|
-
display: block;
|
|
43
|
-
path {
|
|
44
|
-
fill: ${t.colors.primary600}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
`,Ht=(t,n,o)=>t.map(({actionId:s,isDisplayed:i,applyToProperties:l,label:d})=>{if(!i)return{actionId:s,hasSomeActionsSelected:!1,isDisplayed:i};const c=[...o.split(".."),s],m=D()(l)?[...c,"properties","enabled"]:c,u=m.join(".."),g=y()(n,[...c,"conditions"],null),v=ke(g).some(E=>E);if(D()(l)){const E=y()(n,m,!1);return{actionId:s,checkboxName:u,hasAllActionsSelected:E,hasConditions:v,hasSomeActionsSelected:E,isDisplayed:i,isParentCheckbox:!1,label:d,pathToConditionsObject:c}}const M=y()(n,m,null),{hasAllActionsSelected:N,hasSomeActionsSelected:j}=Te(M);return{actionId:s,checkboxName:u,hasAllActionsSelected:N,hasConditions:v,hasSomeActionsSelected:j,isDisplayed:i,isParentCheckbox:!0,label:d,pathToConditionsObject:c}});const Xe=(t,n)=>`
|
|
48
|
-
${it} {
|
|
49
|
-
background-color: ${t.colors.primary100};
|
|
50
|
-
color: ${t.colors.primary600};
|
|
51
|
-
border-radius: ${n?"2px 2px 0 0":"2px"};
|
|
52
|
-
}
|
|
53
|
-
${dt} {
|
|
54
|
-
display: flex;
|
|
55
|
-
}
|
|
56
|
-
${oe} {
|
|
57
|
-
display: block;
|
|
58
|
-
}
|
|
59
|
-
&:hover {
|
|
60
|
-
${We(t)}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&:focus-within {
|
|
64
|
-
${({theme:o,isActive:s})=>Xe(o,s)}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
`,it=f.ZP.div`
|
|
68
|
-
flex: 1;
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
height: ${Ce};
|
|
72
|
-
background-color: ${({isGrey:t,theme:n})=>t?n.colors.neutral100:n.colors.neutral0};
|
|
73
|
-
border: 1px solid transparent;
|
|
74
|
-
`,Gt=f.ZP.div`
|
|
75
|
-
display: inline-flex;
|
|
76
|
-
min-width: 100%;
|
|
77
|
-
|
|
78
|
-
${oe} {
|
|
79
|
-
display: none;
|
|
80
|
-
}
|
|
81
|
-
${({isActive:t,theme:n})=>t&&Xe(n,t)}
|
|
82
|
-
&:hover {
|
|
83
|
-
${({theme:t,isActive:n})=>Xe(t,n)}
|
|
84
|
-
}
|
|
85
|
-
`,lt=(0,f.ZP)(C.k)`
|
|
86
|
-
width: ${U};
|
|
87
|
-
position: relative;
|
|
88
|
-
`,dt=(0,f.ZP)(p.x)`
|
|
89
|
-
display: none;
|
|
90
|
-
svg {
|
|
91
|
-
width: 11px;
|
|
92
|
-
}
|
|
93
|
-
* {
|
|
94
|
-
fill: ${({theme:t})=>t.colors.primary600};
|
|
95
|
-
}
|
|
96
|
-
`,ct=f.ZP.span`
|
|
97
|
-
position: absolute;
|
|
98
|
-
top: -6px;
|
|
99
|
-
left: 37px;
|
|
100
|
-
width: 6px;
|
|
101
|
-
height: 6px;
|
|
102
|
-
border-radius: 20px;
|
|
103
|
-
background: ${({theme:t})=>t.colors.primary600};
|
|
104
|
-
`,Ut=(0,f.ZP)(p.x)`
|
|
105
|
-
position: absolute;
|
|
106
|
-
right: 9px;
|
|
107
|
-
transform: translateY(10px);
|
|
108
|
-
`,ut=({availableActions:t,isActive:n,isGrey:o,isFormDisabled:s,label:i,onClickToggle:l,pathToData:d})=>{const[c,m]=(0,e.useState)(!1),{formatMessage:u}=(0,H.Z)(),{modifiedData:g,onChangeParentCheckbox:v,onChangeSimpleCheckbox:M}=(0,G.$_)(),N=()=>{m(K=>!K)},j=()=>{m(!1)},E=y()(g,d.split(".."),{}),h=(0,e.useMemo)(()=>Object.keys(E).reduce((K,J)=>(K[J]=Y()(E[J],"conditions"),K),{}),[E]),{hasAllActionsSelected:L,hasSomeActionsSelected:$}=Te(h),I=(0,e.useMemo)(()=>Ht(t,g,d),[t,g,d]),te=I.some(({hasConditions:K})=>K);return e.createElement(Gt,{isActive:n},e.createElement(it,{isGrey:o},e.createElement(rt,{isCollapsable:!0,isFormDisabled:s,label:i,checkboxName:d,onChange:v,onClick:l,someChecked:$,value:L,isActive:n},e.createElement(dt,{paddingLeft:2},n?e.createElement(ue.Z,null):e.createElement(ae.Z,null))),e.createElement(C.k,{style:{flex:1}},I.map(({actionId:K,hasConditions:J,hasAllActionsSelected:V,hasSomeActionsSelected:fe,isDisplayed:Ie,isParentCheckbox:se,checkboxName:ve,label:Ve})=>Ie?se?e.createElement(lt,{key:K,justifyContent:"center",alignItems:"center"},J&&e.createElement(ct,null),e.createElement(w.C,{disabled:s,name:ve,"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${Ve} ${i}`}),onValueChange:Se=>{v({target:{name:ve,value:Se}})},indeterminate:fe,value:V})):e.createElement(lt,{key:K,justifyContent:"center",alignItems:"center"},J&&e.createElement(ct,null),e.createElement(w.C,{disabled:s,indeterminate:J,name:ve,onValueChange:Se=>{M({target:{name:ve,value:Se}})},value:V})):e.createElement(Ue,{key:K}))),c&&e.createElement(W,{headerBreadCrumbs:[i,"Settings.permissions.conditions.conditions"],actions:I,isFormDisabled:s,onClosed:j,onToggle:N})),e.createElement(Ut,null,e.createElement(oe,{onClick:N,hasConditions:te})))};ut.propTypes={availableActions:a().array.isRequired,isActive:a().bool.isRequired,isGrey:a().bool.isRequired,isFormDisabled:a().bool.isRequired,label:a().string.isRequired,onClickToggle:a().func.isRequired,pathToData:a().string.isRequired};var Kt=ut;const zt=f.ZP.span`
|
|
109
|
-
color: ${({theme:t})=>t.colors.danger700};
|
|
110
|
-
padding-left: ${({theme:t})=>t.spaces[1]}px;
|
|
111
|
-
`;var mt=()=>e.createElement(zt,null,"*"),Xt=(t,n)=>t.map(o=>{const s=Array.isArray(o.subjects)&&o.subjects.indexOf(n)!==-1;return{...o,isDisplayed:s}});const wt=(0,f.ZP)(p.x)`
|
|
112
|
-
transform: translate(-4px, -12px);
|
|
113
|
-
|
|
114
|
-
&:before {
|
|
115
|
-
content: '';
|
|
116
|
-
width: ${4/16}rem;
|
|
117
|
-
height: ${12/16}rem;
|
|
118
|
-
background: ${({theme:t})=>t.colors.primary200};
|
|
119
|
-
display: block;
|
|
120
|
-
}
|
|
121
|
-
`,Yt=f.ZP.svg`
|
|
122
|
-
position: relative;
|
|
123
|
-
flex-shrink: 0;
|
|
124
|
-
transform: translate(-0.5px, -1px);
|
|
125
|
-
|
|
126
|
-
* {
|
|
127
|
-
fill: ${({theme:t,color:n})=>t.colors[n]};
|
|
128
|
-
}
|
|
129
|
-
`,we=t=>e.createElement(wt,null,e.createElement(Yt,{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},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"})));we.defaultProps={fill:"primary200"},we.propTypes={fill:a().string};var Jt=(0,e.memo)(we);const pt=(0,f.ZP)(C.k)`
|
|
130
|
-
width: ${U};
|
|
131
|
-
position: relative;
|
|
132
|
-
`,Qt=(0,f.ZP)(C.k)`
|
|
133
|
-
height: ${Ce};
|
|
134
|
-
`,qt=(0,f.ZP)(p.x)`
|
|
135
|
-
padding-left: ${31/16}rem;
|
|
136
|
-
`,_t=(0,f.ZP)(p.x)`
|
|
137
|
-
border-left: ${({isVisible:t,theme:n})=>t?`4px solid ${n.colors.primary200}`:"4px solid transparent"};
|
|
138
|
-
`,en=(0,f.ZP)(C.k)`
|
|
139
|
-
padding-left: ${({theme:t})=>t.spaces[4]};
|
|
140
|
-
width: ${({level:t})=>145-t*36}px;
|
|
141
|
-
|
|
142
|
-
${({isCollapsable:t,theme:n})=>t&&`
|
|
143
|
-
${Ne} {
|
|
144
|
-
display: block;
|
|
145
|
-
color: ${n.colors.neutral100};
|
|
146
|
-
}
|
|
147
|
-
&:hover {
|
|
148
|
-
${We(n)}
|
|
149
|
-
}
|
|
150
|
-
`}
|
|
151
|
-
${({isActive:t,theme:n})=>t&&We(n)};
|
|
152
|
-
`,tn=f.ZP.div`
|
|
153
|
-
padding-top: ${({theme:t})=>t.spaces[2]};
|
|
154
|
-
margin-top: ${({theme:t})=>t.spaces[2]};
|
|
155
|
-
width: ${4/16}rem;
|
|
156
|
-
background-color: ${({theme:t})=>t.colors.primary200};
|
|
157
|
-
border-top-left-radius: 2px;
|
|
158
|
-
border-top-right-radius: 2px;
|
|
159
|
-
`,Ye=({childrenForm:t,isFormDisabled:n,recursiveLevel:o,pathToDataFromActionRow:s,propertyActions:i,parentName:l,propertyName:d})=>{const{formatMessage:c}=(0,H.Z)(),{modifiedData:m,onChangeParentCheckbox:u,onChangeSimpleCheckbox:g}=(0,G.$_)(),[v,M]=(0,e.useState)(null),N=E=>{M(h=>h===E?null:E)},j=(0,e.useMemo)(()=>v?t.find(({value:E})=>E===v):null,[v,t]);return e.createElement(qt,null,e.createElement(tn,null),t.map(({label:E,value:h,required:L,children:$},I)=>{const te=I+1<t.length,K=Array.isArray($),J=v===h;return e.createElement(_t,{key:h,isVisible:te},e.createElement(Qt,null,e.createElement(Jt,{color:"primary200"}),e.createElement(C.k,{style:{flex:1}},e.createElement(en,{level:o,isActive:J,isCollapsable:K},e.createElement(ot,{alignItems:"center",isCollapsable:K,...K&&{onClick:()=>N(h),"aria-expanded":J,onKeyDown:({key:V})=>(V==="Enter"||V===" ")&&N(h),tabIndex:0,role:"button"},title:E},e.createElement(T.Z,{ellipsis:!0},ce()(E)),L&&e.createElement(mt,null),e.createElement(Ne,{$isActive:J}))),e.createElement(C.k,{style:{flex:1}},i.map(({actionId:V,label:fe,isActionRelatedToCurrentProperty:Ie})=>{if(!Ie)return e.createElement(Ue,{key:V});const se=[...s.split(".."),V,"properties",d,...l.split(".."),h],ve=y()(m,se,!1);if(!$)return e.createElement(pt,{key:fe,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{disabled:n,name:se.join(".."),"aria-label":c({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${l} ${E} ${fe}`}),onValueChange:Me=>{g({target:{name:se.join(".."),value:Me}})},value:ve}));const{hasAllActionsSelected:Ve,hasSomeActionsSelected:Se}=Te(ve);return e.createElement(pt,{key:fe,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{key:fe,disabled:n,name:se.join(".."),"aria-label":c({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${l} ${E} ${fe}`}),onValueChange:Me=>{u({target:{name:se.join(".."),value:Me}})},value:Ve,indeterminate:Se}))})))),j&&J&&e.createElement(p.x,{paddingBottom:2},e.createElement(Ye,{isFormDisabled:n,parentName:`${l}..${h}`,pathToDataFromActionRow:s,propertyActions:i,propertyName:d,recursiveLevel:o+1,childrenForm:j.children})))}))};Ye.propTypes={childrenForm:a().array.isRequired,isFormDisabled:a().bool.isRequired,parentName:a().string.isRequired,pathToDataFromActionRow:a().string.isRequired,propertyActions:a().array.isRequired,propertyName:a().string.isRequired,recursiveLevel:a().number.isRequired};var nn=(0,e.memo)(Ye);const sn=t=>t.reduce((o,s)=>(s.isActionRelatedToCurrentProperty&&o.push(s.actionId),o),[]);var on=(t,n,o,s,i)=>{const d=sn(t).reduce((c,m)=>{const u=[...o.split(".."),m,"properties",s,i],g=y()(n,u,!1);return c[m]=g,c},{});return Te(d)};const gt=(0,f.ZP)(C.k)`
|
|
160
|
-
width: ${U};
|
|
161
|
-
position: relative;
|
|
162
|
-
`,rn=(0,f.ZP)(C.k)`
|
|
163
|
-
height: ${Ce};
|
|
164
|
-
flex: 1;
|
|
165
|
-
|
|
166
|
-
${({isCollapsable:t,theme:n})=>t&&`
|
|
167
|
-
${Ne} {
|
|
168
|
-
display: block;
|
|
169
|
-
color: ${n.colors.neutral100};
|
|
170
|
-
}
|
|
171
|
-
&:hover {
|
|
172
|
-
${We(n)}
|
|
173
|
-
}
|
|
174
|
-
`}
|
|
175
|
-
${({isActive:t,theme:n})=>t&&We(n)};
|
|
176
|
-
`,Je=({childrenForm:t,label:n,isFormDisabled:o,name:s,required:i,pathToData:l,propertyActions:d,propertyName:c,isOdd:m})=>{const{formatMessage:u}=(0,H.Z)(),[g,v]=(0,e.useState)(null),{modifiedData:M,onChangeCollectionTypeLeftActionRowCheckbox:N,onChangeParentCheckbox:j,onChangeSimpleCheckbox:E}=(0,G.$_)(),h=g===s,L=(0,e.useMemo)(()=>Array.isArray(t)?t:[],[t]),$=L.length>0,I=(0,e.useCallback)(()=>{$&&v(V=>V===s?null:s)},[$,s]),te=({target:{value:V}})=>{N(l,c,s,V)},{hasAllActionsSelected:K,hasSomeActionsSelected:J}=(0,e.useMemo)(()=>on(d,M,l,c,s),[d,M,l,c,s]);return e.createElement(e.Fragment,null,e.createElement(rn,{alignItems:"center",isCollapsable:$,isActive:h,background:m?"neutral100":"neutral0"},e.createElement(C.k,null,e.createElement(rt,{onChange:te,onClick:I,isCollapsable:$,isFormDisabled:o,label:n,someChecked:J,value:K,isActive:h},i&&e.createElement(mt,null),e.createElement(Ne,{$isActive:h})),e.createElement(C.k,null,d.map(({label:V,isActionRelatedToCurrentProperty:fe,actionId:Ie})=>{if(!fe)return e.createElement(Ue,{key:V});const se=[...l.split(".."),Ie,"properties",c,s];if(!$){const Me=y()(M,se,!1);return e.createElement(gt,{key:Ie,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{disabled:o,name:se.join(".."),"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${s} ${V}`}),onValueChange:ts=>{E({target:{name:se.join(".."),value:ts}})},value:Me}))}const ve=y()(M,se,{}),{hasAllActionsSelected:Ve,hasSomeActionsSelected:Se}=Te(ve);return e.createElement(gt,{key:V,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{disabled:o,name:se.join(".."),onValueChange:Me=>{j({target:{name:se.join(".."),value:Me}})},"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${s} ${V}`}),value:Ve,indeterminate:Se}))})))),h&&e.createElement(nn,{childrenForm:L,isFormDisabled:o,parentName:s,pathToDataFromActionRow:l,propertyName:c,propertyActions:d,recursiveLevel:0}))};Je.defaultProps={childrenForm:[],required:!1},Je.propTypes={childrenForm:a().array,label:a().string.isRequired,isFormDisabled:a().bool.isRequired,name:a().string.isRequired,pathToData:a().string.isRequired,propertyActions:a().array.isRequired,propertyName:a().string.isRequired,required:a().bool,isOdd:a().bool.isRequired};var an=(0,e.memo)(Je);const ft=(0,f.ZP)(C.k)`
|
|
177
|
-
width: ${U};
|
|
178
|
-
flex-shrink: 0;
|
|
179
|
-
`,ln=(0,f.ZP)(C.k)`
|
|
180
|
-
width: ${ye};
|
|
181
|
-
height: ${Ce};
|
|
182
|
-
flex-shrink: 0;
|
|
183
|
-
`,ht=({headers:t,label:n})=>{const{formatMessage:o}=(0,H.Z)(),s=o({id:"Settings.roles.form.permission.property-label",defaultMessage:"{label} permissions"},{label:n});return e.createElement(C.k,null,e.createElement(ln,{alignItems:"center",paddingLeft:6},e.createElement(T.Z,{variant:"sigma",textColor:"neutral500"},s)),t.map(i=>i.isActionRelatedToCurrentProperty?e.createElement(ft,{justifyContent:"center",key:i.label},e.createElement(T.Z,{variant:"sigma",textColor:"neutral500"},o({id:`Settings.roles.form.permissions.${i.label.toLowerCase()}`,defaultMessage:i.label}))):e.createElement(ft,{key:i.label})))};ht.propTypes={headers:a().arrayOf(a().shape({label:a().string.isRequired,isActionRelatedToCurrentProperty:a().bool.isRequired})).isRequired,label:a().string.isRequired};var dn=ht,cn=(t,n)=>t.map(o=>{const s=Array.isArray(o.applyToProperties)&&o.applyToProperties.indexOf(n)!==-1&&o.isDisplayed;return{label:o.label,actionId:o.actionId,isActionRelatedToCurrentProperty:s}});const un=f.ZP.div`
|
|
184
|
-
display: inline-flex;
|
|
185
|
-
flex-direction: column;
|
|
186
|
-
min-width: 0;
|
|
187
|
-
`,yt=({availableActions:t,childrenForm:n,isFormDisabled:o,label:s,pathToData:i,propertyName:l})=>{const d=(0,e.useMemo)(()=>cn(t,l),[t,l]);return e.createElement(un,null,e.createElement(dn,{label:s,headers:d}),e.createElement(p.x,null,n.map(({children:c,label:m,value:u,required:g},v)=>e.createElement(an,{childrenForm:c,key:u,label:m,isFormDisabled:o,name:u,required:g,propertyActions:d,pathToData:i,propertyName:l,isOdd:v%2===0}))))};yt.propTypes={childrenForm:a().array.isRequired,availableActions:a().array.isRequired,isFormDisabled:a().bool.isRequired,label:a().string.isRequired,pathToData:a().string.isRequired,propertyName:a().string.isRequired};var mn=yt;const pn=f.ZP.div`
|
|
188
|
-
flex-direction: column;
|
|
189
|
-
display: inline-flex;
|
|
190
|
-
min-width: 100%;
|
|
191
|
-
${({theme:t,isActive:n})=>n&&`border: 1px solid ${t.colors.primary600};`}
|
|
192
|
-
`,Ct=({allActions:t,contentTypeName:n,label:o,index:s,isActive:i,isFormDisabled:l,onClickToggleCollapse:d,pathToData:c,properties:m})=>{const u=(0,e.useCallback)(()=>{d(n)},[n,d]),g=(0,e.useMemo)(()=>Xt(t,n),[t,n]);return e.createElement(pn,{isActive:i},e.createElement(Kt,{availableActions:g,isActive:i,isGrey:s%2===0,isFormDisabled:l,label:o,onClickToggle:u,pathToData:c}),i&&m.map(({label:v,value:M,children:N})=>e.createElement(mn,{availableActions:g,childrenForm:N,isFormDisabled:l,label:v,pathToData:c,propertyName:M,key:M})))};Ct.propTypes={allActions:a().array.isRequired,contentTypeName:a().string.isRequired,index:a().number.isRequired,isActive:a().bool.isRequired,isFormDisabled:a().bool.isRequired,label:a().string.isRequired,onClickToggleCollapse:a().func.isRequired,pathToData:a().string.isRequired,properties:a().array.isRequired};var gn=Ct;const Qe=({actions:t,isFormDisabled:n,pathToData:o,subjects:s})=>{const[i,l]=(0,e.useState)(null),d=c=>{l(i===c?null:c)};return s.map(({uid:c,label:m,properties:u},g)=>e.createElement(gn,{allActions:t,key:c,contentTypeName:c,label:m,isActive:i===c,isFormDisabled:n,index:g,onClickToggleCollapse:d,pathToData:`${o}..${c}`,properties:u}))};Qe.defaultProps={actions:[],subjects:[]},Qe.propTypes={actions:a().array.isRequired,isFormDisabled:a().bool.isRequired,pathToData:a().string.isRequired,subjects:a().arrayOf(a().shape({uid:a().string.isRequired,label:a().string.isRequired,properties:a().array.isRequired}))};var fn=(0,e.memo)(Qe),hn=t=>t.filter(({subjects:n})=>n&&n.length);const yn=t=>t.map(({actionId:n})=>n),Cn=(t,n)=>t.reduce((o,s)=>(Object.keys(n).forEach(i=>{const l=y()(n,[i,s],{}),d={[i]:ze(l)};o[s]?o[s]={...o[s],...d}:o[s]=d}),o),{});var vn=(t,n)=>{const o=yn(t),s=Cn(o,n);return Object.keys(s).reduce((l,d)=>(l[d]=Te(s[d]),l),{})};const En=(0,f.ZP)(C.k)`
|
|
193
|
-
width: ${U};
|
|
194
|
-
flex-shrink: 0;
|
|
195
|
-
`,qe=({actions:t,isFormDisabled:n,kind:o})=>{const{formatMessage:s}=(0,H.Z)(),{modifiedData:i,onChangeCollectionTypeGlobalActionCheckbox:l}=(0,G.$_)(),d=(0,e.useMemo)(()=>hn(t),[t]),c=(0,e.useMemo)(()=>vn(d,i[o]),[i,d,o]);return e.createElement(p.x,{paddingBottom:4,paddingTop:6,style:{paddingLeft:ye}},e.createElement(C.k,{gap:0},d.map(({label:m,actionId:u})=>e.createElement(En,{direction:"column",alignItems:"center",justifyContent:"center",key:u,gap:3},e.createElement(T.Z,{variant:"sigma",textColor:"neutral500"},s({id:`Settings.roles.form.permissions.${m.toLowerCase()}`,defaultMessage:m})),e.createElement(w.C,{disabled:n,onValueChange:g=>{l(o,u,g)},name:u,"aria-label":s({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:s({id:`Settings.roles.form.permissions.${m.toLowerCase()}`,defaultMessage:m})}),value:y()(c,[u,"hasAllActionsSelected"],!1),indeterminate:y()(c,[u,"hasSomeActionsSelected"],!1)})))))};qe.defaultProps={actions:[]},qe.propTypes={actions:a().arrayOf(a().shape({label:a().string.isRequired,actionId:a().string.isRequired,subjects:a().array.isRequired})),isFormDisabled:a().bool.isRequired,kind:a().string.isRequired};var bn=(0,e.memo)(qe);const xn=(0,f.ZP)(p.x)`
|
|
196
|
-
overflow-x: auto;
|
|
197
|
-
`,vt=({isFormDisabled:t,kind:n,layout:{actions:o,subjects:s}})=>{const i=F()([...s],"label");return e.createElement(xn,{background:"neutral0"},e.createElement(bn,{actions:o,kind:n,isFormDisabled:t}),e.createElement(fn,{actions:o,isFormDisabled:t,pathToData:n,subjects:i}))};vt.propTypes={isFormDisabled:a().bool.isRequired,kind:a().string.isRequired,layout:a().shape({actions:a().array,subjects:a().arrayOf(a().shape({uid:a().string.isRequired,label:a().string.isRequired,properties:a().array.isRequired}))}).isRequired};var Et=(0,e.memo)(vt),Rn=r(76402);const bt=({children:t,value:n})=>e.createElement(Rn.$l.Provider,{value:n},t);bt.propTypes={children:a().node.isRequired,value:a().exact({availableConditions:a().array.isRequired,modifiedData:a().object.isRequired,onChangeCollectionTypeLeftActionRowCheckbox:a().func.isRequired,onChangeConditions:a().func.isRequired,onChangeSimpleCheckbox:a().func.isRequired,onChangeParentCheckbox:a().func.isRequired,onChangeCollectionTypeGlobalActionCheckbox:a().func.isRequired}).isRequired};var Pn=bt,An=r(83828),Tn=r(61762),Sn=r(89966),xt=r(8284),Mn=r(15335),$n=r(5803),On=(t,n,o)=>t.map(s=>{const i=[...o,s.action,"properties","enabled"],l=y()(n,i,!1),d=y()(n,[...o,s.action,"conditions"],{}),c=ke(d).some(m=>m);return{...s,isDisplayed:l,checkboxName:i.join(".."),hasSomeActionsSelected:l,value:l,hasConditions:c,label:s.displayName,actionId:s.action,pathToConditionsObject:[...o,s.action]}}),Dn=t=>{const n=Object.entries(t).reduce((s,i)=>{const[l,{conditions:d}]=i;return s[l]=d,s},{});return ke(n).some(s=>s)};const jn=f.ZP.div`
|
|
198
|
-
flex: 1;
|
|
199
|
-
align-self: center;
|
|
200
|
-
border-top: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
201
|
-
`,Ln=f.ZP.div`
|
|
202
|
-
position: relative;
|
|
203
|
-
word-break: keep-all;
|
|
204
|
-
${({hasConditions:t,disabled:n,theme:o})=>t&&`
|
|
205
|
-
&:before {
|
|
206
|
-
content: '';
|
|
207
|
-
position: absolute;
|
|
208
|
-
top: ${-4/16}rem;
|
|
209
|
-
left: ${-8/16}rem;
|
|
210
|
-
width: ${6/16}rem;
|
|
211
|
-
height: ${6/16}rem;
|
|
212
|
-
border-radius: ${20/16}rem;
|
|
213
|
-
background: ${n?o.colors.neutral100:o.colors.primary600};
|
|
214
|
-
}
|
|
215
|
-
`}
|
|
216
|
-
`,Rt=({categoryName:t,isFormDisabled:n,subCategoryName:o,actions:s,pathToData:i})=>{const[l,d]=(0,e.useState)(!1),{modifiedData:c,onChangeParentCheckbox:m,onChangeSimpleCheckbox:u}=(0,G.$_)(),{formatMessage:g}=(0,H.Z)(),v=y()(c,i,{}),M=(0,e.useMemo)(()=>Object.keys(v).reduce((I,te)=>(I[te]=ze(v[te]),I),{}),[v]),{hasAllActionsSelected:N,hasSomeActionsSelected:j}=Te(M),E=()=>{d(I=>!I)},h=()=>{d(!1)},L=On(s,c,i),$=Dn(y()(c,[...i],{}));return e.createElement(e.Fragment,null,e.createElement(p.x,null,e.createElement(C.k,{justifyContent:"space-between",alignItems:"center"},e.createElement(p.x,{paddingRight:4},e.createElement(T.Z,{variant:"sigma",textColor:"neutral600"},o)),e.createElement(jn,null),e.createElement(p.x,{paddingLeft:4},e.createElement(xt.X,{name:i.join(".."),disabled:n,onValueChange:I=>{m({target:{name:i.join(".."),value:I}})},indeterminate:j,value:N},g({id:"app.utils.select-all",defaultMessage:"Select all"})))),e.createElement(C.k,{paddingTop:6,paddingBottom:6},e.createElement(Mn.r,{gap:2,style:{flex:1}},L.map(({checkboxName:I,value:te,action:K,displayName:J,hasConditions:V})=>e.createElement($n.P,{col:3,key:K},e.createElement(Ln,{disabled:n,hasConditions:V},e.createElement(xt.X,{name:I,disabled:n,onValueChange:fe=>{u({target:{name:I,value:fe}})},value:te},J))))),e.createElement(oe,{hasConditions:$,onClick:E}))),l&&e.createElement(W,{headerBreadCrumbs:[t,o],actions:L,isFormDisabled:n,onClosed:h,onToggle:E}))};Rt.propTypes={actions:a().array.isRequired,categoryName:a().string.isRequired,isFormDisabled:a().bool.isRequired,subCategoryName:a().string.isRequired,pathToData:a().array.isRequired};var kn=Rt;const _e=({childrenForm:t,kind:n,name:o,isOpen:s,isFormDisabled:i,isWhite:l,onOpenCategory:d,pathToData:c})=>{const{formatMessage:m}=(0,H.Z)(),u=()=>{d(o)},g=(0,e.useMemo)(()=>o.split("::").pop(),[o]);return e.createElement(An.U,{expanded:s,onToggle:u,id:`accordion-${o}`,variant:l?"primary":"secondary"},e.createElement(Tn.B,{title:ce()(g),description:`${m({id:"Settings.permissions.category"},{category:g})} ${n==="plugins"?"plugin":n}`}),e.createElement(Sn.v,null,e.createElement(p.x,{padding:6},t.map(({actions:v,subCategoryName:M,subCategoryId:N})=>e.createElement(kn,{key:M,actions:v,categoryName:g,isFormDisabled:i,subCategoryName:M,pathToData:[...c,N]})))))};_e.defaultProps={},_e.propTypes={childrenForm:a().array.isRequired,isOpen:a().bool.isRequired,isFormDisabled:a().bool.isRequired,isWhite:a().bool.isRequired,kind:a().string.isRequired,name:a().string.isRequired,onOpenCategory:a().func.isRequired,pathToData:a().array.isRequired};var In=_e;const Pt=({isFormDisabled:t,kind:n,layout:o})=>{const[s,i]=(0,e.useState)(null),l=d=>{i(d===s?null:d)};return e.createElement(p.x,{padding:6,background:"neutral0"},o.map(({category:d,categoryId:c,childrenForm:m},u)=>e.createElement(In,{key:d,childrenForm:m,kind:n,isFormDisabled:t,isOpen:s===d,isWhite:u%2===1,name:d,onOpenCategory:l,pathToData:[n,c]})))};Pt.propTypes={isFormDisabled:a().bool.isRequired,kind:a().string.isRequired,layout:a().arrayOf(a().shape({category:a().string.isRequired,categoryId:a().string.isRequired,childrenForm:a().arrayOf(a().shape({actions:a().array.isRequired})).isRequired}).isRequired).isRequired};var At=Pt,Zn=r(86349),Bn=r.n(Zn),Fn=r(3040),ge=r.n(Fn),Tt=(t,n,o)=>t.find(s=>s.action===n&&s.subject===o);const St=(t,n=[])=>t.reduce((o,s)=>(o[s.id]=n.indexOf(s.id)!==-1,o),{}),Mt=({children:t},n,o="")=>t.reduce((s,i)=>{if(i.children)return{...s,[i.value]:Mt(i,n,`${o}${i.value}.`)};const l=n.indexOf(`${o}${i.value}`)!==-1;return s[i.value]=l,s},{}),Nn=(t,n,o)=>t.reduce((s,i)=>{const l=n.properties.find(({value:d})=>d===i);if(l){const d=y()(o,["properties",l.value],[]),c=Mt(l,d);s.properties[i]=c}return s},{properties:{}}),Wn=(t,n)=>n.reduce((o,s)=>{const i=t.find(({uid:l})=>l===s)||null;return i&&(o[s]=i),o},{});var $t=({subjects:t},n,o,s=[])=>n.reduce((i,l)=>{const d=l.subjects,c=Wn(t,d);if(D()(c))return i;const m=Object.keys(c).reduce((u,g)=>{const{actionId:v,applyToProperties:M}=l,E=c[g].properties.map(({value:I})=>I).every(I=>(M||[]).indexOf(I)===-1),h=Tt(s,v,g),L=St(o,y()(h,"conditions",[]));if(D()(M)||E)return ge()(u,[g,v],{properties:{enabled:h!==void 0},conditions:L}),u;const $=Nn(M,c[g],h);return ge()(u,[g,v],{...$,conditions:L}),u},{});return Bn()(i,m)},{});const Vn=(t,n,o)=>t.reduce((s,i)=>{const l=Tt(o,i.action,null);return s[i.action]={properties:{enabled:l!==void 0},conditions:St(n,l?.conditions??[])},s},{}),Hn=(t,n,o)=>t.reduce((s,i)=>(s[i.subCategoryId]=Vn(i.actions,n,o),s),{});var Ot=(t,n,o=[])=>t.reduce((s,{categoryId:i,childrenForm:l})=>{const d=Hn(l,n,o);return s[i]=d,s},{});const Dt=t=>t.split(" ").join("-");var jt=(t,n)=>Object.entries(de()(t,n)).map(([o,s])=>({category:o,categoryId:Dt(o),childrenForm:Object.entries(de()(s,"subCategory")).map(([i,l])=>({subCategoryName:i,subCategoryId:Dt(i),actions:l}))})),Gn=(t,n)=>{const{conditions:o,sections:{collectionTypes:s,singleTypes:i,plugins:l,settings:d}}=t,c={collectionTypes:s,singleTypes:i,plugins:jt(l,"plugin"),settings:jt(d,"category")},m={collectionTypes:$t(s,s.actions||[],o,n),singleTypes:$t(i,i.actions||[],o,n),plugins:Ot(c.plugins,o,n),settings:Ot(c.settings,o,n)};return{initialData:m,modifiedData:m,layouts:c}},Un=r(99381),et=r.n(Un);const Lt=t=>Object.keys(t).reduce((n,o)=>{const s=t[o];if(be()(s)&&!S()(s,"conditions"))return{...n,[o]:Lt(s)};if(be()(s)&&S()(s,"conditions")&&!ke(Y()(s,"conditions")).some(l=>l)){const l=Object.keys(s.conditions).reduce((d,c)=>(d[c]=!1,d),{});return{...n,[o]:{...s,conditions:l}}}return n[o]=s,n},{});var tt=Lt;const kt=(t,n,o=!1)=>Object.keys(t).reduce((s,i)=>{const l=t[i];return i==="conditions"&&!o?(s[i]=l,s):be()(l)?{...s,[i]:kt(l,n,i==="fields")}:(s[i]=n,s)},{});var Ge=kt;const Kn={initialData:{},modifiedData:{},layouts:{}};var zn=(t,n)=>(0,Q.ZP)(t,o=>{switch(n.type){case"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX":{const{collectionTypeKind:s,actionId:i,value:l}=n,d=["modifiedData",s];Object.keys(y()(t,d)).forEach(c=>{const m=y()(t,[...d,c,i],void 0);if(m){let u=Ge(m,l);if(!l&&u.conditions){const g=Ge(u.conditions,!1);u={...u,conditions:g}}ge()(o,[...d,c,i],u)}});break}case"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX":{const{pathToCollectionType:s,propertyName:i,rowName:l,value:d}=n;let c=et()(t.modifiedData);const m=s.split(".."),u=y()(c,m,{});Object.keys(u).forEach(g=>{if(S()(u[g],`properties.${i}`)){const v=y()(u,[g,"properties",i,l]),M=[...m,g,"properties",i,l];if(!be()(v))ge()(c,M,d);else{const N=Ge(v,d);ge()(c,M,N)}}}),d||(c=tt(c)),ge()(o,"modifiedData",c);break}case"ON_CHANGE_CONDITIONS":{Object.entries(n.conditions).forEach(s=>{const[i,l]=s;ge()(o,["modifiedData",...i.split(".."),"conditions"],l)});break}case"ON_CHANGE_SIMPLE_CHECKBOX":{let s=et()(t.modifiedData);ge()(s,[...n.keys.split("..")],n.value),n.value||(s=tt(s)),ge()(o,"modifiedData",s);break}case"ON_CHANGE_TOGGLE_PARENT_CHECKBOX":{const{keys:s,value:i}=n,l=[...s.split("..")];let d=et()(t.modifiedData);const c=y()(d,l,{}),m=Ge(c,i);ge()(d,l,m),i||(d=tt(d)),ge()(o,["modifiedData"],d);break}case"RESET_FORM":{o.modifiedData=t.initialData;break}case"SET_FORM_AFTER_SUBMIT":{o.initialData=t.modifiedData;break}default:return o}});const nt=t=>Object.entries(t).filter(([,n])=>n).map(([n])=>n),Xn=t=>{const[n,{conditions:o}]=t;return{action:n,subject:null,conditions:nt(o),properties:{}}},wn=t=>Object.values(t).reduce((n,o)=>{const s=Object.entries(o).reduce((i,l)=>{const[,{properties:{enabled:d}}]=l;if(!d)return i;const c=Xn(l);return i.push(c),i},[]);return[...n,...s]},[]);var It=t=>Object.values(t).reduce((n,o)=>{const s=wn(o);return[...n,...s]},[]);const Zt=(t,n="")=>Object.entries(t).reduce((o,s)=>{const[i,l]=s;return be()(l)?[...o,...Zt(l,`${n}${i}.`)]:(l&&!be()(l)&&o.push(`${n}${i}`),o)},[]),Yn=(t,n,{conditions:o,properties:s})=>Object.entries(s).reduce((i,l)=>{const[d,c]=l;return i.properties[d]=Zt(c),i},{action:t,subject:n,conditions:nt(o),properties:{}}),Jn=(t,n,{conditions:o})=>({action:t,subject:n,properties:{},conditions:nt(o)}),Qn=(t,n)=>Object.entries(n).reduce((s,i)=>{const[l,d]=i;if(!ke(d).some(u=>u))return s;if(!d?.properties?.enabled){const u=Yn(l,t,d);return[...s,u]}if(!d.properties.enabled)return s;const m=Jn(l,t,d);return s.push(m),s},[]);var Bt=t=>Object.entries(t).reduce((o,s)=>{const[i,l]=s,d=Qn(i,l);return[...o,...d]},[]),qn=t=>{const n=It(t.plugins),o=It(t.settings),s=Bt(t.collectionTypes),i=Bt(t.singleTypes);return[...n,...o,...s,...i]},_n=[{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"}];const st=(0,e.forwardRef)(({layout:t,isFormDisabled:n,permissions:o},s)=>{const[{initialData:i,layouts:l,modifiedData:d},c]=(0,e.useReducer)(zn,Kn,()=>Gn(t,o)),{formatMessage:m}=(0,H.Z)();(0,e.useImperativeHandle)(s,()=>({getPermissions(){const j=(0,Z.e5)(i.collectionTypes,d.collectionTypes),E=(0,Z.e5)(i.singleTypes,d.singleTypes),h={...j,...E};let L;return D()(h)?L=!1:L=Object.values(h).some($=>Object.values($).some(I=>S()(I,"conditions"))),{permissionsToSend:qn(d),didUpdateConditions:L}},resetForm(){c({type:"RESET_FORM"})},setFormAfterSubmit(){c({type:"SET_FORM_AFTER_SUBMIT"})}}));const u=(j,E,h,L)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX",pathToCollectionType:j,propertyName:E,rowName:h,value:L})},g=(j,E,h)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX",collectionTypeKind:j,actionId:E,value:h})},v=j=>{c({type:"ON_CHANGE_CONDITIONS",conditions:j})},M=(0,e.useCallback)(({target:{name:j,value:E}})=>{c({type:"ON_CHANGE_SIMPLE_CHECKBOX",keys:j,value:E})},[]),N=(0,e.useCallback)(({target:{name:j,value:E}})=>{c({type:"ON_CHANGE_TOGGLE_PARENT_CHECKBOX",keys:j,value:E})},[]);return e.createElement(Pn,{value:{availableConditions:t.conditions,modifiedData:d,onChangeConditions:v,onChangeSimpleCheckbox:M,onChangeParentCheckbox:N,onChangeCollectionTypeLeftActionRowCheckbox:u,onChangeCollectionTypeGlobalActionCheckbox:g}},e.createElement(b.v,{id:"tabs",label:m({id:"Settings.permissions.users.tabs.label",defaultMessage:"Tabs Permissions"})},e.createElement(P.m,null,_n.map(j=>e.createElement(P.O,{key:j.id},m({id:j.labelId,defaultMessage:j.defaultMessage})))),e.createElement(R.n,{style:{position:"relative"}},e.createElement(R.x,null,e.createElement(Et,{layout:l.collectionTypes,kind:"collectionTypes",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(Et,{layout:l.singleTypes,kind:"singleTypes",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(At,{layout:l.plugins,kind:"plugins",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(At,{layout:l.settings,kind:"settings",isFormDisabled:n})))))});st.defaultProps={permissions:[],layout:{conditions:[],sections:{collectionTypes:{},singleTypes:{actions:[]},settings:[],plugins:[]}}},st.propTypes={layout:a().object,isFormDisabled:a().bool.isRequired,permissions:a().array};var es=(0,e.memo)(st)},87056:function(X,B,r){"use strict";r.r(B),r.d(B,{default:function(){return T}});var e=r(32735),b=r(19565),P=r(15062),R=r(53038),Z=r(30305),O=r(27649),S=r(82055),x=r(87933),D=r(41415),q=r(17e3),a=r(72850),H=r(29439),p=r(92802),A=r(33795),F=r.n(A),f=r(67879),C=r(2160),w=r(1283),ue=r(49372),ae=r(15335),ie=r(5803),y=r(10369),le=r(33475),Y=r(60216),G=r.n(Y);const _=({disabled:ne,role:z,values:k,errors:Q,onChange:pe,onBlur:de})=>{const{formatMessage:ee}=(0,f.Z)();return e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(x.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(x.k,{justifyContent:"space-between"},e.createElement(a.x,null,e.createElement(a.x,null,e.createElement(ue.Z,{fontWeight:"bold"},z?z.name:ee({id:"global.details",defaultMessage:"Details"}))),e.createElement(a.x,null,e.createElement(ue.Z,{textColor:"neutral500",variant:"pi"},z?z.description:ee({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(D.z,{disabled:!0,variant:"secondary"},ee({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:z.usersCount}))),e.createElement(ae.r,{gap:4},e.createElement(ie.P,{col:6},e.createElement(y.o,{disabled:ne,name:"name",error:Q.name&&ee({id:Q.name}),label:ee({id:"global.name",defaultMessage:"Name"}),onChange:pe,onBlur:de,value:k.name||""})),e.createElement(ie.P,{col:6},e.createElement(le.g,{disabled:ne,label:ee({id:"global.description",defaultMessage:"Description"}),id:"description",error:Q.name&&ee({id:Q.name}),onChange:pe,onBlur:de},k.description||"")))))};_.defaultProps={disabled:!1,role:null,values:{name:"",description:""}},_.propTypes={disabled:G().bool,errors:G().object.isRequired,onBlur:G().func.isRequired,onChange:G().func.isRequired,role:G().object,values:G().object};var xe=_,me=r(24346),oe=me.Ry().shape({name:me.Z_().required(b.I0.required)}),Ee=()=>{const ne=(0,b.lm)(),{formatMessage:z}=(0,f.Z)(),{params:{id:k}}=(0,R.$B)("/settings/roles/:id"),[Q,pe]=(0,e.useState)(!1),de=(0,e.useRef)(),{lockApp:ee,unlockApp:ce}=(0,b.o1)(),{trackUsage:Ze}=(0,b.rS)(),{isLoading:Ae,data:Be}=(0,C.U_)(k),{role:he,permissions:Oe,isLoading:De,onSubmitSucceeded:Fe}=(0,C.Dq)(k),{put:je}=(0,b.kY)(),He=async re=>{try{ee(),pe(!0);const{permissionsToSend:W,didUpdateConditions:U}=de.current.getPermissions();await je(`/admin/roles/${k}`,re),he.code!=="strapi-super-admin"&&(await je(`/admin/roles/${k}/permissions`,{permissions:W}),U&&Ze("didUpdateConditions")),de.current.setFormAfterSubmit(),Fe({name:re.name,description:re.description}),ne({type:"success",message:{id:"notification.success.saved"}})}catch(W){console.error(W.response);const U=F()(W,"response.payload.message","An error occured"),ye=F()(W,"response.payload.data.permissions[0]",U);ne({type:"warning",message:ye})}finally{pe(!1),ce()}},Le=he.code==="strapi-super-admin";return e.createElement(O.o,null,e.createElement(b.SL,{name:"Roles"}),e.createElement(p.J9,{enableReinitialize:!0,initialValues:{name:he.name,description:he.description},onSubmit:He,validationSchema:oe,validateOnChange:!1},({handleSubmit:re,values:W,errors:U,handleChange:ye,handleBlur:Ce})=>e.createElement("form",{onSubmit:re},e.createElement(S.T,{primaryAction:e.createElement(x.k,{gap:2},e.createElement(D.z,{disabled:he.code==="strapi-super-admin",onClick:re,loading:Q,size:"L"},z({id:"global.save",defaultMessage:"Save"}))),title:z({id:"Settings.roles.edit.title",defaultMessage:"Edit a role"}),subtitle:z({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(b.rU,{startIcon:e.createElement(H.Z,null),to:"/settings/roles"},z({id:"global.back",defaultMessage:"Back"}))}),e.createElement(q.D,null,e.createElement(x.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(xe,{isLoading:De,disabled:Le,errors:U,values:W,onChange:ye,onBlur:Ce,role:he}),!Ae&&!De?e.createElement(a.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(w.Z,{isFormDisabled:Le,permissions:Oe,ref:de,layout:Be})):e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(b.dO,null)))))))},T=()=>{const ne=(0,P.v9)(Z._),{isLoading:z,allowedActions:{canRead:k,canUpdate:Q}}=(0,b.ss)({read:ne.settings.roles.read,update:ne.settings.roles.update});return z?e.createElement(b.dO,null):!k&&!Q?e.createElement(R.l_,{to:"/"}):e.createElement(Ee,null)}},84802:function(X){function B(r,e,b,P){for(var R=-1,Z=r==null?0:r.length;++R<Z;){var O=r[R];e(P,O,b(O),r)}return P}X.exports=B},62435:function(X,B,r){var e=r(56671);function b(P,R,Z,O){return e(P,function(S,x,D){R(O,S,Z(S),D)}),O}X.exports=b},85580:function(X,B,r){var e=r(84802),b=r(62435),P=r(88904),R=r(77236);function Z(O,S){return function(x,D){var q=R(x)?e:b,a=S?S():{};return q(x,O,P(D,2),a)}}X.exports=Z},72091:function(X,B,r){var e=r(40314),b=1/0;function P(R){var Z=R==null?0:R.length;return Z?e(R,b):[]}X.exports=P},81346:function(X,B,r){var e=r(40999),b=r(85580),P=Object.prototype,R=P.hasOwnProperty,Z=b(function(O,S,x){R.call(O,x)?O[x].push(S):e(O,x,[S])});X.exports=Z},83828:function(X,B,r){"use strict";r.d(B,{U:function(){return H},y:function(){return q}});var e=r(74512),b=r(32735),P=r(8471),R=r(91045),Z=r(74971),O=r(49372),S=r(87933),x=r(72850);const D=({theme:p,expanded:A,variant:F,disabled:f,error:C})=>C?`1px solid ${p.colors.danger600} !important`:f?`1px solid ${p.colors.neutral150}`:A?`1px solid ${p.colors.primary600}`:F==="primary"?`1px solid ${p.colors.neutral0}`:`1px solid ${p.colors.neutral100}`,q=(0,P.ZP)(O.Z)``,a=(0,P.ZP)(x.x)`
|
|
217
|
-
border: ${D};
|
|
218
|
-
|
|
219
|
-
&:hover:not([aria-disabled='true']) {
|
|
220
|
-
border: 1px solid ${({theme:p})=>p.colors.primary600};
|
|
221
|
-
|
|
222
|
-
${q} {
|
|
223
|
-
color: ${({theme:p,expanded:A})=>A?void 0:p.colors.primary700};
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
${O.Z} {
|
|
227
|
-
color: ${({theme:p,expanded:A})=>A?void 0:p.colors.primary600};
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
& > ${S.k} {
|
|
231
|
-
background: ${({theme:p})=>p.colors.primary100};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
[data-strapi-dropdown='true'] {
|
|
235
|
-
background: ${({theme:p})=>p.colors.primary200};
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
`,H=({children:p,disabled:A=!1,error:F,expanded:f=!1,hasErrorMessage:C=!0,id:w,onToggle:ue,toggle:ae,size:ie="M",variant:y="primary",shadow:le})=>{const Y=(0,Z.M)(w),G=b.useMemo(()=>({expanded:f,onToggle:ue,toggle:ae,id:Y,size:ie,variant:y,disabled:A}),[A,f,Y,ue,ie,ae,y]);return(0,e.jsxs)(R.S.Provider,{value:G,children:[(0,e.jsx)(a,{"data-strapi-expanded":f,disabled:A,"aria-disabled":A,expanded:f,hasRadius:!0,variant:y,error:F,shadow:le,children:p}),F&&C&&(0,e.jsx)(x.x,{paddingTop:1,children:(0,e.jsx)(O.Z,{variant:"pi",textColor:"danger600",children:F})})]})}},89966:function(X,B,r){"use strict";r.d(B,{v:function(){return R}});var e=r(74512),b=r(91045),P=r(72850);const R=({children:Z,...O})=>{const{expanded:S,id:x}=(0,b.A)();if(!S)return null;const D=`accordion-content-${x}`,q=`accordion-label-${x}`,a=`accordion-desc-${x}`;return(0,e.jsx)(P.x,{role:"region",id:D,"aria-labelledby":q,"aria-describedby":a,...O,children:Z})}},91045:function(X,B,r){"use strict";r.d(B,{A:function(){return P},S:function(){return b}});var e=r(32735);const b=(0,e.createContext)({disabled:!1,expanded:!1,id:"",size:"M",variant:"primary"}),P=()=>(0,e.useContext)(b)},61762:function(X,B,r){"use strict";r.d(B,{B:function(){return p}});var e=r(74512),b=r(16899),P=r(8471),R=r(83828),Z=r(91045);const O=({expanded:A,disabled:F,variant:f})=>{let C="neutral100";return A?C="primary100":F?C="neutral150":f==="primary"&&(C="neutral0"),C};var S=r(7563),x=r(99140),D=r(87933),q=r(49372);const a=(0,P.ZP)(S.A)`
|
|
239
|
-
text-align: left;
|
|
240
|
-
|
|
241
|
-
// necessary to make the ellipsis prop work on the title
|
|
242
|
-
> span {
|
|
243
|
-
max-width: 100%;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
svg {
|
|
247
|
-
width: ${14/16}rem;
|
|
248
|
-
height: ${14/16}rem;
|
|
249
|
-
|
|
250
|
-
path {
|
|
251
|
-
fill: ${({theme:A,expanded:F})=>F?A.colors.primary600:A.colors.neutral500};
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
`,H=(0,P.ZP)(D.k)`
|
|
255
|
-
min-height: ${({theme:A,size:F})=>A.sizes.accordions[F]};
|
|
256
|
-
border-radius: ${({theme:A,expanded:F})=>F?`${A.borderRadius} ${A.borderRadius} 0 0`:A.borderRadius};
|
|
257
|
-
|
|
258
|
-
&:hover {
|
|
259
|
-
svg {
|
|
260
|
-
path {
|
|
261
|
-
fill: ${({theme:A})=>A.colors.primary600};
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
`,p=({title:A,description:F,as:f="span",togglePosition:C="right",action:w,...ue})=>{const{onToggle:ae,toggle:ie,expanded:y,id:le,size:Y,variant:G,disabled:_}=(0,Z.A)(),xe=`accordion-content-${le}`,me=`accordion-label-${le}`,Re=`accordion-desc-${le}`,oe=Y==="M"?6:4,Pe=Y==="M"?oe:oe-2,Ee=O({expanded:y,disabled:_,variant:G}),$e={as:f,fontWeight:Y==="S"?"bold":void 0,id:me,textColor:y?"primary600":"neutral700",ellipsis:!0,variant:Y==="M"?"delta":void 0},T=y?"primary600":"neutral600",ne=y?"primary200":"neutral200",z=Y==="M"?`${32/16}rem`:`${24/16}rem`,k=()=>{_||(ie&&!ae?(console.warn('Deprecation warning: Usage of "toggle" prop in Accordion component is deprecated. This is discouraged and will be removed in the next major release. Please use "onToggle" instead'),ie()):ae&&ae())},Q=(0,e.jsx)(D.k,{justifyContent:"center",borderRadius:"50%",height:z,width:z,transform:y?"rotate(180deg)":void 0,"data-strapi-dropdown":!0,"aria-hidden":!0,as:"span",background:ne,cursor:_?"not-allowed":"pointer",onClick:k,shrink:0,children:(0,e.jsx)(x.J,{as:b.Z,width:Y==="M"?`${11/16}rem`:`${8/16}rem`,color:y?"primary600":"neutral600"})});return(0,e.jsx)(H,{paddingBottom:Pe,paddingLeft:oe,paddingRight:oe,paddingTop:Pe,background:Ee,expanded:y,size:Y,justifyContent:"space-between",cursor:_?"not-allowed":"",children:(0,e.jsxs)(D.k,{gap:3,flex:1,maxWidth:"100%",children:[C==="left"&&Q,(0,e.jsx)(a,{onClick:k,"aria-disabled":_,"aria-expanded":y,"aria-controls":xe,"aria-labelledby":me,"data-strapi-accordion-toggle":!0,expanded:y,type:"button",flex:1,minWidth:0,...ue,children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(R.y,{...$e,children:A}),F&&(0,e.jsx)(q.Z,{as:"p",id:Re,textColor:T,children:F})]})}),C==="right"&&(0,e.jsxs)(D.k,{gap:3,children:[Q,w]}),C==="left"&&w]})})}},27799:function(X,B,r){"use strict";r.d(B,{Q:function(){return R}});var e=r(74512),b=r(8471),P=r(6407);const R=({options:O,...S})=>(0,e.jsx)(P.NU,{...S,children:O.map(x=>"children"in x?(0,e.jsx)(P.Ab,{label:x.label,values:x.children.map(D=>D.value.toString()),children:x.children.map(D=>(0,e.jsx)(Z,{value:D.value,children:D.label},D.value))},x.label):(0,e.jsx)(P.ML,{value:x.value,children:x.label},x.value))}),Z=(0,b.ZP)(P.ML)`
|
|
266
|
-
padding-left: ${({theme:O})=>O.spaces[7]};
|
|
267
|
-
`}}]);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[3455],{32239:function(N,x,t){t.r(x),t.d(x,{default:function(){return ge}});var e=t(32735),n=t(19565),f=t(15062),T=t(30305),y=t(27649),b=t(82055),W=t(41415),U=t(99223),S=t(17e3),E=t(56755),F=t(73269),K=t(33827),V=t(94547),v=t(19786),O=t(49372),z=t(3685),X=t(35658),G=t(47765),J=t(68625),Y=t(4038),k=t(19406),w=t(33795),q=t.n(w),Z=t(67879),_=t(53038),ee=t(2160),te=()=>"todo empty role",ne=t(87933),le=t(72850),se=t(50563),ae=t(60216),L=t.n(ae);const $=({id:s,name:d,description:l,usersCount:h,icons:c,rowIndex:o,canUpdate:M})=>{const{formatMessage:p}=(0,Z.Z)(),[,r]=c,C=p({id:"Roles.RoleRow.user-count",defaultMessage:"{number, plural, =0 {# user} one {# user} other {# users}}"},{number:h});return e.createElement(V.Tr,{"aria-rowindex":o,key:s,...M?(0,n.X7)({fn:r.onClick}):{}},e.createElement(v.Td,{maxWidth:(0,n.Q1)(130)},e.createElement(O.Z,{ellipsis:!0,textColor:"neutral800"},d)),e.createElement(v.Td,{maxWidth:(0,n.Q1)(250)},e.createElement(O.Z,{ellipsis:!0,textColor:"neutral800"},l)),e.createElement(v.Td,null,e.createElement(O.Z,{textColor:"neutral800"},C)),e.createElement(v.Td,null,e.createElement(ne.k,{justifyContent:"flex-end",...n.UW},c.map((u,R)=>u?e.createElement(le.x,{key:u.label,paddingLeft:R===0?0:1},e.createElement(se.h,{onClick:u.onClick,label:u.label,noBorder:!0,icon:u.icon})):null))))};$.propTypes={id:L().number.isRequired,name:L().string.isRequired,description:L().string.isRequired,usersCount:L().number.isRequired,icons:L().array.isRequired,rowIndex:L().number.isRequired,canUpdate:L().bool},$.defaultProps={canUpdate:!1};var oe=$,re=t(97889);const ie={roleToDelete:null,showModalConfirmButtonLoading:!1,shouldRefetchData:!1};var de=(s,d)=>(0,re.ZP)(s,l=>{switch(d.type){case"ON_REMOVE_ROLES":{l.showModalConfirmButtonLoading=!0;break}case"ON_REMOVE_ROLES_SUCCEEDED":{l.shouldRefetchData=!0,l.roleToDelete=null;break}case"RESET_DATA_TO_DELETE":{l.shouldRefetchData=!1,l.roleToDelete=null,l.showModalConfirmButtonLoading=!1;break}case"SET_ROLE_TO_DELETE":{l.roleToDelete=d.id;break}default:return l}});const ce=()=>{(0,n.go)();const{locale:s}=(0,Z.Z)(),d=(0,f.v9)(T._),{isLoading:l,allowedActions:{canCreate:h,canDelete:c,canRead:o,canUpdate:M}}=(0,n.ss)(d.settings.roles),{getData:p,roles:r,isLoading:C}=(0,ee.bF)(!1),[{query:u}]=(0,n.Kx)(),R=u?._q||"",{includes:D}=(0,n.L0)(s,{sensitivity:"base"}),P=(0,n.Xe)(s,{sensitivity:"base"}),j=(r||[]).filter(m=>D(m.name,R)||D(m.description,R)).sort((m,A)=>P.compare(m.name,A.name)||P.compare(m.description,A.description));return(0,e.useEffect)(()=>{!l&&o&&p()},[l,o,p]),{isLoadingForPermissions:l,canCreate:h,canDelete:c,canRead:o,canUpdate:M,isLoading:C,getData:p,sortedRoles:j,roles:r}},ue=({getData:s,canCreate:d,canDelete:l,canUpdate:h})=>{const{formatMessage:c}=(0,Z.Z)(),o=(0,n.lm)(),[M,p]=(0,e.useState)(!1),{push:r}=(0,_.k6)(),[{selectedRoles:C,showModalConfirmButtonLoading:u,roleToDelete:R},D]=(0,e.useReducer)(de,ie),{post:P}=(0,n.tg)(),j=async()=>{try{D({type:"ON_REMOVE_ROLES"}),await P("/admin/roles/batch-delete",{ids:[R]}),await s(),D({type:"RESET_DATA_TO_DELETE"})}catch(a){const i=q()(a,["response","payload","data","ids"],null);if(i&&Array.isArray(i)){const he=i.join(`
|
|
2
|
-
`);o({type:"warning",message:he})}else o({type:"warning",message:{id:"notification.error"}})}g()},m=(0,e.useCallback)(a=>{r(`/settings/roles/duplicate/${a}`)},[r]),A=()=>r("/settings/roles/new"),B=(0,e.useCallback)(a=>{D({type:"SET_ROLE_TO_DELETE",id:a}),g()},[]),g=()=>p(a=>!a),I=(0,e.useCallback)(a=>{r(`/settings/roles/${a}`)},[r]),H=(0,e.useCallback)((a,i)=>{a.preventDefault(),a.stopPropagation(),i.usersCount?o({type:"info",message:{id:"Roles.ListPage.notification.delete-not-allowed"}}):B(i.id)},[o,B]),Q=(0,e.useCallback)((a,i)=>{a.preventDefault(),a.stopPropagation(),m(i.id)},[m]),Ee=(0,e.useCallback)(a=>[...d?[{onClick:i=>Q(i,a),label:c({id:"app.utils.duplicate",defaultMessage:"Duplicate"}),icon:e.createElement(G.Z,null)}]:[],...h?[{onClick:()=>I(a.id),label:c({id:"app.utils.edit",defaultMessage:"Edit"}),icon:e.createElement(J.Z,null)}]:[],...l?[{onClick:i=>H(i,a),label:c({id:"global.delete",defaultMessage:"Delete"}),icon:e.createElement(Y.Z,null)}]:[]],[c,H,Q,I,d,h,l]);return{handleNewRoleClick:A,getIcons:Ee,selectedRoles:C,isWarningDeleteAllOpened:M,showModalConfirmButtonLoading:u,handleToggleModal:g,handleDeleteData:j}};var me=()=>{const{formatMessage:s}=(0,Z.Z)(),{isLoadingForPermissions:d,canCreate:l,canRead:h,canDelete:c,canUpdate:o,isLoading:M,getData:p,sortedRoles:r}=ce(),{handleNewRoleClick:C,getIcons:u,isWarningDeleteAllOpened:R,showModalConfirmButtonLoading:D,handleToggleModal:P,handleDeleteData:j}=ue({getData:p,canCreate:l,canDelete:c,canUpdate:o}),m=r.length+1,A=6;if(d)return e.createElement(y.o,null,e.createElement(n.dO,null));const B=s({id:"global.roles",defaultMessage:"roles"});return e.createElement(y.o,null,e.createElement(n.SL,{name:"Roles"}),e.createElement(b.T,{primaryAction:l?e.createElement(W.z,{onClick:C,startIcon:e.createElement(k.Z,null),size:"S"},s({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null,title:B,subtitle:s({id:"Settings.roles.list.description",defaultMessage:"List of roles"}),as:"h2"}),h&&e.createElement(U.Z,{startActions:e.createElement(n.m,{label:s({id:"app.component.search.label",defaultMessage:"Search for {target}"},{target:B})})}),h&&e.createElement(S.D,null,e.createElement(E.i,{colCount:A,rowCount:m,footer:l?e.createElement(F.c,{onClick:C,icon:e.createElement(k.Z,null)},s({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null},e.createElement(K.h,null,e.createElement(V.Tr,{"aria-rowindex":1},e.createElement(v.Th,null,e.createElement(O.Z,{variant:"sigma",textColor:"neutral600"},s({id:"global.name",defaultMessage:"Name"}))),e.createElement(v.Th,null,e.createElement(O.Z,{variant:"sigma",textColor:"neutral600"},s({id:"global.description",defaultMessage:"Description"}))),e.createElement(v.Th,null,e.createElement(O.Z,{variant:"sigma",textColor:"neutral600"},s({id:"global.users",defaultMessage:"Users"}))),e.createElement(v.Th,null,e.createElement(z.T,null,s({id:"global.actions",defaultMessage:"Actions"}))))),e.createElement(X.p,null,r?.map((g,I)=>e.createElement(oe,{key:g.id,id:g.id,name:g.name,description:g.description,usersCount:g.usersCount,icons:u(g),rowIndex:I+2,canUpdate:o})))),!m&&!M&&e.createElement(te,null)),e.createElement(n.QH,{isOpen:R,onConfirm:j,isConfirmButtonLoading:D,onToggleDialog:P}))},ge=()=>{const s=(0,f.v9)(T._);return e.createElement(n.O4,{permissions:s.settings.roles.main},e.createElement(me,null))}},99223:function(N,x,t){t.d(x,{Z:function(){return f}});var e=t(74512),n=t(87933);const f=({startActions:T,endActions:y})=>!T&&!y?null:(0,e.jsxs)(n.k,{justifyContent:"space-between",alignItems:"flex-start",paddingBottom:4,paddingLeft:10,paddingRight:10,children:[(0,e.jsx)(n.k,{gap:2,wrap:"wrap",children:T}),(0,e.jsx)(n.k,{gap:2,shrink:0,wrap:"wrap",children:y})]})},73269:function(N,x,t){t.d(x,{c:function(){return S}});var e=t(74512),n=t(8471),f=t(72850),T=t(9026),y=t(87933),b=t(49372);const W=(0,n.ZP)(f.x)`
|
|
3
|
-
height: ${24/16}rem;
|
|
4
|
-
width: ${24/16}rem;
|
|
5
|
-
border-radius: 50%;
|
|
6
|
-
display: flex;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
align-items: center;
|
|
9
|
-
|
|
10
|
-
svg {
|
|
11
|
-
height: ${10/16}rem;
|
|
12
|
-
width: ${10/16}rem;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
svg path {
|
|
16
|
-
fill: ${({theme:E})=>E.colors.primary600};
|
|
17
|
-
}
|
|
18
|
-
`,U=(0,n.ZP)(f.x)`
|
|
19
|
-
border-radius: 0 0 ${({theme:E})=>E.borderRadius} ${({theme:E})=>E.borderRadius};
|
|
20
|
-
display: block;
|
|
21
|
-
width: 100%;
|
|
22
|
-
border: none;
|
|
23
|
-
`,S=({children:E,icon:F,...K})=>(0,e.jsxs)("div",{children:[(0,e.jsx)(T.i,{}),(0,e.jsx)(U,{as:"button",background:"primary100",padding:5,...K,children:(0,e.jsxs)(y.k,{children:[(0,e.jsx)(W,{"aria-hidden":!0,background:"primary200",children:F}),(0,e.jsx)(f.x,{paddingLeft:3,children:(0,e.jsx)(b.Z,{variant:"pi",fontWeight:"bold",textColor:"primary600",children:E})})]})})]})}}]);
|