@strapi/admin 4.12.0-beta.1 → 4.12.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +14 -38
  2. package/admin/src/content-manager/components/RelationInput/components/Option.js +6 -5
  3. package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +7 -7
  4. package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFields.js +23 -21
  5. package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +21 -23
  6. package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +24 -22
  7. package/admin/src/content-manager/pages/ListView/components/Body/index.js +191 -0
  8. package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/ConfirmBulkActionDialog/index.js +164 -0
  9. package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/SelectedEntriesModal/index.js +468 -0
  10. package/admin/src/content-manager/{components/DynamicTable/BulkActionsBar → pages/ListView/components/BulkActionButtons}/index.js +56 -132
  11. package/admin/src/content-manager/pages/ListView/components/CellContent/RelationMultiple/index.js +63 -69
  12. package/admin/src/content-manager/pages/ListView/components/CellContent/RepeatableComponent/index.js +28 -21
  13. package/admin/src/content-manager/pages/ListView/components/TableRows/index.js +7 -3
  14. package/admin/src/content-manager/pages/ListView/index.js +191 -132
  15. package/admin/src/layouts/UnauthenticatedLayout/LocaleToggle/index.js +7 -7
  16. package/admin/src/pages/AuthPage/components/Register/index.js +4 -0
  17. package/admin/src/translations/ca.json +4 -4
  18. package/admin/src/translations/de.json +4 -4
  19. package/admin/src/translations/dk.json +2 -2
  20. package/admin/src/translations/en.json +23 -4
  21. package/admin/src/translations/es.json +4 -4
  22. package/admin/src/translations/eu.json +4 -4
  23. package/admin/src/translations/fr.json +2 -2
  24. package/admin/src/translations/gu.json +4 -4
  25. package/admin/src/translations/hi.json +4 -4
  26. package/admin/src/translations/hu.json +4 -4
  27. package/admin/src/translations/ja.json +2 -2
  28. package/admin/src/translations/ko.json +2 -2
  29. package/admin/src/translations/ml.json +4 -4
  30. package/admin/src/translations/nl.json +4 -4
  31. package/admin/src/translations/pl.json +4 -4
  32. package/admin/src/translations/pt-BR.json +4 -4
  33. package/admin/src/translations/ru.json +4 -4
  34. package/admin/src/translations/sa.json +4 -4
  35. package/admin/src/translations/sk.json +4 -4
  36. package/admin/src/translations/sv.json +4 -4
  37. package/admin/src/translations/tr.json +4 -4
  38. package/admin/src/translations/zh-Hans.json +4 -4
  39. package/admin/src/translations/zh.json +4 -4
  40. package/build/2379.0ca87a89.chunk.js +1 -0
  41. package/build/2395.df7a044a.chunk.js +26 -0
  42. package/build/2801.b1140c9b.chunk.js +1 -0
  43. package/build/{3100.21c343fa.chunk.js → 3100.2ba4df95.chunk.js} +1 -1
  44. package/build/{3483.e182b190.chunk.js → 3483.e2ee2547.chunk.js} +1 -1
  45. package/build/{970.89601f27.chunk.js → 3739.63e352f1.chunk.js} +52 -20
  46. package/build/3984.dda474f7.chunk.js +1 -0
  47. package/build/502.8ae8ef60.chunk.js +1 -0
  48. package/build/5483.6dd2e776.chunk.js +6 -0
  49. package/build/6158.c974fd83.chunk.js +1 -0
  50. package/build/6691.f880a0b6.chunk.js +105 -0
  51. package/build/7065.99ca8ab1.chunk.js +112 -0
  52. package/build/7464.8a6c1e6c.chunk.js +1 -0
  53. package/build/8276.6c7b8e6e.chunk.js +26 -0
  54. package/build/{9932.b5a3bb3a.chunk.js → 9806.91360bb6.chunk.js} +47 -47
  55. package/build/{Admin-authenticatedApp.2ffa318a.chunk.js → Admin-authenticatedApp.24998de8.chunk.js} +2 -2
  56. package/build/Admin_settingsPage.8c600d1a.chunk.js +111 -0
  57. package/build/{admin-app.088bcd33.chunk.js → admin-app.c2e4e128.chunk.js} +9 -9
  58. package/build/{ca-json.1fed5d8b.chunk.js → ca-json.a53c10b6.chunk.js} +1 -1
  59. package/build/content-manager.8772445b.chunk.js +1103 -0
  60. package/build/{content-type-builder-translation-ar-json.56d8fcf4.chunk.js → content-type-builder-translation-ar-json.3e808e2f.chunk.js} +1 -1
  61. package/build/{content-type-builder-translation-cs-json.a5b299ca.chunk.js → content-type-builder-translation-cs-json.1ef9e106.chunk.js} +1 -1
  62. package/build/{content-type-builder-translation-de-json.393a76c0.chunk.js → content-type-builder-translation-de-json.63fcff7b.chunk.js} +1 -1
  63. package/build/{content-type-builder-translation-dk-json.fbd39bb7.chunk.js → content-type-builder-translation-dk-json.fd626b67.chunk.js} +1 -1
  64. package/build/{content-type-builder-translation-en-json.38e20391.chunk.js → content-type-builder-translation-en-json.ed29ff4d.chunk.js} +1 -1
  65. package/build/{content-type-builder-translation-es-json.9288474b.chunk.js → content-type-builder-translation-es-json.a4a361a9.chunk.js} +1 -1
  66. package/build/{content-type-builder-translation-fr-json.d35e269c.chunk.js → content-type-builder-translation-fr-json.499c3a46.chunk.js} +1 -1
  67. package/build/{content-type-builder-translation-id-json.f0513929.chunk.js → content-type-builder-translation-id-json.65255f93.chunk.js} +1 -1
  68. package/build/{content-type-builder-translation-it-json.aaf16753.chunk.js → content-type-builder-translation-it-json.e268ab74.chunk.js} +1 -1
  69. package/build/{content-type-builder-translation-ko-json.8fe21a7f.chunk.js → content-type-builder-translation-ko-json.04cb309d.chunk.js} +1 -1
  70. package/build/{content-type-builder-translation-ms-json.3b5d2d3e.chunk.js → content-type-builder-translation-ms-json.f6b743b9.chunk.js} +1 -1
  71. package/build/{content-type-builder-translation-nl-json.225ef5d3.chunk.js → content-type-builder-translation-nl-json.997fe8cc.chunk.js} +1 -1
  72. package/build/{content-type-builder-translation-pl-json.92f36be2.chunk.js → content-type-builder-translation-pl-json.634f638b.chunk.js} +1 -1
  73. package/build/{content-type-builder-translation-pt-BR-json.3bd10f89.chunk.js → content-type-builder-translation-pt-BR-json.6a95dc71.chunk.js} +1 -1
  74. package/build/{content-type-builder-translation-ru-json.9bfe47ce.chunk.js → content-type-builder-translation-ru-json.3af65503.chunk.js} +1 -1
  75. package/build/{content-type-builder-translation-sk-json.d03cc18a.chunk.js → content-type-builder-translation-sk-json.c6078082.chunk.js} +1 -1
  76. package/build/{content-type-builder-translation-sv-json.d23dcd32.chunk.js → content-type-builder-translation-sv-json.a6df2462.chunk.js} +1 -1
  77. package/build/{content-type-builder-translation-th-json.7ad256e2.chunk.js → content-type-builder-translation-th-json.122277cc.chunk.js} +1 -1
  78. package/build/{content-type-builder-translation-tr-json.926f6191.chunk.js → content-type-builder-translation-tr-json.41f44f77.chunk.js} +1 -1
  79. package/build/{content-type-builder-translation-uk-json.7bf19546.chunk.js → content-type-builder-translation-uk-json.e1315acd.chunk.js} +1 -1
  80. package/build/{content-type-builder-translation-zh-Hans-json.415577fb.chunk.js → content-type-builder-translation-zh-Hans-json.6ff57db6.chunk.js} +1 -1
  81. package/build/{content-type-builder-translation-zh-json.958d90e1.chunk.js → content-type-builder-translation-zh-json.3532b962.chunk.js} +1 -1
  82. package/build/{content-type-builder.3963fb2d.chunk.js → content-type-builder.40534de5.chunk.js} +21 -17
  83. package/build/{de-json.fcac7381.chunk.js → de-json.b3be02c7.chunk.js} +1 -1
  84. package/build/{dk-json.e34cad0d.chunk.js → dk-json.842aa391.chunk.js} +1 -1
  85. package/build/{en-json.fb9f6ddd.chunk.js → en-json.4c733bd1.chunk.js} +1 -1
  86. package/build/{es-json.42096084.chunk.js → es-json.f57b5335.chunk.js} +1 -1
  87. package/build/{eu-json.fb17c8f9.chunk.js → eu-json.633025f0.chunk.js} +1 -1
  88. package/build/{fr-json.69789980.chunk.js → fr-json.aa8839d2.chunk.js} +1 -1
  89. package/build/{gu-json.4d667d0c.chunk.js → gu-json.5bd62812.chunk.js} +1 -1
  90. package/build/{hi-json.323be97d.chunk.js → hi-json.9104eb78.chunk.js} +1 -1
  91. package/build/{hu-json.fe71e6c8.chunk.js → hu-json.9f4aae42.chunk.js} +1 -1
  92. package/build/index.html +1 -1
  93. package/build/{ja-json.81b6d1e3.chunk.js → ja-json.91286391.chunk.js} +1 -1
  94. package/build/{ko-json.4539f4ba.chunk.js → ko-json.fcf3ec4b.chunk.js} +1 -1
  95. package/build/main.ef5fb1a8.js +2856 -0
  96. package/build/{ml-json.8988e374.chunk.js → ml-json.557aa14c.chunk.js} +1 -1
  97. package/build/{nl-json.98345913.chunk.js → nl-json.b2b16eea.chunk.js} +1 -1
  98. package/build/{pl-json.59a5dab3.chunk.js → pl-json.f094a417.chunk.js} +1 -1
  99. package/build/{pt-BR-json.9410688b.chunk.js → pt-BR-json.dec7fb01.chunk.js} +1 -1
  100. package/build/review-workflows-settings-create-view.d4b5dbb8.chunk.js +1 -0
  101. package/build/review-workflows-settings-edit-view.77299c63.chunk.js +1 -0
  102. package/build/review-workflows-settings-list-view.3ee9190d.chunk.js +56 -0
  103. package/build/{ru-json.678cd48b.chunk.js → ru-json.8193d8c4.chunk.js} +1 -1
  104. package/build/{runtime~main.44bf2a37.js → runtime~main.c99f4c36.js} +2 -2
  105. package/build/{sa-json.6359a11c.chunk.js → sa-json.a56836f1.chunk.js} +1 -1
  106. package/build/{sk-json.2374f129.chunk.js → sk-json.bf2f057a.chunk.js} +1 -1
  107. package/build/sso-settings-page.3a1ed8c9.chunk.js +1 -0
  108. package/build/{sv-json.ae6e71ea.chunk.js → sv-json.fd0e86c6.chunk.js} +1 -1
  109. package/build/{tr-json.bac5dbd3.chunk.js → tr-json.56c32cf6.chunk.js} +1 -1
  110. package/build/upload.cbfeefa5.chunk.js +58 -0
  111. package/build/{zh-Hans-json.fada6f40.chunk.js → zh-Hans-json.36d81cdc.chunk.js} +1 -1
  112. package/build/{zh-json.3529f1e5.chunk.js → zh-json.1cc86ff0.chunk.js} +1 -1
  113. package/ee/admin/constants.js +3 -0
  114. package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +12 -4
  115. package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/constants.js +2 -2
  116. package/ee/admin/hooks/index.js +1 -1
  117. package/ee/admin/hooks/useLicenseLimitNotification/index.js +1 -1
  118. package/ee/admin/hooks/useLicenseLimits/__mocks__/index.js +8 -0
  119. package/ee/admin/hooks/useLicenseLimits/index.js +1 -3
  120. package/ee/admin/hooks/useLicenseLimits/useLicenseLimits.js +3 -13
  121. package/ee/admin/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/index.js +19 -4
  122. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +7 -0
  123. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stages.js +20 -16
  124. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/WorkflowAttributes/WorkflowAttributes.js +38 -23
  125. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/constants.js +3 -0
  126. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/CreateView/CreateView.js +62 -14
  127. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/CreateView/index.js +8 -3
  128. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/EditView/EditView.js +91 -33
  129. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/EditView/index.js +8 -3
  130. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/ListView/ListView.js +72 -55
  131. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/ListView/index.js +8 -3
  132. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/reducer/index.js +1 -7
  133. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/utils/{getWorkflowValidationSchema.js → validateWorkflow.js} +33 -2
  134. package/ee/admin/pages/SettingsPage/pages/SingleSignOn/utils/schema.js +8 -5
  135. package/ee/admin/pages/SettingsPage/pages/Users/ListPage/index.js +1 -1
  136. package/ee/server/constants/workflows.js +1 -0
  137. package/ee/server/services/review-workflows/review-workflows.js +1 -1
  138. package/ee/server/services/review-workflows/validation.js +12 -4
  139. package/ee/server/services/review-workflows/workflows/content-types.js +28 -19
  140. package/ee/server/services/review-workflows/workflows/index.js +14 -2
  141. package/ee/server/validation/authentication.js +14 -8
  142. package/ee/server/validation/review-workflows.js +6 -2
  143. package/package.json +9 -9
  144. package/build/190.66d89241.chunk.js +0 -117
  145. package/build/2379.d33a2e16.chunk.js +0 -1
  146. package/build/2395.b0419a54.chunk.js +0 -26
  147. package/build/2801.18ac397d.chunk.js +0 -1
  148. package/build/3984.ea7b8036.chunk.js +0 -1
  149. package/build/502.ccb38223.chunk.js +0 -1
  150. package/build/5483.ed2c7efa.chunk.js +0 -6
  151. package/build/6158.f9d82db9.chunk.js +0 -1
  152. package/build/6691.e6d5ac38.chunk.js +0 -105
  153. package/build/7464.c6d0565c.chunk.js +0 -1
  154. package/build/8276.23e0763b.chunk.js +0 -26
  155. package/build/Admin_settingsPage.3ad19487.chunk.js +0 -79
  156. package/build/content-manager.9b569036.chunk.js +0 -1094
  157. package/build/main.98c989b0.js +0 -2908
  158. package/build/review-workflows-settings-create-view.60bc516c.chunk.js +0 -1
  159. package/build/review-workflows-settings-edit-view.898ea409.chunk.js +0 -1
  160. package/build/review-workflows-settings-list-view.240cacdf.chunk.js +0 -56
  161. package/build/sso-settings-page.ed6f3f15.chunk.js +0 -1
  162. package/build/upload.8d01c525.chunk.js +0 -26
  163. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/ProtectedPage/ProtectedPage.js +0 -21
  164. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/ProtectedPage/index.js +0 -1
  165. /package/admin/src/content-manager/components/{DynamicTable → ListViewTable}/CellContent/PublicationState/PublicationState.js +0 -0
  166. /package/admin/src/content-manager/components/{DynamicTable → ListViewTable}/CellContent/PublicationState/index.js +0 -0
