@strapi/admin 4.11.5 → 4.11.6

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 (150) hide show
  1. package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +6 -6
  2. package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFields.js +23 -21
  3. package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +21 -23
  4. package/admin/src/content-manager/pages/EditView/Information/index.js +1 -1
  5. package/admin/src/content-manager/pages/EditView/InformationBox/InformationBoxCE.js +1 -2
  6. package/admin/src/content-manager/pages/EditView/InformationBox/index.js +1 -3
  7. package/admin/src/content-manager/pages/EditView/index.js +14 -2
  8. package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +24 -22
  9. package/admin/src/content-manager/pages/ListView/components/CellContent/RelationMultiple/index.js +61 -67
  10. package/admin/src/content-manager/pages/ListView/components/CellContent/RepeatableComponent/index.js +28 -21
  11. package/admin/src/content-manager/pages/ListView/components/TableRows/index.js +4 -0
  12. package/admin/src/layouts/UnauthenticatedLayout/LocaleToggle/index.js +7 -7
  13. package/admin/src/pages/AuthPage/components/Login/index.js +3 -5
  14. package/admin/src/pages/AuthPage/constants.js +3 -2
  15. package/admin/src/pages/AuthPage/index.js +18 -1
  16. package/admin/src/pages/HomePage/index.js +19 -7
  17. package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +17 -1
  18. package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +16 -3
  19. package/admin/src/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +2 -4
  20. package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +15 -1
  21. package/admin/src/pages/SettingsPage/pages/Users/ListPage/index.js +36 -5
  22. package/admin/src/pages/SettingsPage/pages/Users/components/MagicLink/index.js +3 -5
  23. package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +1 -3
  24. package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/index.js +16 -1
  25. package/build/1049.758a01f5.chunk.js +1 -0
  26. package/build/{3528.4845cf92.chunk.js → 1386.762d6eb8.chunk.js} +1 -1
  27. package/build/1727.b49f0713.chunk.js +1 -0
  28. package/build/{5563.27e2de0c.chunk.js → 2225.15d1df72.chunk.js} +2 -2
  29. package/build/2379.3ba39b61.chunk.js +1 -0
  30. package/build/2395.c27eb585.chunk.js +26 -0
  31. package/build/2801.93343c11.chunk.js +1 -0
  32. package/build/{7394.423886bd.chunk.js → 3100.21c343fa.chunk.js} +1 -1
  33. package/build/311.cb0884bb.chunk.js +1 -0
  34. package/build/3483.642d2321.chunk.js +1 -0
  35. package/build/{970.89601f27.chunk.js → 3739.63e352f1.chunk.js} +52 -20
  36. package/build/3984.298bdb66.chunk.js +1 -0
  37. package/build/4546.5aac90fe.chunk.js +1 -0
  38. package/build/502.f6b78f85.chunk.js +1 -0
  39. package/build/{5542.c62d0daf.chunk.js → 5542.2415a393.chunk.js} +6 -6
  40. package/build/6158.f9d82db9.chunk.js +1 -0
  41. package/build/7030.b98dcedf.chunk.js +1 -0
  42. package/build/7464.fe31804b.chunk.js +1 -0
  43. package/build/8276.d03dc679.chunk.js +26 -0
  44. package/build/918.54414509.chunk.js +1 -0
  45. package/build/978.bab58f0a.chunk.js +1 -0
  46. package/build/{9932.9f3790a5.chunk.js → 9932.b5a3bb3a.chunk.js} +2 -2
  47. package/build/{9944.29289a16.chunk.js → 9944.7af075a5.chunk.js} +1 -1
  48. package/build/{Admin-authenticatedApp.7f04c595.chunk.js → Admin-authenticatedApp.b3060bbe.chunk.js} +5 -5
  49. package/build/Admin_InternalErrorPage.f45f2462.chunk.js +1 -0
  50. package/build/{Admin_homePage.be30ef4e.chunk.js → Admin_homePage.ac9dfb86.chunk.js} +23 -15
  51. package/build/{Admin_marketplace.74a58e20.chunk.js → Admin_marketplace.f0b87fce.chunk.js} +1 -1
  52. package/build/{Admin_pluginsPage.ce464189.chunk.js → Admin_pluginsPage.8728ff6e.chunk.js} +1 -1
  53. package/build/{Admin_profilePage.0adb571e.chunk.js → Admin_profilePage.a968035f.chunk.js} +2 -2
  54. package/build/Admin_settingsPage.8c600d1a.chunk.js +111 -0
  55. package/build/Upload_ConfigureTheView.345ac1e0.chunk.js +1 -0
  56. package/build/admin-app.1c3f7fd6.chunk.js +36 -0
  57. package/build/{admin-edit-roles-page.3fdd6b9d.chunk.js → admin-edit-roles-page.a49b9f4f.chunk.js} +4 -4
  58. package/build/admin-edit-users.67704088.chunk.js +10 -0
  59. package/build/{admin-roles-list.e17b00d7.chunk.js → admin-roles-list.0c129e98.chunk.js} +1 -1
  60. package/build/admin-users.3279ffb0.chunk.js +11 -0
  61. package/build/api-tokens-create-page.46c2ea84.chunk.js +1 -0
  62. package/build/{api-tokens-edit-page.9a1dd2fa.chunk.js → api-tokens-edit-page.58139df9.chunk.js} +1 -1
  63. package/build/{api-tokens-list-page.a103f526.chunk.js → api-tokens-list-page.505bf7e0.chunk.js} +2 -2
  64. package/build/audit-logs-settings-page.4b422831.chunk.js +1 -0
  65. package/build/content-manager.9f7f0cb8.chunk.js +1101 -0
  66. package/build/{content-type-builder-list-view.82cfadc0.chunk.js → content-type-builder-list-view.bf9be456.chunk.js} +4 -4
  67. package/build/{content-type-builder-translation-ar-json.56d8fcf4.chunk.js → content-type-builder-translation-ar-json.3e808e2f.chunk.js} +1 -1
  68. package/build/{content-type-builder-translation-cs-json.a5b299ca.chunk.js → content-type-builder-translation-cs-json.1ef9e106.chunk.js} +1 -1
  69. package/build/{content-type-builder-translation-de-json.393a76c0.chunk.js → content-type-builder-translation-de-json.63fcff7b.chunk.js} +1 -1
  70. package/build/{content-type-builder-translation-dk-json.fbd39bb7.chunk.js → content-type-builder-translation-dk-json.fd626b67.chunk.js} +1 -1
  71. package/build/{content-type-builder-translation-en-json.f592325b.chunk.js → content-type-builder-translation-en-json.9f2b9c49.chunk.js} +1 -1
  72. package/build/{content-type-builder-translation-es-json.9288474b.chunk.js → content-type-builder-translation-es-json.a4a361a9.chunk.js} +1 -1
  73. package/build/{content-type-builder-translation-fr-json.d35e269c.chunk.js → content-type-builder-translation-fr-json.499c3a46.chunk.js} +1 -1
  74. package/build/{content-type-builder-translation-id-json.f0513929.chunk.js → content-type-builder-translation-id-json.65255f93.chunk.js} +1 -1
  75. package/build/{content-type-builder-translation-it-json.aaf16753.chunk.js → content-type-builder-translation-it-json.e268ab74.chunk.js} +1 -1
  76. package/build/{content-type-builder-translation-ko-json.8fe21a7f.chunk.js → content-type-builder-translation-ko-json.04cb309d.chunk.js} +1 -1
  77. package/build/{content-type-builder-translation-ms-json.3b5d2d3e.chunk.js → content-type-builder-translation-ms-json.f6b743b9.chunk.js} +1 -1
  78. package/build/{content-type-builder-translation-nl-json.225ef5d3.chunk.js → content-type-builder-translation-nl-json.997fe8cc.chunk.js} +1 -1
  79. package/build/{content-type-builder-translation-pl-json.92f36be2.chunk.js → content-type-builder-translation-pl-json.634f638b.chunk.js} +1 -1
  80. package/build/{content-type-builder-translation-pt-BR-json.3bd10f89.chunk.js → content-type-builder-translation-pt-BR-json.6a95dc71.chunk.js} +1 -1
  81. package/build/{content-type-builder-translation-ru-json.9bfe47ce.chunk.js → content-type-builder-translation-ru-json.3af65503.chunk.js} +1 -1
  82. package/build/{content-type-builder-translation-sk-json.d03cc18a.chunk.js → content-type-builder-translation-sk-json.c6078082.chunk.js} +1 -1
  83. package/build/{content-type-builder-translation-sv-json.d23dcd32.chunk.js → content-type-builder-translation-sv-json.a6df2462.chunk.js} +1 -1
  84. package/build/{content-type-builder-translation-th-json.7ad256e2.chunk.js → content-type-builder-translation-th-json.122277cc.chunk.js} +1 -1
  85. package/build/{content-type-builder-translation-tr-json.926f6191.chunk.js → content-type-builder-translation-tr-json.41f44f77.chunk.js} +1 -1
  86. package/build/{content-type-builder-translation-uk-json.7bf19546.chunk.js → content-type-builder-translation-uk-json.e1315acd.chunk.js} +1 -1
  87. package/build/{content-type-builder-translation-zh-Hans-json.415577fb.chunk.js → content-type-builder-translation-zh-Hans-json.6ff57db6.chunk.js} +1 -1
  88. package/build/{content-type-builder-translation-zh-json.ad24dbeb.chunk.js → content-type-builder-translation-zh-json.3532b962.chunk.js} +1 -1
  89. package/build/content-type-builder.7a90cece.chunk.js +170 -0
  90. package/build/{email-settings-page.45695daa.chunk.js → email-settings-page.d494d1eb.chunk.js} +2 -2
  91. package/build/{i18n-settings-page.29308d0b.chunk.js → i18n-settings-page.47f78016.chunk.js} +1 -1
  92. package/build/index.html +1 -1
  93. package/build/main.22e2d4ec.js +2856 -0
  94. package/build/review-workflows-settings.f1104fb9.chunk.js +110 -0
  95. package/build/runtime~main.437fdcbb.js +2 -0
  96. package/build/sso-settings-page.ed6f3f15.chunk.js +1 -0
  97. package/build/transfer-tokens-create-page.1597e6ab.chunk.js +1 -0
  98. package/build/transfer-tokens-edit-page.8741529f.chunk.js +1 -0
  99. package/build/{transfer-tokens-list-page.7237443d.chunk.js → transfer-tokens-list-page.22147d2c.chunk.js} +2 -2
  100. package/build/upload-settings.cac210a0.chunk.js +14 -0
  101. package/build/upload.cbfeefa5.chunk.js +58 -0
  102. package/build/{users-advanced-settings-page.750b1f76.chunk.js → users-advanced-settings-page.18379a56.chunk.js} +1 -1
  103. package/build/users-email-settings-page.a87978e5.chunk.js +9 -0
  104. package/build/users-providers-settings-page.8876c1ee.chunk.js +14 -0
  105. package/build/{users-roles-settings-page.d286426a.chunk.js → users-roles-settings-page.0431f48c.chunk.js} +2 -2
  106. package/build/webhook-edit-page.a91f27a1.chunk.js +33 -0
  107. package/build/{webhook-list-page.940a40f1.chunk.js → webhook-list-page.65e1b5bb.chunk.js} +1 -1
  108. package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +1 -1
  109. package/ee/admin/content-manager/pages/EditView/InformationBox/index.js +1 -3
  110. package/ee/admin/pages/AuthPage/components/Login/index.js +3 -5
  111. package/ee/admin/pages/HomePage/index.js +11 -0
  112. package/ee/admin/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/index.js +1 -3
  113. package/ee/admin/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +2 -4
  114. package/ee/admin/pages/SettingsPage/pages/Users/ListPage/index.js +13 -0
  115. package/ee/admin/pages/SettingsPage/pages/Users/components/MagicLink/index.js +3 -5
  116. package/ee/admin/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +1 -3
  117. package/index.js +0 -14
  118. package/package.json +10 -18
  119. package/webpack.alias.js +0 -3
  120. package/webpack.config.js +1 -75
  121. package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/index.js +0 -5
  122. package/build/1386.3b2aa6a7.chunk.js +0 -3
  123. package/build/1970.39a2d75e.chunk.js +0 -1
  124. package/build/2799.cf9b491f.chunk.js +0 -1
  125. package/build/3269.1ea0f5a6.chunk.js +0 -1
  126. package/build/539.865446c0.chunk.js +0 -1
  127. package/build/5932.f8be7e31.chunk.js +0 -1
  128. package/build/7018.98feed67.chunk.js +0 -1
  129. package/build/7259.0e25ab5d.chunk.js +0 -1
  130. package/build/Admin_InternalErrorPage.8911cb49.chunk.js +0 -1
  131. package/build/Admin_settingsPage.36152558.chunk.js +0 -79
  132. package/build/Upload_ConfigureTheView.7a1cb9c9.chunk.js +0 -1
  133. package/build/admin-app.3ea6009c.chunk.js +0 -61
  134. package/build/admin-edit-users.78552758.chunk.js +0 -10
  135. package/build/admin-users.c23322fc.chunk.js +0 -11
  136. package/build/api-tokens-create-page.3dd4e921.chunk.js +0 -1
  137. package/build/audit-logs-settings-page.37fe915c.chunk.js +0 -1
  138. package/build/content-manager.552c7418.chunk.js +0 -1094
  139. package/build/content-type-builder.238687f9.chunk.js +0 -166
  140. package/build/main.3d752c03.js +0 -2927
  141. package/build/review-workflows-settings.93808ae0.chunk.js +0 -110
  142. package/build/runtime~main.87232977.js +0 -2
  143. package/build/sso-settings-page.0cdb96a6.chunk.js +0 -1
  144. package/build/transfer-tokens-create-page.de14cad4.chunk.js +0 -1
  145. package/build/transfer-tokens-edit-page.4f5e39af.chunk.js +0 -1
  146. package/build/upload-settings.cb6c14c3.chunk.js +0 -14
  147. package/build/upload.7e629643.chunk.js +0 -26
  148. package/build/users-email-settings-page.e9bcd865.chunk.js +0 -9
  149. package/build/users-providers-settings-page.a94253e9.chunk.js +0 -14
  150. package/build/webhook-edit-page.77ef4f1a.chunk.js +0 -33
