@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.
Files changed (167) hide show
  1. package/admin/src/content-manager/components/DynamicTable/CellContent/PublicationState/PublicationState.js +26 -0
  2. package/admin/src/content-manager/components/DynamicTable/CellContent/PublicationState/index.js +1 -0
  3. package/admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/ReviewWorkflowsStage.js +15 -0
  4. package/admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/index.js +1 -0
  5. package/admin/src/content-manager/components/DynamicTable/index.js +43 -49
  6. package/admin/src/content-manager/components/DynamicZone/components/DynamicComponent.js +2 -0
  7. package/admin/src/content-manager/components/DynamicZone/utils/select.js +1 -1
  8. package/admin/src/content-manager/components/FieldComponent/utils/select.js +2 -1
  9. package/admin/src/content-manager/components/Inputs/utils/getInputType.js +1 -1
  10. package/admin/src/content-manager/components/Inputs/utils/select.js +1 -1
  11. package/admin/src/content-manager/hooks/useContentTypeLayout/index.js +1 -2
  12. package/admin/src/content-manager/hooks/useFetchContentTypeLayout/utils/formatLayouts.js +4 -1
  13. package/admin/src/content-manager/pages/CollectionTypeRecursivePath/index.js +1 -2
  14. package/admin/src/content-manager/pages/EditSettingsView/init.js +3 -1
  15. package/admin/src/content-manager/pages/EditSettingsView/utils/createPossibleMainFieldsForModelsAndComponents.js +2 -4
  16. package/admin/src/content-manager/pages/EditView/DeleteLink/utils/select.js +1 -1
  17. package/admin/src/content-manager/pages/EditView/Information/index.js +77 -53
  18. package/admin/src/content-manager/pages/EditView/InformationBox/InformationBoxCE.js +13 -0
  19. package/admin/src/content-manager/pages/EditView/InformationBox/index.js +3 -0
  20. package/admin/src/content-manager/pages/EditView/index.js +3 -4
  21. package/admin/src/content-manager/pages/EditView/utils/createAttributesLayout.js +2 -1
  22. package/admin/src/content-manager/pages/EditView/utils/getFieldsActionMatchingPermissions.js +2 -1
  23. package/admin/src/content-manager/pages/ListView/index.js +6 -9
  24. package/admin/src/content-manager/utils/checkIfAttributeIsDisplayable.js +1 -1
  25. package/admin/src/content-manager/utils/createDefaultForm.js +2 -2
  26. package/admin/src/content-manager/utils/formatLayoutToApi.js +2 -1
  27. package/admin/src/content-manager/utils/getFieldName.js +1 -1
  28. package/admin/src/content-manager/utils/mergeMetasWithSchema.js +1 -1
  29. package/admin/src/content-manager/utils/paths.js +1 -1
  30. package/admin/src/content-manager/utils/removePasswordFieldsFromData.js +1 -1
  31. package/admin/src/hooks/useRegenerate/index.js +1 -1
  32. package/admin/src/hooks/useSettingsForm/index.js +3 -3
  33. package/admin/src/hooks/useSettingsForm/reducer.js +3 -1
  34. package/admin/src/hooks/useSettingsMenu/reducer.js +1 -1
  35. package/admin/src/index.js +1 -0
  36. package/admin/src/pages/AuthPage/reducer.js +1 -1
  37. package/admin/src/pages/SettingsPage/components/Tokens/TokenTypeSelect/index.js +5 -7
  38. package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/CollapsableContentType/index.js +1 -1
  39. package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/reducer.js +1 -1
  40. package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/transformPermissionsData.js +6 -8
  41. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/utils/createDefaultConditionsForm.js +1 -1
  42. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/Collapse/utils/generateCheckboxesActions.js +2 -1
  43. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/utils/getRowLabelCheckboxeState.js +2 -1
  44. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/GlobalActions/utils/getRowLabelCheckboxesState.js +1 -1
  45. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/reducer.js +6 -1
  46. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/createDefaultCTFormFromLayout.js +5 -1
  47. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/createDefaultPluginsFormFromLayout.js +1 -2
  48. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/formatContentTypesPermissionToAPI.js +2 -2
  49. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/updateConditionsToFalse.js +4 -1
  50. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/updateValues.js +1 -1
  51. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PluginsAndSettings/SubCategory/utils/formatActions.js +1 -1
  52. package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/utils/createArrayOfValues.js +2 -1
  53. package/admin/src/pages/SettingsPage/pages/Roles/ListPage/index.js +1 -1
  54. package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/components/FormTransferTokenContainer/index.js +0 -41
  55. package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/index.js +4 -6
  56. package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/utils/schema.js +0 -1
  57. package/admin/src/pages/SettingsPage/pages/Users/ProtectedEditPage/index.js +2 -2
  58. package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/utils/formatData.js +1 -7
  59. package/admin/src/permissions/index.js +1 -1
  60. package/admin/src/translations/en.json +6 -0
  61. package/admin/src/utils/getAttributesToDisplay.js +2 -4
  62. package/admin/src/utils/getExistingActions.js +1 -3
  63. package/admin/src/utils/sortLinks.js +1 -1
  64. package/build/{8580.b0dcf37c.chunk.js → 2263.4c5916f9.chunk.js} +61 -61
  65. package/build/4649.213b8a3b.chunk.js +30 -0
  66. package/build/6985.66cca29c.chunk.js +1 -0
  67. package/build/7259.aefb51e8.chunk.js +1 -0
  68. package/build/{7112.2bf13da3.chunk.js → 9505.dbe702ab.chunk.js} +6 -6
  69. package/build/{Admin-authenticatedApp.5aa08bf5.chunk.js → Admin-authenticatedApp.f50ad423.chunk.js} +3 -3
  70. package/build/{Admin_marketplace.0f6c8ee2.chunk.js → Admin_marketplace.02608d56.chunk.js} +1 -1
  71. package/build/{Admin_profilePage.d2a8f9ab.chunk.js → Admin_profilePage.76afeca0.chunk.js} +1 -1
  72. package/build/Admin_settingsPage.147755cd.chunk.js +9 -0
  73. package/build/admin-app.55dd7921.chunk.js +112 -0
  74. package/build/admin-edit-roles-page.cf543488.chunk.js +216 -0
  75. package/build/admin-edit-users.31c20712.chunk.js +10 -0
  76. package/build/admin-roles-list.489c501f.chunk.js +2 -0
  77. package/build/{admin-users.af8c3123.chunk.js → admin-users.3e111a7d.chunk.js} +1 -1
  78. package/build/{api-tokens-create-page.2a6e22bd.chunk.js → api-tokens-create-page.4328b852.chunk.js} +1 -1
  79. package/build/{api-tokens-edit-page.fa38cd63.chunk.js → api-tokens-edit-page.bce5050f.chunk.js} +1 -1
  80. package/build/content-manager.4480ae88.chunk.js +1137 -0
  81. package/build/content-type-builder-translation-en-json.7961593e.chunk.js +1 -0
  82. package/build/content-type-builder.af9abf1e.chunk.js +126 -0
  83. package/build/en-json.697b4bcf.chunk.js +1 -0
  84. package/build/index.html +1 -1
  85. package/build/main.af8c0f31.js +3790 -0
  86. package/build/review-workflows-settings.7a7dc773.chunk.js +57 -0
  87. package/build/runtime~main.5a95bee6.js +2 -0
  88. package/build/sso-settings-page.272b87c8.chunk.js +1 -0
  89. package/build/{upload-settings.0200561d.chunk.js → upload-settings.0875e973.chunk.js} +1 -1
  90. package/build/upload-translation-fr-json.baab9911.chunk.js +1 -0
  91. package/build/users-advanced-settings-page.1d3c14c7.chunk.js +1 -0
  92. package/build/{users-email-settings-page.a3c80419.chunk.js → users-email-settings-page.e8db68c4.chunk.js} +1 -1
  93. package/build/users-providers-settings-page.14cac425.chunk.js +1 -0
  94. package/build/users-roles-settings-page.2ea4de84.chunk.js +30 -0
  95. package/build/{webhook-edit-page.a2a2b7bb.chunk.js → webhook-edit-page.329141a5.chunk.js} +3 -3
  96. package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +92 -0
  97. package/ee/admin/content-manager/pages/EditView/InformationBox/index.js +3 -0
  98. package/ee/admin/hooks/useSettingsMenu/utils/customAdminLinks.js +12 -12
  99. package/ee/admin/hooks/useSettingsMenu/utils/customGlobalLinks.js +21 -13
  100. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/ReviewWorkflows.js +195 -0
  101. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/actions/index.js +42 -0
  102. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/AddStage/AddStage.js +87 -0
  103. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/AddStage/index.js +1 -0
  104. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +90 -0
  105. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/index.js +1 -0
  106. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stages.js +92 -0
  107. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/index.js +1 -0
  108. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/constants.js +6 -0
  109. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/hooks/useReviewWorkflows.js +35 -0
  110. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/index.js +3 -0
  111. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/reducer/index.js +121 -0
  112. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/utils/getWorkflowValidationSchema.js +25 -0
  113. package/ee/admin/pages/SettingsPage/utils/customRoutes.js +16 -2
  114. package/ee/admin/permissions/customPermissions.js +3 -0
  115. package/ee/server/bootstrap.js +16 -0
  116. package/ee/server/config/admin-actions.js +10 -0
  117. package/ee/server/constants/default-stages.json +14 -0
  118. package/ee/server/constants/default-workflow.json +1 -0
  119. package/ee/server/constants/workflows.js +8 -0
  120. package/ee/server/content-types/index.js +9 -0
  121. package/ee/server/content-types/workflow/index.js +34 -0
  122. package/ee/server/content-types/workflow-stage/index.js +41 -0
  123. package/ee/server/controllers/index.js +2 -0
  124. package/ee/server/controllers/workflows/index.js +36 -0
  125. package/ee/server/controllers/workflows/stages/index.js +95 -0
  126. package/ee/server/index.js +1 -0
  127. package/ee/server/middlewares/review-workflows.js +40 -0
  128. package/ee/server/migrations/review-workflows.js +39 -0
  129. package/ee/server/register.js +7 -0
  130. package/ee/server/routes/index.js +104 -0
  131. package/ee/server/services/index.js +4 -0
  132. package/ee/server/services/review-workflows/entity-service-decorator.js +42 -0
  133. package/ee/server/services/review-workflows/review-workflows.js +175 -0
  134. package/ee/server/services/review-workflows/stages.js +148 -0
  135. package/ee/server/services/review-workflows/workflows.js +25 -0
  136. package/ee/server/utils/index.js +8 -0
  137. package/ee/server/utils/persisted-tables.js +49 -0
  138. package/ee/server/utils/review-workflows.js +25 -0
  139. package/ee/server/utils/test.js +11 -0
  140. package/ee/server/validation/review-workflows.js +24 -0
  141. package/package.json +13 -13
  142. package/server/controllers/transfer/runner.js +2 -4
  143. package/server/routes/transfer.js +4 -13
  144. package/server/services/constants.js +0 -4
  145. package/server/services/permission/permissions-manager/sanitize.js +2 -0
  146. package/server/services/transfer/permission.js +1 -1
  147. package/server/services/transfer/token.js +31 -33
  148. package/server/validation/transfer/token.js +2 -10
  149. package/build/2637.679b590b.chunk.js +0 -1
  150. package/build/5563.451e91ee.chunk.js +0 -30
  151. package/build/7259.7744297b.chunk.js +0 -1
  152. package/build/Admin_settingsPage.489ec4eb.chunk.js +0 -9
  153. package/build/admin-app.4b313104.chunk.js +0 -112
  154. package/build/admin-edit-roles-page.3b196317.chunk.js +0 -216
  155. package/build/admin-edit-users.af3b0f15.chunk.js +0 -10
  156. package/build/admin-roles-list.0ad504a7.chunk.js +0 -2
  157. package/build/content-manager.f530e141.chunk.js +0 -1139
  158. package/build/content-type-builder-translation-en-json.e577d595.chunk.js +0 -1
  159. package/build/content-type-builder.6ecd201d.chunk.js +0 -126
  160. package/build/en-json.01a88a30.chunk.js +0 -1
  161. package/build/main.43b93ff3.js +0 -3843
  162. package/build/runtime~main.a40b1b57.js +0 -2
  163. package/build/sso-settings-page.5a8588ef.chunk.js +0 -1
  164. package/build/upload-translation-fr-json.84429734.chunk.js +0 -1
  165. package/build/users-advanced-settings-page.c0cae03a.chunk.js +0 -1
  166. package/build/users-providers-settings-page.5f86e45c.chunk.js +0 -1
  167. package/build/users-roles-settings-page.b02986df.chunk.js +0 -30
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react';
2
- import { get } from 'lodash';
2
+ import get from 'lodash/get';
3
3
  import { useFetchClient, useNotification } from '@strapi/helper-plugin';