@@ -1,100 +1,22 @@
1
- import React, { useState } from 'react';
1
+ import * as React from 'react';
2
2
 
3
- import { Button, Dialog, DialogBody, DialogFooter, Flex, Typography } from '@strapi/design-system';
4
- import { useTracking } from '@strapi/helper-plugin';
5
- import { Check, ExclamationMarkCircle, Trash } from '@strapi/icons';
3
+ import { Button, Typography } from '@strapi/design-system';
4
+ import { useTracking, useTableContext } from '@strapi/helper-plugin';
5
+ import { Check, Trash } from '@strapi/icons';
6
6
  import PropTypes from 'prop-types';
7
7
  import { useIntl } from 'react-intl';
8
8
  import { useSelector } from 'react-redux';
9
9
 
10
- import { listViewDomain } from '../../../pages/ListView/selectors';
11
- import { getTrad } from '../../../utils';
12
- import InjectionZoneList from '../../InjectionZoneList';
10
+ import InjectionZoneList from '../../../../components/InjectionZoneList';
11
+ import { getTrad } from '../../../../utils';
12
+ import { listViewDomain } from '../../selectors';
13
13
 
14
- const ConfirmBulkActionDialog = ({ onToggleDialog, isOpen, dialogBody, endAction }) => {
15
- const { formatMessage } = useIntl();
16
-
17
- return (
18
- <Dialog
19
- onClose={onToggleDialog}
20
- title={formatMessage({
21
- id: 'app.components.ConfirmDialog.title',
22
- defaultMessage: 'Confirmation',
23
- })}
24
- labelledBy="confirmation"
25
- describedBy="confirm-description"
26
- isOpen={isOpen}
27
- >
28
- <DialogBody icon={<ExclamationMarkCircle />}>
29
- <Flex direction="column" alignItems="stretch" gap={2}>
30
- {dialogBody}
31
- </Flex>
32
- </DialogBody>
33
- <DialogFooter
34
- startAction={
35
- <Button onClick={onToggleDialog} variant="tertiary">
36
- {formatMessage({
37
- id: 'app.components.Button.cancel',
38
- defaultMessage: 'Cancel',
39
- })}
40
- </Button>
41
- }
42
- endAction={endAction}
43
- />
44
- </Dialog>
45
- );
46
- };
47
-
48
- ConfirmBulkActionDialog.propTypes = {
49
- isOpen: PropTypes.bool.isRequired,
50
- onToggleDialog: PropTypes.func.isRequired,
51
- dialogBody: PropTypes.node.isRequired,
52
- endAction: PropTypes.node.isRequired,
53
- };
54
-
55
- const confirmDialogsPropTypes = {
56
- isConfirmButtonLoading: PropTypes.bool.isRequired,
57
- isOpen: PropTypes.bool.isRequired,
58
- onConfirm: PropTypes.func.isRequired,
59
- onToggleDialog: PropTypes.func.isRequired,
60
- };
61
-
62
- const ConfirmDialogPublishAll = ({ isOpen, onToggleDialog, isConfirmButtonLoading, onConfirm }) => {
63
- const { formatMessage } = useIntl();
64
-
65
- return (
66
- <ConfirmBulkActionDialog
67
- isOpen={isOpen}
68
- onToggleDialog={onToggleDialog}
69
- dialogBody={
70
- <>
71
- <Typography id="confirm-description" textAlign="center">
72
- {formatMessage({
73
- id: getTrad('popUpWarning.bodyMessage.contentType.publish.all'),
74
- defaultMessage: 'Are you sure you want to publish these entries?',
75
- })}
76
- </Typography>
77
- <InjectionZoneList area="contentManager.listView.publishModalAdditionalInfos" />
78
- </>
79
- }
80
- endAction={
81
- <Button
82
- onClick={onConfirm}
83
- variant="secondary"
84
- startIcon={<Check />}
85
- loading={isConfirmButtonLoading}
86
- >
87
- {formatMessage({
88
- id: 'app.utils.publish',
89
- defaultMessage: 'Publish',
90
- })}
91
- </Button>
92
- }
93
- />
94
- );
95
- };
14
+ import { ConfirmBulkActionDialog, confirmDialogsPropTypes } from './ConfirmBulkActionDialog';
15
+ import SelectedEntriesModal from './SelectedEntriesModal';
96
16
 