@@ -159,7 +159,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
159
159
  trackUsageRef.current('willDeleteEntry', trackerProperty);
160
160
 
161
161
  const { data } = await del(getRequestUrl(slug), {
162
- params: query,
162
+ params,
163
163
  });
164
164
 
165
165
  toggleNotification({
@@ -181,7 +181,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
181
181
  return Promise.reject(err);
182
182
  }
183
183
  },
184
- [del, slug, displayErrors, toggleNotification, query, dispatch, rawQuery]
184
+ [del, slug, params, toggleNotification, dispatch, rawQuery, displayErrors]
185
185
  );
186
186
 
187
187
  const onPost = useCallback(
@@ -265,7 +265,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
265
265
  endPoint,
266
266
  {},
267
267
  {
268
- params: query,
268
+ params,
269
269
  }
270
270
  );
271
271
 
@@ -287,7 +287,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
287
287
 
288
288
  return Promise.reject(err);
289
289
  }
290
- }, [post, cleanReceivedData, displayErrors, slug, query, dispatch, toggleNotification]);
290
+ }, [slug, dispatch, post, params, toggleNotification, cleanReceivedData, displayErrors]);
291
291
 
292
292
  const onPut = useCallback(
293
293
  async (body, trackerProperty) => {
@@ -341,7 +341,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
341
341
  endPoint,
342
342
  {},
343
343
  {
344
- params: query,
344
+ params,
345
345
  }
346
346
  );
347
347
 
@@ -358,7 +358,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
358
358
  dispatch(setStatus('resolved'));
359
359
  displayErrors(err);
360
360
  }