4
4
 
5
5
  const useRegenerate = (url, id, onRegenerate) => {
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useReducer } from 'react';
2
2
  import { request, useNotification, useOverlayBlocker } from '@strapi/helper-plugin';
3
- import { get, has, omit } from 'lodash';
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 = get(err, 'response.payload', { data: {} });
105
+ const data = err?.response?.payload ?? { data: {} };
106
106
 
107
- if (has(data, 'data') && typeof data.data === 'string') {
107
+ if (!!data?.data && typeof data.data === 'string') {
108
108
  toggleNotification({
109
109
  type: 'warning',
110
110
  message: data.data,
@@ -1,6 +1,8 @@
1
1
  /* eslint-disable consistent-return */
2
2
  import produce from 'immer';
3
- import { pick, set, unset } from 'lodash';
3
+ import pick from 'lodash/pick';
4
+ import set from 'lodash/set';
5
+ import unset from 'lodash/unset';
4
6
 
5
7
  const initialState = {
6
8
  fieldsToPick: [],
@@ -1,5 +1,5 @@
1
1
  import produce from 'immer';
2
- import { set } from 'lodash';
2
+ import set from 'lodash/set';
3
3
 
4
4
  const initialState = {
5
5
  menu: [],
@@ -13,6 +13,7 @@ window.strapi = {
13
13
  features: {
14
14
  SSO: 'sso',
15
15
  AUDIT_LOGS: 'audit-logs',
16
+ REVIEW_WORKFLOWS: 'review-workflows',
16
17
  },
17
18
  projectType: 'Community',
18
19
  };
@@ -1,5 +1,5 @@
1
1
  import produce from 'immer';
2
- import { set } from 'lodash';
2
+ import set from 'lodash/set';
3
3
  /* eslint-disable consistent-return */
4
4
 
5
5
  const initialState = {
@@ -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 = ({ name, errors, values, onChange, canEditInputs, options, label }) => {
7
+ const TokenTypeSelect = ({ errors, values, onChange, canEditInputs, options, label }) => {
8
8
  const { formatMessage } = useIntl();
9
9
 
10
10
  return (
11
11
  <Select
12
- name={name}
12
+ name="type"
13
13
  label={formatMessage({
14
14
  id: label.id,
15
15
  defaultMessage: label.defaultMessage,
16
16
  })}
17
- value={values && values[name]}
17
+ value={values?.type}
18
18
  error={
19
- errors[name]
19
+ errors.type
20
20
  ? formatMessage(
21
- errors[name]?.id ? errors[name] : { id: errors[name], defaultMessage: errors[name] }
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
  };
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { capitalize } from 'lodash';
2
+ import capitalize from 'lodash/capitalize';
3
3
  import { useIntl } from 'react-intl';
4
4
  import {
5
5
  Accordion,
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable consistent-return */
2
2
  import produce from 'immer';
3
- import { pull } from 'lodash';
3
+ import pull from 'lodash/pull';
4
4
  import { transformPermissionsData } from './utils';
5
5
 
6
6
  export const initialState = {
@@ -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: flatten(
13
- Object.keys(data[apiId].controllers).map((controller) => ({
10
+ controllers: Object.keys(data[apiId].controllers)
11
+ .map((controller) => ({
14
12
  controller,
15
- actions: flatten(
16
- data[apiId].controllers[controller].map((action) => {
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,4 @@
1
- import { get } from 'lodash';
1
+ import get from 'lodash/get';
2
2
 
3
3
  const createConditionsForm = (conditions, valueObject) => {
4
4
  return conditions.reduce((acc, current) => {
@@ -1,4 +1,5 @@
1
- import { get, isEmpty } from 'lodash';
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,4 +1,5 @@
1
- import { get } from 'lodash';
1
+ import get from 'lodash/get';
2
+
2
3
  import { getCheckboxState } from '../../../../utils';
3
4
 
4
5
  /**
@@ -1,4 +1,4 @@
1
- import { get } from 'lodash';
1
+ import get from 'lodash/get';
2
2
  import { getCheckboxState, removeConditionKeyFromData } from '../../utils';
3
3
 
4
4
  const getActionsIds = (array) => array.map(({ actionId }) => actionId);
@@ -1,5 +1,10 @@
1
1
  import produce from 'immer';
2
- import { cloneDeep, has, isObject, get, set } from 'lodash';
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 { merge, get, isEmpty, set } from 'lodash';
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
- get(foundMatchingPermission, 'conditions', [])
14
+ foundMatchingPermission?.conditions ?? []
16
15
  ),
17
16
  };
18
17
 
@@ -1,4 +1,4 @@
1
- import { has, isObject } from 'lodash';
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 (!has(permissions, 'properties.enabled')) {
80
+ if (!permissions?.properties?.enabled) {
81
81
  const createdPermissionsArray = createPermissionWithProperties(
82
82
  actionName,
83
83
  subject,
@@ -1,4 +1,7 @@
1
- import { isObject, has, omit } from 'lodash';
1
+ import isObject from 'lodash/isObject';
2
+ import has from 'lodash/has';
3
+ import omit from 'lodash/omit';
4
+
2
5
  import { createArrayOfValues } from '../../utils';
3
6
 
4
7
  /**
@@ -1,4 +1,4 @@
1
- import { isObject } from 'lodash';
1
+ import isObject from 'lodash/isObject';
2
2
 
3
3
  /**
4
4
  * Sets all the none object values of an object to the given one
@@ -1,4 +1,4 @@
1
- import { get } from 'lodash';
1
+ import get from 'lodash/get';
2
2
  import { createArrayOfValues } from '../../../utils';
3
3
 
4
4
  /**
@@ -1,4 +1,5 @@
1
- import { flattenDeep, isObject } from 'lodash';
1
+ import flattenDeep from 'lodash/flattenDeep';
2
+ import isObject from 'lodash/isObject';
2
3
 
3
4
  const createArrayOfValues = (obj) => {
4
5
  if (!isObject(obj)) {
@@ -26,7 +26,7 @@ import {
26
26
  Typography,
27
27
  VisuallyHidden,
28
28
  } from '@strapi/design-system';
29
- import { get } from 'lodash';
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
- permissions,
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?.permissions,
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
- import { get } from 'lodash';
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 = get(state, '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
- const webhooks = { ...data };
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) => {
@@ -1,4 +1,4 @@
1
- import { merge } from 'lodash';
1
+ import merge from 'lodash/merge';
2
2
  import customPermissions from 'ee_else_ce/permissions/customPermissions';
3
3
  import defaultPermissions from './defaultPermissions';
4
4
 
@@ -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 = get(contentType, ['options', '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 = get(contentType, ['attributes'], {});
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
- get(current[1], 'contentTypeActions', {}),
24
+ current[1]?.contentTypeActions ?? {},
27
25
  ]),
28
26
  ];
29
27
  }, [])
@@ -1,4 +1,4 @@
1
- import { sortBy } from 'lodash';
1
+ import sortBy from 'lodash/sortBy';
2
2
 
3
3
  const sortLinks = (links) => sortBy(links, (object) => object.name);
4
4