97
- ConfirmDialogPublishAll.propTypes = confirmDialogsPropTypes;
17
+ /* -------------------------------------------------------------------------------------------------
18
+ * ConfirmDialogUnpublishAll
19
+ * -----------------------------------------------------------------------------------------------*/
98
20
 
99
21
  const ConfirmDialogUnpublishAll = ({
100
22
  isOpen,
@@ -138,6 +60,10 @@ const ConfirmDialogUnpublishAll = ({
138
60
 
139
61
  ConfirmDialogUnpublishAll.propTypes = confirmDialogsPropTypes;
140
62
 
63
+ /* -------------------------------------------------------------------------------------------------
64
+ * ConfirmDialogDeleteAll
65
+ * -----------------------------------------------------------------------------------------------*/
66
+
141
67
  const ConfirmDialogDeleteAll = ({ isOpen, onToggleDialog, isConfirmButtonLoading, onConfirm }) => {
142
68
  const { formatMessage } = useIntl();
143
69
 
@@ -176,21 +102,25 @@ const ConfirmDialogDeleteAll = ({ isOpen, onToggleDialog, isConfirmButtonLoading
176
102
 
177
103
  ConfirmDialogDeleteAll.propTypes = confirmDialogsPropTypes;
178
104
 
179
- const BulkActionsBar = ({
105
+ /* -------------------------------------------------------------------------------------------------
106
+ * BulkActionButtons
107
+ * -----------------------------------------------------------------------------------------------*/
108
+
109
+ const BulkActionButtons = ({
180
110
  showPublish,
181
111
  showDelete,
182
112
  onConfirmDeleteAll,
183
- onConfirmPublishAll,
184
113
  onConfirmUnpublishAll,
185
- selectedEntries,
186
- clearSelectedEntries,
114
+ refetchData,
187
115
  }) => {
188
116
  const { formatMessage } = useIntl();
189
117
  const { trackUsage } = useTracking();
190
118
  const { data } = useSelector(listViewDomain());
119
+ const { selectedEntries, setSelectedEntries } = useTableContext();
191
120
 
192
- const [isConfirmButtonLoading, setIsConfirmButtonLoading] = useState(false);
193
- const [dialogToOpen, setDialogToOpen] = useState(null);
121
+ const [isConfirmButtonLoading, setIsConfirmButtonLoading] = React.useState(false);
122
+ const [isSelectedEntriesModalOpen, setIsSelectedEntriesModalOpen] = React.useState(false);
123
+ const [dialogToOpen, setDialogToOpen] = React.useState(null);
194
124
 
195
125
  // Filters for Bulk actions
196
126
  const selectedEntriesObjects = data.filter((entry) => selectedEntries.includes(entry.id));
@@ -199,7 +129,7 @@ const BulkActionsBar = ({
199
129
  const unpublishButtonIsShown =
200
130
  showPublish && selectedEntriesObjects.some((entry) => entry.publishedAt);
201
131
 
202
- const toggleDeleteModal = () => {
132
+ const toggleDeleteDialog = () => {
203
133
  if (dialogToOpen === 'delete') {
204
134
  setDialogToOpen(null);
205
135
  } else {
@@ -208,16 +138,7 @@ const BulkActionsBar = ({
208
138
  }
209
139
  };
210
140
 
211
- const togglePublishModal = () => {
212
- if (dialogToOpen === 'publish') {
213
- setDialogToOpen(null);
214
- } else {
215
- setDialogToOpen('publish');
216
- trackUsage('willBulkPublishEntries');
217
- }
218
- };
219
-
220
- const toggleUnpublishModal = () => {
141
+ const toggleUnpublishDialog = () => {
221
142
  if (dialogToOpen === 'unpublish') {
222
143
  setDialogToOpen(null);
223
144
  } else {
@@ -226,46 +147,51 @@ const BulkActionsBar = ({
226
147
  }
227
148
  };
228
149
 
229
- const handleBulkAction = async (confirmAction, toggleModal) => {
150
+ const handleBulkAction = async (confirmAction, toggleDialog) => {
230
151
  try {
231
152
  setIsConfirmButtonLoading(true);
232
153
  await confirmAction(selectedEntries);
233
154
  setIsConfirmButtonLoading(false);
234
- toggleModal();
235
- clearSelectedEntries();
155
+ toggleDialog();
156
+ setSelectedEntries([]);
236
157
  } catch (error) {
237
158
  setIsConfirmButtonLoading(false);
238
- toggleModal();
159
+ toggleDialog();
239
160
  }
240
161
  };
241
162
 
242
- const handleBulkDelete = () => handleBulkAction(onConfirmDeleteAll, toggleDeleteModal);
243
- const handleBulkPublish = () => handleBulkAction(onConfirmPublishAll, togglePublishModal);
244
- const handleBulkUnpublish = () => handleBulkAction(onConfirmUnpublishAll, toggleUnpublishModal);
163
+ const handleBulkDelete = () => handleBulkAction(onConfirmDeleteAll, toggleDeleteDialog);
164
+ const handleBulkUnpublish = () => handleBulkAction(onConfirmUnpublishAll, toggleUnpublishDialog);
165
+ const handleToggleSelectedEntriesModal = () => {
166
+ setIsSelectedEntriesModalOpen((prev) => {
167
+ if (prev) {
168
+ refetchData();
169
+ }
170
+
171
+ return !prev;
172
+ });
173
+ };
245
174
 
246
175
  return (
247
176
  <>
248
177
  {publishButtonIsShown && (
249
178
  <>
250
- <Button variant="tertiary" onClick={togglePublishModal}>
179
+ <Button variant="tertiary" onClick={handleToggleSelectedEntriesModal}>
251
180
  {formatMessage({ id: 'app.utils.publish', defaultMessage: 'Publish' })}
252
181
  </Button>
253
- <ConfirmDialogPublishAll
254
- isOpen={dialogToOpen === 'publish'}
255
- onToggleDialog={togglePublishModal}
256
- isConfirmButtonLoading={isConfirmButtonLoading}
257
- onConfirm={handleBulkPublish}
258
- />
182
+ {isSelectedEntriesModalOpen && (
183
+ <SelectedEntriesModal onToggle={handleToggleSelectedEntriesModal} />
184
+ )}
259
185
  </>
260
186
  )}
261
187
  {unpublishButtonIsShown && (
262
188
  <>
263
- <Button variant="tertiary" onClick={toggleUnpublishModal}>
189
+ <Button variant="tertiary" onClick={toggleUnpublishDialog}>
264
190
  {formatMessage({ id: 'app.utils.unpublish', defaultMessage: 'Unpublish' })}
265
191
  </Button>
266
192
  <ConfirmDialogUnpublishAll
267
193
  isOpen={dialogToOpen === 'unpublish'}
268
- onToggleDialog={toggleUnpublishModal}
194
+ onToggleDialog={toggleUnpublishDialog}
269
195
  isConfirmButtonLoading={isConfirmButtonLoading}
270
196
  onConfirm={handleBulkUnpublish}
271
197
  />
@@ -273,12 +199,12 @@ const BulkActionsBar = ({
273
199
  )}
274
200
  {showDelete && (
275
201
  <>
276
- <Button variant="danger-light" onClick={toggleDeleteModal}>
202
+ <Button variant="danger-light" onClick={toggleDeleteDialog}>
277
203
  {formatMessage({ id: 'global.delete', defaultMessage: 'Delete' })}
278
204
  </Button>
279
205
  <ConfirmDialogDeleteAll
280
206
  isOpen={dialogToOpen === 'delete'}
281
- onToggleDialog={toggleDeleteModal}
207
+ onToggleDialog={toggleDeleteDialog}
282
208
  isConfirmButtonLoading={isConfirmButtonLoading}
283
209
  onConfirm={handleBulkDelete}
284
210
  />
@@ -288,22 +214,20 @@ const BulkActionsBar = ({
288
214
  );
289
215
  };
290
216
 
291
- BulkActionsBar.defaultProps = {
217
+ BulkActionButtons.defaultProps = {
292
218
  showPublish: false,
293
219
  showDelete: false,
294
220
  onConfirmDeleteAll() {},
295
- onConfirmPublishAll() {},
296
221
  onConfirmUnpublishAll() {},
222
+ refetchData() {},
297
223
  };
298
224
 
299
- BulkActionsBar.propTypes = {
225
+ BulkActionButtons.propTypes = {
300
226
  showPublish: PropTypes.bool,
301
227
  showDelete: PropTypes.bool,
302
228
  onConfirmDeleteAll: PropTypes.func,
303
- onConfirmPublishAll: PropTypes.func,
304
229
  onConfirmUnpublishAll: PropTypes.func,
305
- selectedEntries: PropTypes.array.isRequired,
306
- clearSelectedEntries: PropTypes.func.isRequired,
230
+ refetchData: PropTypes.func,
307
231
  };
308
232
 
309
- export default BulkActionsBar;
233
+ export default BulkActionButtons;
@@ -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,53 +39,71 @@ 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
- id: getTrad('DynamicTable.relation-loading'),
72
+ id: getTrad('ListViewTable.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
- id: getTrad('DynamicTable.relation-more'),
96
+ id: getTrad('ListViewTable.relation-more'),
117
97
  defaultMessage: 'This relation contains more entities than displayed',
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;
@@ -181,10 +181,10 @@ export const TableRows = ({
181
181
  if (hasReviewWorkflows && name === 'strapi_reviewWorkflows_stage') {
182
182
  return (
183
183
  <Td key={key}>
184
- {data.strapi_stage ? (
184
+ {data.strapi_reviewWorkflows_stage ? (
185
185
  <ReviewWorkflowsStage
186
- color={data.strapi_stage.color}
187
- name={data.strapi_stage.name}
186
+ color={data.strapi_reviewWorkflows_stage.color}
187
+ name={data.strapi_reviewWorkflows_stage.name}
188
188
  />
189
189
  ) : (
190
190
  <Typography textColor="neutral800">-</Typography>
@@ -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