361
- }, [post, cleanReceivedData, toggleNotification, displayErrors, slug, dispatch, query]);
361
+ }, [slug, dispatch, post, params, toggleNotification, cleanReceivedData, displayErrors]);
362
362
 
363
363
  return children({
364
364
  componentsDataStructure,
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
- import { Box, Button, Flex, MenuItem, SimpleMenu, Typography } from '@strapi/design-system';
3
+ import { Box, Flex, Typography } from '@strapi/design-system';
4
+ import { Menu } from '@strapi/design-system/v2';
4
5
  import { Plus } from '@strapi/icons';
5
6
  import PropTypes from 'prop-types';
6
7
  import { useIntl } from 'react-intl';
@@ -41,26 +42,27 @@ const DisplayedFields = ({ editLayout, fields, onRemoveField, onAddField }) => {
41
42
  {editLayout.map((row, index) => (
42
43
  <RowsLayout key={row.rowId} row={row} rowIndex={index} onRemoveField={onRemoveField} />
43
44
  ))}
44
- <SimpleMenu
45
- id="label"
46
- label={formatMessage({
47
- id: getTrad('containers.SettingPage.add.field'),
48
- defaultMessage: 'Insert another field',
49
- })}
50
- as={Button}
51
- data-testid="add-field"
52
- fullWidth
53
- startIcon={<Plus />}
54
- endIcon={null}
55
- variant="secondary"
56
- disabled={fields.length === 0}
57
- >
58
- {fields.map((field) => (
59
- <MenuItem key={field} onClick={() => onAddField(field)}>
60
- {field}
61
- </MenuItem>
62
- ))}
63
- </SimpleMenu>
45
+ <Menu.Root>
46
+ <Menu.Trigger
47
+ startIcon={<Plus />}
48
+ endIcon={null}
49
+ disabled={fields.length === 0}
50
+ fullWidth
51
+ variant="secondary"
52
+ >
53
+ {formatMessage({
54
+ id: getTrad('containers.SettingPage.add.field'),
55
+ defaultMessage: 'Insert another field',
56
+ })}
57
+ </Menu.Trigger>
58
+ <Menu.Content>
59
+ {fields.map((field) => (
60
+ <Menu.Item key={field} onSelect={() => onAddField(field)}>
61
+ {field}
62
+ </Menu.Item>
63
+ ))}
64
+ </Menu.Content>
65
+ </Menu.Root>
64
66
  </Flex>
65
67
  </Box>
66
68
  </Flex>
@@ -105,32 +105,30 @@ const ModalForm = ({ onMetaChange, onSizeChange }) => {
105
105
  const { type, customField } = attributes[selectedField];
106
106
  const { isResizable } = fieldSizes[customField] ?? fieldSizes[type];
107
107
 
108
- const sizeField = (
109
- <GridItem col={6} key="size">
110
- <Select
111
- value={fieldForm?.size}
112
- name="size"
113
- onChange={(value) => {
114
- onSizeChange({ name: selectedField, value });
115
- }}
116
- label={formatMessage({
117
- id: getTrad('containers.SettingPage.editSettings.size.label'),
118
- defaultMessage: 'Size',
119
- })}
120
- >
121
- {FIELD_SIZES.map(([value, label]) => (
122
- <Option key={value} value={value}>
123
- {label}
124
- </Option>
125
- ))}
126
- </Select>
127
- </GridItem>
128
- );
129
-
130
108
  return (
131
109
  <>
132
110
  {metaFields}
133
- {isResizable && sizeField}
111
+ {isResizable && (
112
+ <GridItem col={6} key="size">
113
+ <Select
114
+ value={fieldForm?.size}
115
+ name="size"
116
+ onChange={(value) => {
117
+ onSizeChange({ name: selectedField, value });
118
+ }}
119
+ label={formatMessage({
120
+ id: getTrad('containers.SettingPage.editSettings.size.label'),
121
+ defaultMessage: 'Size',
122
+ })}
123
+ >
124
+ {FIELD_SIZES.map(([value, label]) => (
125
+ <Option key={value} value={value}>
126
+ {label}
127
+ </Option>
128
+ ))}
129
+ </Select>
130
+ </GridItem>
131
+ )}
134
132
  </>
135
133
  );
136
134
  };
@@ -124,7 +124,7 @@ Root.propTypes = {
124
124
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
125
125
  };
126
126
 
127
- export default {
127
+ export const Information = {
128
128
  Root,
129
129
  Title,
130
130
  Body,
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
- import Information from '../Information';
3
+ import { Information } from '../Information';
4
4
 
5
- // This component is overwritten by the EE counterpart
6
5
  export function InformationBoxCE() {
7
6
  return (
8
7
  <Information.Root>
@@ -1,3 +1 @@
1
- import { InformationBoxCE } from './InformationBoxCE';
2
-
3
- export default InformationBoxCE;
1
+ export * from './InformationBoxCE';
@@ -9,12 +9,12 @@ import {
9
9
  useTracking,
10
10
  } from '@strapi/helper-plugin';
11
11
  import { Layer, Pencil } from '@strapi/icons';
12
- import InformationBox from 'ee_else_ce/content-manager/pages/EditView/InformationBox';
13
12
  import PropTypes from 'prop-types';
14
13
  import { useIntl } from 'react-intl';
15
14
  import { useSelector } from 'react-redux';
16
15
  import { useLocation } from 'react-router-dom';
17
16
 
17
+ import { useEnterprise } from '../../../hooks/useEnterprise';
18
18
  import { selectAdminPermissions } from '../../../pages/App/selectors';
19
19
  import { InjectionZone } from '../../../shared/components';
20
20
  import CollectionTypeFormWrapper from '../../components/CollectionTypeFormWrapper';
@@ -29,6 +29,7 @@ import DraftAndPublishBadge from './DraftAndPublishBadge';
29
29
  import GridRow from './GridRow';
30
30
  import Header from './Header';
31
31
  import { useOnce } from './hooks/useOnce';
32
+ import { InformationBoxCE } from './InformationBox';
32
33
  import { selectCurrentLayout, selectAttributesLayout, selectCustomFieldUids } from './selectors';
33
34
  import { getFieldsActionMatchingPermissions } from './utils';
34
35
 
@@ -42,6 +43,12 @@ const EditView = ({ allowedActions, isSingleType, goBack, slug, id, origin, user
42
43
  const permissions = useSelector(selectAdminPermissions);
43
44
  const location = useLocation();
44
45
  const toggleNotification = useNotification();
46
+ const Information = useEnterprise(
47
+ InformationBoxCE,
48
+ async () =>
49
+ (await import('../../../../../ee/admin/content-manager/pages/EditView/InformationBox'))
50
+ .InformationBoxEE
51
+ );
45
52
 
46
53
  useOnce(() => {
47
54
  /**
@@ -91,6 +98,11 @@ const EditView = ({ allowedActions, isSingleType, goBack, slug, id, origin, user
91
98
  return <LoadingIndicatorPage />;
92
99
  }
93
100
 
101
+ // wait until the EE component is fully loaded before rendering, to prevent flickering
102
+ if (!Information) {
103
+ return null;
104
+ }
105
+
94
106
  return (
95
107
  <DataManagementWrapper allLayoutData={layout} slug={slug} id={id} origin={origin}>
96
108
  {({
@@ -202,7 +214,7 @@ const EditView = ({ allowedActions, isSingleType, goBack, slug, id, origin, user
202
214
  paddingTop={6}
203
215
  shadow="tableShadow"
204
216
  >
205
- <InformationBox />
217
+ <Information />
206
218
  <InjectionZone area="contentManager.editView.informations" />
207
219
  </Box>
208
220
  <Box as="aside" aria-labelledby="links">
@@ -1,6 +1,7 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
2
 
3
- import { Box, Flex, IconButton, MenuItem, SimpleMenu, Typography } from '@strapi/design-system';
3
+ import { Box, Flex, VisuallyHidden, Typography } from '@strapi/design-system';
4
+ import { Menu } from '@strapi/design-system/v2';
4
5
  import { Plus } from '@strapi/icons';
5
6
  import { PropTypes } from 'prop-types';
6
7
  import { useIntl } from 'react-intl';
@@ -10,19 +11,12 @@ import { getTrad } from '../../../utils';
10
11
 
11
12
  import DraggableCard from './DraggableCard';
12
13
 
13
- const FlexWrapper = styled(Box)`
14
+ const ScrollableContainer = styled(Box)`
14
15
  flex: ${({ size }) => size};
15
- `;
16
-
17
- const ScrollableContainer = styled(FlexWrapper)`
18
16
  overflow-x: scroll;
19
17
  overflow-y: hidden;
20
18
  `;
21
19
 
22
- const SelectContainer = styled(FlexWrapper)`
23
- max-width: ${32 / 16}rem;
24
- `;
25
-
26
20
  const SortDisplayedFields = ({
27
21
  displayedFields,
28
22
  listRemainingFields,
@@ -89,24 +83,32 @@ const SortDisplayedFields = ({
89
83
  ))}
90
84
  </Flex>
91
85
  </ScrollableContainer>
92
- <SelectContainer size="auto" paddingBottom={4}>
93
- <SimpleMenu
94
- label={formatMessage({
95
- id: getTrad('components.FieldSelect.label'),
96
- defaultMessage: 'Add a field',
97
- })}
98
- as={IconButton}
99
- icon={<Plus />}
86
+ <Menu.Root>
87
+ <Menu.Trigger
88
+ paddingLeft={2}
89
+ paddingRight={2}
90
+ justifyContent="center"
91
+ endIcon={null}
100
92
  disabled={listRemainingFields.length <= 0}
101
- data-testid="add-field"
93
+ marginBottom={4}
94
+ variant="tertiary"
102
95
  >
96
+ <VisuallyHidden as="span">
97
+ {formatMessage({
98
+ id: getTrad('components.FieldSelect.label'),
99
+ defaultMessage: 'Add a field',
100
+ })}
101
+ </VisuallyHidden>
102
+ <Plus aria-hidden focusable={false} style={{ position: 'relative', top: 2 }} />
103
+ </Menu.Trigger>
104
+ <Menu.Content>
103
105
  {listRemainingFields.map((field) => (
104
- <MenuItem key={field} onClick={() => handleAddField(field)}>
106
+ <Menu.Item key={field} onSelect={() => handleAddField(field)}>
105
107
  {metadatas[field].list.label || field}
106
- </MenuItem>
108
+ </Menu.Item>
107
109
  ))}
108
- </SimpleMenu>
109
- </SelectContainer>
110
+ </Menu.Content>
111
+ </Menu.Root>
110
112
  </Flex>
111
113
  </>
112
114
  );
@@ -1,16 +1,8 @@
1
- import React, { useMemo, useState } from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
 
3
- import {
4
- Badge,
5
- Box,
6
- Flex,
7
- Loader,
8
- MenuItem,
9
- SimpleMenu,
10
- Typography,
11
- useNotifyAT,
12
- } from '@strapi/design-system';
13
- import { stopPropagation, useFetchClient } from '@strapi/helper-plugin';
3
+ import { Badge, Flex, Loader, Typography, useNotifyAT } from '@strapi/design-system';
4
+ import { Menu } from '@strapi/design-system/v2';
5
+ import { useFetchClient } from '@strapi/helper-plugin';
14
6
  import PropTypes from 'prop-types';
15
7
  import { useIntl } from 'react-intl';
16
8
  import { useQuery } from 'react-query';
@@ -19,54 +11,24 @@ import styled from 'styled-components';
19
11
  import { getRequestUrl, getTrad } from '../../../../../utils';
20
12
  import CellValue from '../CellValue';
21
13
 
22
- const TypographyMaxWidth = styled(Typography)`
23
- max-width: 500px;
24
- `;
25
-
26
- const fetchRelation = async (endPoint, notifyStatus, get) => {
27
- const {
28
- data: { results, pagination },
29
- } = await get(endPoint);
30
-
31
- notifyStatus();
32
-
33
- return { results, pagination };
34
- };
35
-
36
14
  const RelationMultiple = ({ fieldSchema, metadatas, name, entityId, value, contentType }) => {
37
15
  const { formatMessage } = useIntl();
38
16
  const { notifyStatus } = useNotifyAT();
39
- const relationFetchEndpoint = useMemo(
40
- () => getRequestUrl(`relations/${contentType.uid}/${entityId}/${name.split('.')[0]}`),
41
- [entityId, name, contentType]
42
- );
43
17
  const [isOpen, setIsOpen] = useState(false);
44
- const { get } = useFetchClient();
45
-
46
- const Label = (
47
- <Flex gap={1} wrap="nowrap">
48
- <Badge>{value.count}</Badge>
49
- {formatMessage(
50
- {
51
- id: 'content-manager.containers.ListPage.items',
52
- defaultMessage: '{number, plural, =0 {items} one {item} other {items}}',
53
- },
54
- { number: value.count }
55
- )}
56
- </Flex>
57
- );
58
18
 
59
- const notify = () => {
60
- const message = formatMessage({
61
- id: getTrad('DynamicTable.relation-loaded'),
62
- defaultMessage: 'Relations have been loaded',
63
- });
64
- notifyStatus(message);
65
- };
19
+ const { get } = useFetchClient();
66
20
 
67
21
  const { data, status } = useQuery(
68
22
  [fieldSchema.targetModel, entityId],
69
- () => fetchRelation(relationFetchEndpoint, notify, get),
23
+ async () => {
24
+ const {
25
+ data: { results, pagination },
26
+ } = await get(
27
+ getRequestUrl(`relations/${contentType.uid}/${entityId}/${name.split('.')[0]}`)
28
+ );
29
+
30
+ return { results, pagination };
31
+ },
70
32
  {
71
33
  enabled: isOpen,
72
34
  staleTime: 0,
@@ -77,40 +39,58 @@ const RelationMultiple = ({ fieldSchema, metadatas, name, entityId, value, conte
77
39
  }
78
40
  );
79
41
 
42
+ useEffect(() => {
43
+ if (data) {
44
+ notifyStatus(
45
+ formatMessage({
46
+ id: getTrad('DynamicTable.relation-loaded'),
47
+ defaultMessage: 'Relations have been loaded',
48
+ })
49
+ );
50
+ }
51
+ }, [data, formatMessage, notifyStatus]);
52
+
80
53
  return (
81
- <Box {...stopPropagation}>
82
- <SimpleMenu
83
- label={Label}
84
- size="S"
85
- onOpen={() => setIsOpen(true)}
86
- onClose={() => setIsOpen(false)}
87
- >
54
+ <Menu.Root onOpenChange={(isOpen) => setIsOpen(isOpen)}>
55
+ <MenuTrigger onClick={(e) => e.stopPropagation()}>
56
+ <Flex gap={1} wrap="nowrap">
57
+ <Badge>{value.count}</Badge>
58
+ {formatMessage(
59
+ {
60
+ id: 'content-manager.containers.ListPage.items',
61
+ defaultMessage: '{number, plural, =0 {items} one {item} other {items}}',
62
+ },
63
+ { number: value.count }
64
+ )}
65
+ </Flex>
66
+ </MenuTrigger>
67
+ <Menu.Content>
88
68
  {status !== 'success' && (
89
- <MenuItem aria-disabled>
69
+ <Menu.Item disabled>
90
70
  <Loader small>
91
71
  {formatMessage({
92
72
  id: getTrad('DynamicTable.relation-loading'),
93
73
  defaultMessage: 'Relations are loading',
94
74
  })}
95
75
  </Loader>
96
- </MenuItem>
76
+ </Menu.Item>
97
77
  )}
98
78
 
99
79
  {status === 'success' && (
100
80
  <>
101
81
  {data?.results.map((entry) => (
102
- <MenuItem key={entry.id} aria-disabled>
82
+ <Menu.Item key={entry.id} disabled>
103
83
  <TypographyMaxWidth ellipsis>
104
84
  <CellValue
105
85
  type={metadatas.mainField.schema.type}
106
86
  value={entry[metadatas.mainField.name] || entry.id}
107
87
  />
108
88
  </TypographyMaxWidth>
109
- </MenuItem>
89
+ </Menu.Item>
110
90
  ))}
111
91
 
112
92
  {data?.pagination.total > 10 && (
113
- <MenuItem
93
+ <Menu.Item
114
94
  aria-disabled
115
95
  aria-label={formatMessage({
116
96
  id: getTrad('DynamicTable.relation-more'),
@@ -118,12 +98,12 @@ const RelationMultiple = ({ fieldSchema, metadatas, name, entityId, value, conte
118
98
  })}
119
99
  >
120
100
  <Typography>…</Typography>
121
- </MenuItem>
101
+ </Menu.Item>
122
102
  )}
123
103
  </>
124
104
  )}
125
- </SimpleMenu>
126
- </Box>
105
+ </Menu.Content>
106
+ </Menu.Root>
127
107
  );
128
108
  };
129
109
 
@@ -147,4 +127,18 @@ RelationMultiple.propTypes = {
147
127
  value: PropTypes.object.isRequired,
148
128
  };
149
129
 
130
+ const TypographyMaxWidth = styled(Typography)`
131
+ max-width: 500px;
132
+ `;
133
+
134
+ /**
135
+ * TODO: this needs to be solved in the Design-System
136
+ */
137
+ const MenuTrigger = styled(Menu.Trigger)`
138
+ svg {
139
+ width: ${6 / 16}rem;
140
+ height: ${4 / 16}rem;
141
+ }
142
+ `;
143
+
150
144
  export default RelationMultiple;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
- import { Badge, Box, MenuItem, SimpleMenu, Typography } from '@strapi/design-system';
4
- import { stopPropagation } from '@strapi/helper-plugin';
3
+ import { Badge, Typography } from '@strapi/design-system';
4
+ import { Menu } from '@strapi/design-system/v2';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useIntl } from 'react-intl';
7
7
  import styled from 'styled-components';
@@ -18,31 +18,28 @@ const RepeatableComponentCell = ({ value, metadatas }) => {
18
18
  mainField: { type: mainFieldType, name: mainFieldName },
19
19
  } = metadatas;
20
20
 
21
- const Label = (
22
- <>
23
- <Badge>{value.length}</Badge>{' '}
24
- {formatMessage(
25
- {
26
- id: 'content-manager.containers.ListPage.items',
27
- defaultMessage: '{number, plural, =0 {items} one {item} other {items}}',
28
- },
29
- { number: value.length }
30
- )}
31
- </>
32
- );
33
-
34
21
  return (
35
- <Box {...stopPropagation}>
36
- <SimpleMenu label={Label} size="S">
22
+ <Menu.Root>
23
+ <MenuTrigger onClick={(e) => e.stopPropagation()}>
24
+ <Badge>{value.length}</Badge>{' '}
25
+ {formatMessage(
26
+ {
27
+ id: 'content-manager.containers.ListPage.items',
28
+ defaultMessage: '{number, plural, =0 {items} one {item} other {items}}',
29
+ },
30
+ { number: value.length }
31
+ )}
32
+ </MenuTrigger>
33
+ <Menu.Content>
37
34
  {value.map((item) => (
38
- <MenuItem key={item.id} aria-disabled>
35
+ <Menu.Item key={item.id} disabled>
39
36
  <TypographyMaxWidth ellipsis>
40
37
  <CellValue type={mainFieldType} value={item[mainFieldName] || item.id} />
41
38
  </TypographyMaxWidth>
42
- </MenuItem>
39
+ </Menu.Item>
43
40
  ))}
44
- </SimpleMenu>
45
- </Box>
41
+ </Menu.Content>
42
+ </Menu.Root>
46
43
  );
47
44
  };
48
45
 
@@ -57,4 +54,14 @@ RepeatableComponentCell.propTypes = {
57
54
  value: PropTypes.array.isRequired,
58
55
  };
59
56
 
57
+ /**
58
+ * TODO: this needs to be solved in the Design-System
59
+ */
60
+ const MenuTrigger = styled(Menu.Trigger)`
61
+ svg {
62
+ width: ${6 / 16}rem;
63
+ height: ${4 / 16}rem;
64
+ }
65
+ `;
66
+
60
67
  export default RepeatableComponentCell;
@@ -193,6 +193,10 @@ export const TableRows = ({
193
193
  );
194
194
  }
195
195
 
196
+ if (typeof cellFormatter === 'function') {
197
+ return <Td key={key}>{cellFormatter(data, { key, name, ...rest })}</Td>;
198
+ }
199
+
196
200
  return (
197
201
  <Td key={key}>
198
202
  <CellContent
@@ -6,7 +6,7 @@
6
6
 
7
7
  import React from 'react';
8
8
 
9
- import { MenuItem, SimpleMenu } from '@strapi/design-system';
9
+ import { SingleSelect, SingleSelectOption } from '@strapi/design-system';
10
10
  import { useIntl } from 'react-intl';
11
11
 
12
12
  import useLocalesProvider from '../../../components/LocalesProvider/useLocalesProvider';
@@ -16,13 +16,13 @@ const LocaleToggle = () => {
16
16
  const { locale } = useIntl();
17
17
 
18
18
  return (
19
- <SimpleMenu label={localeNames[locale]}>
20
- {Object.keys(localeNames).map((lang) => (
21
- <MenuItem onClick={() => changeLocale(lang)} key={lang}>
22
- {localeNames[lang]}
23
- </MenuItem>
19
+ <SingleSelect value={locale} onChange={(language) => changeLocale(language)}>
20
+ {Object.entries(localeNames).map(([language, name]) => (
21
+ <SingleSelectOption key={language} value={language}>
22
+ {name}
23
+ </SingleSelectOption>
24
24
  ))}
25
- </SimpleMenu>
25
+ </SingleSelect>
26
26
  );
27
27
  };
28
28
 
@@ -6,7 +6,7 @@ import UnauthenticatedLayout from '../../../../layouts/UnauthenticatedLayout';
6
6
 
7
7
  import BaseLogin from './BaseLogin';
8
8
 
9
- const Login = (loginProps) => {
9
+ export const LoginCE = (loginProps) => {
10
10
  return (
11
11
  <UnauthenticatedLayout>
12
12
  <BaseLogin {...loginProps} />
@@ -14,12 +14,10 @@ const Login = (loginProps) => {
14
14
  );
15
15
  };
16
16
 
17
- Login.defaultProps = {
17
+ LoginCE.defaultProps = {
18
18
  onSubmit: (e) => e.preventDefault(),
19
19
  };
20
20
 
21
- Login.propTypes = {
21
+ LoginCE.propTypes = {
22
22
  onSubmit: PropTypes.func,
23
23
  };
24
-
25
- export default Login;
@@ -1,5 +1,4 @@
1
1
  import { translatedErrors } from '@strapi/helper-plugin';
2
- import Login from 'ee_else_ce/pages/AuthPage/components/Login';
3
2
  import * as yup from 'yup';
4
3
 
5
4
  import ForgotPassword from './components/ForgotPassword';
@@ -27,8 +26,10 @@ export const FORMS = {
27
26
  schema: null,
28
27
  inputsPrefix: '',
29
28
  },
29
+
30
+ // the `Component` attribute is set after all forms and CE/EE components are loaded, but since we
31
+ // are here outside of a React component we can not use the hook directly
30
32
  login: {
31
- Component: Login,
32
33
  endPoint: 'login',
33
34
  fieldsToDisable: [],
34
35
  fieldsToOmit: ['rememberMe'],