@strapi/admin 4.11.2 → 4.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/components/AuthenticatedApp/index.js +2 -2
- package/admin/src/constants.js +90 -0
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +10 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +12 -8
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +5 -6
- package/admin/src/content-manager/components/RelationInput/RelationInput.js +99 -178
- package/admin/src/content-manager/components/RelationInput/components/Option.js +17 -15
- package/admin/src/content-manager/components/RelationInput/components/RelationList.js +2 -2
- package/admin/src/content-manager/components/RelationInputDataManager/RelationInputDataManager.js +12 -6
- package/admin/src/content-manager/components/RelationInputDataManager/utils/select.js +18 -3
- package/admin/src/content-manager/pages/App/index.js +4 -4
- package/admin/src/content-manager/pages/CollectionTypeRecursivePath/index.js +9 -5
- package/admin/src/content-manager/pages/ComponentSetttingsView/index.js +3 -4
- package/admin/src/content-manager/pages/EditView/hooks/useOnce.js +14 -0
- package/admin/src/content-manager/pages/EditView/index.js +31 -10
- package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/CellContent/RelationMultiple/index.js +1 -1
- package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/CellContent/utils/hasContent.js +1 -1
- package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/ConfirmDialogDelete/index.js +7 -4
- package/admin/src/content-manager/pages/ListView/components/ConfirmDialogDeleteAll/index.js +78 -0
- package/admin/src/content-manager/pages/ListView/{FieldPicker → components/FieldPicker}/index.js +20 -9
- package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/TableRows/index.js +90 -61
- package/admin/src/content-manager/pages/ListView/index.js +173 -34
- package/admin/src/content-manager/pages/ListView/utils/index.js +0 -2
- package/admin/src/content-manager/pages/ListViewLayoutManager/Permissions.js +1 -1
- package/admin/src/content-manager/pages/SingleTypeRecursivePath/index.js +4 -4
- package/admin/src/hooks/useMenu/index.js +70 -37
- package/admin/src/hooks/useMenu/utils/getGeneralLinks.js +5 -2
- package/admin/src/hooks/useSettingsMenu/constants.js +0 -7
- package/admin/src/hooks/useSettingsMenu/index.js +19 -5
- package/admin/src/pages/App/constants.js +1 -0
- package/admin/src/pages/App/index.js +23 -2
- package/admin/src/pages/App/reducer.js +8 -1
- package/admin/src/pages/App/selectors.js +12 -0
- package/admin/src/pages/AuthPage/{utils/forms.js → constants.js} +6 -8
- package/admin/src/pages/AuthPage/index.js +17 -5
- package/admin/src/pages/InstalledPluginsPage/index.js +10 -7
- package/admin/src/pages/MarketplacePage/index.js +11 -6
- package/admin/src/pages/ProfilePage/index.js +2 -2
- package/admin/src/pages/SettingsPage/components/Tokens/Table/index.js +15 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +4 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/index.js +4 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ProtectedCreateView/index.js +5 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ProtectedEditView/index.js +5 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ProtectedListView/index.js +11 -6
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +130 -107
- package/admin/src/pages/SettingsPage/pages/Roles/CreatePage/index.js +5 -3
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/index.js +4 -2
- package/admin/src/pages/SettingsPage/pages/Roles/ProtectedEditPage/index.js +8 -9
- package/admin/src/pages/SettingsPage/pages/Roles/ProtectedListPage/index.js +11 -6
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/index.js +4 -2
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ListView/index.js +4 -2
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ProtectedCreateView/index.js +5 -2
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ProtectedEditView/index.js +5 -2
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ProtectedListView/index.js +11 -6
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/{utils/layout.js → constants.js} +35 -2
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +43 -10
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/index.js +4 -2
- package/admin/src/pages/SettingsPage/pages/Users/ProtectedEditPage/index.js +13 -9
- package/admin/src/pages/SettingsPage/pages/Users/ProtectedListPage/index.js +11 -6
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/Events/index.js +4 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/utils/makeWebhookValidationSchema.js +11 -5
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +4 -3
- package/admin/src/pages/SettingsPage/pages/Webhooks/ProtectedCreateView/index.js +11 -6
- package/admin/src/pages/SettingsPage/pages/Webhooks/ProtectedEditView/index.js +11 -6
- package/admin/src/pages/SettingsPage/pages/Webhooks/ProtectedListView/index.js +11 -6
- package/admin/src/translations/ca.json +1 -0
- package/admin/src/translations/en.json +4 -1
- package/admin/src/translations/es.json +5 -0
- package/admin/src/translations/fr.json +1 -0
- package/build/1386.3b2aa6a7.chunk.js +3 -0
- package/build/1799.44d2e264.chunk.js +33 -0
- package/build/1970.39a2d75e.chunk.js +1 -0
- package/build/3269.1ea0f5a6.chunk.js +1 -0
- package/build/{3528.969338e2.chunk.js → 3528.4845cf92.chunk.js} +1 -1
- package/build/448.829e1344.chunk.js +1 -0
- package/build/{5542.64b623c9.chunk.js → 5542.c62d0daf.chunk.js} +1 -1
- package/build/5563.86f9aa9c.chunk.js +79 -0
- package/build/{5932.9e1f8f92.chunk.js → 5932.6a23b88c.chunk.js} +1 -1
- package/build/{7018.0e8a6297.chunk.js → 7018.98feed67.chunk.js} +1 -1
- package/build/7259.fb69d4bf.chunk.js +1 -0
- package/build/7394.423886bd.chunk.js +1 -0
- package/build/{371.6e4e2c1f.chunk.js → 970.89601f27.chunk.js} +24 -24
- package/build/Admin-authenticatedApp.cb649fc1.chunk.js +79 -0
- package/build/{Admin_InternalErrorPage.4a6f7b20.chunk.js → Admin_InternalErrorPage.8911cb49.chunk.js} +1 -1
- package/build/{Admin_homePage.6cd6c25c.chunk.js → Admin_homePage.be30ef4e.chunk.js} +1 -1
- package/build/{Admin_marketplace.c82c1d3c.chunk.js → Admin_marketplace.74a58e20.chunk.js} +8 -8
- package/build/Admin_pluginsPage.ce464189.chunk.js +6 -0
- package/build/{Admin_profilePage.9d70d609.chunk.js → Admin_profilePage.2131eb68.chunk.js} +2 -2
- package/build/Admin_settingsPage.4069bb8a.chunk.js +79 -0
- package/build/{Upload_ConfigureTheView.34f449d7.chunk.js → Upload_ConfigureTheView.7a1cb9c9.chunk.js} +1 -1
- package/build/admin-app.fea867af.chunk.js +61 -0
- package/build/admin-edit-roles-page.3fdd6b9d.chunk.js +267 -0
- package/build/admin-edit-users.200551e3.chunk.js +10 -0
- package/build/admin-roles-list.e17b00d7.chunk.js +23 -0
- package/build/admin-users.3b12dca2.chunk.js +11 -0
- package/build/api-tokens-create-page.3dd4e921.chunk.js +1 -0
- package/build/api-tokens-edit-page.9a1dd2fa.chunk.js +1 -0
- package/build/api-tokens-list-page.a103f526.chunk.js +16 -0
- package/build/audit-logs-settings-page.f538490f.chunk.js +1 -0
- package/build/ca-json.1fed5d8b.chunk.js +1 -0
- package/build/content-manager.c40f5ff9.chunk.js +1088 -0
- package/build/{content-type-builder-list-view.c28d33a6.chunk.js → content-type-builder-list-view.a200a358.chunk.js} +3 -3
- package/build/content-type-builder.bd1bbff1.chunk.js +166 -0
- package/build/{email-settings-page.aee46eaa.chunk.js → email-settings-page.45695daa.chunk.js} +2 -2
- package/build/en-json.fb9f6ddd.chunk.js +1 -0
- package/build/es-json.42096084.chunk.js +1 -0
- package/build/fr-json.69789980.chunk.js +1 -0
- package/build/{i18n-settings-page.4bc37a3f.chunk.js → i18n-settings-page.29308d0b.chunk.js} +1 -1
- package/build/index.html +1 -1
- package/build/main.ee36abd9.js +2927 -0
- package/build/review-workflows-settings.93808ae0.chunk.js +110 -0
- package/build/{runtime~main.2d0ed226.js → runtime~main.efd966f6.js} +2 -2
- package/build/sso-settings-page.0cdb96a6.chunk.js +1 -0
- package/build/transfer-tokens-create-page.de14cad4.chunk.js +1 -0
- package/build/transfer-tokens-edit-page.4f5e39af.chunk.js +1 -0
- package/build/transfer-tokens-list-page.7237443d.chunk.js +16 -0
- package/build/{upload-settings.a05aa26c.chunk.js → upload-settings.cb6c14c3.chunk.js} +2 -2
- package/build/upload.7e629643.chunk.js +26 -0
- package/build/users-advanced-settings-page.750b1f76.chunk.js +9 -0
- package/build/{users-email-settings-page.0bc87315.chunk.js → users-email-settings-page.e9bcd865.chunk.js} +1 -1
- package/build/{users-providers-settings-page.e88f1ac5.chunk.js → users-providers-settings-page.a94253e9.chunk.js} +1 -1
- package/build/{users-roles-settings-page.573a5c3e.chunk.js → users-roles-settings-page.1f505119.chunk.js} +5 -5
- package/build/webhook-edit-page.77ef4f1a.chunk.js +33 -0
- package/build/webhook-list-page.940a40f1.chunk.js +63 -0
- package/ee/admin/constants.js +16 -0
- package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +1 -1
- package/ee/admin/hooks/useLicenseLimits/index.js +4 -2
- package/ee/admin/hooks/useSettingsMenu/constants.js +0 -5
- package/ee/admin/pages/AuthPage/constants.js +12 -0
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/index.js +7 -7
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ProtectedListPage/index.js +11 -6
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/ProtectedPage.js +20 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/ReviewWorkflows.js +68 -73
- package/ee/admin/pages/SettingsPage/pages/SingleSignOn/index.js +16 -12
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/ModalForm/{utils/roleSettingsForm.js → constants.js} +14 -8
- package/ee/admin/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/EventTableEE.js +8 -9
- package/ee/server/constants/webhookEvents.js +5 -0
- package/ee/server/controllers/workflows/stages/index.js +1 -1
- package/ee/server/services/passport.js +1 -1
- package/ee/server/services/review-workflows/entity-service-decorator.js +52 -1
- package/ee/server/services/review-workflows/review-workflows.js +4 -1
- package/package.json +12 -12
- package/server/content-types/User.js +10 -0
- package/server/services/permission/permissions-manager/sanitize.js +1 -1
- package/server/strategies/api-token.js +9 -5
- package/server/strategies/data-transfer.js +9 -5
- package/admin/src/content-manager/components/DynamicTable/index.js +0 -163
- package/admin/src/content-manager/components/RelationInput/components/Relation.js +0 -53
- package/admin/src/content-manager/pages/ListView/FieldPicker/utils/getAllAllowedHeader.js +0 -17
- package/admin/src/content-manager/pages/ListView/PaginationFooter/index.js +0 -35
- package/admin/src/hooks/useMenu/reducer.js +0 -63
- package/admin/src/pages/AuthPage/utils/index.js +0 -2
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/formDataModel.js +0 -8
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/roleSettingsForm.js +0 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/schema.js +0 -11
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/stepper.js +0 -17
- package/admin/src/permissions/customPermissions.js +0 -1
- package/admin/src/permissions/defaultPermissions.js +0 -92
- package/admin/src/permissions/index.js +0 -8
- package/build/1970.d246745e.chunk.js +0 -1
- package/build/3562.e0b1a0b3.chunk.js +0 -50
- package/build/5563.8a76bb1d.chunk.js +0 -79
- package/build/7259.eac09d4b.chunk.js +0 -1
- package/build/7447.3dabc92f.chunk.js +0 -35
- package/build/9363.6a7a78fc.chunk.js +0 -33
- package/build/Admin-authenticatedApp.4e158a8c.chunk.js +0 -79
- package/build/Admin_pluginsPage.5d9d4060.chunk.js +0 -6
- package/build/Admin_settingsPage.fefeafa0.chunk.js +0 -79
- package/build/admin-app.42c7a752.chunk.js +0 -63
- package/build/admin-edit-roles-page.6d62ca0b.chunk.js +0 -267
- package/build/admin-edit-users.bce64103.chunk.js +0 -10
- package/build/admin-roles-list.81ae57e3.chunk.js +0 -23
- package/build/admin-users.1ec50325.chunk.js +0 -11
- package/build/api-tokens-create-page.65411a36.chunk.js +0 -1
- package/build/api-tokens-edit-page.60312cb6.chunk.js +0 -1
- package/build/api-tokens-list-page.36a241c1.chunk.js +0 -16
- package/build/audit-logs-settings-page.fca8e2a0.chunk.js +0 -1
- package/build/ca-json.43e14418.chunk.js +0 -1
- package/build/content-manager.d6e60c78.chunk.js +0 -1094
- package/build/content-type-builder.dc0c8745.chunk.js +0 -132
- package/build/en-json.f5fa476a.chunk.js +0 -1
- package/build/es-json.715b6fd8.chunk.js +0 -1
- package/build/fr-json.73494bf5.chunk.js +0 -1
- package/build/main.9b423e8b.js +0 -2926
- package/build/review-workflows-settings.fc0b59ca.chunk.js +0 -61
- package/build/sso-settings-page.52f8d7de.chunk.js +0 -1
- package/build/transfer-tokens-create-page.9ec277d7.chunk.js +0 -1
- package/build/transfer-tokens-edit-page.fa5ade14.chunk.js +0 -1
- package/build/transfer-tokens-list-page.ae9900e4.chunk.js +0 -16
- package/build/upload.b0efd607.chunk.js +0 -26
- package/build/users-advanced-settings-page.d9e11bab.chunk.js +0 -9
- package/build/webhook-edit-page.1e8c9382.chunk.js +0 -31
- package/build/webhook-list-page.b2bcb3b6.chunk.js +0 -63
- package/ee/admin/pages/AuthPage/utils/forms.js +0 -16
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/formDataModel.js +0 -14
- /package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/CellContent/CellValue.js +0 -0
- /package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/CellContent/Media/FileWrapper.js +0 -0
- /package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/CellContent/Media/index.js +0 -0
- /package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/CellContent/MultipleMedias.js +0 -0
- /package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/CellContent/RelationSingle/index.js +0 -0
- /package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/CellContent/RepeatableComponent/index.js +0 -0
- /package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/CellContent/SingleComponent/index.js +0 -0
- /package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/CellContent/index.js +0 -0
- /package/admin/src/content-manager/{components/DynamicTable → pages/ListView/components}/CellContent/utils/isSingleRelation.js +0 -0
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
HeaderLayout,
|
|
10
10
|
Layout,
|
|
11
11
|
Link,
|
|
12
|
+
Loader,
|
|
12
13
|
Main,
|
|
13
14
|
Typography,
|
|
14
15
|
} from '@strapi/design-system';
|
|
@@ -24,9 +25,10 @@ import { Check, ExternalLink } from '@strapi/icons';
|
|
|
24
25
|
import AdminSeatInfo from 'ee_else_ce/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo';
|
|
25
26
|
import { useIntl } from 'react-intl';
|
|
26
27
|
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
28
|
+
import { useSelector } from 'react-redux';
|
|
27
29
|
|
|
28
30
|
import { useConfigurations } from '../../../../hooks';
|
|
29
|
-
import
|
|
31
|
+
import { selectAdminPermissions } from '../../../App/selectors';
|
|
30
32
|
|
|
31
33
|
import CustomizationInfos from './components/CustomizationInfos';
|
|
32
34
|
import { fetchProjectSettings, postProjectSettings } from './utils/api';
|
|
@@ -39,16 +41,24 @@ const ApplicationInfosPage = () => {
|
|
|
39
41
|
const { formatMessage } = useIntl();
|
|
40
42
|
const queryClient = useQueryClient();
|
|
41
43
|
useFocusWhenNavigate();
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
+
const {
|
|
45
|
+
communityEdition,
|
|
46
|
+
latestStrapiReleaseTag,
|
|
47
|
+
nodeVersion,
|
|
48
|
+
shouldUpdateStrapi,
|
|
49
|
+
strapiVersion,
|
|
50
|
+
} = useAppInfo();
|
|
44
51
|
const { updateProjectSettings } = useConfigurations();
|
|
52
|
+
const permissions = useSelector(selectAdminPermissions);
|
|
45
53
|
|
|
46
54
|
const {
|
|
47
55
|
allowedActions: { canRead, canUpdate },
|
|
48
|
-
} = useRBAC(
|
|
56
|
+
} = useRBAC(permissions.settings['project-settings']);
|
|
49
57
|
const canSubmit = canRead && canUpdate;
|
|
50
58
|
|
|
51
|
-
const { data } = useQuery('project-settings', fetchProjectSettings, {
|
|
59
|
+
const { data, isLoading } = useQuery('project-settings', fetchProjectSettings, {
|
|
60
|
+
enabled: canRead,
|
|
61
|
+
});
|
|
52
62
|
|
|
53
63
|
const submitMutation = useMutation((body) => postProjectSettings(body), {
|
|
54
64
|
async onSuccess({ menuLogo, authLogo }) {
|
|
@@ -97,121 +107,134 @@ const ApplicationInfosPage = () => {
|
|
|
97
107
|
|
|
98
108
|
return (
|
|
99
109
|
<Layout>
|
|
110
|
+
{/* TODO: Add missing translation */}
|
|
100
111
|
<SettingsPageTitle name="Application" />
|
|
101
112
|
<Main>
|
|
102
|
-
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
defaultMessage: 'Administration panel’s global information',
|
|
113
|
+
{isLoading ? (
|
|
114
|
+
<Loader>
|
|
115
|
+
{formatMessage({
|
|
116
|
+
id: 'Settings.application.isLoading',
|
|
117
|
+
defaultMessage: 'Loading',
|
|
108
118
|
})}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
>
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
119
|
+
</Loader>
|
|
120
|
+
) : (
|
|
121
|
+
<form onSubmit={handleSubmit}>
|
|
122
|
+
<HeaderLayout
|
|
123
|
+
title={formatMessage({
|
|
124
|
+
id: 'Settings.application.title',
|
|
125
|
+
defaultMessage: 'Overview',
|
|
126
|
+
})}
|
|
127
|
+
subtitle={formatMessage({
|
|
128
|
+
id: 'Settings.application.description',
|
|
129
|
+
defaultMessage: 'Administration panel’s global information',
|
|
130
|
+
})}
|
|
131
|
+
primaryAction={
|
|
132
|
+
canSubmit && (
|
|
133
|
+
<Button type="submit" startIcon={<Check />}>
|
|
134
|
+
{formatMessage({ id: 'global.save', defaultMessage: 'Save' })}
|
|
135
|
+
</Button>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
/>
|
|
139
|
+
<ContentLayout>
|
|
140
|
+
<Flex direction="column" alignItems="stretch" gap={6}>
|
|
141
|
+
<Flex
|
|
142
|
+
direction="column"
|
|
143
|
+
alignItems="stretch"
|
|
144
|
+
gap={4}
|
|
145
|
+
hasRadius
|
|
146
|
+
background="neutral0"
|
|
147
|
+
shadow="tableShadow"
|
|
148
|
+
paddingTop={6}
|
|
149
|
+
paddingBottom={6}
|
|
150
|
+
paddingRight={7}
|
|
151
|
+
paddingLeft={7}
|
|
152
|
+
>
|
|
153
|
+
<Typography variant="delta" as="h3">
|
|
154
|
+
{formatMessage({
|
|
155
|
+
id: 'global.details',
|
|
156
|
+
defaultMessage: 'Details',
|
|
157
|
+
})}
|
|
158
|
+
</Typography>
|
|
159
|
+
|
|
160
|
+
<Grid gap={5} as="dl">
|
|
161
|
+
<GridItem col={6} s={12}>
|
|
162
|
+
<Typography variant="sigma" textColor="neutral600" as="dt">
|
|
163
|
+
{formatMessage({
|
|
164
|
+
id: 'Settings.application.strapiVersion',
|
|
165
|
+
defaultMessage: 'strapi version',
|
|
166
|
+
})}
|
|
167
|
+
</Typography>
|
|
168
|
+
<Flex gap={3} direction="column" alignItems="start" as="dd">
|
|
169
|
+
<Typography>v{strapiVersion}</Typography>
|
|
170
|
+
{shouldUpdateStrapi && (
|
|
171
|
+
<Link
|
|
172
|
+
href={`https://github.com/strapi/strapi/releases/tag/${latestStrapiReleaseTag}`}
|
|
173
|
+
isExternal
|
|
174
|
+
endIcon={<ExternalLink />}
|
|
175
|
+
>
|
|
176
|
+
{formatMessage({
|
|
177
|
+
id: 'Settings.application.link-upgrade',
|
|
178
|
+
defaultMessage: 'Upgrade your admin panel',
|
|
179
|
+
})}
|
|
180
|
+
</Link>
|
|
181
|
+
)}
|
|
182
|
+
</Flex>
|
|
183
|
+
</GridItem>
|
|
184
|
+
<GridItem col={6} s={12}>
|
|
185
|
+
<Typography variant="sigma" textColor="neutral600" as="dt">
|
|
186
|
+
{formatMessage({
|
|
187
|
+
id: 'Settings.application.edition-title',
|
|
188
|
+
defaultMessage: 'current plan',
|
|
189
|
+
})}
|
|
190
|
+
</Typography>
|
|
191
|
+
<Flex gap={3} direction="column" alignItems="start" as="dd">
|
|
192
|
+
<Typography>
|
|
193
|
+
{formatMessage(
|
|
194
|
+
{
|
|
195
|
+
id: 'Settings.application.ee-or-ce',
|
|
196
|
+
defaultMessage:
|
|
197
|
+
'{communityEdition, select, true {Community Edition} other {Enterprise Edition}}',
|
|
198
|
+
},
|
|
199
|
+
{ communityEdition }
|
|
200
|
+
)}
|
|
201
|
+
</Typography>
|
|
149
202
|
<Link
|
|
150
|
-
href=
|
|
203
|
+
href="https://strapi.io/pricing-self-hosted"
|
|
151
204
|
isExternal
|
|
152
205
|
endIcon={<ExternalLink />}
|
|
153
206
|
>
|
|
154
207
|
{formatMessage({
|
|
155
|
-
id: 'Settings.application.link-
|
|
156
|
-
defaultMessage: '
|
|
208
|
+
id: 'Settings.application.link-pricing',
|
|
209
|
+
defaultMessage: 'See all pricing plans',
|
|
157
210
|
})}
|
|
158
211
|
</Link>
|
|
159
|
-
|
|
160
|
-
</
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
{formatMessage({
|
|
165
|
-
id: 'Settings.application.edition-title',
|
|
166
|
-
defaultMessage: 'current plan',
|
|
167
|
-
})}
|
|
168
|
-
</Typography>
|
|
169
|
-
<Flex gap={3} direction="column" alignItems="start" as="dd">
|
|
170
|
-
<Typography>
|
|
171
|
-
{formatMessage(
|
|
172
|
-
{
|
|
173
|
-
id: 'Settings.application.ee-or-ce',
|
|
174
|
-
defaultMessage:
|
|
175
|
-
'{communityEdition, select, true {Community Edition} other {Enterprise Edition}}',
|
|
176
|
-
},
|
|
177
|
-
{ communityEdition: appInfos.communityEdition }
|
|
178
|
-
)}
|
|
179
|
-
</Typography>
|
|
180
|
-
<Link
|
|
181
|
-
href="https://strapi.io/pricing-self-hosted"
|
|
182
|
-
isExternal
|
|
183
|
-
endIcon={<ExternalLink />}
|
|
184
|
-
>
|
|
212
|
+
</Flex>
|
|
213
|
+
</GridItem>
|
|
214
|
+
|
|
215
|
+
<GridItem col={6} s={12}>
|
|
216
|
+
<Typography variant="sigma" textColor="neutral600" as="dt">
|
|
185
217
|
{formatMessage({
|
|
186
|
-
id: 'Settings.application.
|
|
187
|
-
defaultMessage: '
|
|
218
|
+
id: 'Settings.application.node-version',
|
|
219
|
+
defaultMessage: 'node version',
|
|
188
220
|
})}
|
|
189
|
-
</
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<AdminSeatInfo />
|
|
203
|
-
</Grid>
|
|
221
|
+
</Typography>
|
|
222
|
+
<Typography as="dd">{nodeVersion}</Typography>
|
|
223
|
+
</GridItem>
|
|
224
|
+
<AdminSeatInfo />
|
|
225
|
+
</Grid>
|
|
226
|
+
</Flex>
|
|
227
|
+
{canRead && data && (
|
|
228
|
+
<CustomizationInfos
|
|
229
|
+
canUpdate={canUpdate}
|
|
230
|
+
ref={inputsRef}
|
|
231
|
+
projectSettingsStored={data}
|
|
232
|
+
/>
|
|
233
|
+
)}
|
|
204
234
|
</Flex>
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
ref={inputsRef}
|
|
209
|
-
projectSettingsStored={data}
|
|
210
|
-
/>
|
|
211
|
-
)}
|
|
212
|
-
</Flex>
|
|
213
|
-
</ContentLayout>
|
|
214
|
-
</form>
|
|
235
|
+
</ContentLayout>
|
|
236
|
+
</form>
|
|
237
|
+
)}
|
|
215
238
|
</Main>
|
|
216
239
|
</Layout>
|
|
217
240
|
);
|
|
@@ -30,11 +30,12 @@ import { Formik } from 'formik';
|
|
|
30
30
|
import get from 'lodash/get';
|
|
31
31
|
import isEmpty from 'lodash/isEmpty';
|
|
32
32
|
import { useIntl } from 'react-intl';
|
|
33
|
+
import { useSelector } from 'react-redux';
|
|
33
34
|
import { useHistory, useRouteMatch } from 'react-router-dom';
|
|
34
35
|
import styled from 'styled-components';
|
|
35
36
|
|
|
36
37
|
import { useFetchPermissionsLayout, useFetchRole } from '../../../../../hooks';
|
|
37
|
-
import
|
|
38
|
+
import { selectAdminPermissions } from '../../../../App/selectors';
|
|
38
39
|
import Permissions from '../EditPage/components/Permissions';
|
|
39
40
|
|
|
40
41
|
import schema from './utils/schema';
|
|
@@ -61,7 +62,6 @@ const CreatePage = () => {
|
|
|
61
62
|
const id = get(params, 'params.id', null);
|
|
62
63
|
const { isLoading: isLayoutLoading, data: permissionsLayout } = useFetchPermissionsLayout();
|
|
63
64
|
const { permissions: rolePermissions, isLoading: isRoleLoading } = useFetchRole(id);
|
|
64
|
-
|
|
65
65
|
const { post, put } = useFetchClient();
|
|
66
66
|
|
|
67
67
|
const handleCreateRoleSubmit = (data) => {
|
|
@@ -257,8 +257,10 @@ const CreatePage = () => {
|
|
|
257
257
|
};
|
|
258
258
|
|
|
259
259
|
export default function () {
|
|
260
|
+
const permissions = useSelector(selectAdminPermissions);
|
|
261
|
+
|
|
260
262
|
return (
|
|
261
|
-
<CheckPagePermissions permissions={
|
|
263
|
+
<CheckPagePermissions permissions={permissions.settings.roles.create}>
|
|
262
264
|
<CreatePage />
|
|
263
265
|
</CheckPagePermissions>
|
|
264
266
|
);
|
|
@@ -31,10 +31,11 @@ import {
|
|
|
31
31
|
import { Duplicate, Pencil, Plus, Trash } from '@strapi/icons';
|
|
32
32
|
import get from 'lodash/get';
|
|
33
33
|
import { useIntl } from 'react-intl';
|
|
34
|
+
import { useSelector } from 'react-redux';
|
|
34
35
|
import { useHistory } from 'react-router-dom';
|
|
35
36
|
|
|
36
37
|
import { useRolesList } from '../../../../../hooks';
|
|
37
|
-
import
|
|
38
|
+
import { selectAdminPermissions } from '../../../../App/selectors';
|
|
38
39
|
|
|
39
40
|
import EmptyRole from './components/EmptyRole';
|
|
40
41
|
import BaseRoleRow from './components/RoleRow';
|
|
@@ -43,10 +44,11 @@ import reducer, { initialState } from './reducer';
|
|
|
43
44
|
const useSortedRoles = () => {
|
|
44
45
|
useFocusWhenNavigate();
|
|
45
46
|
const { locale } = useIntl();
|
|
47
|
+
const permissions = useSelector(selectAdminPermissions);
|
|
46
48
|
const {
|
|
47
49
|
isLoading: isLoadingForPermissions,
|
|
48
50
|
allowedActions: { canCreate, canDelete, canRead, canUpdate },
|
|
49
|
-
} = useRBAC(
|
|
51
|
+
} = useRBAC(permissions.settings.roles);
|
|
50
52
|
|
|
51
53
|
const { getData, roles, isLoading } = useRolesList(false);
|
|
52
54
|
const [{ query }] = useQueryParams();
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { LoadingIndicatorPage, useRBAC } from '@strapi/helper-plugin';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
4
5
|
import { Redirect } from 'react-router-dom';
|
|
5
6
|
|
|
6
|
-
import
|
|
7
|
+
import { selectAdminPermissions } from '../../../../App/selectors';
|
|
7
8
|
import EditPage from '../EditPage';
|
|
8
9
|
|
|
9
10
|
const ProtectedEditPage = () => {
|
|
10
|
-
const permissions =
|
|
11
|
-
return {
|
|
12
|
-
read: adminPermissions.settings.roles.read,
|
|
13
|
-
update: adminPermissions.settings.roles.update,
|
|
14
|
-
};
|
|
15
|
-
}, []);
|
|
11
|
+
const permissions = useSelector(selectAdminPermissions);
|
|
16
12
|
|
|
17
13
|
const {
|
|
18
14
|
isLoading,
|
|
19
15
|
allowedActions: { canRead, canUpdate },
|
|
20
|
-
} = useRBAC(
|
|
16
|
+
} = useRBAC({
|
|
17
|
+
read: permissions.settings.roles.read,
|
|
18
|
+
update: permissions.settings.roles.update,
|
|
19
|
+
});
|
|
21
20
|
|
|
22
21
|
if (isLoading) {
|
|
23
22
|
return <LoadingIndicatorPage />;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { CheckPagePermissions } from '@strapi/helper-plugin';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
4
5
|
|
|
5
|
-
import
|
|
6
|
+
import { selectAdminPermissions } from '../../../../App/selectors';
|
|
6
7
|
import ListPage from '../ListPage';
|
|
7
8
|
|
|
8
|
-
const ProtectedListPage = () =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const ProtectedListPage = () => {
|
|
10
|
+
const permissions = useSelector(selectAdminPermissions);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<CheckPagePermissions permissions={permissions.settings.roles.main}>
|
|
14
|
+
<ListPage />
|
|
15
|
+
</CheckPagePermissions>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
13
18
|
|
|
14
19
|
export default ProtectedListPage;
|
|
@@ -16,10 +16,11 @@ import {
|
|
|
16
16
|
import { Formik } from 'formik';
|
|
17
17
|
import { useIntl } from 'react-intl';
|
|
18
18
|
import { useQuery } from 'react-query';
|
|
19
|
+
import { useSelector } from 'react-redux';
|
|
19
20
|
import { useHistory, useRouteMatch } from 'react-router-dom';
|
|
20
21
|
|
|
21
|
-
import adminPermissions from '../../../../../permissions';
|
|
22
22
|
import { formatAPIErrors } from '../../../../../utils';
|
|
23
|
+
import { selectAdminPermissions } from '../../../../App/selectors';
|
|
23
24
|
import { TRANSFER_TOKEN_TYPE } from '../../../components/Tokens/constants';
|
|
24
25
|
import FormHead from '../../../components/Tokens/FormHead';
|
|
25
26
|
import TokenBox from '../../../components/Tokens/TokenBox';
|
|
@@ -46,9 +47,10 @@ const TransferTokenCreateView = () => {
|
|
|
46
47
|
const { trackUsage } = useTracking();
|
|
47
48
|
const trackUsageRef = useRef(trackUsage);
|
|
48
49
|
const { setCurrentStep } = useGuidedTour();
|
|
50
|
+
const permissions = useSelector(selectAdminPermissions);
|
|
49
51
|
const {
|
|
50
52
|
allowedActions: { canCreate, canUpdate, canRegenerate },
|
|
51
|
-
} = useRBAC(
|
|
53
|
+
} = useRBAC(permissions.settings['transfer-tokens']);
|
|
52
54
|
const {
|
|
53
55
|
params: { id },
|
|
54
56
|
} = useRouteMatch('/settings/transfer-tokens/:id');
|
|
@@ -17,9 +17,10 @@ import { Plus } from '@strapi/icons';
|
|
|
17
17
|
import qs from 'qs';
|
|
18
18
|
import { useIntl } from 'react-intl';
|
|
19
19
|
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
20
|
+
import { useSelector } from 'react-redux';
|
|
20
21
|
import { useHistory } from 'react-router-dom';
|
|
21
22
|
|
|
22
|
-
import
|
|
23
|
+
import { selectAdminPermissions } from '../../../../App/selectors';
|
|
23
24
|
import { TRANSFER_TOKEN_TYPE } from '../../../components/Tokens/constants';
|
|
24
25
|
import Table from '../../../components/Tokens/Table';
|
|
25
26
|
|
|
@@ -30,9 +31,10 @@ const TransferTokenListView = () => {
|
|
|
30
31
|
const queryClient = useQueryClient();
|
|
31
32
|
const { formatMessage } = useIntl();
|
|
32
33
|
const toggleNotification = useNotification();
|
|
34
|
+
const permissions = useSelector(selectAdminPermissions);
|
|
33
35
|
const {
|
|
34
36
|
allowedActions: { canCreate, canDelete, canUpdate, canRead },
|
|
35
|
-
} = useRBAC(
|
|
37
|
+
} = useRBAC(permissions.settings['transfer-tokens']);
|
|
36
38
|
const { push } = useHistory();
|
|
37
39
|
const { trackUsage } = useTracking();
|
|
38
40
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { CheckPagePermissions } from '@strapi/helper-plugin';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
4
5
|
|
|
5
|
-
import
|
|
6
|
+
import { selectAdminPermissions } from '../../../../App/selectors';
|
|
6
7
|
import EditView from '../EditView';
|
|
7
8
|
|
|
8
9
|
const ProtectedTransferTokenCreateView = () => {
|
|
10
|
+
const permissions = useSelector(selectAdminPermissions);
|
|
11
|
+
|
|
9
12
|
return (
|
|
10
|
-
<CheckPagePermissions permissions={
|
|
13
|
+
<CheckPagePermissions permissions={permissions.settings['transfer-tokens'].create}>
|
|
11
14
|
<EditView />
|
|
12
15
|
</CheckPagePermissions>
|
|
13
16
|
);
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { CheckPagePermissions } from '@strapi/helper-plugin';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
4
5
|
|
|
5
|
-
import
|
|
6
|
+
import { selectAdminPermissions } from '../../../../App/selectors';
|
|
6
7
|
import EditView from '../EditView';
|
|
7
8
|
|
|
8
9
|
const ProtectedTransferTokenCreateView = () => {
|
|
10
|
+
const permissions = useSelector(selectAdminPermissions);
|
|
11
|
+
|
|
9
12
|
return (
|
|
10
|
-
<CheckPagePermissions permissions={
|
|
13
|
+
<CheckPagePermissions permissions={permissions.settings['transfer-tokens'].read}>
|
|
11
14
|
<EditView />
|
|
12
15
|
</CheckPagePermissions>
|
|
13
16
|
);
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { CheckPagePermissions } from '@strapi/helper-plugin';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
4
5
|
|
|
5
|
-
import
|
|
6
|
+
import { selectAdminPermissions } from '../../../../App/selectors';
|
|
6
7
|
import ListView from '../ListView';
|
|
7
8
|
|
|
8
|
-
const ProtectedTransferTokenListView = () =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const ProtectedTransferTokenListView = () => {
|
|
10
|
+
const permissions = useSelector(selectAdminPermissions);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<CheckPagePermissions permissions={permissions.settings['transfer-tokens'].main}>
|
|
14
|
+
<ListView />
|
|
15
|
+
</CheckPagePermissions>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
13
18
|
|
|
14
19
|
export default ProtectedTransferTokenListView;
|
|
@@ -183,13 +183,13 @@ const EditPage = ({ canUpdate }) => {
|
|
|
183
183
|
validateOnChange={false}
|
|
184
184
|
validationSchema={editValidation}
|
|
185
185
|
>
|
|
186
|
-
{({ errors, values, handleChange, isSubmitting }) => {
|
|
186
|
+
{({ errors, values, handleChange, isSubmitting, dirty }) => {
|
|
187
187
|
return (
|
|
188
188
|
<Form>
|
|
189
189
|
<HeaderLayout
|
|
190
190
|
primaryAction={
|
|
191
191
|
<Button
|
|
192
|
-
disabled={isSubmitting || !canUpdate}
|
|
192
|
+
disabled={(isSubmitting || !canUpdate) ? true : !dirty}
|
|
193
193
|
startIcon={<Check />}
|
|
194
194
|
loading={isSubmitting}
|
|
195
195
|
type="submit"
|
package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/{utils/layout.js → constants.js}
RENAMED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { translatedErrors } from '@strapi/helper-plugin';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
|
|
4
|
+
export const FORM_INITIAL_VALUES = {
|
|
5
|
+
firstname: '',
|
|
6
|
+
lastname: '',
|
|
7
|
+
email: '',
|
|
8
|
+
roles: [],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const ROLE_LAYOUT = [];
|
|
12
|
+
|
|
13
|
+
export const FORM_LAYOUT = [
|
|
2
14
|
[
|
|
3
15
|
{
|
|
4
16
|
intlLabel: {
|
|
@@ -55,4 +67,25 @@ const layout = [
|
|
|
55
67
|
],
|
|
56
68
|
];
|
|
57
69
|
|
|
58
|
-
export
|
|
70
|
+
export const FORM_SCHEMA = yup.object().shape({
|
|
71
|
+
firstname: yup.string().trim().required(translatedErrors.required),
|
|
72
|
+
lastname: yup.string(),
|
|
73
|
+
email: yup.string().email(translatedErrors.email).required(translatedErrors.required),
|
|
74
|
+
roles: yup.array().min(1, translatedErrors.required).required(translatedErrors.required),
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const STEPPER = {
|
|
78
|
+
create: {
|
|
79
|
+
buttonSubmitLabel: {
|
|
80
|
+
id: 'app.containers.Users.ModalForm.footer.button-success',
|
|
81
|
+
defaultMessage: 'Invite user',
|
|
82
|
+
},
|
|
83
|
+
isDisabled: false,
|
|
84
|
+
next: 'magic-link',
|
|
85
|
+
},
|
|
86
|
+
'magic-link': {
|
|
87
|
+
buttonSubmitLabel: { id: 'global.finish', defaultMessage: 'Finish' },
|
|
88
|
+
isDisabled: true,
|
|
89
|
+
next: null,
|
|
90
|
+
},
|
|
91
|
+
};
|