@strapi/admin 4.6.0 → 4.7.0-beta.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/.browserslistrc +2 -1
- package/admin/src/assets/images/onboarding-preview.png +0 -0
- package/admin/src/components/AuthenticatedApp/utils/api.js +5 -4
- package/admin/src/components/LeftMenu/index.js +9 -3
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +18 -16
- package/admin/src/content-manager/components/DynamicTable/CellContent/RelationMultiple/index.js +5 -5
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/findLeafByPathAndReplace.js +1 -3
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +6 -5
- package/admin/src/content-manager/components/InputUID/index.js +4 -4
- package/admin/src/content-manager/components/Inputs/index.js +0 -2
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +35 -14
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/index.js +4 -3
- package/admin/src/content-manager/hooks/useLazyComponents/index.js +9 -13
- package/admin/src/content-manager/hooks/useRelation/useRelation.js +4 -4
- package/admin/src/content-manager/pages/App/useModels.js +8 -3
- package/admin/src/content-manager/pages/App/utils/getContentTypeLinks.js +3 -2
- package/admin/src/content-manager/pages/ComponentSetttingsView/index.js +4 -4
- package/admin/src/content-manager/pages/EditSettingsView/utils/api.js +4 -2
- package/admin/src/content-manager/pages/ListSettingsView/utils/api.js +4 -2
- package/admin/src/content-manager/pages/ListView/index.js +9 -9
- package/admin/src/core/utils/index.js +0 -1
- package/admin/src/hooks/useFetchEnabledPlugins/utils/api.js +3 -2
- package/admin/src/hooks/useInjectReducer/index.js +1 -0
- package/admin/src/hooks/useInjectReducer/useInjectReducer.js +19 -0
- package/admin/src/hooks/useRegenerate/index.js +4 -4
- package/admin/src/hooks/useRolesList/index.js +5 -3
- package/admin/src/hooks/useSettingsMenu/utils/defaultGlobalLinks.js +7 -0
- package/admin/src/index.js +4 -3
- package/admin/src/pages/Admin/Onboarding/constants.js +46 -0
- package/admin/src/pages/Admin/Onboarding/index.js +161 -89
- package/admin/src/pages/Admin/index.js +5 -2
- package/admin/src/pages/ProfilePage/utils/api.js +5 -3
- package/admin/src/pages/SettingsPage/{pages/Users/ListPage → components}/Filters/index.js +0 -0
- package/admin/src/pages/SettingsPage/{pages/ApiTokens/EditView/components → components/Tokens}/FormHead/index.js +36 -19
- package/admin/src/pages/SettingsPage/components/Tokens/FormiTokenContainer/LifeSpanInput.js +96 -0
- package/admin/src/pages/SettingsPage/components/Tokens/LifeSpanInput/index.js +98 -0
- package/admin/src/pages/SettingsPage/components/Tokens/Regenerate/index.js +73 -0
- package/admin/src/pages/SettingsPage/{pages/ApiTokens/ListView/DynamicTable → components/Tokens/Table}/DefaultButton/index.js +1 -1
- package/admin/src/pages/SettingsPage/{pages/ApiTokens/ListView/DynamicTable → components/Tokens/Table}/DeleteButton/index.js +1 -1
- package/admin/src/pages/SettingsPage/{pages/ApiTokens/ListView/DynamicTable → components/Tokens/Table}/ReadButton/index.js +0 -0
- package/admin/src/pages/SettingsPage/{pages/ApiTokens/ListView/DynamicTable → components/Tokens/Table}/UpdateButton/index.js +0 -0
- package/admin/src/pages/SettingsPage/components/Tokens/Table/index.js +135 -0
- package/admin/src/pages/SettingsPage/{pages/ApiTokens/EditView/components/ContentBox → components/Tokens/TokenBox}/index.js +17 -17
- package/admin/src/pages/SettingsPage/components/Tokens/TokenDescription/index.js +51 -0
- package/admin/src/pages/SettingsPage/components/Tokens/TokenName/index.js +46 -0
- package/admin/src/pages/SettingsPage/components/Tokens/TokenTypeSelect/index.js +69 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/CollapsableContentType/index.js +5 -3
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/FormApiTokenContainer/index.js +52 -142
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/Regenerate/index.js +5 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +43 -19
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/index.js +9 -16
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/api.js +5 -3
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/components/FormTransferTokenContainer/index.js +105 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/components/LoadingView/index.js +50 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/index.js +201 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/utils/getDateOfExpiration.js +16 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/utils/index.js +4 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/utils/schema.js +10 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ListView/index.js +182 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ListView/utils/tableHeaders.js +48 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ProtectedCreateView/index.js +14 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ProtectedEditView/index.js +14 -0
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ProtectedListView/index.js +12 -0
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/utils/api.js +6 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +9 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/utils/api.js +6 -3
- package/admin/src/pages/SettingsPage/pages/Users/components/SelectRoles/index.js +3 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/index.js +3 -2
- package/admin/src/pages/SettingsPage/utils/defaultRoutes.js +33 -0
- package/admin/src/permissions/defaultPermissions.js +8 -0
- package/admin/src/translations/en.json +25 -6
- package/admin/src/translations/eu.json +796 -0
- package/admin/src/translations/languageNativeNames.js +1 -0
- package/admin/src/translations/ru.json +9 -9
- package/build/1412.936ed920.chunk.js +159 -0
- package/build/1683.c8aa7b7c.chunk.js +268 -0
- package/build/19eb2dfcf2603eb55733.png +0 -0
- package/build/2607.2e48dbf8.chunk.js +66 -0
- package/build/2743.6d1632f9.chunk.js +45 -0
- package/build/3075.dc3894fe.chunk.js +108 -0
- package/build/3632.0317b618.chunk.js +138 -0
- package/build/4649.15cc0afe.chunk.js +30 -0
- package/build/{5910.a5374848.chunk.js → 4855.bd092921.chunk.js} +65 -65
- package/build/7259.aa68d808.chunk.js +1 -0
- package/build/7407.883fb1f5.chunk.js +1 -0
- package/build/9707.7290fd92.chunk.js +96 -0
- package/build/Admin-authenticatedApp.f29f6021.chunk.js +79 -0
- package/build/{Admin_homePage.79ab880c.chunk.js → Admin_homePage.b1730882.chunk.js} +1 -1
- package/build/{Admin_marketplace.eabf21b2.chunk.js → Admin_marketplace.ea0316c2.chunk.js} +2 -2
- package/build/Admin_pluginsPage.5c24f963.chunk.js +6 -0
- package/build/Admin_profilePage.59af1978.chunk.js +15 -0
- package/build/Admin_settingsPage.178dc6e3.chunk.js +178 -0
- package/build/admin-app.77a50e1f.chunk.js +112 -0
- package/build/admin-edit-roles-page.446b69dc.chunk.js +1 -0
- package/build/admin-edit-users.2ed69bfd.chunk.js +10 -0
- package/build/admin-users.fc003b10.chunk.js +11 -0
- package/build/{api-tokens-create-page.0e686c30.chunk.js → api-tokens-create-page.0db3aec1.chunk.js} +1 -1
- package/build/{api-tokens-edit-page.d6c7487b.chunk.js → api-tokens-edit-page.671e0e26.chunk.js} +1 -1
- package/build/api-tokens-list-page.7387102c.chunk.js +16 -0
- package/build/audit-logs-settings-page.c3dce30d.chunk.js +1 -0
- package/build/content-manager.42b24d46.chunk.js +1139 -0
- package/build/{content-type-builder-list-view.4243b2b1.chunk.js → content-type-builder-list-view.79e84b36.chunk.js} +1 -6
- package/build/{content-type-builder.365b6bf4.chunk.js → content-type-builder.855db321.chunk.js} +16 -15
- package/build/{email-settings-page.379552b1.chunk.js → email-settings-page.d1fcc7a3.chunk.js} +4 -9
- package/build/en-json.b0748970.chunk.js +1 -0
- package/build/eu-json.fceecd8b.chunk.js +1 -0
- package/build/i18n-settings-page.b8d8753e.chunk.js +60 -0
- package/build/index.html +1 -1
- package/build/main.1022ed01.js +4393 -0
- package/build/ru-json.aa5cd123.chunk.js +1 -0
- package/build/runtime~main.84941a97.js +2 -0
- package/build/sso-settings-page.b85ad080.chunk.js +41 -0
- package/build/transfer-tokens-create-page.16e23791.chunk.js +1 -0
- package/build/transfer-tokens-edit-page.3886c973.chunk.js +1 -0
- package/build/transfer-tokens-list-page.e8010a89.chunk.js +16 -0
- package/build/upload-settings.ef64bbf9.chunk.js +84 -0
- package/build/upload.c5730dfa.chunk.js +33 -0
- package/build/users-advanced-settings-page.fce9908e.chunk.js +8 -0
- package/build/users-email-settings-page.343d0ad2.chunk.js +23 -0
- package/build/users-providers-settings-page.e5a9a3f1.chunk.js +99 -0
- package/build/users-roles-settings-page.66312f31.chunk.js +30 -0
- package/build/webhook-edit-page.73e51e64.chunk.js +75 -0
- package/build/{webhook-list-page.f75ba3f2.chunk.js → webhook-list-page.1134f130.chunk.js} +1 -1
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/ComboboxFilter/index.js +41 -0
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/Modal/ActionBody.js +1 -3
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/TableRows/index.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/hooks/useAuditLogsData.js +47 -0
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/index.js +30 -31
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/utils/getActionTypesDefaultMessages.js +7 -9
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/utils/getDisplayedFilters.js +88 -0
- package/ee/admin/pages/SettingsPage/pages/Roles/ListPage/index.js +4 -2
- package/ee/server/migrations/audit-logs-table.js +45 -0
- package/ee/server/register.js +2 -0
- package/ee/server/services/audit-logs.js +11 -1
- package/package.json +30 -30
- package/server/bootstrap.js +2 -0
- package/server/config/admin-actions.js +48 -0
- package/server/content-types/index.js +2 -0
- package/server/content-types/transfer-token-permission.js +36 -0
- package/server/content-types/transfer-token.js +66 -0
- package/server/controllers/admin.js +16 -0
- package/server/controllers/api-token.js +4 -5
- package/server/controllers/index.js +1 -0
- package/server/controllers/transfer/index.js +13 -0
- package/server/controllers/transfer/runner.js +24 -0
- package/server/controllers/transfer/token.js +131 -0
- package/server/register.js +2 -9
- package/server/routes/index.js +2 -0
- package/server/routes/transfer.js +95 -0
- package/server/services/api-token.js +2 -3
- package/server/services/constants.js +6 -0
- package/server/services/index.js +1 -0
- package/server/services/transfer/index.js +6 -0
- package/server/services/transfer/permission.js +22 -0
- package/server/services/transfer/token.js +409 -0
- package/server/strategies/api-token.js +4 -2
- package/server/strategies/data-transfer.js +107 -0
- package/server/strategies/index.js +1 -0
- package/server/utils/index.d.ts +2 -0
- package/server/validation/api-tokens.js +1 -6
- package/server/validation/transfer/index.js +5 -0
- package/server/validation/transfer/token.js +34 -0
- package/admin/src/content-manager/components/InputJSON/FieldWrapper.js +0 -40
- package/admin/src/content-manager/components/InputJSON/Label.js +0 -35
- package/admin/src/content-manager/components/InputJSON/components.js +0 -36
- package/admin/src/content-manager/components/InputJSON/index.js +0 -223
- package/admin/src/content-manager/components/InputJSON/jsonlint.js +0 -680
- package/admin/src/core/utils/axiosInstance.js +0 -40
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/FormBody/index.js +0 -78
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/index.js +0 -112
- package/build/2607.ce06608e.chunk.js +0 -66
- package/build/2743.dea372fb.chunk.js +0 -42
- package/build/3075.03ebe93d.chunk.js +0 -115
- package/build/3632.963ac97d.chunk.js +0 -138
- package/build/4318.8cb388a5.chunk.js +0 -30
- package/build/4656.a0d43cca.chunk.js +0 -159
- package/build/8633.4af74a50.chunk.js +0 -1
- package/build/9641.a311b612.chunk.js +0 -276
- package/build/9707.62831b4d.chunk.js +0 -101
- package/build/Admin-authenticatedApp.50dc27f9.chunk.js +0 -75
- package/build/Admin_pluginsPage.953e796b.chunk.js +0 -6
- package/build/Admin_profilePage.5c2efda5.chunk.js +0 -15
- package/build/Admin_settingsPage.19cfb9ca.chunk.js +0 -178
- package/build/admin-app.34295b50.chunk.js +0 -112
- package/build/admin-edit-roles-page.d50d9654.chunk.js +0 -1
- package/build/admin-edit-users.912b856d.chunk.js +0 -10
- package/build/admin-users.e36e7111.chunk.js +0 -11
- package/build/api-tokens-list-page.1cd86136.chunk.js +0 -16
- package/build/audit-logs-settings-page.308a6250.chunk.js +0 -1
- package/build/codemirror-addon-closebrackets.71aa4bbd.chunk.js +0 -2
- package/build/codemirror-addon-lint-js.405f70fb.chunk.js +0 -1
- package/build/codemirror-addon-lint.8487ad3d.chunk.js +0 -1
- package/build/codemirror-addon-mark-selection.1928c849.chunk.js +0 -1
- package/build/codemirror-css.359a2a4b.chunk.js +0 -345
- package/build/codemirror-javacript.af237b68.chunk.js +0 -1
- package/build/codemirror-theme.2fe63a16.chunk.js +0 -33
- package/build/content-manager.851f40ce.chunk.js +0 -1170
- package/build/en-json.38d182e5.chunk.js +0 -1
- package/build/i18n-settings-page.3ab28b1a.chunk.js +0 -65
- package/build/main.9f31732e.js +0 -4454
- package/build/ru-json.3b411a39.chunk.js +0 -1
- package/build/runtime~main.2b8e2318.js +0 -2
- package/build/sso-settings-page.b64a44e8.chunk.js +0 -41
- package/build/upload-settings.6c26ff37.chunk.js +0 -89
- package/build/upload.2c69d238.chunk.js +0 -38
- package/build/users-advanced-settings-page.c4270682.chunk.js +0 -13
- package/build/users-email-settings-page.60422a2f.chunk.js +0 -28
- package/build/users-providers-settings-page.e1834060.chunk.js +0 -104
- package/build/users-roles-settings-page.3ef35132.chunk.js +0 -30
- package/build/webhook-edit-page.c0080dc1.chunk.js +0 -75
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import { Textarea } from '@strapi/design-system/Textarea';
|
|
5
|
+
|
|
6
|
+
const TokenDescription = ({ errors, values, onChange, canEditInputs }) => {
|
|
7
|
+
const { formatMessage } = useIntl();
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<Textarea
|
|
11
|
+
label={formatMessage({
|
|
12
|
+
id: 'Settings.tokens.form.description',
|
|
13
|
+
defaultMessage: 'Description',
|
|
14
|
+
})}
|
|
15
|
+
name="description"
|
|
16
|
+
error={
|
|
17
|
+
errors.description
|
|
18
|
+
? formatMessage(
|
|
19
|
+
errors.description?.id
|
|
20
|
+
? errors.description
|
|
21
|
+
: {
|
|
22
|
+
id: errors.description,
|
|
23
|
+
defaultMessage: errors.description,
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
: null
|
|
27
|
+
}
|
|
28
|
+
onChange={onChange}
|
|
29
|
+
disabled={!canEditInputs}
|
|
30
|
+
>
|
|
31
|
+
{values.description}
|
|
32
|
+
</Textarea>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
TokenDescription.propTypes = {
|
|
37
|
+
errors: PropTypes.shape({
|
|
38
|
+
description: PropTypes.string,
|
|
39
|
+
}),
|
|
40
|
+
onChange: PropTypes.func.isRequired,
|
|
41
|
+
canEditInputs: PropTypes.bool.isRequired,
|
|
42
|
+
values: PropTypes.shape({
|
|
43
|
+
description: PropTypes.string,
|
|
44
|
+
}).isRequired,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
TokenDescription.defaultProps = {
|
|
48
|
+
errors: {},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default TokenDescription;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import { TextInput } from '@strapi/design-system/TextInput';
|
|
5
|
+
|
|
6
|
+
const TokenName = ({ errors, values, onChange, canEditInputs }) => {
|
|
7
|
+
const { formatMessage } = useIntl();
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<TextInput
|
|
11
|
+
name="name"
|
|
12
|
+
error={
|
|
13
|
+
errors.name
|
|
14
|
+
? formatMessage(
|
|
15
|
+
errors.name?.id ? errors.name : { id: errors.name, defaultMessage: errors.name }
|
|
16
|
+
)
|
|
17
|
+
: null
|
|
18
|
+
}
|
|
19
|
+
label={formatMessage({
|
|
20
|
+
id: 'Settings.tokens.form.name',
|
|
21
|
+
defaultMessage: 'Name',
|
|
22
|
+
})}
|
|
23
|
+
onChange={onChange}
|
|
24
|
+
value={values.name}
|
|
25
|
+
disabled={!canEditInputs}
|
|
26
|
+
required
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
TokenName.propTypes = {
|
|
32
|
+
errors: PropTypes.shape({
|
|
33
|
+
name: PropTypes.string,
|
|
34
|
+
}),
|
|
35
|
+
onChange: PropTypes.func.isRequired,
|
|
36
|
+
canEditInputs: PropTypes.bool.isRequired,
|
|
37
|
+
values: PropTypes.shape({
|
|
38
|
+
name: PropTypes.string,
|
|
39
|
+
}).isRequired,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
TokenName.defaultProps = {
|
|
43
|
+
errors: {},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default TokenName;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
|
|
5
|
+
import { Select, Option } from '@strapi/design-system/Select';
|
|
6
|
+
|
|
7
|
+
const TokenTypeSelect = ({ errors, values, onChange, canEditInputs, options, label }) => {
|
|
8
|
+
const { formatMessage } = useIntl();
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<Select
|
|
12
|
+
name="type"
|
|
13
|
+
label={formatMessage({
|
|
14
|
+
id: label.id,
|
|
15
|
+
defaultMessage: label.defaultMessage,
|
|
16
|
+
})}
|
|
17
|
+
value={values?.type}
|
|
18
|
+
error={
|
|
19
|
+
errors.type
|
|
20
|
+
? formatMessage(
|
|
21
|
+
errors.type?.id ? errors.type : { id: errors.type, defaultMessage: errors.type }
|
|
22
|
+
)
|
|
23
|
+
: null
|
|
24
|
+
}
|
|
25
|
+
onChange={onChange}
|
|
26
|
+
placeholder="Select"
|
|
27
|
+
required
|
|
28
|
+
disabled={!canEditInputs}
|
|
29
|
+
>
|
|
30
|
+
{options &&
|
|
31
|
+
options.map(({ value, label }) => (
|
|
32
|
+
<Option key={value} value={value}>
|
|
33
|
+
{formatMessage(label)}
|
|
34
|
+
</Option>
|
|
35
|
+
))}
|
|
36
|
+
</Select>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
TokenTypeSelect.propTypes = {
|
|
41
|
+
options: PropTypes.arrayOf(
|
|
42
|
+
PropTypes.shape({
|
|
43
|
+
label: PropTypes.shape({
|
|
44
|
+
id: PropTypes.string,
|
|
45
|
+
defaultMessage: PropTypes.string,
|
|
46
|
+
}),
|
|
47
|
+
value: PropTypes.string,
|
|
48
|
+
})
|
|
49
|
+
),
|
|
50
|
+
errors: PropTypes.shape({
|
|
51
|
+
type: PropTypes.string,
|
|
52
|
+
}),
|
|
53
|
+
onChange: PropTypes.func.isRequired,
|
|
54
|
+
canEditInputs: PropTypes.bool.isRequired,
|
|
55
|
+
values: PropTypes.shape({
|
|
56
|
+
type: PropTypes.string,
|
|
57
|
+
}).isRequired,
|
|
58
|
+
label: PropTypes.shape({
|
|
59
|
+
id: PropTypes.string,
|
|
60
|
+
defaultMessage: PropTypes.string,
|
|
61
|
+
}).isRequired,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
TokenTypeSelect.defaultProps = {
|
|
65
|
+
errors: {},
|
|
66
|
+
options: [],
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default TokenTypeSelect;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { capitalize } from 'lodash';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
3
6
|
import { Accordion, AccordionToggle, AccordionContent } from '@strapi/design-system/Accordion';
|
|
4
7
|
import { Checkbox } from '@strapi/design-system/Checkbox';
|
|
5
8
|
import { Grid, GridItem } from '@strapi/design-system/Grid';
|
|
@@ -7,8 +10,6 @@ import { Typography } from '@strapi/design-system/Typography';
|
|
|
7
10
|
import { Box } from '@strapi/design-system/Box';
|
|
8
11
|
import { Flex } from '@strapi/design-system/Flex';
|
|
9
12
|
import CogIcon from '@strapi/icons/Cog';
|
|
10
|
-
import styled from 'styled-components';
|
|
11
|
-
import PropTypes from 'prop-types';
|
|
12
13
|
import { useApiTokenPermissionsContext } from '../../../../../../../contexts/ApiTokenPermissions';
|
|
13
14
|
import CheckboxWrapper from './CheckBoxWrapper';
|
|
14
15
|
|
|
@@ -30,6 +31,7 @@ const CollapsableContentType = ({
|
|
|
30
31
|
value: { onChangeSelectAll, onChange, selectedActions, setSelectedAction, selectedAction },
|
|
31
32
|
} = useApiTokenPermissionsContext();
|
|
32
33
|
const [expanded, setExpanded] = useState(false);
|
|
34
|
+
const { formatMessage } = useIntl();
|
|
33
35
|
|
|
34
36
|
const handleExpandedAccordion = () => {
|
|
35
37
|
setExpanded((s) => !s);
|
|
@@ -83,7 +85,7 @@ const CollapsableContentType = ({
|
|
|
83
85
|
}}
|
|
84
86
|
disabled={disabled}
|
|
85
87
|
>
|
|
86
|
-
Select all
|
|
88
|
+
{formatMessage({ id: 'app.utils.select-all', defaultMessage: 'Select all' })}
|
|
87
89
|
</Checkbox>
|
|
88
90
|
</Box>
|
|
89
91
|
</Flex>
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { usePersistentState } from '@strapi/helper-plugin';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import { Box } from '@strapi/design-system/Box';
|
|
6
5
|
import { Grid, GridItem } from '@strapi/design-system/Grid';
|
|
7
|
-
import { Select, Option } from '@strapi/design-system/Select';
|
|
8
6
|
import { Stack } from '@strapi/design-system/Stack';
|
|
9
|
-
import { Textarea } from '@strapi/design-system/Textarea';
|
|
10
|
-
import { TextInput } from '@strapi/design-system/TextInput';
|
|
11
7
|
import { Typography } from '@strapi/design-system/Typography';
|
|
12
|
-
import
|
|
8
|
+
import LifeSpanInput from '../../../../../components/Tokens/LifeSpanInput';
|
|
9
|
+
import TokenName from '../../../../../components/Tokens/TokenName';
|
|
10
|
+
import TokenDescription from '../../../../../components/Tokens/TokenDescription';
|
|
11
|
+
import TokenTypeSelect from '../../../../../components/Tokens/TokenTypeSelect';
|
|
13
12
|
|
|
14
13
|
const FormApiTokenContainer = ({
|
|
15
14
|
errors,
|
|
@@ -22,7 +21,6 @@ const FormApiTokenContainer = ({
|
|
|
22
21
|
setHasChangedPermissions,
|
|
23
22
|
}) => {
|
|
24
23
|
const { formatMessage } = useIntl();
|
|
25
|
-
const [lang] = usePersistentState('strapi-admin-language', 'en');
|
|
26
24
|
|
|
27
25
|
const handleChangeSelectApiTokenType = ({ target: { value } }) => {
|
|
28
26
|
setHasChangedPermissions(false);
|
|
@@ -39,6 +37,30 @@ const FormApiTokenContainer = ({
|
|
|
39
37
|
}
|
|
40
38
|
};
|
|
41
39
|
|
|
40
|
+
const typeOptions = [
|
|
41
|
+
{
|
|
42
|
+
value: 'read-only',
|
|
43
|
+
label: {
|
|
44
|
+
id: 'Settings.apiTokens.types.read-only',
|
|
45
|
+
defaultMessage: 'Read-only',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
value: 'full-access',
|
|
50
|
+
label: {
|
|
51
|
+
id: 'Settings.apiTokens.types.full-access',
|
|
52
|
+
defaultMessage: 'Full access',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: 'custom',
|
|
57
|
+
label: {
|
|
58
|
+
id: 'Settings.apiTokens.types.custom',
|
|
59
|
+
defaultMessage: 'Custom',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
42
64
|
return (
|
|
43
65
|
<Box
|
|
44
66
|
background="neutral0"
|
|
@@ -58,158 +80,46 @@ const FormApiTokenContainer = ({
|
|
|
58
80
|
</Typography>
|
|
59
81
|
<Grid gap={5}>
|
|
60
82
|
<GridItem key="name" col={6} xs={12}>
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
? formatMessage(
|
|
66
|
-
errors.name?.id
|
|
67
|
-
? errors.name
|
|
68
|
-
: { id: errors.name, defaultMessage: errors.name }
|
|
69
|
-
)
|
|
70
|
-
: null
|
|
71
|
-
}
|
|
72
|
-
label={formatMessage({
|
|
73
|
-
id: 'Settings.apiTokens.form.name',
|
|
74
|
-
defaultMessage: 'Name',
|
|
75
|
-
})}
|
|
83
|
+
<TokenName
|
|
84
|
+
errors={errors}
|
|
85
|
+
values={values}
|
|
86
|
+
canEditInputs={canEditInputs}
|
|
76
87
|
onChange={onChange}
|
|
77
|
-
value={values.name}
|
|
78
|
-
disabled={!canEditInputs}
|
|
79
|
-
required
|
|
80
88
|
/>
|
|
81
89
|
</GridItem>
|
|
82
90
|
<GridItem key="description" col={6} xs={12}>
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
})}
|
|
88
|
-
name="description"
|
|
89
|
-
error={
|
|
90
|
-
errors.description
|
|
91
|
-
? formatMessage(
|
|
92
|
-
errors.description?.id
|
|
93
|
-
? errors.description
|
|
94
|
-
: {
|
|
95
|
-
id: errors.description,
|
|
96
|
-
defaultMessage: errors.description,
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
: null
|
|
100
|
-
}
|
|
91
|
+
<TokenDescription
|
|
92
|
+
errors={errors}
|
|
93
|
+
values={values}
|
|
94
|
+
canEditInputs={canEditInputs}
|
|
101
95
|
onChange={onChange}
|
|
102
|
-
|
|
103
|
-
>
|
|
104
|
-
{values.description}
|
|
105
|
-
</Textarea>
|
|
96
|
+
/>
|
|
106
97
|
</GridItem>
|
|
107
98
|
<GridItem key="lifespan" col={6} xs={12}>
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
error={
|
|
116
|
-
errors.lifespan
|
|
117
|
-
? formatMessage(
|
|
118
|
-
errors.lifespan?.id
|
|
119
|
-
? errors.lifespan
|
|
120
|
-
: { id: errors.lifespan, defaultMessage: errors.lifespan }
|
|
121
|
-
)
|
|
122
|
-
: null
|
|
123
|
-
}
|
|
124
|
-
onChange={(value) => {
|
|
125
|
-
onChange({ target: { name: 'lifespan', value } });
|
|
126
|
-
}}
|
|
127
|
-
required
|
|
128
|
-
disabled={!isCreating}
|
|
129
|
-
placeholder="Select"
|
|
130
|
-
>
|
|
131
|
-
<Option value="604800000">
|
|
132
|
-
{formatMessage({
|
|
133
|
-
id: 'Settings.apiTokens.duration.7-days',
|
|
134
|
-
defaultMessage: '7 days',
|
|
135
|
-
})}
|
|
136
|
-
</Option>
|
|
137
|
-
<Option value="2592000000">
|
|
138
|
-
{formatMessage({
|
|
139
|
-
id: 'Settings.apiTokens.duration.30-days',
|
|
140
|
-
defaultMessage: '30 days',
|
|
141
|
-
})}
|
|
142
|
-
</Option>
|
|
143
|
-
<Option value="7776000000">
|
|
144
|
-
{formatMessage({
|
|
145
|
-
id: 'Settings.apiTokens.duration.90-days',
|
|
146
|
-
defaultMessage: '90 days',
|
|
147
|
-
})}
|
|
148
|
-
</Option>
|
|
149
|
-
<Option value="0">
|
|
150
|
-
{formatMessage({
|
|
151
|
-
id: 'Settings.apiTokens.duration.unlimited',
|
|
152
|
-
defaultMessage: 'Unlimited',
|
|
153
|
-
})}
|
|
154
|
-
</Option>
|
|
155
|
-
</Select>
|
|
156
|
-
<Typography variant="pi" textColor="neutral600">
|
|
157
|
-
{!isCreating &&
|
|
158
|
-
`${formatMessage({
|
|
159
|
-
id: 'Settings.apiTokens.duration.expiration-date',
|
|
160
|
-
defaultMessage: 'Expiration date',
|
|
161
|
-
})}: ${getDateOfExpiration(
|
|
162
|
-
apiToken?.createdAt,
|
|
163
|
-
parseInt(values.lifespan, 10),
|
|
164
|
-
lang
|
|
165
|
-
)}`}
|
|
166
|
-
</Typography>
|
|
99
|
+
<LifeSpanInput
|
|
100
|
+
isCreating={isCreating}
|
|
101
|
+
errors={errors}
|
|
102
|
+
values={values}
|
|
103
|
+
onChange={onChange}
|
|
104
|
+
token={apiToken}
|
|
105
|
+
/>
|
|
167
106
|
</GridItem>
|
|
168
107
|
|
|
169
108
|
<GridItem key="type" col={6} xs={12}>
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
109
|
+
<TokenTypeSelect
|
|
110
|
+
values={values}
|
|
111
|
+
errors={errors}
|
|
112
|
+
label={{
|
|
173
113
|
id: 'Settings.apiTokens.form.type',
|
|
174
114
|
defaultMessage: 'Token type',
|
|
175
|
-
}
|
|
176
|
-
value={values?.type}
|
|
177
|
-
error={
|
|
178
|
-
errors.type
|
|
179
|
-
? formatMessage(
|
|
180
|
-
errors.type?.id
|
|
181
|
-
? errors.type
|
|
182
|
-
: { id: errors.type, defaultMessage: errors.type }
|
|
183
|
-
)
|
|
184
|
-
: null
|
|
185
|
-
}
|
|
115
|
+
}}
|
|
186
116
|
onChange={(value) => {
|
|
187
117
|
handleChangeSelectApiTokenType({ target: { value } });
|
|
188
118
|
onChange({ target: { name: 'type', value } });
|
|
189
119
|
}}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
>
|
|
194
|
-
<Option value="read-only">
|
|
195
|
-
{formatMessage({
|
|
196
|
-
id: 'Settings.apiTokens.types.read-only',
|
|
197
|
-
defaultMessage: 'Read-only',
|
|
198
|
-
})}
|
|
199
|
-
</Option>
|
|
200
|
-
<Option value="full-access">
|
|
201
|
-
{formatMessage({
|
|
202
|
-
id: 'Settings.apiTokens.types.full-access',
|
|
203
|
-
defaultMessage: 'Full access',
|
|
204
|
-
})}
|
|
205
|
-
</Option>
|
|
206
|
-
<Option value="custom">
|
|
207
|
-
{formatMessage({
|
|
208
|
-
id: 'Settings.apiTokens.types.custom',
|
|
209
|
-
defaultMessage: 'Custom',
|
|
210
|
-
})}
|
|
211
|
-
</Option>
|
|
212
|
-
</Select>
|
|
120
|
+
options={typeOptions}
|
|
121
|
+
canEditInputs={canEditInputs}
|
|
122
|
+
/>
|
|
213
123
|
</GridItem>
|
|
214
124
|
</Grid>
|
|
215
125
|
</Stack>
|
package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/Regenerate/index.js
CHANGED
|
@@ -9,7 +9,11 @@ import { useRegenerate } from '../../../../../../../hooks';
|
|
|
9
9
|
export const Regenerate = ({ onRegenerate, idToRegenerate }) => {
|
|
10
10
|
const { formatMessage } = useIntl();
|
|
11
11
|
const [showConfirmDialog, setShowConfirmDialog] = useState(false);
|
|
12
|
-
const { regenerateData, isLoadingConfirmation } = useRegenerate(
|
|
12
|
+
const { regenerateData, isLoadingConfirmation } = useRegenerate(
|
|
13
|
+
'/admin/api-tokens/',
|
|
14
|
+
idToRegenerate,
|
|
15
|
+
onRegenerate
|
|
16
|
+
);
|
|
13
17
|
const handleConfirmRegeneration = async () => {
|
|
14
18
|
regenerateData();
|
|
15
19
|
setShowConfirmDialog(false);
|
|
@@ -9,21 +9,25 @@ import {
|
|
|
9
9
|
useTracking,
|
|
10
10
|
useGuidedTour,
|
|
11
11
|
useRBAC,
|
|
12
|
+
useFetchClient,
|
|
12
13
|
} from '@strapi/helper-plugin';
|
|
13
14
|
import { Main } from '@strapi/design-system/Main';
|
|
14
15
|
import { Formik } from 'formik';
|
|
15
16
|
import { useRouteMatch, useHistory } from 'react-router-dom';
|
|
16
17
|
import { useQuery } from 'react-query';
|
|
18
|
+
import { ContentLayout } from '@strapi/design-system/Layout';
|
|
19
|
+
import { Stack } from '@strapi/design-system/Stack';
|
|
17
20
|
import { formatAPIErrors } from '../../../../../utils';
|
|
18
|
-
import { axiosInstance } from '../../../../../core/utils';
|
|
19
21
|
import { schema } from './utils';
|
|
20
22
|
import LoadingView from './components/LoadingView';
|
|
21
|
-
import FormHead from './components/FormHead';
|
|
22
|
-
import FormBody from './components/FormBody';
|
|
23
23
|
import adminPermissions from '../../../../../permissions';
|
|
24
24
|
import { ApiTokenPermissionsContextProvider } from '../../../../../contexts/ApiTokenPermissions';
|
|
25
25
|
import init from './init';
|
|
26
26
|
import reducer, { initialState } from './reducer';
|
|
27
|
+
import Permissions from './components/Permissions';
|
|
28
|
+
import FormApiTokenContainer from './components/FormApiTokenContainer';
|
|
29
|
+
import TokenBox from '../../../components/Tokens/TokenBox';
|
|
30
|
+
import FormHead from '../../../components/Tokens/FormHead';
|
|
27
31
|
|
|
28
32
|
const MSG_ERROR_NAME_TAKEN = 'Name already taken';
|
|
29
33
|
|
|
@@ -50,6 +54,7 @@ const ApiTokenCreateView = () => {
|
|
|
50
54
|
const {
|
|
51
55
|
params: { id },
|
|
52
56
|
} = useRouteMatch('/settings/api-tokens/:id');
|
|
57
|
+
const { get, post, put } = useFetchClient();
|
|
53
58
|
|
|
54
59
|
const isCreating = id === 'create';
|
|
55
60
|
|
|
@@ -58,7 +63,7 @@ const ApiTokenCreateView = () => {
|
|
|
58
63
|
async () => {
|
|
59
64
|
const [permissions, routes] = await Promise.all(
|
|
60
65
|
['/admin/content-api/permissions', '/admin/content-api/routes'].map(async (url) => {
|
|
61
|
-
const { data } = await
|
|
66
|
+
const { data } = await get(url);
|
|
62
67
|
|
|
63
68
|
return data.data;
|
|
64
69
|
})
|
|
@@ -112,7 +117,7 @@ const ApiTokenCreateView = () => {
|
|
|
112
117
|
async () => {
|
|
113
118
|
const {
|
|
114
119
|
data: { data },
|
|
115
|
-
} = await
|
|
120
|
+
} = await get(`/admin/api-tokens/${id}`);
|
|
116
121
|
|
|
117
122
|
setApiToken({
|
|
118
123
|
...data,
|
|
@@ -160,12 +165,12 @@ const ApiTokenCreateView = () => {
|
|
|
160
165
|
const {
|
|
161
166
|
data: { data: response },
|
|
162
167
|
} = isCreating
|
|
163
|
-
? await
|
|
168
|
+
? await post(`/admin/api-tokens`, {
|
|
164
169
|
...body,
|
|
165
170
|
lifespan: lifespanVal,
|
|
166
171
|
permissions: body.type === 'custom' ? state.selectedActions : null,
|
|
167
172
|
})
|
|
168
|
-
: await
|
|
173
|
+
: await put(`/admin/api-tokens/${id}`, {
|
|
169
174
|
name: body.name,
|
|
170
175
|
description: body.description,
|
|
171
176
|
type: body.type,
|
|
@@ -279,22 +284,41 @@ const ApiTokenCreateView = () => {
|
|
|
279
284
|
return (
|
|
280
285
|
<Form>
|
|
281
286
|
<FormHead
|
|
282
|
-
|
|
283
|
-
|
|
287
|
+
backUrl="/settings/api-tokens"
|
|
288
|
+
title={{
|
|
289
|
+
id: 'Settings.apiTokens.createPage.title',
|
|
290
|
+
defaultMessage: 'Create API Token',
|
|
291
|
+
}}
|
|
292
|
+
token={apiToken}
|
|
293
|
+
setToken={setApiToken}
|
|
284
294
|
canEditInputs={canEditInputs}
|
|
285
295
|
canRegenerate={canRegenerate}
|
|
286
296
|
isSubmitting={isSubmitting}
|
|
297
|
+
regenerateUrl="/admin/api-tokens/"
|
|
287
298
|
/>
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
299
|
+
|
|
300
|
+
<ContentLayout>
|
|
301
|
+
<Stack spacing={6}>
|
|
302
|
+
{Boolean(apiToken?.name) && <TokenBox token={apiToken?.accessKey} />}
|
|
303
|
+
<FormApiTokenContainer
|
|
304
|
+
errors={errors}
|
|
305
|
+
onChange={handleChange}
|
|
306
|
+
canEditInputs={canEditInputs}
|
|
307
|
+
isCreating={isCreating}
|
|
308
|
+
values={values}
|
|
309
|
+
apiToken={apiToken}
|
|
310
|
+
onDispatch={dispatch}
|
|
311
|
+
setHasChangedPermissions={setHasChangedPermissions}
|
|
312
|
+
/>
|
|
313
|
+
<Permissions
|
|
314
|
+
disabled={
|
|
315
|
+
!canEditInputs ||
|
|
316
|
+
values?.type === 'read-only' ||
|
|
317
|
+
values?.type === 'full-access'
|
|
318
|
+
}
|
|
319
|
+
/>
|
|
320
|
+
</Stack>
|
|
321
|
+
</ContentLayout>
|
|
298
322
|
</Form>
|
|
299
323
|
);
|
|
300
324
|
}}
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
NoPermissions,
|
|
12
12
|
useRBAC,
|
|
13
13
|
NoContent,
|
|
14
|
-
DynamicTable,
|
|
15
14
|
useTracking,
|
|
16
15
|
useGuidedTour,
|
|
16
|
+
useFetchClient,
|
|
17
17
|
LinkButton,
|
|
18
18
|
} from '@strapi/helper-plugin';
|
|
19
19
|
import { HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
|
|
@@ -21,10 +21,9 @@ import { Main } from '@strapi/design-system/Main';
|
|
|
21
21
|
import { Button } from '@strapi/design-system/Button';
|
|
22
22
|
import Plus from '@strapi/icons/Plus';
|
|
23
23
|
|
|
24
|
-
import { axiosInstance } from '../../../../../core/utils';
|
|
25
24
|
import adminPermissions from '../../../../../permissions';
|
|
26
25
|
import tableHeaders from './utils/tableHeaders';
|
|
27
|
-
import
|
|
26
|
+
import Table from '../../../components/Tokens/Table';
|
|
28
27
|
|
|
29
28
|
const ApiTokenListView = () => {
|
|
30
29
|
useFocusWhenNavigate();
|
|
@@ -38,6 +37,7 @@ const ApiTokenListView = () => {
|
|
|
38
37
|
const { trackUsage } = useTracking();
|
|
39
38
|
const { startSection } = useGuidedTour();
|
|
40
39
|
const startSectionRef = useRef(startSection);
|
|
40
|
+
const { get, del } = useFetchClient();
|
|
41
41
|
|
|
42
42
|
useEffect(() => {
|
|
43
43
|
if (startSectionRef.current) {
|
|
@@ -67,7 +67,7 @@ const ApiTokenListView = () => {
|
|
|
67
67
|
trackUsage('willAccessTokenList');
|
|
68
68
|
const {
|
|
69
69
|
data: { data },
|
|
70
|
-
} = await
|
|
70
|
+
} = await get(`/admin/api-tokens`);
|
|
71
71
|
|
|
72
72
|
trackUsage('didAccessTokenList', { number: data.length });
|
|
73
73
|
|
|
@@ -90,7 +90,7 @@ const ApiTokenListView = () => {
|
|
|
90
90
|
|
|
91
91
|
const deleteMutation = useMutation(
|
|
92
92
|
async (id) => {
|
|
93
|
-
await
|
|
93
|
+
await del(`/admin/api-tokens/${id}`);
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
async onSuccess() {
|
|
@@ -143,22 +143,15 @@ const ApiTokenListView = () => {
|
|
|
143
143
|
<ContentLayout>
|
|
144
144
|
{!canRead && <NoPermissions />}
|
|
145
145
|
{shouldDisplayDynamicTable && (
|
|
146
|
-
<
|
|
146
|
+
<Table
|
|
147
|
+
permissions={{ canRead, canDelete, canUpdate }}
|
|
147
148
|
headers={headers}
|
|
148
149
|
contentType="api-tokens"
|
|
149
150
|
rows={apiTokens}
|
|
150
|
-
withBulkActions={canDelete || canUpdate || canRead}
|
|
151
151
|
isLoading={isLoading}
|
|
152
152
|
onConfirmDelete={(id) => deleteMutation.mutateAsync(id)}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
canRead={canRead}
|
|
156
|
-
canDelete={canDelete}
|
|
157
|
-
canUpdate={canUpdate}
|
|
158
|
-
rows={apiTokens}
|
|
159
|
-
withBulkActions={canDelete || canUpdate || canRead}
|
|
160
|
-
/>
|
|
161
|
-
</DynamicTable>
|
|
153
|
+
tokens={apiTokens}
|
|
154
|
+
/>
|
|
162
155
|
)}
|
|
163
156
|
{shouldDisplayNoContentWithCreationButton && (
|
|
164
157
|
<NoContent
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getFetchClient } from '@strapi/helper-plugin';
|
|
2
2
|
import prefixAllUrls from './prefixAllUrls';
|
|
3
3
|
|
|
4
4
|
const fetchProjectSettings = async () => {
|
|
5
|
-
const {
|
|
5
|
+
const { get } = getFetchClient();
|
|
6
|
+
const { data } = await get('/admin/project-settings');
|
|
6
7
|
|
|
7
8
|
return prefixAllUrls(data);
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
const postProjectSettings = async (body) => {
|
|
11
|
-
const {
|
|
12
|
+
const { post } = getFetchClient();
|
|
13
|
+
const { data } = await post('/admin/project-settings', body, {
|
|
12
14
|
headers: {
|
|
13
15
|
'Content-Type': 'multipart/form-data',
|
|
14
16
|
},
|