@strapi/admin 4.9.0-exp.90df253ba90fd6879eb56a720a1f80d04ff745b8 → 4.10.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/admin/src/content-manager/components/DynamicTable/CellContent/PublicationState/PublicationState.js +26 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/PublicationState/index.js +1 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/ReviewWorkflowsStage.js +15 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/index.js +1 -0
- package/admin/src/content-manager/components/DynamicTable/index.js +43 -49
- package/admin/src/content-manager/components/DynamicZone/components/DynamicComponent.js +2 -0
- package/admin/src/content-manager/components/DynamicZone/utils/select.js +1 -1
- package/admin/src/content-manager/components/FieldComponent/utils/select.js +2 -1
- package/admin/src/content-manager/components/Inputs/utils/getInputType.js +1 -1
- package/admin/src/content-manager/components/Inputs/utils/select.js +1 -1
- package/admin/src/content-manager/hooks/useContentTypeLayout/index.js +1 -2
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/utils/formatLayouts.js +4 -1
- package/admin/src/content-manager/pages/CollectionTypeRecursivePath/index.js +1 -2
- package/admin/src/content-manager/pages/EditSettingsView/init.js +3 -1
- package/admin/src/content-manager/pages/EditSettingsView/utils/createPossibleMainFieldsForModelsAndComponents.js +2 -4
- package/admin/src/content-manager/pages/EditView/DeleteLink/utils/select.js +1 -1
- package/admin/src/content-manager/pages/EditView/Information/index.js +77 -53
- package/admin/src/content-manager/pages/EditView/InformationBox/InformationBoxCE.js +13 -0
- package/admin/src/content-manager/pages/EditView/InformationBox/index.js +3 -0
- package/admin/src/content-manager/pages/EditView/index.js +3 -4
- package/admin/src/content-manager/pages/EditView/utils/createAttributesLayout.js +2 -1
- package/admin/src/content-manager/pages/EditView/utils/getFieldsActionMatchingPermissions.js +2 -1
- package/admin/src/content-manager/pages/ListView/index.js +6 -9
- package/admin/src/content-manager/utils/checkIfAttributeIsDisplayable.js +1 -1
- package/admin/src/content-manager/utils/createDefaultForm.js +2 -2
- package/admin/src/content-manager/utils/formatLayoutToApi.js +2 -1
- package/admin/src/content-manager/utils/getFieldName.js +1 -1
- package/admin/src/content-manager/utils/mergeMetasWithSchema.js +1 -1
- package/admin/src/content-manager/utils/paths.js +1 -1
- package/admin/src/content-manager/utils/removePasswordFieldsFromData.js +1 -1
- package/admin/src/hooks/useRegenerate/index.js +1 -1
- package/admin/src/hooks/useSettingsForm/index.js +3 -3
- package/admin/src/hooks/useSettingsForm/reducer.js +3 -1
- package/admin/src/hooks/useSettingsMenu/reducer.js +1 -1
- package/admin/src/index.js +1 -0
- package/admin/src/pages/AuthPage/reducer.js +1 -1
- package/admin/src/pages/SettingsPage/components/Tokens/TokenTypeSelect/index.js +5 -7
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/CollapsableContentType/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/reducer.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/transformPermissionsData.js +6 -8
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/utils/createDefaultConditionsForm.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/Collapse/utils/generateCheckboxesActions.js +2 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/utils/getRowLabelCheckboxeState.js +2 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/GlobalActions/utils/getRowLabelCheckboxesState.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/reducer.js +6 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/createDefaultCTFormFromLayout.js +5 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/createDefaultPluginsFormFromLayout.js +1 -2
- 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/updateConditionsToFalse.js +4 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/updateValues.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PluginsAndSettings/SubCategory/utils/formatActions.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/utils/createArrayOfValues.js +2 -1
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/components/FormTransferTokenContainer/index.js +0 -41
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/index.js +4 -6
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/utils/schema.js +0 -1
- package/admin/src/pages/SettingsPage/pages/Users/ProtectedEditPage/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/utils/formatData.js +1 -7
- package/admin/src/permissions/index.js +1 -1
- package/admin/src/translations/en.json +6 -0
- package/admin/src/utils/getAttributesToDisplay.js +2 -4
- package/admin/src/utils/getExistingActions.js +1 -3
- package/admin/src/utils/sortLinks.js +1 -1
- package/build/{8580.b0dcf37c.chunk.js → 2263.4c5916f9.chunk.js} +61 -61
- package/build/4649.213b8a3b.chunk.js +30 -0
- package/build/6985.66cca29c.chunk.js +1 -0
- package/build/7259.aefb51e8.chunk.js +1 -0
- package/build/{7112.2bf13da3.chunk.js → 9505.dbe702ab.chunk.js} +6 -6
- package/build/{Admin-authenticatedApp.5aa08bf5.chunk.js → Admin-authenticatedApp.f50ad423.chunk.js} +3 -3
- package/build/{Admin_marketplace.0f6c8ee2.chunk.js → Admin_marketplace.02608d56.chunk.js} +1 -1
- package/build/{Admin_profilePage.d2a8f9ab.chunk.js → Admin_profilePage.76afeca0.chunk.js} +1 -1
- package/build/Admin_settingsPage.147755cd.chunk.js +9 -0
- package/build/admin-app.55dd7921.chunk.js +112 -0
- package/build/admin-edit-roles-page.cf543488.chunk.js +216 -0
- package/build/admin-edit-users.31c20712.chunk.js +10 -0
- package/build/admin-roles-list.489c501f.chunk.js +2 -0
- package/build/{admin-users.af8c3123.chunk.js → admin-users.3e111a7d.chunk.js} +1 -1
- package/build/{api-tokens-create-page.2a6e22bd.chunk.js → api-tokens-create-page.4328b852.chunk.js} +1 -1
- package/build/{api-tokens-edit-page.fa38cd63.chunk.js → api-tokens-edit-page.bce5050f.chunk.js} +1 -1
- package/build/content-manager.4480ae88.chunk.js +1137 -0
- package/build/content-type-builder-translation-en-json.7961593e.chunk.js +1 -0
- package/build/content-type-builder.af9abf1e.chunk.js +126 -0
- package/build/en-json.697b4bcf.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.af8c0f31.js +3790 -0
- package/build/review-workflows-settings.7a7dc773.chunk.js +57 -0
- package/build/runtime~main.5a95bee6.js +2 -0
- package/build/sso-settings-page.272b87c8.chunk.js +1 -0
- package/build/{upload-settings.0200561d.chunk.js → upload-settings.0875e973.chunk.js} +1 -1
- package/build/upload-translation-fr-json.baab9911.chunk.js +1 -0
- package/build/users-advanced-settings-page.1d3c14c7.chunk.js +1 -0
- package/build/{users-email-settings-page.a3c80419.chunk.js → users-email-settings-page.e8db68c4.chunk.js} +1 -1
- package/build/users-providers-settings-page.14cac425.chunk.js +1 -0
- package/build/users-roles-settings-page.2ea4de84.chunk.js +30 -0
- package/build/{webhook-edit-page.a2a2b7bb.chunk.js → webhook-edit-page.329141a5.chunk.js} +3 -3
- package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +92 -0
- package/ee/admin/content-manager/pages/EditView/InformationBox/index.js +3 -0
- package/ee/admin/hooks/useSettingsMenu/utils/customAdminLinks.js +12 -12
- package/ee/admin/hooks/useSettingsMenu/utils/customGlobalLinks.js +21 -13
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/ReviewWorkflows.js +195 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/actions/index.js +42 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/AddStage/AddStage.js +87 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/AddStage/index.js +1 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +90 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/index.js +1 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stages.js +92 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/index.js +1 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/constants.js +6 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/hooks/useReviewWorkflows.js +35 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/index.js +3 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/reducer/index.js +121 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/utils/getWorkflowValidationSchema.js +25 -0
- package/ee/admin/pages/SettingsPage/utils/customRoutes.js +16 -2
- package/ee/admin/permissions/customPermissions.js +3 -0
- package/ee/server/bootstrap.js +16 -0
- package/ee/server/config/admin-actions.js +10 -0
- package/ee/server/constants/default-stages.json +14 -0
- package/ee/server/constants/default-workflow.json +1 -0
- package/ee/server/constants/workflows.js +8 -0
- package/ee/server/content-types/index.js +9 -0
- package/ee/server/content-types/workflow/index.js +34 -0
- package/ee/server/content-types/workflow-stage/index.js +41 -0
- package/ee/server/controllers/index.js +2 -0
- package/ee/server/controllers/workflows/index.js +36 -0
- package/ee/server/controllers/workflows/stages/index.js +95 -0
- package/ee/server/index.js +1 -0
- package/ee/server/middlewares/review-workflows.js +40 -0
- package/ee/server/migrations/review-workflows.js +39 -0
- package/ee/server/register.js +7 -0
- package/ee/server/routes/index.js +104 -0
- package/ee/server/services/index.js +4 -0
- package/ee/server/services/review-workflows/entity-service-decorator.js +42 -0
- package/ee/server/services/review-workflows/review-workflows.js +175 -0
- package/ee/server/services/review-workflows/stages.js +148 -0
- package/ee/server/services/review-workflows/workflows.js +25 -0
- package/ee/server/utils/index.js +8 -0
- package/ee/server/utils/persisted-tables.js +49 -0
- package/ee/server/utils/review-workflows.js +25 -0
- package/ee/server/utils/test.js +11 -0
- package/ee/server/validation/review-workflows.js +24 -0
- package/package.json +13 -13
- package/server/controllers/transfer/runner.js +2 -4
- package/server/routes/transfer.js +4 -13
- package/server/services/constants.js +0 -4
- package/server/services/permission/permissions-manager/sanitize.js +2 -0
- package/server/services/transfer/permission.js +1 -1
- package/server/services/transfer/token.js +31 -33
- package/server/validation/transfer/token.js +2 -10
- package/build/2637.679b590b.chunk.js +0 -1
- package/build/5563.451e91ee.chunk.js +0 -30
- package/build/7259.7744297b.chunk.js +0 -1
- package/build/Admin_settingsPage.489ec4eb.chunk.js +0 -9
- package/build/admin-app.4b313104.chunk.js +0 -112
- package/build/admin-edit-roles-page.3b196317.chunk.js +0 -216
- package/build/admin-edit-users.af3b0f15.chunk.js +0 -10
- package/build/admin-roles-list.0ad504a7.chunk.js +0 -2
- package/build/content-manager.f530e141.chunk.js +0 -1139
- package/build/content-type-builder-translation-en-json.e577d595.chunk.js +0 -1
- package/build/content-type-builder.6ecd201d.chunk.js +0 -126
- package/build/en-json.01a88a30.chunk.js +0 -1
- package/build/main.43b93ff3.js +0 -3843
- package/build/runtime~main.a40b1b57.js +0 -2
- package/build/sso-settings-page.5a8588ef.chunk.js +0 -1
- package/build/upload-translation-fr-json.84429734.chunk.js +0 -1
- package/build/users-advanced-settings-page.c0cae03a.chunk.js +0 -1
- package/build/users-providers-settings-page.5f86e45c.chunk.js +0 -1
- package/build/users-roles-settings-page.b02986df.chunk.js +0 -30
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useReducer } from 'react';
|
|
2
2
|
import { request, useNotification, useOverlayBlocker } from '@strapi/helper-plugin';
|
|
3
|
-
import
|
|
3
|
+
import omit from 'lodash/omit';
|
|
4
4
|
import { checkFormValidity, formatAPIErrors } from '../../utils';
|
|
5
5
|
import { initialState, reducer } from './reducer';
|
|
6
6
|
import init from './init';
|
|
@@ -102,9 +102,9 @@ const useSettingsForm = (endPoint, schema, cbSuccess, fieldsToPick) => {
|
|
|
102
102
|
message: { id: 'notification.success.saved' },
|
|
103
103
|
});
|
|
104
104
|
} catch (err) {
|
|
105
|
-
const data =
|
|
105
|
+
const data = err?.response?.payload ?? { data: {} };
|
|
106
106
|
|
|
107
|
-
if (
|
|
107
|
+
if (!!data?.data && typeof data.data === 'string') {
|
|
108
108
|
toggleNotification({
|
|
109
109
|
type: 'warning',
|
|
110
110
|
message: data.data,
|
package/admin/src/index.js
CHANGED
|
@@ -4,21 +4,21 @@ import { useIntl } from 'react-intl';
|
|
|
4
4
|
|
|
5
5
|
import { Select, Option } from '@strapi/design-system';
|
|
6
6
|
|
|
7
|
-
const TokenTypeSelect = ({
|
|
7
|
+
const TokenTypeSelect = ({ errors, values, onChange, canEditInputs, options, label }) => {
|
|
8
8
|
const { formatMessage } = useIntl();
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<Select
|
|
12
|
-
name=
|
|
12
|
+
name="type"
|
|
13
13
|
label={formatMessage({
|
|
14
14
|
id: label.id,
|
|
15
15
|
defaultMessage: label.defaultMessage,
|
|
16
16
|
})}
|
|
17
|
-
value={values
|
|
17
|
+
value={values?.type}
|
|
18
18
|
error={
|
|
19
|
-
errors
|
|
19
|
+
errors.type
|
|
20
20
|
? formatMessage(
|
|
21
|
-
errors
|
|
21
|
+
errors.type?.id ? errors.type : { id: errors.type, defaultMessage: errors.type }
|
|
22
22
|
)
|
|
23
23
|
: null
|
|
24
24
|
}
|
|
@@ -38,7 +38,6 @@ const TokenTypeSelect = ({ name, errors, values, onChange, canEditInputs, option
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
TokenTypeSelect.propTypes = {
|
|
41
|
-
name: PropTypes.string,
|
|
42
41
|
options: PropTypes.arrayOf(
|
|
43
42
|
PropTypes.shape({
|
|
44
43
|
label: PropTypes.shape({
|
|
@@ -63,7 +62,6 @@ TokenTypeSelect.propTypes = {
|
|
|
63
62
|
};
|
|
64
63
|
|
|
65
64
|
TokenTypeSelect.defaultProps = {
|
|
66
|
-
name: 'type',
|
|
67
65
|
errors: {},
|
|
68
66
|
options: [],
|
|
69
67
|
};
|
package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/transformPermissionsData.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { flatten } from 'lodash';
|
|
2
|
-
|
|
3
1
|
const transformPermissionsData = (data) => {
|
|
4
2
|
const layout = {
|
|
5
3
|
allActionsIds: [],
|
|
@@ -9,11 +7,11 @@ const transformPermissionsData = (data) => {
|
|
|
9
7
|
layout.permissions = Object.keys(data).map((apiId) => ({
|
|
10
8
|
apiId,
|
|
11
9
|
label: apiId.split('::')[1],
|
|
12
|
-
controllers:
|
|
13
|
-
|
|
10
|
+
controllers: Object.keys(data[apiId].controllers)
|
|
11
|
+
.map((controller) => ({
|
|
14
12
|
controller,
|
|
15
|
-
actions:
|
|
16
|
-
|
|
13
|
+
actions: data[apiId].controllers[controller]
|
|
14
|
+
.map((action) => {
|
|
17
15
|
const actionId = `${apiId}.${controller}.${action}`;
|
|
18
16
|
|
|
19
17
|
if (apiId.includes('api::')) {
|
|
@@ -25,9 +23,9 @@ const transformPermissionsData = (data) => {
|
|
|
25
23
|
actionId,
|
|
26
24
|
};
|
|
27
25
|
})
|
|
28
|
-
|
|
26
|
+
.flat(),
|
|
29
27
|
}))
|
|
30
|
-
|
|
28
|
+
.flat(),
|
|
31
29
|
}));
|
|
32
30
|
|
|
33
31
|
return layout;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import get from 'lodash/get';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
2
3
|
import { createArrayOfValues, getCheckboxState } from '../../../utils';
|
|
3
4
|
|
|
4
5
|
const generateCheckboxesActions = (availableActions, modifiedData, pathToData) => {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import produce from 'immer';
|
|
2
|
-
import
|
|
2
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
3
|
+
import has from 'lodash/has';
|
|
4
|
+
import isObject from 'lodash/isObject';
|
|
5
|
+
import get from 'lodash/get';
|
|
6
|
+
import set from 'lodash/set';
|
|
7
|
+
|
|
3
8
|
import updateConditionsToFalse from './utils/updateConditionsToFalse';
|
|
4
9
|
import updateValues from './utils/updateValues';
|
|
5
10
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import get from 'lodash/get';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import merge from 'lodash/merge';
|
|
4
|
+
import set from 'lodash/set';
|
|
5
|
+
|
|
2
6
|
import findMatchingPermission from './findMatchingPermissions';
|
|
3
7
|
/**
|
|
4
8
|
* Creates the default condition form: { [conditionId]: false }
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { get } from 'lodash';
|
|
2
1
|
import { createDefaultConditionsForm } from './createDefaultCTFormFromLayout';
|
|
3
2
|
import findMatchingPermission from './findMatchingPermissions';
|
|
4
3
|
|
|
@@ -12,7 +11,7 @@ const createSubCategoryForm = (actions, conditions, permissions) => {
|
|
|
12
11
|
},
|
|
13
12
|
conditions: createDefaultConditionsForm(
|
|
14
13
|
conditions,
|
|
15
|
-
|
|
14
|
+
foundMatchingPermission?.conditions ?? []
|
|
16
15
|
),
|
|
17
16
|
};
|
|
18
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import isObject from 'lodash/isObject';
|
|
2
2
|
import { createArrayOfValues } from '../../utils';
|
|
3
3
|
import { createConditionsArray } from './formatSettingsPermissionsToAPI';
|
|
4
4
|
|
|
@@ -77,7 +77,7 @@ const createSubjectPermissions = (subject, actions) => {
|
|
|
77
77
|
return acc;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
if (!
|
|
80
|
+
if (!permissions?.properties?.enabled) {
|
|
81
81
|
const createdPermissionsArray = createPermissionWithProperties(
|
|
82
82
|
actionName,
|
|
83
83
|
subject,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
Typography,
|
|
27
27
|
VisuallyHidden,
|
|
28
28
|
} from '@strapi/design-system';
|
|
29
|
-
import
|
|
29
|
+
import get from 'lodash/get';
|
|
30
30
|
import matchSorter from 'match-sorter';
|
|
31
31
|
import { useIntl } from 'react-intl';
|
|
32
32
|
import { useHistory } from 'react-router-dom';
|
|
@@ -5,7 +5,6 @@ import { Box, Grid, GridItem, Flex, Typography } from '@strapi/design-system';
|
|
|
5
5
|
import LifeSpanInput from '../../../../../components/Tokens/LifeSpanInput';
|
|
6
6
|
import TokenName from '../../../../../components/Tokens/TokenName';
|
|
7
7
|
import TokenDescription from '../../../../../components/Tokens/TokenDescription';
|
|
8
|
-
import TokenTypeSelect from '../../../../../components/Tokens/TokenTypeSelect';
|
|
9
8
|
|
|
10
9
|
const FormTransferTokenContainer = ({
|
|
11
10
|
errors,
|
|
@@ -17,30 +16,6 @@ const FormTransferTokenContainer = ({
|
|
|
17
16
|
}) => {
|
|
18
17
|
const { formatMessage } = useIntl();
|
|
19
18
|
|
|
20
|
-
const typeOptions = [
|
|
21
|
-
{
|
|
22
|
-
value: 'push',
|
|
23
|
-
label: {
|
|
24
|
-
id: 'Settings.transferTokens.types.push',
|
|
25
|
-
defaultMessage: 'Push',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
value: 'pull',
|
|
30
|
-
label: {
|
|
31
|
-
id: 'Settings.transferTokens.types.pull',
|
|
32
|
-
defaultMessage: 'Pull',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
value: 'push-pull',
|
|
37
|
-
label: {
|
|
38
|
-
id: 'Settings.transferTokens.types.push-pull',
|
|
39
|
-
defaultMessage: 'Full Access',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
|
|
44
19
|
return (
|
|
45
20
|
<Box
|
|
46
21
|
background="neutral0"
|
|
@@ -84,22 +59,6 @@ const FormTransferTokenContainer = ({
|
|
|
84
59
|
token={transferToken}
|
|
85
60
|
/>
|
|
86
61
|
</GridItem>
|
|
87
|
-
<GridItem key="permissions" col={6} xs={12}>
|
|
88
|
-
<TokenTypeSelect
|
|
89
|
-
name="permissions"
|
|
90
|
-
values={values}
|
|
91
|
-
errors={errors}
|
|
92
|
-
label={{
|
|
93
|
-
id: 'Settings.tokens.form.type',
|
|
94
|
-
defaultMessage: 'Token type',
|
|
95
|
-
}}
|
|
96
|
-
onChange={(value) => {
|
|
97
|
-
onChange({ target: { name: 'permissions', value } });
|
|
98
|
-
}}
|
|
99
|
-
options={typeOptions}
|
|
100
|
-
canEditInputs={canEditInputs}
|
|
101
|
-
/>
|
|
102
|
-
</GridItem>
|
|
103
62
|
</Grid>
|
|
104
63
|
</Flex>
|
|
105
64
|
</Box>
|
|
@@ -92,8 +92,6 @@ const TransferTokenCreateView = () => {
|
|
|
92
92
|
? parseInt(body.lifespan, 10)
|
|
93
93
|
: null;
|
|
94
94
|
|
|
95
|
-
const permissions = body.permissions.split('-');
|
|
96
|
-
|
|
97
95
|
try {
|
|
98
96
|
const {
|
|
99
97
|
data: { data: response },
|
|
@@ -101,12 +99,13 @@ const TransferTokenCreateView = () => {
|
|
|
101
99
|
? await post(`/admin/transfer/tokens`, {
|
|
102
100
|
...body,
|
|
103
101
|
lifespan: lifespanVal,
|
|
104
|
-
permissions,
|
|
102
|
+
permissions: ['push'],
|
|
105
103
|
})
|
|
106
104
|
: await put(`/admin/transfer/tokens/${id}`, {
|
|
107
105
|
name: body.name,
|
|
108
106
|
description: body.description,
|
|
109
|
-
|
|
107
|
+
type: body.type,
|
|
108
|
+
permissions: ['push'],
|
|
110
109
|
});
|
|
111
110
|
|
|
112
111
|
unlockApp();
|
|
@@ -133,7 +132,7 @@ const TransferTokenCreateView = () => {
|
|
|
133
132
|
});
|
|
134
133
|
|
|
135
134
|
trackUsageRef.current(isCreating ? 'didCreateToken' : 'didEditToken', {
|
|
136
|
-
type: transferToken?.
|
|
135
|
+
type: transferToken?.type,
|
|
137
136
|
tokenType: TRANSFER_TOKEN_TYPE,
|
|
138
137
|
});
|
|
139
138
|
} catch (err) {
|
|
@@ -174,7 +173,6 @@ const TransferTokenCreateView = () => {
|
|
|
174
173
|
lifespan: transferToken?.lifespan
|
|
175
174
|
? transferToken.lifespan.toString()
|
|
176
175
|
: transferToken?.lifespan,
|
|
177
|
-
permissions: transferToken?.permissions.join('-'),
|
|
178
176
|
}}
|
|
179
177
|
enableReinitialize
|
|
180
178
|
onSubmit={(body, actions) => handleSubmit(body, actions)}
|
|
@@ -5,7 +5,6 @@ const schema = yup.object().shape({
|
|
|
5
5
|
name: yup.string(translatedErrors.string).max(100).required(translatedErrors.required),
|
|
6
6
|
description: yup.string().nullable(),
|
|
7
7
|
lifespan: yup.number().integer().min(0).nullable().defined(translatedErrors.required),
|
|
8
|
-
permissions: yup.string(translatedErrors.string).required(translatedErrors.required),
|
|
9
8
|
});
|
|
10
9
|
|
|
11
10
|
export default schema;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useMemo } from 'react';
|
|
2
2
|
import { useRBAC, LoadingIndicatorPage, useNotification } from '@strapi/helper-plugin';
|
|
3
3
|
import { Redirect, useLocation } from 'react-router-dom';
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import adminPermissions from '../../../../../permissions';
|
|
6
6
|
import EditPage from '../EditPage';
|
|
7
7
|
|
|
@@ -19,7 +19,7 @@ const ProtectedEditPage = () => {
|
|
|
19
19
|
allowedActions: { canRead, canUpdate },
|
|
20
20
|
} = useRBAC(permissions);
|
|
21
21
|
const { state } = useLocation();
|
|
22
|
-
const from =
|
|
22
|
+
const from = state?.from ?? '/';
|
|
23
23
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
if (!isLoading) {
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import { set } from 'lodash';
|
|
2
|
-
|
|
3
1
|
const cleanData = (data) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
set(webhooks, 'headers', unformatHeaders(data.headers));
|
|
7
|
-
|
|
8
|
-
return webhooks;
|
|
2
|
+
return { ...data, headers: unformatHeaders(data.headers) };
|
|
9
3
|
};
|
|
10
4
|
|
|
11
5
|
const unformatHeaders = (headers) => {
|
|
@@ -251,6 +251,11 @@
|
|
|
251
251
|
"Settings.profile.form.section.experience.title": "Experience",
|
|
252
252
|
"Settings.profile.form.section.helmet.title": "User profile",
|
|
253
253
|
"Settings.profile.form.section.profile.page.title": "Profile page",
|
|
254
|
+
"Settings.review-workflows.page.title": "Review Workflows",
|
|
255
|
+
"Settings.review-workflows.page.subtitle": "{count, plural, one {# stage} other {# stages}}",
|
|
256
|
+
"Settings.review-workflows.page.isLoading": "Workflow is loading",
|
|
257
|
+
"Settings.review-workflows.page.delete.confirm.body": "All entries assigned to deleted stages will be moved to the first stage. Are you sure you want to save this?",
|
|
258
|
+
"Settings.review-workflows.stage.name.label": "Stage name",
|
|
254
259
|
"Settings.roles.create.description": "Define the rights given to the role",
|
|
255
260
|
"Settings.roles.create.title": "Create a role",
|
|
256
261
|
"Settings.roles.created": "Role created",
|
|
@@ -802,6 +807,7 @@
|
|
|
802
807
|
"content-manager.relation.notAvailable": "No relations available",
|
|
803
808
|
"content-manager.relation.publicationState.draft": "Draft",
|
|
804
809
|
"content-manager.relation.publicationState.published": "Published",
|
|
810
|
+
"content-manager.reviewWorkflows.stage.label": "Review stage",
|
|
805
811
|
"content-manager.select.currently.selected": "{count} currently selected",
|
|
806
812
|
"content-manager.success.record.delete": "Deleted",
|
|
807
813
|
"content-manager.success.record.publish": "Published",
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { get } from 'lodash';
|
|
2
|
-
|
|
3
1
|
const getAttributesToDisplay = (contentType) => {
|
|
4
|
-
const timestamps =
|
|
2
|
+
const timestamps = contentType?.options?.timestamps;
|
|
5
3
|
|
|
6
4
|
// Sometimes timestamps is false
|
|
7
5
|
let timestampsArray = Array.isArray(timestamps) ? timestamps : [];
|
|
8
6
|
const idsAttributes = ['id', '_id']; // For both SQL and mongo
|
|
9
7
|
const unwritableAttributes = [...idsAttributes, ...timestampsArray, 'publishedAt'];
|
|
10
|
-
const schemaAttributes =
|
|
8
|
+
const schemaAttributes = contentType?.attributes ?? {};
|
|
11
9
|
|
|
12
10
|
return Object.keys(schemaAttributes).reduce((acc, current) => {
|
|
13
11
|
if (!unwritableAttributes.includes(current)) {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { get } from 'lodash';
|
|
2
|
-
|
|
3
1
|
const getExistingActions = (permissions) => {
|
|
4
2
|
return Array.from(
|
|
5
3
|
new Set(
|
|
@@ -23,7 +21,7 @@ const getExistingActions = (permissions) => {
|
|
|
23
21
|
...acc,
|
|
24
22
|
...getActionsPermission([
|
|
25
23
|
...Object.values(current[1].attributes || {}),
|
|
26
|
-
|
|
24
|
+
current[1]?.contentTypeActions ?? {},
|
|
27
25
|
]),
|
|
28
26
|
];
|
|
29
27
|
}, [])
|