@strapi/admin 4.3.4 → 4.4.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/StrapiApp.js +27 -35
- 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/Providers/index.js +14 -10
- 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/FieldTypeIcon/index.js +31 -1
- 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 +62 -15
- 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/FormModal.js +7 -2
- 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 +23 -22
- 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 +98 -94
- 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/CustomFields.js +80 -0
- package/admin/src/core/apis/Plugin.js +1 -1
- package/admin/src/core/apis/index.js +1 -0
- 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/524.2437fb56.chunk.js +644 -0
- 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.aaa66872.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.1f9e13f8.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.86f7594d.chunk.js +1178 -0
- package/build/content-type-builder-list-view.9b874fd4.chunk.js +194 -0
- package/build/content-type-builder-translation-en-json.f985c9c4.chunk.js +1 -0
- package/build/content-type-builder-translation-pt-BR-json.d6c7fcc1.chunk.js +1 -0
- package/build/content-type-builder.47ab07ad.chunk.js +145 -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.7db3414f.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.3dfda620.js → runtime~main.c1c5510b.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/611.aa894d27.chunk.js +0 -158
- package/build/8773.c190837d.chunk.js +0 -330
- package/build/Admin-authenticatedApp.380e5e99.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-list-view.4a704844.chunk.js +0 -194
- package/build/content-type-builder-translation-en-json.201bfb78.chunk.js +0 -1
- 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
|
@@ -9,12 +9,12 @@ import { translatedErrors as errorsTrads } from '@strapi/helper-plugin';
|
|
|
9
9
|
|
|
10
10
|
import isFieldTypeNumber from '../../../utils/isFieldTypeNumber';
|
|
11
11
|
|
|
12
|
-
yup.addMethod(yup.mixed, 'defined', function() {
|
|
13
|
-
return this.test('defined', errorsTrads.required, value => value !== undefined);
|
|
12
|
+
yup.addMethod(yup.mixed, 'defined', function () {
|
|
13
|
+
return this.test('defined', errorsTrads.required, (value) => value !== undefined);
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
yup.addMethod(yup.array, 'notEmptyMin', function(min) {
|
|
17
|
-
return this.test('notEmptyMin', errorsTrads.min, value => {
|
|
16
|
+
yup.addMethod(yup.array, 'notEmptyMin', function (min) {
|
|
17
|
+
return this.test('notEmptyMin', errorsTrads.min, (value) => {
|
|
18
18
|
if (isEmpty(value)) {
|
|
19
19
|
return true;
|
|
20
20
|
}
|
|
@@ -23,8 +23,8 @@ yup.addMethod(yup.array, 'notEmptyMin', function(min) {
|
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
yup.addMethod(yup.string, 'isInferior', function(message, max) {
|
|
27
|
-
return this.test('isInferior', message, function(value) {
|
|
26
|
+
yup.addMethod(yup.string, 'isInferior', function (message, max) {
|
|
27
|
+
return this.test('isInferior', message, function (value) {
|
|
28
28
|
if (!value) {
|
|
29
29
|
return true;
|
|
30
30
|
}
|
|
@@ -37,8 +37,8 @@ yup.addMethod(yup.string, 'isInferior', function(message, max) {
|
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
yup.addMethod(yup.string, 'isSuperior', function(message, min) {
|
|
41
|
-
return this.test('isSuperior', message, function(value) {
|
|
40
|
+
yup.addMethod(yup.string, 'isSuperior', function (message, min) {
|
|
41
|
+
return this.test('isSuperior', message, function (value) {
|
|
42
42
|
if (!value) {
|
|
43
43
|
return true;
|
|
44
44
|
}
|
|
@@ -51,7 +51,7 @@ yup.addMethod(yup.string, 'isSuperior', function(message, min) {
|
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
const getAttributes = data => get(data, ['attributes'], {});
|
|
54
|
+
const getAttributes = (data) => get(data, ['attributes'], {});
|
|
55
55
|
|
|
56
56
|
const createYupSchema = (
|
|
57
57
|
model,
|
|
@@ -97,7 +97,7 @@ const createYupSchema = (
|
|
|
97
97
|
if (attribute.repeatable === true) {
|
|
98
98
|
const { min, max, required } = attribute;
|
|
99
99
|
|
|
100
|
-
let componentSchema = yup.lazy(value => {
|
|
100
|
+
let componentSchema = yup.lazy((value) => {
|
|
101
101
|
let baseSchema = yup.array().of(componentFieldSchema);
|
|
102
102
|
|
|
103
103
|
if (min) {
|
|
@@ -123,7 +123,7 @@ const createYupSchema = (
|
|
|
123
123
|
|
|
124
124
|
return acc;
|
|
125
125
|
}
|
|
126
|
-
const componentSchema = yup.lazy(obj => {
|
|
126
|
+
const componentSchema = yup.lazy((obj) => {
|
|
127
127
|
if (obj !== undefined) {
|
|
128
128
|
return attribute.required === true && !options.isDraft
|
|
129
129
|
? componentFieldSchema.defined()
|
|
@@ -154,7 +154,7 @@ const createYupSchema = (
|
|
|
154
154
|
if (min) {
|
|
155
155
|
if (attribute.required) {
|
|
156
156
|
dynamicZoneSchema = dynamicZoneSchema
|
|
157
|
-
.test('min', errorsTrads.min, value => {
|
|
157
|
+
.test('min', errorsTrads.min, (value) => {
|
|
158
158
|
if (options.isCreatingEntry) {
|
|
159
159
|
return value && value.length >= min;
|
|
160
160
|
}
|
|
@@ -165,7 +165,7 @@ const createYupSchema = (
|
|
|
165
165
|
|
|
166
166
|
return value !== null && value.length >= min;
|
|
167
167
|
})
|
|
168
|
-
.test('required', errorsTrads.required, value => {
|
|
168
|
+
.test('required', errorsTrads.required, (value) => {
|
|
169
169
|
if (options.isCreatingEntry) {
|
|
170
170
|
return value !== null || value !== undefined;
|
|
171
171
|
}
|
|
@@ -180,7 +180,7 @@ const createYupSchema = (
|
|
|
180
180
|
dynamicZoneSchema = dynamicZoneSchema.notEmptyMin(min);
|
|
181
181
|
}
|
|
182
182
|
} else if (attribute.required && !options.isDraft) {
|
|
183
|
-
dynamicZoneSchema = dynamicZoneSchema.test('required', errorsTrads.required, value => {
|
|
183
|
+
dynamicZoneSchema = dynamicZoneSchema.test('required', errorsTrads.required, (value) => {
|
|
184
184
|
if (options.isCreatingEntry) {
|
|
185
185
|
return value !== null || value !== undefined;
|
|
186
186
|
}
|
|
@@ -215,7 +215,7 @@ const createYupSchemaAttribute = (type, validations, options) => {
|
|
|
215
215
|
if (type === 'json') {
|
|
216
216
|
schema = yup
|
|
217
217
|
.mixed(errorsTrads.json)
|
|
218
|
-
.test('isJSON', errorsTrads.json, value => {
|
|
218
|
+
.test('isJSON', errorsTrads.json, (value) => {
|
|
219
219
|
if (value === undefined) {
|
|
220
220
|
return true;
|
|
221
221
|
}
|
|
@@ -238,7 +238,7 @@ const createYupSchemaAttribute = (type, validations, options) => {
|
|
|
238
238
|
if (['number', 'integer', 'float', 'decimal'].includes(type)) {
|
|
239
239
|
schema = yup
|
|
240
240
|
.number()
|
|
241
|
-
.transform(cv => (isNaN(cv) ? undefined : cv))
|
|
241
|
+
.transform((cv) => (isNaN(cv) ? undefined : cv))
|
|
242
242
|
.typeError();
|
|
243
243
|
}
|
|
244
244
|
|
|
@@ -250,7 +250,7 @@ const createYupSchemaAttribute = (type, validations, options) => {
|
|
|
250
250
|
schema = yup.date();
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
Object.keys(validations).forEach(validation => {
|
|
253
|
+
Object.keys(validations).forEach((validation) => {
|
|
254
254
|
const validationValue = validations[validation];
|
|
255
255
|
|
|
256
256
|
if (
|
|
@@ -269,7 +269,7 @@ const createYupSchemaAttribute = (type, validations, options) => {
|
|
|
269
269
|
if (options.isCreatingEntry) {
|
|
270
270
|
schema = schema.required(errorsTrads.required);
|
|
271
271
|
} else {
|
|
272
|
-
schema = schema.test('required', errorsTrads.required, value => {
|
|
272
|
+
schema = schema.test('required', errorsTrads.required, (value) => {
|
|
273
273
|
// Field is not touched and the user is editing the entry
|
|
274
274
|
if (value === undefined && !options.isFromComponent) {
|
|
275
275
|
return true;
|
|
@@ -22,7 +22,7 @@ function useSelect({ isFromDynamicZone, name }) {
|
|
|
22
22
|
const allDynamicZoneFields = useMemo(() => {
|
|
23
23
|
const attributes = get(contentType, ['attributes'], {});
|
|
24
24
|
|
|
25
|
-
const dynamicZoneFields = Object.keys(attributes).filter(attrName => {
|
|
25
|
+
const dynamicZoneFields = Object.keys(attributes).filter((attrName) => {
|
|
26
26
|
return get(attributes, [attrName, 'type'], '') === 'dynamiczone';
|
|
27
27
|
});
|
|
28
28
|
|
|
@@ -43,17 +43,17 @@ function useSelect({ isFromDynamicZone, name }) {
|
|
|
43
43
|
return true;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
const includedDynamicZoneFields = allowedFields.filter(name => name === compoName[0]);
|
|
46
|
+
const includedDynamicZoneFields = allowedFields.filter((name) => name === compoName[0]);
|
|
47
47
|
|
|
48
48
|
if (includedDynamicZoneFields.length > 0) {
|
|
49
49
|
return true;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
const relatedChildrenAllowedFields = allowedFields
|
|
53
|
-
.map(fieldName => {
|
|
53
|
+
.map((fieldName) => {
|
|
54
54
|
return fieldName.split('.');
|
|
55
55
|
})
|
|
56
|
-
.filter(fieldName => {
|
|
56
|
+
.filter((fieldName) => {
|
|
57
57
|
if (fieldName.length < compoName.length) {
|
|
58
58
|
return false;
|
|
59
59
|
}
|
|
@@ -78,10 +78,10 @@ function useSelect({ isFromDynamicZone, name }) {
|
|
|
78
78
|
const allowedFields = isCreatingEntry ? [] : readActionAllowedFields;
|
|
79
79
|
|
|
80
80
|
const relatedChildrenAllowedFields = allowedFields
|
|
81
|
-
.map(fieldName => {
|
|
81
|
+
.map((fieldName) => {
|
|
82
82
|
return fieldName.split('.');
|
|
83
83
|
})
|
|
84
|
-
.filter(fieldName => {
|
|
84
|
+
.filter((fieldName) => {
|
|
85
85
|
if (fieldName.length < compoName.length) {
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { Box } from '@strapi/design-system/Box';
|
|
4
|
+
import { useCustomFields } from '@strapi/helper-plugin';
|
|
3
5
|
import Date from '@strapi/icons/Date';
|
|
4
6
|
import Boolean from '@strapi/icons/Boolean';
|
|
5
7
|
import Email from '@strapi/icons/Email';
|
|
@@ -40,10 +42,38 @@ const iconByTypes = {
|
|
|
40
42
|
dynamiczone: <DynamicZone />,
|
|
41
43
|
};
|
|
42
44
|
|
|
43
|
-
const FieldTypeIcon = ({ type }) =>
|
|
45
|
+
const FieldTypeIcon = ({ type, customFieldUid }) => {
|
|
46
|
+
const customFieldsRegistry = useCustomFields();
|
|
47
|
+
|
|
48
|
+
let Compo = iconByTypes[type];
|
|
49
|
+
|
|
50
|
+
if (customFieldUid) {
|
|
51
|
+
const customField = customFieldsRegistry.get(customFieldUid);
|
|
52
|
+
const CustomFieldIcon = customField.icon;
|
|
53
|
+
|
|
54
|
+
if (CustomFieldIcon) {
|
|
55
|
+
Compo = (
|
|
56
|
+
<Box marginRight={3} width={7} height={6}>
|
|
57
|
+
<CustomFieldIcon />
|
|
58
|
+
</Box>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!iconByTypes[type]) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return Compo;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
FieldTypeIcon.defaultProps = {
|
|
71
|
+
customFieldUid: null,
|
|
72
|
+
};
|
|
44
73
|
|
|
45
74
|
FieldTypeIcon.propTypes = {
|
|
46
75
|
type: PropTypes.string.isRequired,
|
|
76
|
+
customFieldUid: PropTypes.string,
|
|
47
77
|
};
|
|
48
78
|
|
|
49
79
|
export default FieldTypeIcon;
|
|
@@ -5,7 +5,7 @@ import { FormattedMessage } from 'react-intl';
|
|
|
5
5
|
const FormTitle = ({ description, title }) => (
|
|
6
6
|
<>
|
|
7
7
|
{!!title && <FormattedMessage id={title} />}
|
|
8
|
-
{!!description && <FormattedMessage id={description}>{msg => <p>{msg}</p>}</FormattedMessage>}
|
|
8
|
+
{!!description && <FormattedMessage id={description}>{(msg) => <p>{msg}</p>}</FormattedMessage>}
|
|
9
9
|
</>
|
|
10
10
|
);
|
|
11
11
|
|
|
@@ -87,11 +87,10 @@ class InputJSON extends React.Component {
|
|
|
87
87
|
|
|
88
88
|
setSize = () => this.codeMirror.setSize('100%', 'auto');
|
|
89
89
|
|
|
90
|
-
getContentAtLine = line => this.codeMirror.getLine(line);
|
|
90
|
+
getContentAtLine = (line) => this.codeMirror.getLine(line);
|
|
91
91
|
|
|
92
|
-
getEditorOption = opt => this.codeMirror.getOption(opt);
|
|
93
|
-
|
|
94
|
-
getValue = () => this.codeMirror.getValue();
|
|
92
|
+
// getEditorOption = (opt) => this.codeMirror.getOption(opt);
|
|
93
|
+
// getValue = () => this.codeMirror.getValue();
|
|
95
94
|
|
|
96
95
|
markSelection = ({ message }) => {
|
|
97
96
|
let line = parseInt(message.split(':')[0].split('line ')[1], 10) - 1;
|
|
@@ -142,7 +141,7 @@ class InputJSON extends React.Component {
|
|
|
142
141
|
this.timer = setTimeout(() => this.testJSON(doc.getValue()), WAIT);
|
|
143
142
|
};
|
|
144
143
|
|
|
145
|
-
testJSON = value => {
|
|
144
|
+
testJSON = (value) => {
|
|
146
145
|
try {
|
|
147
146
|
jsonlint.parse(value);
|
|
148
147
|
} catch (err) {
|
|
@@ -189,7 +188,7 @@ InputJSON.defaultProps = {
|
|
|
189
188
|
error: undefined,
|
|
190
189
|
intlLabel: undefined,
|
|
191
190
|
labelAction: undefined,
|
|
192
|
-
onChange
|
|
191
|
+
onChange() {},
|
|
193
192
|
value: null,
|
|
194
193
|
required: false,
|
|
195
194
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Jison generated parser */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
var jsonlint = (function() {
|
|
3
|
+
var jsonlint = (function () {
|
|
4
4
|
var parser = {
|
|
5
5
|
trace: function trace() {},
|
|
6
6
|
yy: {},
|
|
@@ -453,7 +453,7 @@ var jsonlint = (function() {
|
|
|
453
453
|
},
|
|
454
454
|
};
|
|
455
455
|
/* Jison generated lexer */
|
|
456
|
-
var lexer = (function() {
|
|
456
|
+
var lexer = (function () {
|
|
457
457
|
var lexer = {
|
|
458
458
|
EOF: 1,
|
|
459
459
|
parseError: function parseError(str, hash) {
|
|
@@ -463,7 +463,7 @@ var jsonlint = (function() {
|
|
|
463
463
|
throw new Error(str);
|
|
464
464
|
}
|
|
465
465
|
},
|
|
466
|
-
setInput: function(input) {
|
|
466
|
+
setInput: function (input) {
|
|
467
467
|
this._input = input;
|
|
468
468
|
this._more = this._less = this.done = false;
|
|
469
469
|
this.yylineno = this.yyleng = 0;
|
|
@@ -472,7 +472,7 @@ var jsonlint = (function() {
|
|
|
472
472
|
this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
|
|
473
473
|
return this;
|
|
474
474
|
},
|
|
475
|
-
input: function() {
|
|
475
|
+
input: function () {
|
|
476
476
|
var ch = this._input[0];
|
|
477
477
|
this.yytext += ch;
|
|
478
478
|
this.yyleng++;
|
|
@@ -483,34 +483,34 @@ var jsonlint = (function() {
|
|
|
483
483
|
this._input = this._input.slice(1);
|
|
484
484
|
return ch;
|
|
485
485
|
},
|
|
486
|
-
unput: function(ch) {
|
|
486
|
+
unput: function (ch) {
|
|
487
487
|
this._input = ch + this._input;
|
|
488
488
|
return this;
|
|
489
489
|
},
|
|
490
|
-
more: function() {
|
|
490
|
+
more: function () {
|
|
491
491
|
this._more = true;
|
|
492
492
|
return this;
|
|
493
493
|
},
|
|
494
|
-
less: function(n) {
|
|
494
|
+
less: function (n) {
|
|
495
495
|
this._input = this.match.slice(n) + this._input;
|
|
496
496
|
},
|
|
497
|
-
pastInput: function() {
|
|
497
|
+
pastInput: function () {
|
|
498
498
|
var past = this.matched.substr(0, this.matched.length - this.match.length);
|
|
499
499
|
return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '');
|
|
500
500
|
},
|
|
501
|
-
upcomingInput: function() {
|
|
501
|
+
upcomingInput: function () {
|
|
502
502
|
var next = this.match;
|
|
503
503
|
if (next.length < 20) {
|
|
504
504
|
next += this._input.substr(0, 20 - next.length);
|
|
505
505
|
}
|
|
506
506
|
return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '');
|
|
507
507
|
},
|
|
508
|
-
showPosition: function() {
|
|
508
|
+
showPosition: function () {
|
|
509
509
|
var pre = this.pastInput();
|
|
510
510
|
var c = new Array(pre.length + 1).join('-');
|
|
511
511
|
return pre + this.upcomingInput() + '\n' + c + '^';
|
|
512
512
|
},
|
|
513
|
-
next: function() {
|
|
513
|
+
next: function () {
|
|
514
514
|
if (this.done) {
|
|
515
515
|
return this.EOF;
|
|
516
516
|
}
|
|
@@ -587,7 +587,7 @@ var jsonlint = (function() {
|
|
|
587
587
|
_currentRules: function _currentRules() {
|
|
588
588
|
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
|
589
589
|
},
|
|
590
|
-
topState: function() {
|
|
590
|
+
topState: function () {
|
|
591
591
|
return this.conditionStack[this.conditionStack.length - 2];
|
|
592
592
|
},
|
|
593
593
|
pushState: function begin(condition) {
|
|
@@ -669,7 +669,7 @@ var jsonlint = (function() {
|
|
|
669
669
|
})();
|
|
670
670
|
if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
|
|
671
671
|
exports.parser = jsonlint;
|
|
672
|
-
exports.parse = function() {
|
|
672
|
+
exports.parse = function () {
|
|
673
673
|
return jsonlint.parse.apply(jsonlint, arguments);
|
|
674
674
|
};
|
|
675
675
|
exports.main = function commonjsMain(args) {
|
|
@@ -5,7 +5,7 @@ import get from 'lodash/get';
|
|
|
5
5
|
import omit from 'lodash/omit';
|
|
6
6
|
import take from 'lodash/take';
|
|
7
7
|
import isEqual from 'react-fast-compare';
|
|
8
|
-
import { GenericInput, NotAllowedInput, useLibrary } from '@strapi/helper-plugin';
|
|
8
|
+
import { GenericInput, NotAllowedInput, useLibrary, useCustomFields } from '@strapi/helper-plugin';
|
|
9
9
|
import { useContentTypeLayout } from '../../hooks';
|
|
10
10
|
import { getFieldName } from '../../utils';
|
|
11
11
|
import Wysiwyg from '../Wysiwyg';
|
|
@@ -39,9 +39,10 @@ function Inputs({
|
|
|
39
39
|
const { fields } = useLibrary();
|
|
40
40
|
const { formatMessage } = useIntl();
|
|
41
41
|
const { contentType: currentContentTypeLayout } = useContentTypeLayout();
|
|
42
|
+
const customFieldsRegistry = useCustomFields();
|
|
42
43
|
|
|
43
44
|
const disabled = useMemo(() => !get(metadatas, 'editable', true), [metadatas]);
|
|
44
|
-
const type = fieldSchema
|
|
45
|
+
const { type, customField: customFieldUid } = fieldSchema;
|
|
45
46
|
const error = get(formErrors, [keys], null);
|
|
46
47
|
|
|
47
48
|
const fieldName = useMemo(() => {
|
|
@@ -157,13 +158,53 @@ function Inputs({
|
|
|
157
158
|
return disabled;
|
|
158
159
|
}, [disabled, isCreatingEntry, isUserAllowedToEditField, isUserAllowedToReadField]);
|
|
159
160
|
|
|
160
|
-
const options = useMemo(
|
|
161
|
-
fieldSchema,
|
|
162
|
-
isRequired
|
|
163
|
-
|
|
161
|
+
const options = useMemo(
|
|
162
|
+
() => generateOptions(fieldSchema.enum || [], isRequired),
|
|
163
|
+
[fieldSchema, isRequired]
|
|
164
|
+
);
|
|
164
165
|
|
|
165
166
|
const { label, description, placeholder, visible } = metadatas;
|
|
166
167
|
|
|
168
|
+
/**
|
|
169
|
+
* It decides whether using the default `step` accoding to its `inputType` or the one
|
|
170
|
+
* obtained from `metadatas`.
|
|
171
|
+
*
|
|
172
|
+
* The `metadatas.step` is returned when the `inputValue` is divisible by it or when the
|
|
173
|
+
* `inputValue` is empty, otherwise the default `step` is returned.
|
|
174
|
+
*/
|
|
175
|
+
const inputStep = useMemo(() => {
|
|
176
|
+
if (!metadatas.step || (inputType !== 'datetime' && inputType !== 'time')) {
|
|
177
|
+
return step;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (!inputValue) {
|
|
181
|
+
return metadatas.step;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
let minutes;
|
|
185
|
+
|
|
186
|
+
if (inputType === 'datetime') {
|
|
187
|
+
minutes = parseInt(inputValue.substr(14, 2), 10);
|
|
188
|
+
} else if (inputType === 'time') {
|
|
189
|
+
minutes = parseInt(inputValue.slice(-2), 10);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return minutes % metadatas.step === 0 ? metadatas.step : step;
|
|
193
|
+
}, [inputType, inputValue, metadatas.step, step]);
|
|
194
|
+
|
|
195
|
+
// Memoize the component to avoid remounting it and losing state
|
|
196
|
+
const CustomFieldInput = useMemo(() => {
|
|
197
|
+
if (customFieldUid) {
|
|
198
|
+
const customField = customFieldsRegistry.get(customFieldUid);
|
|
199
|
+
const CustomFieldInput = React.lazy(customField.components.Input);
|
|
200
|
+
|
|
201
|
+
return CustomFieldInput;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Not a custom field, component won't be used
|
|
205
|
+
return null;
|
|
206
|
+
}, [customFieldUid, customFieldsRegistry]);
|
|
207
|
+
|
|
167
208
|
if (visible === false) {
|
|
168
209
|
return null;
|
|
169
210
|
}
|
|
@@ -217,6 +258,18 @@ function Inputs({
|
|
|
217
258
|
);
|
|
218
259
|
}
|
|
219
260
|
|
|
261
|
+
const customInputs = {
|
|
262
|
+
json: InputJSON,
|
|
263
|
+
uid: InputUID,
|
|
264
|
+
media: fields.media,
|
|
265
|
+
wysiwyg: Wysiwyg,
|
|
266
|
+
...fields,
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
if (customFieldUid) {
|
|
270
|
+
customInputs[customFieldUid] = CustomFieldInput;
|
|
271
|
+
}
|
|
272
|
+
|
|
220
273
|
return (
|
|
221
274
|
<GenericInput
|
|
222
275
|
attribute={fieldSchema}
|
|
@@ -229,21 +282,15 @@ function Inputs({
|
|
|
229
282
|
error={error}
|
|
230
283
|
labelAction={labelAction}
|
|
231
284
|
contentTypeUID={currentContentTypeLayout.uid}
|
|
232
|
-
customInputs={
|
|
233
|
-
json: InputJSON,
|
|
234
|
-
uid: InputUID,
|
|
235
|
-
media: fields.media,
|
|
236
|
-
wysiwyg: Wysiwyg,
|
|
237
|
-
...fields,
|
|
238
|
-
}}
|
|
285
|
+
customInputs={customInputs}
|
|
239
286
|
multiple={fieldSchema.multiple || false}
|
|
240
287
|
name={keys}
|
|
241
288
|
onChange={onChange}
|
|
242
289
|
options={options}
|
|
243
290
|
placeholder={placeholder ? { id: placeholder, defaultMessage: placeholder } : null}
|
|
244
291
|
required={fieldSchema.required || false}
|
|
245
|
-
step={
|
|
246
|
-
type={inputType}
|
|
292
|
+
step={inputStep}
|
|
293
|
+
type={customFieldUid || inputType}
|
|
247
294
|
// validations={validations}
|
|
248
295
|
value={inputValue}
|
|
249
296
|
withDefaultValue={false}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
const getStep = type => {
|
|
1
|
+
const getStep = (type) => {
|
|
2
2
|
let step;
|
|
3
3
|
|
|
4
4
|
if (type === 'float' || type === 'decimal') {
|
|
5
5
|
step = 0.01;
|
|
6
|
-
} else if (type === 'time' || type === 'datetime') {
|
|
7
|
-
// Since we cannot set a value that is not in the list of the time picker, we need to set the step to 1
|
|
8
|
-
// TODO: Fix the timepicker in order to be able to set any value regardless of the list
|
|
9
|
-
step = 1;
|
|
10
6
|
} else {
|
|
11
7
|
step = 1;
|
|
12
8
|
}
|
|
@@ -44,16 +44,16 @@ function LayoutDndProvider({
|
|
|
44
44
|
LayoutDndProvider.defaultProps = {
|
|
45
45
|
attributes: {},
|
|
46
46
|
buttonData: [],
|
|
47
|
-
goTo
|
|
47
|
+
goTo() {},
|
|
48
48
|
layout: [],
|
|
49
49
|
metadatas: {},
|
|
50
|
-
moveItem
|
|
51
|
-
moveRow
|
|
52
|
-
onAddData
|
|
50
|
+
moveItem() {},
|
|
51
|
+
moveRow() {},
|
|
52
|
+
onAddData() {},
|
|
53
53
|
relationsLayout: [],
|
|
54
|
-
removeField
|
|
54
|
+
removeField() {},
|
|
55
55
|
selectedItemName: null,
|
|
56
|
-
setEditFieldToSelect
|
|
56
|
+
setEditFieldToSelect() {},
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
LayoutDndProvider.propTypes = {
|
|
@@ -12,10 +12,10 @@ import Inputs from '../Inputs';
|
|
|
12
12
|
|
|
13
13
|
const NonRepeatableComponent = ({ componentUid, isFromDynamicZone, isNested, name }) => {
|
|
14
14
|
const { getComponentLayout } = useContentTypeLayout();
|
|
15
|
-
const componentLayoutData = useMemo(
|
|
16
|
-
componentUid,
|
|
17
|
-
getComponentLayout
|
|
18
|
-
|
|
15
|
+
const componentLayoutData = useMemo(
|
|
16
|
+
() => getComponentLayout(componentUid),
|
|
17
|
+
[componentUid, getComponentLayout]
|
|
18
|
+
);
|
|
19
19
|
const fields = componentLayoutData.layouts.edit;
|
|
20
20
|
|
|
21
21
|
return (
|
|
@@ -25,7 +25,7 @@ const md = new Markdown({
|
|
|
25
25
|
linkify: true,
|
|
26
26
|
typographer: true,
|
|
27
27
|
// Code from: https://github.com/markdown-it/markdown-it/blob/master/support/demo_template/index.js#L83
|
|
28
|
-
highlight
|
|
28
|
+
highlight(str, lang) {
|
|
29
29
|
if (lang && lang !== 'auto' && getLanguage(lang)) {
|
|
30
30
|
return (
|
|
31
31
|
'<pre class="hljs language-' +
|
package/admin/src/content-manager/components/RepeatableComponent/AccordionGroupCustom/index.js
CHANGED
|
@@ -73,7 +73,7 @@ const LabelAction = styled(Box)`
|
|
|
73
73
|
|
|
74
74
|
const AccordionGroupCustom = ({ children, footer, label, labelAction, error }) => {
|
|
75
75
|
const { formatMessage } = useIntl();
|
|
76
|
-
const childrenArray = Children.toArray(children).map(child => {
|
|
76
|
+
const childrenArray = Children.toArray(children).map((child) => {
|
|
77
77
|
return cloneElement(child, { hasErrorMessage: false });
|
|
78
78
|
});
|
|
79
79
|
|