@strapi/admin 4.3.3 → 4.3.6
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/StrapiApp.js +23 -23
- package/admin/src/components/AuthenticatedApp/index.js +15 -12
- package/admin/src/components/AuthenticatedApp/utils/api.js +1 -1
- package/admin/src/components/AutoReloadOverlayBlockerProvider/index.js +8 -6
- package/admin/src/components/ConfigurationsProvider/index.js +21 -12
- package/admin/src/components/ConfigurationsProvider/reducer.js +1 -1
- package/admin/src/components/GuidedTour/Homepage/components/Stepper.js +1 -1
- package/admin/src/components/GuidedTour/Homepage/index.js +2 -2
- package/admin/src/components/GuidedTour/Modal/components/Content.js +6 -6
- package/admin/src/components/GuidedTour/Modal/components/Modal.js +1 -1
- package/admin/src/components/GuidedTour/Modal/index.js +2 -4
- package/admin/src/components/GuidedTour/Modal/reducer.js +1 -1
- package/admin/src/components/GuidedTour/index.js +4 -4
- package/admin/src/components/GuidedTour/init.js +2 -2
- package/admin/src/components/GuidedTour/reducer.js +1 -1
- package/admin/src/components/GuidedTour/utils/isGuidedTourCompleted.js +1 -1
- package/admin/src/components/GuidedTour/utils/persistStateToLocaleStorage.js +4 -4
- package/admin/src/components/LanguageProvider/index.js +1 -1
- package/admin/src/components/LanguageProvider/init.js +1 -1
- package/admin/src/components/LeftMenu/index.js +6 -6
- package/admin/src/components/Notifications/Notification/index.js +3 -4
- package/admin/src/components/Notifications/index.js +2 -2
- package/admin/src/components/Notifications/reducer.js +2 -2
- package/admin/src/components/PluginsInitializer/index.js +4 -2
- package/admin/src/components/PluginsInitializer/init.js +1 -1
- package/admin/src/components/PluginsInitializer/reducer.js +1 -1
- package/admin/src/components/PrivateRoute/index.js +1 -1
- package/admin/src/components/RBACProvider/actions.js +1 -1
- package/admin/src/components/RBACProvider/index.js +1 -1
- package/admin/src/components/RBACProvider/reducer.js +2 -2
- package/admin/src/components/ThemeToggleProvider/index.js +1 -1
- package/admin/src/components/UpgradePlanModal/index.js +1 -1
- package/admin/src/content-manager/components/AttributeFilter/Filters.js +1 -1
- package/admin/src/content-manager/components/AttributeFilter/hooks/useAllowedAttributes.js +1 -1
- package/admin/src/content-manager/components/AttributeFilter/index.js +1 -1
- package/admin/src/content-manager/components/Block/index.js +1 -1
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +7 -12
- package/admin/src/content-manager/components/DragLayer/index.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/CellContent/RelationMultiple/index.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/CellContent/RepeatableComponent/index.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/TableRows/index.js +4 -4
- package/admin/src/content-manager/components/DynamicTable/index.js +25 -4
- package/admin/src/content-manager/components/DynamicZone/components/AddComponentButton/index.js +18 -20
- package/admin/src/content-manager/components/DynamicZone/components/Component/index.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/ComponentCard/index.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/index.js +3 -3
- package/admin/src/content-manager/components/DynamicZone/index.js +10 -10
- package/admin/src/content-manager/components/DynamicZone/utils/connect.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/utils/select.js +1 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +6 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +1 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/cleanData.js +4 -4
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +18 -18
- package/admin/src/content-manager/components/FieldComponent/utils/connect.js +1 -1
- package/admin/src/content-manager/components/FieldComponent/utils/select.js +6 -6
- package/admin/src/content-manager/components/FormTitle/index.js +1 -1
- package/admin/src/content-manager/components/InjectionZoneList/index.js +1 -1
- package/admin/src/content-manager/components/InputJSON/index.js +5 -6
- package/admin/src/content-manager/components/InputJSON/jsonlint.js +13 -13
- package/admin/src/content-manager/components/InputUID/index.js +1 -1
- package/admin/src/content-manager/components/InputUID/regex.js +1 -1
- package/admin/src/content-manager/components/Inputs/index.js +32 -5
- package/admin/src/content-manager/components/Inputs/utils/connect.js +1 -1
- package/admin/src/content-manager/components/Inputs/utils/generateOptions.js +1 -1
- package/admin/src/content-manager/components/Inputs/utils/getStep.js +1 -5
- package/admin/src/content-manager/components/LayoutDndProvider/index.js +6 -6
- package/admin/src/content-manager/components/NonRepeatableComponent/index.js +4 -4
- package/admin/src/content-manager/components/PreviewWysiwyg/utils/mdRenderer.js +1 -1
- package/admin/src/content-manager/components/PreviewWysiwyg/utils/satinizeHtml.js +1 -1
- package/admin/src/content-manager/components/RepeatableComponent/AccordionGroupCustom/index.js +1 -1
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/index.js +9 -15
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/utils/connect.js +1 -1
- package/admin/src/content-manager/components/RepeatableComponent/index.js +5 -5
- package/admin/src/content-manager/components/RepeatableComponent/utils/connect.js +1 -1
- package/admin/src/content-manager/components/RepeatableComponent/utils/getComponentErrorKeys.js +2 -2
- package/admin/src/content-manager/components/SectionTitle/index.js +1 -1
- package/admin/src/content-manager/components/SelectMany/ListItem.js +1 -1
- package/admin/src/content-manager/components/SelectMany/index.js +1 -1
- package/admin/src/content-manager/components/SelectOne/SingleValue.js +1 -1
- package/admin/src/content-manager/components/SelectWrapper/Option.js +1 -1
- package/admin/src/content-manager/components/SelectWrapper/index.js +16 -26
- package/admin/src/content-manager/components/SelectWrapper/utils/connect.js +1 -1
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +6 -11
- package/admin/src/content-manager/components/SingleTypeFormWrapper/utils/getRequestUrl.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/Editor.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/EditorLayout.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/WysiwygFooter.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +4 -4
- package/admin/src/content-manager/components/Wysiwyg/index.js +5 -5
- package/admin/src/content-manager/components/Wysiwyg/utils/utils.js +4 -4
- package/admin/src/content-manager/hooks/useContentTypeLayout/index.js +1 -1
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/index.js +3 -3
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/reducer.js +1 -1
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/utils/formatLayouts.js +7 -7
- package/admin/src/content-manager/hooks/useFindRedirectionLink/index.js +1 -1
- package/admin/src/content-manager/hooks/useFindRedirectionLink/selectors.js +1 -1
- package/admin/src/content-manager/hooks/useSyncRbac/reducer.js +1 -1
- package/admin/src/content-manager/hooks/useSyncRbac/selectors.js +2 -2
- package/admin/src/content-manager/pages/App/LeftMenu/index.js +8 -8
- package/admin/src/content-manager/pages/App/index.js +3 -3
- package/admin/src/content-manager/pages/App/reducer.js +1 -1
- package/admin/src/content-manager/pages/App/selectors.js +4 -4
- package/admin/src/content-manager/pages/App/useModels.js +1 -1
- package/admin/src/content-manager/pages/App/utils/generateModelsLinks.js +2 -2
- package/admin/src/content-manager/pages/CollectionTypeRecursivePath/index.js +1 -1
- package/admin/src/content-manager/pages/ComponentSetttingsView/index.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/ComponentFieldList.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFieldButton.js +5 -5
- package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFields.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/components/DynamicZoneList.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/components/GenericInput.js +3 -3
- package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +36 -5
- package/admin/src/content-manager/pages/EditSettingsView/components/RelationalFieldButton.js +3 -3
- package/admin/src/content-manager/pages/EditSettingsView/components/RelationalFields.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/index.js +21 -21
- package/admin/src/content-manager/pages/EditSettingsView/reducer.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/utils/createPossibleMainFieldsForModelsAndComponents.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/utils/getInputProps.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/utils/layout.js +12 -12
- package/admin/src/content-manager/pages/EditView/DeleteLink/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/DeleteLink/utils/connect.js +1 -1
- package/admin/src/content-manager/pages/EditView/DraftAndPublishBadge/utils/connect.js +1 -1
- package/admin/src/content-manager/pages/EditView/Header/index.js +4 -4
- package/admin/src/content-manager/pages/EditView/Header/utils/connect.js +1 -1
- package/admin/src/content-manager/pages/EditView/Header/utils/getDraftRelations.js +3 -3
- package/admin/src/content-manager/pages/EditView/Informations/utils/getUnits.js +1 -1
- package/admin/src/content-manager/pages/EditView/index.js +7 -10
- package/admin/src/content-manager/pages/EditView/utils/createAttributesLayout.js +2 -2
- package/admin/src/content-manager/pages/EditView/utils/getFieldsActionMatchingPermissions.js +1 -1
- package/admin/src/content-manager/pages/EditViewLayoutManager/Permissions.js +1 -1
- package/admin/src/content-manager/pages/EditViewLayoutManager/reducer.js +1 -1
- package/admin/src/content-manager/pages/EditViewLayoutManager/selectors.js +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/components/DraggableCard.js +6 -6
- package/admin/src/content-manager/pages/ListSettingsView/components/EditFieldForm.js +4 -3
- package/admin/src/content-manager/pages/ListSettingsView/components/Settings.js +9 -9
- package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +2 -2
- package/admin/src/content-manager/pages/ListSettingsView/index.js +9 -9
- package/admin/src/content-manager/pages/ListSettingsView/reducer.js +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/utils/ellipsisCardTitle.js +1 -1
- package/admin/src/content-manager/pages/ListView/FieldPicker/index.js +8 -7
- package/admin/src/content-manager/pages/ListView/FieldPicker/utils/getAllAllowedHeader.js +1 -1
- package/admin/src/content-manager/pages/ListView/actions.js +1 -1
- package/admin/src/content-manager/pages/ListView/index.js +3 -3
- package/admin/src/content-manager/pages/ListView/reducer.js +2 -2
- package/admin/src/content-manager/pages/ListView/selectors.js +3 -3
- package/admin/src/content-manager/pages/ListView/utils/createPluginsFilter.js +1 -1
- package/admin/src/content-manager/pages/ListViewLayoutManager/Permissions.js +2 -2
- package/admin/src/content-manager/sharedReducers/crudReducer/actions.js +3 -3
- package/admin/src/content-manager/sharedReducers/crudReducer/reducer.js +1 -1
- package/admin/src/content-manager/sharedReducers/crudReducer/selectors.js +1 -1
- package/admin/src/content-manager/utils/checkIfAttributeIsDisplayable.js +1 -1
- package/admin/src/content-manager/utils/formatLayoutToApi.js +2 -2
- package/admin/src/content-manager/utils/generatePermissionsObject.js +3 -2
- package/admin/src/content-manager/utils/getFieldName.js +2 -2
- package/admin/src/content-manager/utils/getMaxTempKey.js +2 -2
- package/admin/src/content-manager/utils/getRequestUrl.js +1 -1
- package/admin/src/content-manager/utils/getTrad.js +1 -1
- package/admin/src/content-manager/utils/mergeMetasWithSchema.js +2 -2
- package/admin/src/content-manager/utils/removeKeyInObject.js +1 -1
- package/admin/src/content-manager/utils/removePasswordFieldsFromData.js +2 -2
- package/admin/src/core/apis/Plugin.js +1 -1
- package/admin/src/core/store/configureStore.js +1 -1
- package/admin/src/core/store/createReducer.js +1 -1
- package/admin/src/core/utils/axiosInstance.js +4 -4
- package/admin/src/core/utils/createHook.js +2 -2
- package/admin/src/hooks/useFetchEnabledPlugins/index.js +3 -3
- package/admin/src/hooks/useFetchMarketplacePlugins/index.js +3 -3
- package/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js +1 -1
- package/admin/src/hooks/useFetchMarketplaceProviders/index.js +3 -3
- package/admin/src/hooks/useFetchPermissionsLayout/index.js +1 -1
- package/admin/src/hooks/useFetchPermissionsLayout/reducer.js +1 -1
- package/admin/src/hooks/useFetchRole/index.js +4 -4
- package/admin/src/hooks/useFetchRole/reducer.js +1 -1
- package/admin/src/hooks/useMenu/reducer.js +1 -1
- package/admin/src/hooks/useMenu/utils/getGeneralLinks.js +3 -1
- package/admin/src/hooks/useModels/index.js +1 -1
- package/admin/src/hooks/useModels/reducer.js +3 -3
- package/admin/src/hooks/useRolesList/reducer.js +1 -1
- package/admin/src/hooks/useSettingsForm/index.js +2 -2
- package/admin/src/hooks/useSettingsForm/reducer.js +1 -1
- package/admin/src/hooks/useSettingsMenu/index.js +2 -2
- package/admin/src/hooks/useSettingsMenu/init.js +1 -1
- package/admin/src/hooks/useSettingsMenu/reducer.js +3 -3
- package/admin/src/hooks/useSettingsMenu/utils/formatLinks.js +3 -3
- package/admin/src/hooks/useSettingsMenu/utils/sortLinks.js +1 -1
- package/admin/src/index.js +1 -1
- package/admin/src/layouts/UnauthenticatedLayout/LocaleToggle/index.js +1 -1
- package/admin/src/pages/Admin/Onboarding/index.js +2 -2
- package/admin/src/pages/Admin/index.js +2 -2
- package/admin/src/pages/App/index.js +13 -5
- package/admin/src/pages/App/reducer.js +1 -1
- package/admin/src/pages/AuthPage/components/ForgotPassword/index.js +1 -1
- package/admin/src/pages/AuthPage/components/Login/BaseLogin.js +4 -4
- package/admin/src/pages/AuthPage/components/Login/index.js +2 -2
- package/admin/src/pages/AuthPage/components/Register/index.js +6 -6
- package/admin/src/pages/AuthPage/components/ResetPassword/index.js +5 -5
- package/admin/src/pages/AuthPage/init.js +1 -1
- package/admin/src/pages/AuthPage/reducer.js +1 -1
- package/admin/src/pages/AuthPage/utils/forms.js +2 -8
- package/admin/src/pages/HomePage/ContentBlocks.js +1 -1
- package/admin/src/pages/HomePage/SocialLinks.js +1 -1
- package/admin/src/pages/HomePage/index.js +3 -3
- package/admin/src/pages/InstalledPluginsPage/Plugins.js +1 -1
- package/admin/src/pages/MarketplacePage/components/NpmPackagesGrid/index.js +2 -2
- package/admin/src/pages/MarketplacePage/index.js +6 -10
- package/admin/src/pages/ProfilePage/index.js +20 -23
- package/admin/src/pages/ProfilePage/utils/api.js +1 -1
- package/admin/src/pages/SettingsPage/components/SettingsNav/index.js +4 -4
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/index.js +8 -6
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/index.js +25 -13
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/utils/tableHeaders.js +16 -4
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/Form/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/Form/reducer.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoInput/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoInput/reducer.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/FromComputerForm.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/FromUrlForm.js +2 -2
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoModalStepper/reducer.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +4 -4
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/api.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/getFormData.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/parseFileMetadatas.js +4 -4
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/prefixAllUrls.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/urlToFile.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/ActionRow/index.js +4 -4
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/Collapse/index.js +5 -8
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/Collapse/utils/generateCheckboxesActions.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/utils/getRowLabelCheckboxeState.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/CollapsePropertyMatrix/Header/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/CollapsePropertyMatrix/SubActionRow/index.js +8 -12
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/CollapsePropertyMatrix/utils/generateHeadersFromActions.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/utils/activeStyle.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/utils/getAvailableActions.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapses/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Curve/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/GlobalActions/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/GlobalActions/utils/findDisplayedActions.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/GlobalActions/utils/getRowLabelCheckboxesState.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/index.js +9 -8
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/reducer.js +4 -4
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/createDefaultCTFormFromLayout.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/findMatchingPermissions.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/formatContentTypesPermissionToAPI.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/formatLayoutForSettingsAndPlugins.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/formatPermissionsToAPI.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/formatSettingsPermissionsToAPI.js +4 -4
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/updateConditionsToFalse.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PluginsAndSettings/SubCategory/index.js +5 -8
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PluginsAndSettings/SubCategory/utils/formatActions.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PluginsAndSettings/SubCategory/utils/getConditionsButtonState.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PluginsAndSettings/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RoleForm/index.js +67 -69
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RowLabelWithCheckbox/index.js +4 -3
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/utils/createArrayOfValues.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/utils/getCheckboxState.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/utils/removeConditionKeyFromData.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/index.js +58 -60
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/index.js +6 -10
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/utils/api.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/DynamicTable/TableRows/index.js +4 -4
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/Filters/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +8 -8
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/schema.js +2 -8
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/index.js +17 -11
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/utils/api.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/utils/tableHeaders.js +46 -14
- package/admin/src/pages/SettingsPage/pages/Users/components/SelectRoles/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Users/utils/validations/users/profile.js +1 -5
- package/admin/src/pages/SettingsPage/pages/Users/utils/validations/users/roles.js +1 -4
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/EventRow.js +5 -5
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +4 -4
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/utils/formatValue.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/HeadersInput/Combobox.js +4 -4
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/TriggerContainer/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/utils/fieldsRegex.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/utils/schema.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/index.js +9 -9
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/reducer.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/utils/formatData.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +6 -6
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/reducer.js +4 -4
- package/admin/src/pages/SettingsPage/utils/createSectionsRoutes.js +3 -3
- package/admin/src/pages/SettingsPage/utils/defaultRoutes.js +12 -12
- package/admin/src/pages/SettingsPage/utils/getSectionsToDisplay.js +2 -2
- package/admin/src/pages/UseCasePage/index.js +2 -2
- package/admin/src/shared/components/InjectionZone/index.js +1 -1
- package/admin/src/shared/hooks/useInjectionZone/index.js +1 -1
- package/admin/src/translations/ca.json +4 -4
- package/admin/src/translations/de.json +4 -4
- package/admin/src/translations/dk.json +4 -4
- package/admin/src/translations/en.json +16 -15
- package/admin/src/translations/es.json +163 -6
- package/admin/src/translations/fr.json +4 -4
- package/admin/src/translations/gu.json +4 -4
- package/admin/src/translations/he.json +3 -3
- package/admin/src/translations/hi.json +4 -4
- package/admin/src/translations/hu.json +4 -4
- package/admin/src/translations/id.json +4 -4
- package/admin/src/translations/it.json +4 -4
- package/admin/src/translations/ja.json +4 -4
- package/admin/src/translations/ko.json +4 -4
- package/admin/src/translations/ml.json +4 -4
- package/admin/src/translations/nl.json +4 -4
- package/admin/src/translations/no.json +3 -3
- package/admin/src/translations/pl.json +4 -4
- package/admin/src/translations/pt-BR.json +177 -24
- package/admin/src/translations/ru.json +4 -4
- package/admin/src/translations/sa.json +4 -4
- package/admin/src/translations/sk.json +4 -4
- package/admin/src/translations/sv.json +665 -11
- package/admin/src/translations/th.json +3 -3
- package/admin/src/translations/zh-Hans.json +12 -15
- package/admin/src/translations/zh.json +4 -4
- package/admin/src/utils/getAttributesToDisplay.js +1 -1
- package/admin/src/utils/getExistingActions.js +2 -2
- package/admin/src/utils/getFullName.js +1 -1
- package/admin/src/utils/getRequestUrl.js +1 -1
- package/admin/src/utils/makeUniqueRoutes.js +2 -2
- package/admin/src/utils/sortLinks.js +1 -1
- package/build/{1669.0551026a.chunk.js → 1669.4ce92b2f.chunk.js} +1 -1
- package/build/{6925.fb35248e.chunk.js → 6925.f5c8b6fc.chunk.js} +4 -4
- package/build/{7866.29d1f169.chunk.js → 7866.22e3c9f8.chunk.js} +1 -1
- package/build/8773.4e36117f.chunk.js +325 -0
- package/build/Admin-authenticatedApp.350ee81d.chunk.js +80 -0
- package/build/Admin_InternalErrorPage.12e24216.chunk.js +1 -0
- package/build/{Admin_marketplace.0b758aac.chunk.js → Admin_marketplace.2d181ad7.chunk.js} +1 -1
- package/build/Admin_pluginsPage.4d59785a.chunk.js +1 -0
- package/build/Admin_profilePage.8617313a.chunk.js +15 -0
- package/build/Admin_settingsPage.e58753c8.chunk.js +178 -0
- package/build/admin-app.05edc328.chunk.js +112 -0
- package/build/admin-edit-roles-page.554ba3fa.chunk.js +1 -0
- package/build/admin-edit-users.5bebf473.chunk.js +10 -0
- package/build/admin-users.1d0aa7a0.chunk.js +11 -0
- package/build/{api-tokens-create-page.442e3be0.chunk.js → api-tokens-create-page.b4a9987d.chunk.js} +1 -1
- package/build/{api-tokens-edit-page.5f34eec7.chunk.js → api-tokens-edit-page.6f5b4e26.chunk.js} +1 -1
- package/build/api-tokens-list-page.06938769.chunk.js +15 -0
- package/build/ca-json.d16c1d28.chunk.js +1 -0
- package/build/content-manager.62390771.chunk.js +1178 -0
- package/build/{content-type-builder-list-view.4a704844.chunk.js → content-type-builder-list-view.76a69473.chunk.js} +9 -9
- package/build/content-type-builder-translation-pt-BR-json.d6c7fcc1.chunk.js +1 -0
- package/build/content-type-builder.42cecba9.chunk.js +142 -0
- package/build/de-json.a9b514dc.chunk.js +1 -0
- package/build/dk-json.09e8d145.chunk.js +1 -0
- package/build/en-json.1bf20384.chunk.js +1 -0
- package/build/es-json.bb1fc425.chunk.js +1 -0
- package/build/fr-json.a3cf2e0b.chunk.js +1 -0
- package/build/gu-json.d8311297.chunk.js +1 -0
- package/build/he-json.3b825d80.chunk.js +1 -0
- package/build/hi-json.0edb8d29.chunk.js +1 -0
- package/build/hu-json.7855529a.chunk.js +1 -0
- package/build/i18n-settings-page.bf1304b0.chunk.js +101 -0
- package/build/i18n-translation-fr-json.b401aa34.chunk.js +1 -0
- package/build/id-json.df9618f2.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/it-json.a21bf078.chunk.js +1 -0
- package/build/ja-json.7b0d9067.chunk.js +1 -0
- package/build/ko-json.983c1f8f.chunk.js +1 -0
- package/build/main.f220d4d1.js +9321 -0
- package/build/ml-json.8dd021c8.chunk.js +1 -0
- package/build/nl-json.29d2eb37.chunk.js +1 -0
- package/build/no-json.40386397.chunk.js +1 -0
- package/build/pl-json.1f04f00c.chunk.js +1 -0
- package/build/pt-BR-json.b4bc8efe.chunk.js +1 -0
- package/build/ru-json.7ab40ccf.chunk.js +1 -0
- package/build/{runtime~main.5b7ae71f.js → runtime~main.14842096.js} +2 -2
- package/build/sa-json.c5a9f4ea.chunk.js +1 -0
- package/build/sk-json.e4c24c4e.chunk.js +1 -0
- package/build/sv-json.c3f471ae.chunk.js +1 -0
- package/build/th-json.a59ffb32.chunk.js +1 -0
- package/build/upload-translation-es-json.0f90db48.chunk.js +1 -0
- package/build/{upload-translation-th-json.64dd70ce.chunk.js → upload-translation-th-json.9e1fda51.chunk.js} +1 -1
- package/build/upload.7084cea6.chunk.js +7 -0
- package/build/{users-advanced-settings-page.f38654fc.chunk.js → users-advanced-settings-page.f11c8af4.chunk.js} +1 -1
- package/build/{users-email-settings-page.899e7fbd.chunk.js → users-email-settings-page.73c41236.chunk.js} +1 -1
- package/build/{users-providers-settings-page.a0b0fe39.chunk.js → users-providers-settings-page.f8e78537.chunk.js} +1 -1
- package/build/users-roles-settings-page.cafb4fe5.chunk.js +30 -0
- package/build/{webhook-edit-page.3417d93c.chunk.js → webhook-edit-page.9aba79b2.chunk.js} +3 -3
- package/build/zh-Hans-json.77a42bc5.chunk.js +1 -0
- package/build/zh-json.451a0271.chunk.js +1 -0
- package/ee/admin/hooks/useAuthProviders/reducer.js +1 -1
- package/ee/admin/pages/AuthPage/components/Login/index.js +2 -2
- package/ee/admin/pages/AuthPage/components/Providers/SSOProviders.js +3 -3
- package/ee/admin/pages/SettingsPage/SingleSignOn/index.js +3 -3
- package/ee/admin/pages/SettingsPage/pages/Roles/CreatePage/index.js +11 -9
- package/ee/admin/pages/SettingsPage/pages/Roles/ListPage/index.js +8 -8
- package/ee/admin/pages/SettingsPage/pages/Roles/ListPage/reducer.js +1 -1
- package/ee/admin/pages/SettingsPage/utils/customRoutes.js +1 -1
- package/ee/server/controllers/authentication/middlewares.js +1 -1
- package/ee/server/controllers/authentication/utils.js +1 -1
- package/ee/server/controllers/role.js +4 -4
- package/ee/server/services/passport/provider-registry.js +1 -1
- package/ee/server/services/passport/sso.js +1 -1
- package/ee/server/services/passport.js +1 -1
- package/ee/server/services/role.js +1 -1
- package/ee/server/validation/authentication.js +1 -1
- package/ee/server/validation/role.js +3 -6
- package/ee/server/validation/user.js +1 -1
- package/env.js +2 -2
- package/index.js +2 -2
- package/jest.config.front.js +3 -1
- package/package.json +24 -15
- package/scripts/build.js +2 -2
- package/scripts/create-dev-plugins-file.js +5 -7
- package/scripts/create-plugins-file.js +2 -2
- package/server/config/admin-conditions.js +3 -3
- package/server/controllers/admin.js +1 -1
- package/server/controllers/authentication.js +1 -1
- package/server/controllers/formatters/format-actions-by-sections.js +8 -5
- package/server/controllers/role.js +1 -1
- package/server/controllers/user.js +1 -1
- package/server/controllers/webhooks.js +6 -16
- package/server/domain/action/index.js +3 -3
- package/server/domain/action/provider.js +2 -2
- package/server/domain/condition/index.js +2 -2
- package/server/domain/condition/provider.js +1 -1
- package/server/domain/permission/index.js +3 -3
- package/server/domain/user.js +2 -2
- package/server/policies/hasPermissions.js +5 -5
- package/server/policies/isAuthenticatedAdmin.js +1 -1
- package/server/routes/serve-admin-panel.js +1 -1
- package/server/services/action.js +1 -1
- package/server/services/api-token.js +5 -5
- package/server/services/auth.js +2 -2
- package/server/services/condition.js +1 -1
- package/server/services/content-type.js +5 -3
- package/server/services/passport/local-strategy.js +2 -2
- package/server/services/passport.js +2 -4
- package/server/services/permission/engine-hooks.js +1 -1
- package/server/services/permission/engine.js +9 -9
- package/server/services/permission/permissions-manager/query-builers.js +5 -5
- package/server/services/permission/permissions-manager/sanitize.js +6 -10
- package/server/services/permission/queries.js +12 -13
- package/server/services/permission/sections-builder/handlers.js +21 -19
- package/server/services/permission/sections-builder/section.js +2 -2
- package/server/services/permission/sections-builder/utils.js +5 -5
- package/server/services/project-settings.js +9 -12
- package/server/services/role.js +15 -13
- package/server/services/token.js +2 -2
- package/server/services/user.js +11 -11
- package/server/strategies/admin.js +1 -1
- package/server/strategies/api-token.js +3 -3
- package/server/utils/index.js +1 -1
- package/server/validation/action-provider.js +6 -12
- package/server/validation/api-tokens.js +4 -16
- package/server/validation/authentication/renew-token.js +1 -5
- package/server/validation/common-functions/check-fields-are-correctly-nested.js +5 -3
- package/server/validation/common-functions/check-fields-dont-have-duplicates.js +3 -2
- package/server/validation/common-validators.js +74 -71
- package/server/validation/permission.js +13 -13
- package/server/validation/policies/hasPermissions.js +2 -6
- package/server/validation/user.js +1 -5
- package/utils/create-cache-dir.js +3 -3
- package/utils/get-custom-app-config-file.js +3 -3
- package/utils/get-plugins-path.js +3 -2
- package/utils/should-build-admin.js +4 -4
- package/webpack.config.js +2 -7
- package/build/8773.c190837d.chunk.js +0 -330
- package/build/Admin-authenticatedApp.ccf94499.chunk.js +0 -80
- package/build/Admin_InternalErrorPage.25c53284.chunk.js +0 -1
- package/build/Admin_pluginsPage.0992c2b5.chunk.js +0 -1
- package/build/Admin_profilePage.35ce8e94.chunk.js +0 -15
- package/build/Admin_settingsPage.76ee4c17.chunk.js +0 -178
- package/build/admin-app.93ff2e38.chunk.js +0 -112
- package/build/admin-edit-roles-page.358d98c1.chunk.js +0 -1
- package/build/admin-edit-users.7d9cf406.chunk.js +0 -10
- package/build/admin-users.bb3a8eb6.chunk.js +0 -11
- package/build/api-tokens-list-page.5ea3f6ce.chunk.js +0 -15
- package/build/ca-json.0097e443.chunk.js +0 -1
- package/build/content-manager.55791f82.chunk.js +0 -1178
- package/build/content-type-builder-translation-pt-BR-json.5739a2aa.chunk.js +0 -1
- package/build/content-type-builder.f48a28f9.chunk.js +0 -142
- package/build/de-json.0b92acd2.chunk.js +0 -1
- package/build/dk-json.9f1bc016.chunk.js +0 -1
- package/build/en-json.6d70e9ff.chunk.js +0 -1
- package/build/es-json.2a5a9fc1.chunk.js +0 -1
- package/build/fr-json.84064a0b.chunk.js +0 -1
- package/build/gu-json.dafa6f0d.chunk.js +0 -1
- package/build/he-json.d40da459.chunk.js +0 -1
- package/build/hi-json.b4ae16d1.chunk.js +0 -1
- package/build/hu-json.c81ce352.chunk.js +0 -1
- package/build/i18n-settings-page.9d426e96.chunk.js +0 -101
- package/build/i18n-translation-fr-json.0839d68d.chunk.js +0 -1
- package/build/id-json.fad45d17.chunk.js +0 -1
- package/build/it-json.12df4cdf.chunk.js +0 -1
- package/build/ja-json.850237e9.chunk.js +0 -1
- package/build/ko-json.2f3d256e.chunk.js +0 -1
- package/build/main.66ef8611.js +0 -9317
- package/build/ml-json.dc946c7f.chunk.js +0 -1
- package/build/nl-json.465b173f.chunk.js +0 -1
- package/build/no-json.e8749dd4.chunk.js +0 -1
- package/build/pl-json.4d11f53d.chunk.js +0 -1
- package/build/pt-BR-json.6301d49b.chunk.js +0 -1
- package/build/ru-json.28147733.chunk.js +0 -1
- package/build/sa-json.be504091.chunk.js +0 -1
- package/build/sk-json.5b33afc2.chunk.js +0 -1
- package/build/sv-json.cdcac02d.chunk.js +0 -1
- package/build/th-json.3aadaec6.chunk.js +0 -1
- package/build/upload-translation-es-json.6b1813b6.chunk.js +0 -1
- package/build/upload.0af4feca.chunk.js +0 -7
- package/build/users-roles-settings-page.1206751f.chunk.js +0 -30
- package/build/zh-Hans-json.eac1d90a.chunk.js +0 -1
- package/build/zh-json.96bf6019.chunk.js +0 -1
|
@@ -14,13 +14,10 @@ const registerProviderActionSchema = yup
|
|
|
14
14
|
.string()
|
|
15
15
|
.matches(
|
|
16
16
|
/^[a-z]([a-z|.|-]+)[a-z]$/,
|
|
17
|
-
v => `${v.path}: The id can only contain lowercase letters, dots and hyphens.`
|
|
17
|
+
(v) => `${v.path}: The id can only contain lowercase letters, dots and hyphens.`
|
|
18
18
|
)
|
|
19
19
|
.required(),
|
|
20
|
-
section: yup
|
|
21
|
-
.string()
|
|
22
|
-
.oneOf(['contentTypes', 'plugins', 'settings'])
|
|
23
|
-
.required(),
|
|
20
|
+
section: yup.string().oneOf(['contentTypes', 'plugins', 'settings']).required(),
|
|
24
21
|
pluginName: yup.mixed().when('section', {
|
|
25
22
|
is: 'plugins',
|
|
26
23
|
then: validators.isAPluginName.required(),
|
|
@@ -28,10 +25,7 @@ const registerProviderActionSchema = yup
|
|
|
28
25
|
}),
|
|
29
26
|
subjects: yup.mixed().when('section', {
|
|
30
27
|
is: 'contentTypes',
|
|
31
|
-
then: yup
|
|
32
|
-
.array()
|
|
33
|
-
.of(yup.string())
|
|
34
|
-
.required(),
|
|
28
|
+
then: yup.array().of(yup.string()).required(),
|
|
35
29
|
otherwise: yup
|
|
36
30
|
.mixed()
|
|
37
31
|
.oneOf([undefined], 'subjects should only be defined for the "contentTypes" section'),
|
|
@@ -45,18 +39,18 @@ const registerProviderActionSchema = yup
|
|
|
45
39
|
.test(
|
|
46
40
|
'settingsCategory',
|
|
47
41
|
'category should only be defined for the "settings" section',
|
|
48
|
-
cat => cat === undefined
|
|
42
|
+
(cat) => cat === undefined
|
|
49
43
|
),
|
|
50
44
|
}),
|
|
51
45
|
subCategory: yup.mixed().when('section', {
|
|
52
|
-
is: section => ['settings', 'plugins'].includes(section),
|
|
46
|
+
is: (section) => ['settings', 'plugins'].includes(section),
|
|
53
47
|
then: yup.string(),
|
|
54
48
|
otherwise: yup
|
|
55
49
|
.mixed()
|
|
56
50
|
.test(
|
|
57
51
|
'settingsSubCategory',
|
|
58
52
|
'subCategory should only be defined for "plugins" and "settings" sections',
|
|
59
|
-
subCat => {
|
|
53
|
+
(subCat) => {
|
|
60
54
|
return subCat === undefined;
|
|
61
55
|
}
|
|
62
56
|
),
|
|
@@ -6,30 +6,18 @@ const constants = require('../services/constants');
|
|
|
6
6
|
const apiTokenCreationSchema = yup
|
|
7
7
|
.object()
|
|
8
8
|
.shape({
|
|
9
|
-
name: yup
|
|
10
|
-
.string()
|
|
11
|
-
.min(1)
|
|
12
|
-
.required(),
|
|
9
|
+
name: yup.string().min(1).required(),
|
|
13
10
|
description: yup.string().optional(),
|
|
14
|
-
type: yup
|
|
15
|
-
.string()
|
|
16
|
-
.oneOf(Object.values(constants.API_TOKEN_TYPE))
|
|
17
|
-
.required(),
|
|
11
|
+
type: yup.string().oneOf(Object.values(constants.API_TOKEN_TYPE)).required(),
|
|
18
12
|
})
|
|
19
13
|
.noUnknown();
|
|
20
14
|
|
|
21
15
|
const apiTokenUpdateSchema = yup
|
|
22
16
|
.object()
|
|
23
17
|
.shape({
|
|
24
|
-
name: yup
|
|
25
|
-
.string()
|
|
26
|
-
.min(1)
|
|
27
|
-
.notNull(),
|
|
18
|
+
name: yup.string().min(1).notNull(),
|
|
28
19
|
description: yup.string().nullable(),
|
|
29
|
-
type: yup
|
|
30
|
-
.string()
|
|
31
|
-
.oneOf(Object.values(constants.API_TOKEN_TYPE))
|
|
32
|
-
.notNull(),
|
|
20
|
+
type: yup.string().oneOf(Object.values(constants.API_TOKEN_TYPE)).notNull(),
|
|
33
21
|
})
|
|
34
22
|
.noUnknown();
|
|
35
23
|
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const { yup, validateYupSchema } = require('@strapi/utils');
|
|
4
4
|
|
|
5
|
-
const renewToken = yup
|
|
6
|
-
.object()
|
|
7
|
-
.shape({ token: yup.string().required() })
|
|
8
|
-
.required()
|
|
9
|
-
.noUnknown();
|
|
5
|
+
const renewToken = yup.object().shape({ token: yup.string().required() }).required().noUnknown();
|
|
10
6
|
|
|
11
7
|
module.exports = validateYupSchema(renewToken);
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
const _ = require('lodash');
|
|
4
4
|
|
|
5
|
-
const checkFieldsAreCorrectlyNested = fields => {
|
|
5
|
+
const checkFieldsAreCorrectlyNested = (fields) => {
|
|
6
6
|
if (_.isNil(fields)) {
|
|
7
7
|
// Only check if the fields exist
|
|
8
8
|
return true;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
|
+
if (!Array.isArray(fields)) {
|
|
10
11
|
return false;
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -15,7 +16,8 @@ const checkFieldsAreCorrectlyNested = fields => {
|
|
|
15
16
|
failed = fields
|
|
16
17
|
.slice(indexA + 1)
|
|
17
18
|
.some(
|
|
18
|
-
fieldB =>
|
|
19
|
+
(fieldB) =>
|
|
20
|
+
fieldB.startsWith(`${fields[indexA]}.`) || fields[indexA].startsWith(`${fieldB}.`)
|
|
19
21
|
);
|
|
20
22
|
if (failed) break;
|
|
21
23
|
}
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
const _ = require('lodash');
|
|
4
4
|
|
|
5
|
-
const checkFieldsDontHaveDuplicates = fields => {
|
|
5
|
+
const checkFieldsDontHaveDuplicates = (fields) => {
|
|
6
6
|
if (_.isNil(fields)) {
|
|
7
7
|
// Only check if the fields exist
|
|
8
8
|
return true;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
|
+
if (!Array.isArray(fields)) {
|
|
10
11
|
return false;
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -10,14 +10,11 @@ const {
|
|
|
10
10
|
checkFieldsDontHaveDuplicates,
|
|
11
11
|
} = require('./common-functions');
|
|
12
12
|
|
|
13
|
-
const getActionFromProvider = actionId => {
|
|
13
|
+
const getActionFromProvider = (actionId) => {
|
|
14
14
|
return getService('permission').actionProvider.get(actionId);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
const email = yup
|
|
18
|
-
.string()
|
|
19
|
-
.email()
|
|
20
|
-
.lowercase();
|
|
17
|
+
const email = yup.string().email().lowercase();
|
|
21
18
|
|
|
22
19
|
const firstname = yup.string().min(1);
|
|
23
20
|
|
|
@@ -36,7 +33,7 @@ const roles = yup.array(yup.strapiID()).min(1);
|
|
|
36
33
|
|
|
37
34
|
const isAPluginName = yup
|
|
38
35
|
.string()
|
|
39
|
-
.test('is-a-plugin-name', 'is not a plugin name', function(value) {
|
|
36
|
+
.test('is-a-plugin-name', 'is not a plugin name', function (value) {
|
|
40
37
|
return [undefined, 'admin', ...Object.keys(strapi.plugins)].includes(value)
|
|
41
38
|
? true
|
|
42
39
|
: this.createError({ path: this.path, message: `${this.path} is not an existing plugin` });
|
|
@@ -45,7 +42,7 @@ const isAPluginName = yup
|
|
|
45
42
|
const arrayOfConditionNames = yup
|
|
46
43
|
.array()
|
|
47
44
|
.of(yup.string())
|
|
48
|
-
.test('is-an-array-of-conditions', 'is not a plugin name', function(value) {
|
|
45
|
+
.test('is-an-array-of-conditions', 'is not a plugin name', function (value) {
|
|
49
46
|
const ids = strapi.admin.services.permission.conditionProvider.keys();
|
|
50
47
|
return _.isUndefined(value) || _.difference(value, ids).length === 0
|
|
51
48
|
? true
|
|
@@ -55,14 +52,14 @@ const arrayOfConditionNames = yup
|
|
|
55
52
|
const permissionsAreEquals = (a, b) =>
|
|
56
53
|
a.action === b.action && (a.subject === b.subject || (_.isNil(a.subject) && _.isNil(b.subject)));
|
|
57
54
|
|
|
58
|
-
const checkNoDuplicatedPermissions = permissions =>
|
|
55
|
+
const checkNoDuplicatedPermissions = (permissions) =>
|
|
59
56
|
!Array.isArray(permissions) ||
|
|
60
57
|
permissions.every((permA, i) =>
|
|
61
|
-
permissions.slice(i + 1).every(permB => !permissionsAreEquals(permA, permB))
|
|
58
|
+
permissions.slice(i + 1).every((permB) => !permissionsAreEquals(permA, permB))
|
|
62
59
|
);
|
|
63
60
|
|
|
64
|
-
const checkNilFields = action =>
|
|
65
|
-
function(fields) {
|
|
61
|
+
const checkNilFields = (action) =>
|
|
62
|
+
function (fields) {
|
|
66
63
|
// If the parent has no action field, then we ignore this test
|
|
67
64
|
if (isNil(action)) {
|
|
68
65
|
return true;
|
|
@@ -71,7 +68,7 @@ const checkNilFields = action =>
|
|
|
71
68
|
return actionDomain.appliesToProperty('fields', action) || isNil(fields);
|
|
72
69
|
};
|
|
73
70
|
|
|
74
|
-
const fieldsPropertyValidation = action =>
|
|
71
|
+
const fieldsPropertyValidation = (action) =>
|
|
75
72
|
yup
|
|
76
73
|
.array()
|
|
77
74
|
.of(yup.string())
|
|
@@ -105,20 +102,22 @@ const updatePermissions = yup
|
|
|
105
102
|
action: yup
|
|
106
103
|
.string()
|
|
107
104
|
.required()
|
|
108
|
-
.test(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
.test(
|
|
106
|
+
'action-validity',
|
|
107
|
+
'action is not an existing permission action',
|
|
108
|
+
function (actionId) {
|
|
109
|
+
// If the action field is Nil, ignore the test and let the required check handle the error
|
|
110
|
+
if (isNil(actionId)) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return !!getActionFromProvider(actionId);
|
|
114
115
|
}
|
|
115
|
-
|
|
116
|
-
return !!getActionFromProvider(actionId);
|
|
117
|
-
}),
|
|
116
|
+
),
|
|
118
117
|
subject: yup
|
|
119
118
|
.string()
|
|
120
119
|
.nullable()
|
|
121
|
-
.test('subject-validity', 'Invalid subject submitted', function(subject) {
|
|
120
|
+
.test('subject-validity', 'Invalid subject submitted', function (subject) {
|
|
122
121
|
const action = getActionFromProvider(this.options.parent.action);
|
|
123
122
|
|
|
124
123
|
if (!action) {
|
|
@@ -137,57 +136,61 @@ const updatePermissions = yup
|
|
|
137
136
|
}),
|
|
138
137
|
properties: yup
|
|
139
138
|
.object()
|
|
140
|
-
.test(
|
|
141
|
-
properties
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
.test(
|
|
140
|
+
'properties-structure',
|
|
141
|
+
'Invalid property set at ${path}',
|
|
142
|
+
function (properties) {
|
|
143
|
+
const action = getActionFromProvider(this.options.parent.action);
|
|
144
|
+
const hasNoProperties = isEmpty(properties) || isNil(properties);
|
|
145
|
+
|
|
146
|
+
if (!has('options.applyToProperties', action)) {
|
|
147
|
+
return hasNoProperties;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (hasNoProperties) {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const { applyToProperties } = action.options;
|
|
155
|
+
|
|
156
|
+
if (!isArray(applyToProperties)) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return Object.keys(properties).every((property) =>
|
|
161
|
+
applyToProperties.includes(property)
|
|
162
|
+
);
|
|
148
163
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
164
|
+
)
|
|
165
|
+
.test(
|
|
166
|
+
'fields-property',
|
|
167
|
+
'Invalid fields property at ${path}',
|
|
168
|
+
async function (properties = {}) {
|
|
169
|
+
const action = getActionFromProvider(this.options.parent.action);
|
|
170
|
+
|
|
171
|
+
if (!action || !properties) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (!actionDomain.appliesToProperty('fields', action)) {
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
try {
|
|
180
|
+
await fieldsPropertyValidation(action).validate(properties.fields, {
|
|
181
|
+
strict: true,
|
|
182
|
+
abortEarly: false,
|
|
183
|
+
});
|
|
184
|
+
return true;
|
|
185
|
+
} catch (e) {
|
|
186
|
+
// Propagate fieldsPropertyValidation error with updated path
|
|
187
|
+
throw this.createError({
|
|
188
|
+
message: e.message,
|
|
189
|
+
path: `${this.path}.fields`,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
158
192
|
}
|
|
159
|
-
|
|
160
|
-
return Object.keys(properties).every(property =>
|
|
161
|
-
applyToProperties.includes(property)
|
|
162
|
-
);
|
|
163
|
-
})
|
|
164
|
-
.test('fields-property', 'Invalid fields property at ${path}', async function(
|
|
165
|
-
properties = {}
|
|
166
|
-
) {
|
|
167
|
-
const action = getActionFromProvider(this.options.parent.action);
|
|
168
|
-
|
|
169
|
-
if (!action || !properties) {
|
|
170
|
-
return true;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (!actionDomain.appliesToProperty('fields', action)) {
|
|
174
|
-
return true;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
try {
|
|
178
|
-
await fieldsPropertyValidation(action).validate(properties.fields, {
|
|
179
|
-
strict: true,
|
|
180
|
-
abortEarly: false,
|
|
181
|
-
});
|
|
182
|
-
return true;
|
|
183
|
-
} catch (e) {
|
|
184
|
-
// Propagate fieldsPropertyValidation error with updated path
|
|
185
|
-
throw this.createError({
|
|
186
|
-
message: e.message,
|
|
187
|
-
path: `${this.path}.fields`,
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
}),
|
|
193
|
+
),
|
|
191
194
|
conditions: yup.array().of(yup.string()),
|
|
192
195
|
})
|
|
193
196
|
.noUnknown()
|
|
@@ -21,12 +21,12 @@ const actionFieldsAreEqual = (a, b) => {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const haveSameFieldsAsOtherActions = (a, i, allActions) =>
|
|
24
|
-
allActions.slice(i + 1).every(b => actionFieldsAreEqual(a, b));
|
|
24
|
+
allActions.slice(i + 1).every((b) => actionFieldsAreEqual(a, b));
|
|
25
25
|
|
|
26
|
-
const checkPermissionsAreBound = role =>
|
|
27
|
-
function(permissions) {
|
|
26
|
+
const checkPermissionsAreBound = (role) =>
|
|
27
|
+
function (permissions) {
|
|
28
28
|
const permsBySubject = _.groupBy(
|
|
29
|
-
permissions.filter(perm => BOUND_ACTIONS.includes(perm.action)),
|
|
29
|
+
permissions.filter((perm) => BOUND_ACTIONS.includes(perm.action)),
|
|
30
30
|
'subject'
|
|
31
31
|
);
|
|
32
32
|
|
|
@@ -34,12 +34,12 @@ const checkPermissionsAreBound = role =>
|
|
|
34
34
|
const boundActions = getBoundActionsBySubject(role, subject);
|
|
35
35
|
const missingActions =
|
|
36
36
|
_.xor(
|
|
37
|
-
perms.map(p => p.action),
|
|
37
|
+
perms.map((p) => p.action),
|
|
38
38
|
boundActions
|
|
39
39
|
).length !== 0;
|
|
40
40
|
if (missingActions) return false;
|
|
41
41
|
|
|
42
|
-
const permsBoundByFields = perms.filter(p => BOUND_ACTIONS_FOR_FIELDS.includes(p.action));
|
|
42
|
+
const permsBoundByFields = perms.filter((p) => BOUND_ACTIONS_FOR_FIELDS.includes(p.action));
|
|
43
43
|
const everyActionsHaveSameFields = _.every(permsBoundByFields, haveSameFieldsAsOtherActions);
|
|
44
44
|
if (!everyActionsHaveSameFields) return false;
|
|
45
45
|
}
|
|
@@ -47,15 +47,15 @@ const checkPermissionsAreBound = role =>
|
|
|
47
47
|
return true;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
const noPublishPermissionForAuthorRole = role =>
|
|
51
|
-
function(permissions) {
|
|
50
|
+
const noPublishPermissionForAuthorRole = (role) =>
|
|
51
|
+
function (permissions) {
|
|
52
52
|
const isAuthor = role.code === AUTHOR_CODE;
|
|
53
|
-
const hasPublishPermission = permissions.some(perm => perm.action === PUBLISH_ACTION);
|
|
53
|
+
const hasPublishPermission = permissions.some((perm) => perm.action === PUBLISH_ACTION);
|
|
54
54
|
|
|
55
55
|
return !(isAuthor && hasPublishPermission);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const getUpdatePermissionsSchemas = role => [
|
|
58
|
+
const getUpdatePermissionsSchemas = (role) => [
|
|
59
59
|
validators.updatePermissions,
|
|
60
60
|
yup.object().shape({ permissions: actionsExistSchema.clone() }),
|
|
61
61
|
yup.object().shape({
|
|
@@ -100,12 +100,12 @@ const validatedUpdatePermissionsInput = async (permissions, role) => {
|
|
|
100
100
|
|
|
101
101
|
// validatePermissionsExist
|
|
102
102
|
|
|
103
|
-
const checkPermissionsExist = function(permissions) {
|
|
103
|
+
const checkPermissionsExist = function (permissions) {
|
|
104
104
|
const existingActions = getService('permission').actionProvider.values();
|
|
105
105
|
const failIndex = permissions.findIndex(
|
|
106
|
-
permission =>
|
|
106
|
+
(permission) =>
|
|
107
107
|
!existingActions.some(
|
|
108
|
-
action =>
|
|
108
|
+
(action) =>
|
|
109
109
|
action.actionId === permission.action &&
|
|
110
110
|
(action.section !== 'contentTypes' || action.subjects.includes(permission.subject))
|
|
111
111
|
)
|
|
@@ -5,13 +5,9 @@ const { yup, validateYupSchema } = require('@strapi/utils');
|
|
|
5
5
|
|
|
6
6
|
const hasPermissionsSchema = yup.object({
|
|
7
7
|
actions: yup.array().of(
|
|
8
|
-
yup.lazy(val => {
|
|
8
|
+
yup.lazy((val) => {
|
|
9
9
|
if (_.isArray(val)) {
|
|
10
|
-
return yup
|
|
11
|
-
.array()
|
|
12
|
-
.of(yup.string())
|
|
13
|
-
.min(1)
|
|
14
|
-
.max(2);
|
|
10
|
+
return yup.array().of(yup.string()).min(1).max(2);
|
|
15
11
|
}
|
|
16
12
|
|
|
17
13
|
if (_.isString(val)) {
|
|
@@ -6,7 +6,7 @@ const fs = require('fs-extra');
|
|
|
6
6
|
const tsUtils = require('@strapi/typescript-utils');
|
|
7
7
|
const getCustomAppConfigFile = require('./get-custom-app-config-file');
|
|
8
8
|
|
|
9
|
-
const getPkgPath = name => path.dirname(require.resolve(`${name}/package.json`));
|
|
9
|
+
const getPkgPath = (name) => path.dirname(require.resolve(`${name}/package.json`));
|
|
10
10
|
|
|
11
11
|
async function createPluginsJs(plugins, dest) {
|
|
12
12
|
const pluginsArray = plugins.map(({ pathToPlugin, name }) => {
|
|
@@ -77,11 +77,11 @@ async function createCacheDir({ appDir, plugins }) {
|
|
|
77
77
|
);
|
|
78
78
|
|
|
79
79
|
const pluginsWithFront = Object.keys(plugins)
|
|
80
|
-
.filter(pluginName => {
|
|
80
|
+
.filter((pluginName) => {
|
|
81
81
|
const pluginInfo = plugins[pluginName];
|
|
82
82
|
return fs.existsSync(path.resolve(pluginInfo.pathToPlugin, 'strapi-admin.js'));
|
|
83
83
|
})
|
|
84
|
-
.map(name => ({ name, ...plugins[name] }));
|
|
84
|
+
.map((name) => ({ name, ...plugins[name] }));
|
|
85
85
|
|
|
86
86
|
// create .cache dir
|
|
87
87
|
await fs.emptyDir(cacheDir);
|
|
@@ -9,14 +9,14 @@ const { isUsingTypeScript } = require('@strapi/typescript-utils');
|
|
|
9
9
|
* @param {String} dir - Directory of the admin panel
|
|
10
10
|
* @returns String
|
|
11
11
|
*/
|
|
12
|
-
const getCustomAppConfigFile = async dir => {
|
|
12
|
+
const getCustomAppConfigFile = async (dir) => {
|
|
13
13
|
const adminSrcPath = join(dir, 'src', 'admin');
|
|
14
14
|
const useTypeScript = await isUsingTypeScript(adminSrcPath, 'tsconfig.json');
|
|
15
15
|
|
|
16
16
|
const files = await fse.readdir(adminSrcPath);
|
|
17
17
|
|
|
18
|
-
const appJsx = files.find(file => /^app.jsx?$/.test(file));
|
|
19
|
-
const appTsx = files.find(file => /^app.tsx?$/.test(file));
|
|
18
|
+
const appJsx = files.find((file) => /^app.jsx?$/.test(file));
|
|
19
|
+
const appTsx = files.find((file) => /^app.tsx?$/.test(file));
|
|
20
20
|
|
|
21
21
|
if (useTypeScript) {
|
|
22
22
|
return appTsx || appJsx;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { join, resolve } = require('path');
|
|
4
4
|
const fs = require('fs-extra');
|
|
5
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5
6
|
const glob = require('glob');
|
|
6
7
|
|
|
7
8
|
// Only for dev environement
|
|
@@ -12,7 +13,7 @@ const getPluginsPath = () => {
|
|
|
12
13
|
const corePackageDirs = glob.sync(corePath);
|
|
13
14
|
const pluginsPackageDirs = glob.sync(pluginsPath);
|
|
14
15
|
|
|
15
|
-
const packageDirs = [...corePackageDirs, ...pluginsPackageDirs].filter(dir => {
|
|
16
|
+
const packageDirs = [...corePackageDirs, ...pluginsPackageDirs].filter((dir) => {
|
|
16
17
|
const isCoreAdmin = dir.includes('packages/core/admin');
|
|
17
18
|
const pathToEntryPoint = join(dir, 'admin', 'src', 'index.js');
|
|
18
19
|
const doesAdminFolderExist = fs.pathExistsSync(pathToEntryPoint);
|
|
@@ -20,7 +21,7 @@ const getPluginsPath = () => {
|
|
|
20
21
|
return !isCoreAdmin && doesAdminFolderExist;
|
|
21
22
|
});
|
|
22
23
|
|
|
23
|
-
return packageDirs.map(dir => resolve(__dirname, '..', join(dir, 'admin', 'src')));
|
|
24
|
+
return packageDirs.map((dir) => resolve(__dirname, '..', join(dir, 'admin', 'src')));
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
module.exports = getPluginsPath;
|
|
@@ -18,19 +18,19 @@ const DEFAULT_PLUGINS = [
|
|
|
18
18
|
* @param {Object} plugins
|
|
19
19
|
* @returns {boolean}
|
|
20
20
|
*/
|
|
21
|
-
const hasNonDefaultPlugins = plugins => {
|
|
21
|
+
const hasNonDefaultPlugins = (plugins) => {
|
|
22
22
|
// List of plugins that are not the ones installed in a generated app
|
|
23
|
-
const installedPlugins = Object.keys(plugins).filter(x => !DEFAULT_PLUGINS.includes(x));
|
|
23
|
+
const installedPlugins = Object.keys(plugins).filter((x) => !DEFAULT_PLUGINS.includes(x));
|
|
24
24
|
|
|
25
25
|
// List of default plugins uninstalled from a generated app
|
|
26
|
-
const missingPlugins = DEFAULT_PLUGINS.filter(x => !Object.keys(plugins).includes(x));
|
|
26
|
+
const missingPlugins = DEFAULT_PLUGINS.filter((x) => !Object.keys(plugins).includes(x));
|
|
27
27
|
|
|
28
28
|
const diff = [...installedPlugins, ...missingPlugins];
|
|
29
29
|
|
|
30
30
|
return diff.length > 0;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const hasCustomAdminCode = async dir => {
|
|
33
|
+
const hasCustomAdminCode = async (dir) => {
|
|
34
34
|
const customAdminPath = path.join(dir, 'src', 'admin');
|
|
35
35
|
|
|
36
36
|
const customAdminAppConfigFile = await getCustomAppConfigFile(dir);
|
package/webpack.config.js
CHANGED
|
@@ -49,19 +49,14 @@ module.exports = ({
|
|
|
49
49
|
]
|
|
50
50
|
: [];
|
|
51
51
|
|
|
52
|
-
// Directly inject a polyfill in the webpack entry point before the entry point
|
|
53
|
-
// FIXME: I have noticed a bug regarding the helper-plugin and esbuild-loader
|
|
54
|
-
// The only I could fix it was to inject the babel polyfill
|
|
55
|
-
const babelPolyfill = '@babel/polyfill/dist/polyfill.min.js';
|
|
56
|
-
|
|
57
52
|
return {
|
|
58
53
|
mode: isProduction ? 'production' : 'development',
|
|
59
|
-
bail: isProduction
|
|
54
|
+
bail: !!isProduction,
|
|
60
55
|
devtool: isProduction ? false : 'eval-source-map',
|
|
61
56
|
experiments: {
|
|
62
57
|
topLevelAwait: true,
|
|
63
58
|
},
|
|
64
|
-
entry: [
|
|
59
|
+
entry: [entry],
|
|
65
60
|
output: {
|
|
66
61
|
path: dest,
|
|
67
62
|
publicPath: options.adminPath,
|