@strapi/admin 4.11.0-exp.push-transfer-push-stuck → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/components/Providers/index.js +32 -32
- package/admin/src/components/Theme/index.js +5 -3
- package/admin/src/content-manager/components/ComponentIcon/ComponentIcon.js +16 -26
- package/admin/src/content-manager/components/ComponentIcon/constants.js +133 -0
- package/admin/src/content-manager/components/DynamicTable/BulkActionsBar/index.js +307 -0
- package/admin/src/content-manager/components/DynamicTable/index.js +20 -4
- package/admin/src/content-manager/components/DynamicZone/components/AddComponentButton.js +32 -95
- package/admin/src/content-manager/components/DynamicZone/components/ComponentCard.js +10 -2
- package/admin/src/content-manager/components/DynamicZone/components/ComponentCategory.js +63 -15
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker.js +50 -63
- package/admin/src/content-manager/components/DynamicZone/components/DynamicComponent.js +132 -58
- package/admin/src/content-manager/components/DynamicZone/components/DynamicZoneLabel.js +29 -37
- package/admin/src/content-manager/components/DynamicZone/index.js +131 -83
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +31 -8
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +18 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/index.js +0 -1
- package/admin/src/content-manager/components/Inputs/index.js +18 -11
- package/admin/src/content-manager/components/Inputs/utils/index.js +0 -1
- package/admin/src/content-manager/pages/EditSettingsView/components/DynamicZoneList.js +7 -1
- package/admin/src/content-manager/pages/EditView/index.js +1 -1
- package/admin/src/content-manager/pages/ListView/index.js +118 -2
- package/admin/src/content-manager/utils/index.js +2 -0
- package/admin/src/content-manager/{components/EditViewDataManagerProvider/utils → utils}/schema.js +1 -1
- package/admin/src/hooks/useContentTypes/useContentTypes.js +0 -2
- package/admin/src/index.js +4 -3
- package/admin/src/injectionZones.js +6 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/EventTableCE.js +13 -0
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +3 -0
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/Events/index.js +331 -0
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/HeadersInput/Combobox.js +54 -4
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/HeadersInput/index.js +12 -23
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/index.js +129 -116
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/utils/makeWebhookValidationSchema.js +62 -0
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/index.js +59 -64
- package/admin/src/translations/ar.json +684 -1
- package/admin/src/translations/en.json +12 -1
- package/build/3562.e0b1a0b3.chunk.js +50 -0
- package/build/371.6e4e2c1f.chunk.js +71 -0
- package/build/5297.31c9ffdc.chunk.js +39 -0
- package/build/5542.64b623c9.chunk.js +63 -0
- package/build/{5563.79950369.chunk.js → 5563.badbffde.chunk.js} +2 -2
- package/build/6691.f7a3b5ac.chunk.js +105 -0
- package/build/6970.d456705f.chunk.js +1 -0
- package/build/{7259.5cc67413.chunk.js → 7259.5d0de931.chunk.js} +1 -1
- package/build/8976.0022f5a3.chunk.js +50 -0
- package/build/{1657.ca8562dd.chunk.js → 9932.5ef475c5.chunk.js} +54 -62
- package/build/Admin-authenticatedApp.ab2b5910.chunk.js +79 -0
- package/build/{Admin_InternalErrorPage.96ceaae1.chunk.js → Admin_InternalErrorPage.f25f04f3.chunk.js} +1 -1
- package/build/Admin_homePage.05063e43.chunk.js +73 -0
- package/build/Admin_marketplace.005d2d5b.chunk.js +55 -0
- package/build/Admin_pluginsPage.5d9d4060.chunk.js +6 -0
- package/build/{Admin_profilePage.a8fa3a56.chunk.js → Admin_profilePage.ab7b94d7.chunk.js} +2 -2
- package/build/Admin_settingsPage.07a6a5f0.chunk.js +79 -0
- package/build/{Upload_ConfigureTheView.aa64ed9a.chunk.js → Upload_ConfigureTheView.121deffb.chunk.js} +1 -1
- package/build/admin-app.7cc667be.chunk.js +63 -0
- package/build/{admin-edit-roles-page.0d12b741.chunk.js → admin-edit-roles-page.bfe3304d.chunk.js} +3 -3
- package/build/{admin-edit-users.f9ce7844.chunk.js → admin-edit-users.6efe0382.chunk.js} +2 -2
- package/build/admin-roles-list.b2577370.chunk.js +23 -0
- package/build/admin-users.4af49ccf.chunk.js +26 -0
- package/build/{api-tokens-create-page.973d2816.chunk.js → api-tokens-create-page.65411a36.chunk.js} +1 -1
- package/build/{api-tokens-edit-page.29725c5e.chunk.js → api-tokens-edit-page.60312cb6.chunk.js} +1 -1
- package/build/{api-tokens-list-page.66c4fbdd.chunk.js → api-tokens-list-page.01a4d5cd.chunk.js} +2 -2
- package/build/ar-json.f530bc3f.chunk.js +1 -0
- package/build/audit-logs-settings-page.b165679b.chunk.js +16 -0
- package/build/content-manager.8cc6c3f9.chunk.js +1094 -0
- package/build/content-type-builder-list-view.58f9ed20.chunk.js +211 -0
- package/build/{content-type-builder-translation-en-json.af293c9e.chunk.js → content-type-builder-translation-en-json.f592325b.chunk.js} +1 -1
- package/build/content-type-builder.baeb0413.chunk.js +132 -0
- package/build/email-settings-page.8caad83f.chunk.js +11 -0
- package/build/en-json.a8f34002.chunk.js +1 -0
- package/build/i18n-settings-page.579d5eab.chunk.js +9 -0
- package/build/i18n-translation-en-json.1ec7becf.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.1d678f7b.js +2926 -0
- package/build/{review-workflows-settings.56cab253.chunk.js → review-workflows-settings.3a7bae25.chunk.js} +2 -2
- package/build/{runtime~main.adbe36a4.js → runtime~main.9dbd4553.js} +2 -2
- package/build/{sso-settings-page.265e3d72.chunk.js → sso-settings-page.4bb073e0.chunk.js} +1 -1
- package/build/{transfer-tokens-create-page.170acee6.chunk.js → transfer-tokens-create-page.9ec277d7.chunk.js} +1 -1
- package/build/{transfer-tokens-edit-page.6cf23295.chunk.js → transfer-tokens-edit-page.fa5ade14.chunk.js} +1 -1
- package/build/{transfer-tokens-list-page.c3fec4c1.chunk.js → transfer-tokens-list-page.5d68d590.chunk.js} +2 -2
- package/build/upload-settings.2c1565d6.chunk.js +14 -0
- package/build/upload.257b2aef.chunk.js +26 -0
- package/build/users-advanced-settings-page.ddd29040.chunk.js +9 -0
- package/build/users-email-settings-page.717e2a51.chunk.js +24 -0
- package/build/users-providers-settings-page.c7eae829.chunk.js +29 -0
- package/build/{users-roles-settings-page.2549794b.chunk.js → users-roles-settings-page.63cf2838.chunk.js} +1 -1
- package/build/webhook-edit-page.8576742e.chunk.js +31 -0
- package/build/webhook-list-page.abf5747c.chunk.js +63 -0
- package/ee/admin/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/EventTableEE.js +23 -0
- package/ee/admin/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +3 -0
- package/ee/server/services/review-workflows/review-workflows.js +4 -0
- package/package.json +22 -24
- package/server/controllers/webhooks.js +6 -6
- package/admin/src/content-manager/components/DynamicTable/ConfirmDialogDeleteAll/index.js +0 -73
- package/admin/src/content-manager/components/DynamicZone/utils/connect.js +0 -12
- package/admin/src/content-manager/components/DynamicZone/utils/select.js +0 -53
- package/admin/src/content-manager/components/Inputs/utils/getStep.js +0 -13
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/EventRow.js +0 -70
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +0 -174
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/HeadersInput/keys.js +0 -39
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/utils/fieldsRegex.js +0 -4
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/utils/schema.js +0 -35
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/reducer.js +0 -100
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/utils/formatData.js +0 -20
- package/build/3081.c2cdfac8.chunk.js +0 -108
- package/build/3816.60f858cf.chunk.js +0 -211
- package/build/462.a073ff1f.chunk.js +0 -71
- package/build/5542.002522eb.chunk.js +0 -71
- package/build/617.87b2fe96.chunk.js +0 -155
- package/build/6858.85d76858.chunk.js +0 -50
- package/build/6970.6a329e15.chunk.js +0 -1
- package/build/Admin-authenticatedApp.d425b485.chunk.js +0 -79
- package/build/Admin_homePage.107a9fe0.chunk.js +0 -73
- package/build/Admin_marketplace.717bd7ca.chunk.js +0 -55
- package/build/Admin_pluginsPage.7df6b5a9.chunk.js +0 -6
- package/build/Admin_settingsPage.1394aaf2.chunk.js +0 -79
- package/build/admin-app.ac5b1f59.chunk.js +0 -63
- package/build/admin-roles-list.e8bf9685.chunk.js +0 -31
- package/build/admin-users.751b28b2.chunk.js +0 -34
- package/build/ar-json.39e54aba.chunk.js +0 -1
- package/build/audit-logs-settings-page.3c6cea81.chunk.js +0 -129
- package/build/content-manager.70548048.chunk.js +0 -1123
- package/build/content-type-builder-list-view.1e821eb9.chunk.js +0 -215
- package/build/content-type-builder.b10576e7.chunk.js +0 -126
- package/build/email-settings-page.dba83275.chunk.js +0 -11
- package/build/en-json.d965e364.chunk.js +0 -1
- package/build/i18n-settings-page.55628f74.chunk.js +0 -114
- package/build/i18n-translation-en-json.60af6722.chunk.js +0 -1
- package/build/main.d9d9ed10.js +0 -2630
- package/build/upload-settings.63d99bf5.chunk.js +0 -14
- package/build/upload.c50d8c7a.chunk.js +0 -34
- package/build/users-advanced-settings-page.4f49ca57.chunk.js +0 -9
- package/build/users-email-settings-page.d2429d0a.chunk.js +0 -24
- package/build/users-providers-settings-page.50c5ba27.chunk.js +0 -29
- package/build/webhook-edit-page.ddd5963d.chunk.js +0 -128
- package/build/webhook-list-page.e2fca9f8.chunk.js +0 -71
|
@@ -48,29 +48,29 @@ const Providers = ({
|
|
|
48
48
|
themes,
|
|
49
49
|
}) => {
|
|
50
50
|
return (
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<StrapiAppProvider
|
|
63
|
-
getPlugin={getPlugin}
|
|
64
|
-
menu={menu}
|
|
65
|
-
plugins={plugins}
|
|
66
|
-
runHookParallel={runHookParallel}
|
|
67
|
-
runHookWaterfall={runHookWaterfall}
|
|
68
|
-
runHookSeries={runHookSeries}
|
|
69
|
-
settings={settings}
|
|
51
|
+
<LanguageProvider messages={messages} localeNames={localeNames}>
|
|
52
|
+
<ThemeToggleProvider themes={themes}>
|
|
53
|
+
<Theme>
|
|
54
|
+
<QueryClientProvider client={queryClient}>
|
|
55
|
+
<Provider store={store}>
|
|
56
|
+
<AdminContext.Provider value={{ getAdminInjectedComponents }}>
|
|
57
|
+
<ConfigurationsProvider
|
|
58
|
+
authLogo={authLogo}
|
|
59
|
+
menuLogo={menuLogo}
|
|
60
|
+
showReleaseNotification={showReleaseNotification}
|
|
61
|
+
showTutorials={showTutorials}
|
|
70
62
|
>
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
<StrapiAppProvider
|
|
64
|
+
getPlugin={getPlugin}
|
|
65
|
+
menu={menu}
|
|
66
|
+
plugins={plugins}
|
|
67
|
+
runHookParallel={runHookParallel}
|
|
68
|
+
runHookWaterfall={runHookWaterfall}
|
|
69
|
+
runHookSeries={runHookSeries}
|
|
70
|
+
settings={settings}
|
|
71
|
+
>
|
|
72
|
+
<LibraryProvider components={components} fields={fields}>
|
|
73
|
+
<CustomFieldsProvider customFields={customFields}>
|
|
74
74
|
<AutoReloadOverlayBlockerProvider>
|
|
75
75
|
<OverlayBlockerProvider>
|
|
76
76
|
<GuidedTour>
|
|
@@ -78,16 +78,16 @@ const Providers = ({
|
|
|
78
78
|
</GuidedTour>
|
|
79
79
|
</OverlayBlockerProvider>
|
|
80
80
|
</AutoReloadOverlayBlockerProvider>
|
|
81
|
-
</
|
|
82
|
-
</
|
|
83
|
-
</
|
|
84
|
-
</
|
|
85
|
-
</
|
|
86
|
-
</
|
|
87
|
-
</
|
|
88
|
-
</
|
|
89
|
-
</
|
|
90
|
-
</
|
|
81
|
+
</CustomFieldsProvider>
|
|
82
|
+
</LibraryProvider>
|
|
83
|
+
</StrapiAppProvider>
|
|
84
|
+
</ConfigurationsProvider>
|
|
85
|
+
</AdminContext.Provider>
|
|
86
|
+
</Provider>
|
|
87
|
+
</QueryClientProvider>
|
|
88
|
+
</Theme>
|
|
89
|
+
</ThemeToggleProvider>
|
|
90
|
+
</LanguageProvider>
|
|
91
91
|
);
|
|
92
92
|
};
|
|
93
93
|
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DesignSystemProvider } from '@strapi/design-system';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
4
5
|
import { useThemeToggle } from '../../hooks';
|
|
5
6
|
import GlobalStyle from '../GlobalStyle';
|
|
6
7
|
|
|
7
8
|
const Theme = ({ children }) => {
|
|
8
9
|
const { currentTheme, themes } = useThemeToggle();
|
|
10
|
+
const { locale } = useIntl();
|
|
9
11
|
|
|
10
12
|
return (
|
|
11
|
-
<
|
|
13
|
+
<DesignSystemProvider locale={locale} theme={themes[currentTheme] || themes.light}>
|
|
12
14
|
{children}
|
|
13
15
|
<GlobalStyle />
|
|
14
|
-
</
|
|
16
|
+
</DesignSystemProvider>
|
|
15
17
|
);
|
|
16
18
|
};
|
|
17
19
|
|
|
@@ -1,49 +1,39 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
|
|
5
|
-
import { Flex } from '@strapi/design-system';
|
|
4
|
+
import { Flex, Icon } from '@strapi/design-system';
|
|
5
|
+
import { COMPONENT_ICONS } from './constants';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
const WIDTH_M = 8;
|
|
9
|
-
|
|
10
|
-
const Wrapper = styled(Flex)`
|
|
11
|
-
border-radius: ${({ showBackground }) => (showBackground ? `50%` : 0)};
|
|
12
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
13
|
-
height: ${({ theme, size }) => theme.spaces[size === 'S' ? WIDTH_S : WIDTH_M]};
|
|
14
|
-
width: ${({ theme, size }) => theme.spaces[size === 'S' ? WIDTH_S : WIDTH_M]};
|
|
15
|
-
|
|
16
|
-
svg {
|
|
17
|
-
height: ${({ theme, size }) => theme.spaces[size === 'S' ? WIDTH_S - 2 : WIDTH_M - 3]};
|
|
18
|
-
width: ${({ theme, size }) => theme.spaces[size === 'S' ? WIDTH_S - 2 : WIDTH_M - 3]};
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
export function ComponentIcon({ showBackground = true, size = 'M' }) {
|
|
7
|
+
export function ComponentIcon({ showBackground = true, size = 'M', icon }) {
|
|
23
8
|
return (
|
|
24
|
-
<
|
|
9
|
+
<Flex
|
|
25
10
|
alignItems="center"
|
|
26
11
|
background={showBackground ? 'neutral200' : null}
|
|
27
12
|
justifyContent="center"
|
|
28
13
|
size={size}
|
|
29
14
|
showBackground={showBackground}
|
|
15
|
+
height={size === 'S' ? 5 : 8}
|
|
16
|
+
width={size === 'S' ? 5 : 8}
|
|
17
|
+
color="neutral600"
|
|
18
|
+
borderRadius={showBackground ? '50%' : 0}
|
|
30
19
|
>
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</Wrapper>
|
|
20
|
+
<Icon
|
|
21
|
+
as={COMPONENT_ICONS[icon] || COMPONENT_ICONS.cube}
|
|
22
|
+
height={size === 'S' ? 3 : 5}
|
|
23
|
+
width={size === 'S' ? 3 : 5}
|
|
24
|
+
/>
|
|
25
|
+
</Flex>
|
|
38
26
|
);
|
|
39
27
|
}
|
|
40
28
|
|
|
41
29
|
ComponentIcon.defaultProps = {
|
|
42
30
|
showBackground: true,
|
|
43
31
|
size: 'M',
|
|
32
|
+
icon: 'Cube',
|
|
44
33
|
};
|
|
45
34
|
|
|
46
35
|
ComponentIcon.propTypes = {
|
|
47
36
|
showBackground: PropTypes.bool,
|
|
48
37
|
size: PropTypes.string,
|
|
38
|
+
icon: PropTypes.string,
|
|
49
39
|
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as Icons from '@strapi/icons';
|
|
2
|
+
|
|
3
|
+
const COMPONENT_ICONS = {
|
|
4
|
+
alien: Icons.Alien,
|
|
5
|
+
apps: Icons.Apps,
|
|
6
|
+
archive: Icons.Archive,
|
|
7
|
+
arrowDown: Icons.ArrowDown,
|
|
8
|
+
arrowLeft: Icons.ArrowLeft,
|
|
9
|
+
arrowRight: Icons.ArrowRight,
|
|
10
|
+
arrowUp: Icons.ArrowUp,
|
|
11
|
+
attachment: Icons.Attachment,
|
|
12
|
+
bell: Icons.Bell,
|
|
13
|
+
bold: Icons.Bold,
|
|
14
|
+
book: Icons.Book,
|
|
15
|
+
briefcase: Icons.Briefcase,
|
|
16
|
+
brush: Icons.Brush,
|
|
17
|
+
bulletList: Icons.BulletList,
|
|
18
|
+
calendar: Icons.Calendar,
|
|
19
|
+
car: Icons.Car,
|
|
20
|
+
cast: Icons.Cast,
|
|
21
|
+
chartBubble: Icons.ChartBubble,
|
|
22
|
+
chartCircle: Icons.ChartCircle,
|
|
23
|
+
chartPie: Icons.ChartPie,
|
|
24
|
+
check: Icons.Check,
|
|
25
|
+
clock: Icons.Clock,
|
|
26
|
+
cloud: Icons.Cloud,
|
|
27
|
+
code: Icons.Code,
|
|
28
|
+
cog: Icons.Cog,
|
|
29
|
+
collapse: Icons.Collapse,
|
|
30
|
+
command: Icons.Command,
|
|
31
|
+
connector: Icons.Connector,
|
|
32
|
+
crop: Icons.Crop,
|
|
33
|
+
crown: Icons.Crown,
|
|
34
|
+
cube: Icons.Cube,
|
|
35
|
+
cup: Icons.Cup,
|
|
36
|
+
cursor: Icons.Cursor,
|
|
37
|
+
dashboard: Icons.Dashboard,
|
|
38
|
+
database: Icons.Database,
|
|
39
|
+
discuss: Icons.Discuss,
|
|
40
|
+
doctor: Icons.Doctor,
|
|
41
|
+
earth: Icons.Earth,
|
|
42
|
+
emotionHappy: Icons.EmotionHappy,
|
|
43
|
+
emotionUnhappy: Icons.EmotionUnhappy,
|
|
44
|
+
envelop: Icons.Envelop,
|
|
45
|
+
exit: Icons.Exit,
|
|
46
|
+
expand: Icons.Expand,
|
|
47
|
+
eye: Icons.Eye,
|
|
48
|
+
feather: Icons.Feather,
|
|
49
|
+
file: Icons.File,
|
|
50
|
+
fileError: Icons.FileError,
|
|
51
|
+
filePdf: Icons.FilePdf,
|
|
52
|
+
filter: Icons.Filter,
|
|
53
|
+
folder: Icons.Folder,
|
|
54
|
+
gate: Icons.Gate,
|
|
55
|
+
gift: Icons.Gift,
|
|
56
|
+
globe: Icons.Globe,
|
|
57
|
+
grid: Icons.Grid,
|
|
58
|
+
handHeart: Icons.HandHeart,
|
|
59
|
+
hashtag: Icons.Hashtag,
|
|
60
|
+
headphone: Icons.Headphone,
|
|
61
|
+
heart: Icons.Heart,
|
|
62
|
+
house: Icons.House,
|
|
63
|
+
information: Icons.Information,
|
|
64
|
+
italic: Icons.Italic,
|
|
65
|
+
key: Icons.Key,
|
|
66
|
+
landscape: Icons.Landscape,
|
|
67
|
+
layer: Icons.Layer,
|
|
68
|
+
layout: Icons.Layout,
|
|
69
|
+
lightbulb: Icons.Lightbulb,
|
|
70
|
+
link: Icons.Link,
|
|
71
|
+
lock: Icons.Lock,
|
|
72
|
+
magic: Icons.Magic,
|
|
73
|
+
manyToMany: Icons.ManyToMany,
|
|
74
|
+
manyToOne: Icons.ManyToOne,
|
|
75
|
+
manyWays: Icons.ManyWays,
|
|
76
|
+
medium: Icons.Medium,
|
|
77
|
+
message: Icons.Message,
|
|
78
|
+
microphone: Icons.Microphone,
|
|
79
|
+
monitor: Icons.Monitor,
|
|
80
|
+
moon: Icons.Moon,
|
|
81
|
+
music: Icons.Music,
|
|
82
|
+
oneToMany: Icons.OneToMany,
|
|
83
|
+
oneToOne: Icons.OneToOne,
|
|
84
|
+
oneWay: Icons.OneWay,
|
|
85
|
+
paint: Icons.Paint,
|
|
86
|
+
paintBrush: Icons.PaintBrush,
|
|
87
|
+
paperPlane: Icons.PaperPlane,
|
|
88
|
+
pencil: Icons.Pencil,
|
|
89
|
+
phone: Icons.Phone,
|
|
90
|
+
picture: Icons.Picture,
|
|
91
|
+
pin: Icons.Pin,
|
|
92
|
+
pinMap: Icons.PinMap,
|
|
93
|
+
plane: Icons.Plane,
|
|
94
|
+
play: Icons.Play,
|
|
95
|
+
plus: Icons.Plus,
|
|
96
|
+
priceTag: Icons.PriceTag,
|
|
97
|
+
puzzle: Icons.Puzzle,
|
|
98
|
+
question: Icons.Question,
|
|
99
|
+
quote: Icons.Quote,
|
|
100
|
+
refresh: Icons.Refresh,
|
|
101
|
+
repeat: Icons.Repeat,
|
|
102
|
+
restaurant: Icons.Restaurant,
|
|
103
|
+
rocket: Icons.Rocket,
|
|
104
|
+
rotate: Icons.Rotate,
|
|
105
|
+
scissors: Icons.Scissors,
|
|
106
|
+
search: Icons.Search,
|
|
107
|
+
seed: Icons.Seed,
|
|
108
|
+
server: Icons.Server,
|
|
109
|
+
shield: Icons.Shield,
|
|
110
|
+
shirt: Icons.Shirt,
|
|
111
|
+
shoppingCart: Icons.ShoppingCart,
|
|
112
|
+
slideshow: Icons.Slideshow,
|
|
113
|
+
stack: Icons.Stack,
|
|
114
|
+
star: Icons.Star,
|
|
115
|
+
store: Icons.Store,
|
|
116
|
+
strikeThrough: Icons.StrikeThrough,
|
|
117
|
+
sun: Icons.Sun,
|
|
118
|
+
television: Icons.Television,
|
|
119
|
+
thumbDown: Icons.ThumbDown,
|
|
120
|
+
thumbUp: Icons.ThumbUp,
|
|
121
|
+
train: Icons.Train,
|
|
122
|
+
twitter: Icons.Twitter,
|
|
123
|
+
typhoon: Icons.Typhoon,
|
|
124
|
+
underline: Icons.Underline,
|
|
125
|
+
user: Icons.User,
|
|
126
|
+
volumeMute: Icons.VolumeMute,
|
|
127
|
+
volumeUp: Icons.VolumeUp,
|
|
128
|
+
walk: Icons.Walk,
|
|
129
|
+
wheelchair: Icons.Wheelchair,
|
|
130
|
+
write: Icons.Write,
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export { COMPONENT_ICONS };
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Button, Dialog, DialogBody, DialogFooter, Flex, Typography } from '@strapi/design-system';
|
|
4
|
+
import { Check, ExclamationMarkCircle, Trash } from '@strapi/icons';
|
|
5
|
+
import { useIntl } from 'react-intl';
|
|
6
|
+
import { useSelector } from 'react-redux';
|
|
7
|
+
import { useTracking } from '@strapi/helper-plugin';
|
|
8
|
+
import { getTrad } from '../../../utils';
|
|
9
|
+
import InjectionZoneList from '../../InjectionZoneList';
|
|
10
|
+
import { listViewDomain } from '../../../pages/ListView/selectors';
|
|
11
|
+
|
|
12
|
+
const ConfirmBulkActionDialog = ({ onToggleDialog, isOpen, dialogBody, endAction }) => {
|
|
13
|
+
const { formatMessage } = useIntl();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Dialog
|
|
17
|
+
onClose={onToggleDialog}
|
|
18
|
+
title={formatMessage({
|
|
19
|
+
id: 'app.components.ConfirmDialog.title',
|
|
20
|
+
defaultMessage: 'Confirmation',
|
|
21
|
+
})}
|
|
22
|
+
labelledBy="confirmation"
|
|
23
|
+
describedBy="confirm-description"
|
|
24
|
+
isOpen={isOpen}
|
|
25
|
+
>
|
|
26
|
+
<DialogBody icon={<ExclamationMarkCircle />}>
|
|
27
|
+
<Flex direction="column" alignItems="stretch" gap={2}>
|
|
28
|
+
{dialogBody}
|
|
29
|
+
</Flex>
|
|
30
|
+
</DialogBody>
|
|
31
|
+
<DialogFooter
|
|
32
|
+
startAction={
|
|
33
|
+
<Button onClick={onToggleDialog} variant="tertiary">
|
|
34
|
+
{formatMessage({
|
|
35
|
+
id: 'app.components.Button.cancel',
|
|
36
|
+
defaultMessage: 'Cancel',
|
|
37
|
+
})}
|
|
38
|
+
</Button>
|
|
39
|
+
}
|
|
40
|
+
endAction={endAction}
|
|
41
|
+
/>
|
|
42
|
+
</Dialog>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
ConfirmBulkActionDialog.propTypes = {
|
|
47
|
+
isOpen: PropTypes.bool.isRequired,
|
|
48
|
+
onToggleDialog: PropTypes.func.isRequired,
|
|
49
|
+
dialogBody: PropTypes.node.isRequired,
|
|
50
|
+
endAction: PropTypes.node.isRequired,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const confirmDialogsPropTypes = {
|
|
54
|
+
isConfirmButtonLoading: PropTypes.bool.isRequired,
|
|
55
|
+
isOpen: PropTypes.bool.isRequired,
|
|
56
|
+
onConfirm: PropTypes.func.isRequired,
|
|
57
|
+
onToggleDialog: PropTypes.func.isRequired,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const ConfirmDialogPublishAll = ({ isOpen, onToggleDialog, isConfirmButtonLoading, onConfirm }) => {
|
|
61
|
+
const { formatMessage } = useIntl();
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<ConfirmBulkActionDialog
|
|
65
|
+
isOpen={isOpen}
|
|
66
|
+
onToggleDialog={onToggleDialog}
|
|
67
|
+
dialogBody={
|
|
68
|
+
<>
|
|
69
|
+
<Typography id="confirm-description" textAlign="center">
|
|
70
|
+
{formatMessage({
|
|
71
|
+
id: getTrad('popUpWarning.bodyMessage.contentType.publish.all'),
|
|
72
|
+
defaultMessage: 'Are you sure you want to publish these entries?',
|
|
73
|
+
})}
|
|
74
|
+
</Typography>
|
|
75
|
+
<InjectionZoneList area="contentManager.listView.publishModalAdditionalInfos" />
|
|
76
|
+
</>
|
|
77
|
+
}
|
|
78
|
+
endAction={
|
|
79
|
+
<Button
|
|
80
|
+
onClick={onConfirm}
|
|
81
|
+
variant="secondary"
|
|
82
|
+
startIcon={<Check />}
|
|
83
|
+
loading={isConfirmButtonLoading}
|
|
84
|
+
>
|
|
85
|
+
{formatMessage({
|
|
86
|
+
id: 'app.utils.publish',
|
|
87
|
+
defaultMessage: 'Publish',
|
|
88
|
+
})}
|
|
89
|
+
</Button>
|
|
90
|
+
}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
ConfirmDialogPublishAll.propTypes = confirmDialogsPropTypes;
|
|
96
|
+
|
|
97
|
+
const ConfirmDialogUnpublishAll = ({
|
|
98
|
+
isOpen,
|
|
99
|
+
onToggleDialog,
|
|
100
|
+
isConfirmButtonLoading,
|
|
101
|
+
onConfirm,
|
|
102
|
+
}) => {
|
|
103
|
+
const { formatMessage } = useIntl();
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<ConfirmBulkActionDialog
|
|
107
|
+
isOpen={isOpen}
|
|
108
|
+
onToggleDialog={onToggleDialog}
|
|
109
|
+
dialogBody={
|
|
110
|
+
<>
|
|
111
|
+
<Typography id="confirm-description" textAlign="center">
|
|
112
|
+
{formatMessage({
|
|
113
|
+
id: getTrad('popUpWarning.bodyMessage.contentType.unpublish.all'),
|
|
114
|
+
defaultMessage: 'Are you sure you want to unpublish these entries?',
|
|
115
|
+
})}
|
|
116
|
+
</Typography>
|
|
117
|
+
<InjectionZoneList area="contentManager.listView.unpublishModalAdditionalInfos" />
|
|
118
|
+
</>
|
|
119
|
+
}
|
|
120
|
+
endAction={
|
|
121
|
+
<Button
|
|
122
|
+
onClick={onConfirm}
|
|
123
|
+
variant="secondary"
|
|
124
|
+
startIcon={<Check />}
|
|
125
|
+
loading={isConfirmButtonLoading}
|
|
126
|
+
>
|
|
127
|
+
{formatMessage({
|
|
128
|
+
id: 'app.utils.unpublish',
|
|
129
|
+
defaultMessage: 'Unpublish',
|
|
130
|
+
})}
|
|
131
|
+
</Button>
|
|
132
|
+
}
|
|
133
|
+
/>
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
ConfirmDialogUnpublishAll.propTypes = confirmDialogsPropTypes;
|
|
138
|
+
|
|
139
|
+
const ConfirmDialogDeleteAll = ({ isOpen, onToggleDialog, isConfirmButtonLoading, onConfirm }) => {
|
|
140
|
+
const { formatMessage } = useIntl();
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<ConfirmBulkActionDialog
|
|
144
|
+
isOpen={isOpen}
|
|
145
|
+
onToggleDialog={onToggleDialog}
|
|
146
|
+
dialogBody={
|
|
147
|
+
<>
|
|
148
|
+
<Typography id="confirm-description" textAlign="center">
|
|
149
|
+
{formatMessage({
|
|
150
|
+
id: getTrad('popUpWarning.bodyMessage.contentType.delete.all'),
|
|
151
|
+
defaultMessage: 'Are you sure you want to delete these entries?',
|
|
152
|
+
})}
|
|
153
|
+
</Typography>
|
|
154
|
+
<InjectionZoneList area="contentManager.listView.deleteModalAdditionalInfos" />
|
|
155
|
+
</>
|
|
156
|
+
}
|
|
157
|
+
endAction={
|
|
158
|
+
<Button
|
|
159
|
+
onClick={onConfirm}
|
|
160
|
+
variant="danger-light"
|
|
161
|
+
startIcon={<Trash />}
|
|
162
|
+
id="confirm-delete"
|
|
163
|
+
loading={isConfirmButtonLoading}
|
|
164
|
+
>
|
|
165
|
+
{formatMessage({
|
|
166
|
+
id: 'app.components.Button.confirm',
|
|
167
|
+
defaultMessage: 'Confirm',
|
|
168
|
+
})}
|
|
169
|
+
</Button>
|
|
170
|
+
}
|
|
171
|
+
/>
|
|
172
|
+
);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
ConfirmDialogDeleteAll.propTypes = confirmDialogsPropTypes;
|
|
176
|
+
|
|
177
|
+
const BulkActionsBar = ({
|
|
178
|
+
showPublish,
|
|
179
|
+
showDelete,
|
|
180
|
+
onConfirmDeleteAll,
|
|
181
|
+
onConfirmPublishAll,
|
|
182
|
+
onConfirmUnpublishAll,
|
|
183
|
+
selectedEntries,
|
|
184
|
+
clearSelectedEntries,
|
|
185
|
+
}) => {
|
|
186
|
+
const { formatMessage } = useIntl();
|
|
187
|
+
const { trackUsage } = useTracking();
|
|
188
|
+
const { data } = useSelector(listViewDomain());
|
|
189
|
+
|
|
190
|
+
const [isConfirmButtonLoading, setIsConfirmButtonLoading] = useState(false);
|
|
191
|
+
const [dialogToOpen, setDialogToOpen] = useState(null);
|
|
192
|
+
|
|
193
|
+
// Filters for Bulk actions
|
|
194
|
+
const selectedEntriesObjects = data.filter((entry) => selectedEntries.includes(entry.id));
|
|
195
|
+
const publishButtonIsShown =
|
|
196
|
+
showPublish && selectedEntriesObjects.some((entry) => !entry.publishedAt);
|
|
197
|
+
const unpublishButtonIsShown =
|
|
198
|
+
showPublish && selectedEntriesObjects.some((entry) => entry.publishedAt);
|
|
199
|
+
|
|
200
|
+
const toggleDeleteModal = () => {
|
|
201
|
+
if (dialogToOpen === 'delete') {
|
|
202
|
+
setDialogToOpen(null);
|
|
203
|
+
} else {
|
|
204
|
+
setDialogToOpen('delete');
|
|
205
|
+
trackUsage('willBulkDeleteEntries');
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const togglePublishModal = () => {
|
|
210
|
+
if (dialogToOpen === 'publish') {
|
|
211
|
+
setDialogToOpen(null);
|
|
212
|
+
} else {
|
|
213
|
+
setDialogToOpen('publish');
|
|
214
|
+
trackUsage('willBulkPublishEntries');
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const toggleUnpublishModal = () => {
|
|
219
|
+
if (dialogToOpen === 'unpublish') {
|
|
220
|
+
setDialogToOpen(null);
|
|
221
|
+
} else {
|
|
222
|
+
setDialogToOpen('unpublish');
|
|
223
|
+
trackUsage('willBulkUnpublishEntries');
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const handleBulkAction = async (confirmAction, toggleModal) => {
|
|
228
|
+
try {
|
|
229
|
+
setIsConfirmButtonLoading(true);
|
|
230
|
+
await confirmAction(selectedEntries);
|
|
231
|
+
setIsConfirmButtonLoading(false);
|
|
232
|
+
toggleModal();
|
|
233
|
+
clearSelectedEntries();
|
|
234
|
+
} catch (error) {
|
|
235
|
+
setIsConfirmButtonLoading(false);
|
|
236
|
+
toggleModal();
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const handleBulkDelete = () => handleBulkAction(onConfirmDeleteAll, toggleDeleteModal);
|
|
241
|
+
const handleBulkPublish = () => handleBulkAction(onConfirmPublishAll, togglePublishModal);
|
|
242
|
+
const handleBulkUnpublish = () => handleBulkAction(onConfirmUnpublishAll, toggleUnpublishModal);
|
|
243
|
+
|
|
244
|
+
return (
|
|
245
|
+
<>
|
|
246
|
+
{publishButtonIsShown && (
|
|
247
|
+
<>
|
|
248
|
+
<Button variant="tertiary" onClick={togglePublishModal}>
|
|
249
|
+
{formatMessage({ id: 'app.utils.publish', defaultMessage: 'Publish' })}
|
|
250
|
+
</Button>
|
|
251
|
+
<ConfirmDialogPublishAll
|
|
252
|
+
isOpen={dialogToOpen === 'publish'}
|
|
253
|
+
onToggleDialog={togglePublishModal}
|
|
254
|
+
isConfirmButtonLoading={isConfirmButtonLoading}
|
|
255
|
+
onConfirm={handleBulkPublish}
|
|
256
|
+
/>
|
|
257
|
+
</>
|
|
258
|
+
)}
|
|
259
|
+
{unpublishButtonIsShown && (
|
|
260
|
+
<>
|
|
261
|
+
<Button variant="tertiary" onClick={toggleUnpublishModal}>
|
|
262
|
+
{formatMessage({ id: 'app.utils.unpublish', defaultMessage: 'Unpublish' })}
|
|
263
|
+
</Button>
|
|
264
|
+
<ConfirmDialogUnpublishAll
|
|
265
|
+
isOpen={dialogToOpen === 'unpublish'}
|
|
266
|
+
onToggleDialog={toggleUnpublishModal}
|
|
267
|
+
isConfirmButtonLoading={isConfirmButtonLoading}
|
|
268
|
+
onConfirm={handleBulkUnpublish}
|
|
269
|
+
/>
|
|
270
|
+
</>
|
|
271
|
+
)}
|
|
272
|
+
{showDelete && (
|
|
273
|
+
<>
|
|
274
|
+
<Button variant="danger-light" onClick={toggleDeleteModal}>
|
|
275
|
+
{formatMessage({ id: 'global.delete', defaultMessage: 'Delete' })}
|
|
276
|
+
</Button>
|
|
277
|
+
<ConfirmDialogDeleteAll
|
|
278
|
+
isOpen={dialogToOpen === 'delete'}
|
|
279
|
+
onToggleDialog={toggleDeleteModal}
|
|
280
|
+
isConfirmButtonLoading={isConfirmButtonLoading}
|
|
281
|
+
onConfirm={handleBulkDelete}
|
|
282
|
+
/>
|
|
283
|
+
</>
|
|
284
|
+
)}
|
|
285
|
+
</>
|
|
286
|
+
);
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
BulkActionsBar.defaultProps = {
|
|
290
|
+
showPublish: false,
|
|
291
|
+
showDelete: false,
|
|
292
|
+
onConfirmDeleteAll() {},
|
|
293
|
+
onConfirmPublishAll() {},
|
|
294
|
+
onConfirmUnpublishAll() {},
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
BulkActionsBar.propTypes = {
|
|
298
|
+
showPublish: PropTypes.bool,
|
|
299
|
+
showDelete: PropTypes.bool,
|
|
300
|
+
onConfirmDeleteAll: PropTypes.func,
|
|
301
|
+
onConfirmPublishAll: PropTypes.func,
|
|
302
|
+
onConfirmUnpublishAll: PropTypes.func,
|
|
303
|
+
selectedEntries: PropTypes.array.isRequired,
|
|
304
|
+
clearSelectedEntries: PropTypes.func.isRequired,
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export default BulkActionsBar;
|
|
@@ -9,19 +9,22 @@ import { INJECT_COLUMN_IN_TABLE } from '../../../exposedHooks';
|
|
|
9
9
|
import { selectDisplayedHeaders } from '../../pages/ListView/selectors';
|
|
10
10
|
import { getTrad } from '../../utils';
|
|
11
11
|
import TableRows from './TableRows';
|
|
12
|
-
import ConfirmDialogDeleteAll from './ConfirmDialogDeleteAll';
|
|
13
12
|
import ConfirmDialogDelete from './ConfirmDialogDelete';
|
|
14
13
|
import { PublicationState } from './CellContent/PublicationState/PublicationState';
|
|
14
|
+
import BulkActionsBar from './BulkActionsBar';
|
|
15
15
|
|
|
16
16
|
const DynamicTable = ({
|
|
17
17
|
canCreate,
|
|
18
18
|
canDelete,
|
|
19
|
+
canPublish,
|
|
19
20
|
contentTypeName,
|
|
20
21
|
action,
|
|
21
22
|
isBulkable,
|
|
22
23
|
isLoading,
|
|
23
24
|
onConfirmDelete,
|
|
24
25
|
onConfirmDeleteAll,
|
|
26
|
+
onConfirmPublishAll,
|
|
27
|
+
onConfirmUnpublishAll,
|
|
25
28
|
layout,
|
|
26
29
|
rows,
|
|
27
30
|
}) => {
|
|
@@ -89,17 +92,27 @@ const DynamicTable = ({
|
|
|
89
92
|
|
|
90
93
|
return (
|
|
91
94
|
<Table
|
|
92
|
-
components={{ ConfirmDialogDelete
|
|
95
|
+
components={{ ConfirmDialogDelete }}
|
|
93
96
|
contentType={contentTypeName}
|
|
94
97
|
action={action}
|
|
95
98
|
isLoading={isLoading}
|
|
96
99
|
headers={tableHeaders}
|
|
97
100
|
onConfirmDelete={onConfirmDelete}
|
|
98
|
-
onConfirmDeleteAll={onConfirmDeleteAll}
|
|
99
101
|
onOpenDeleteAllModalTrackedEvent="willBulkDeleteEntries"
|
|
100
102
|
rows={rows}
|
|
101
103
|
withBulkActions
|
|
102
|
-
withMainAction={canDelete && isBulkable}
|
|
104
|
+
withMainAction={(canDelete || canPublish) && isBulkable}
|
|
105
|
+
renderBulkActionsBar={({ selectedEntries, clearSelectedEntries }) => (
|
|
106
|
+
<BulkActionsBar
|
|
107
|
+
showPublish={canPublish && hasDraftAndPublish}
|
|
108
|
+
showDelete={canDelete}
|
|
109
|
+
onConfirmDeleteAll={onConfirmDeleteAll}
|
|
110
|
+
onConfirmPublishAll={onConfirmPublishAll}
|
|
111
|
+
onConfirmUnpublishAll={onConfirmUnpublishAll}
|
|
112
|
+
selectedEntries={selectedEntries}
|
|
113
|
+
clearSelectedEntries={clearSelectedEntries}
|
|
114
|
+
/>
|
|
115
|
+
)}
|
|
103
116
|
>
|
|
104
117
|
<TableRows
|
|
105
118
|
canCreate={canCreate}
|
|
@@ -121,6 +134,7 @@ DynamicTable.defaultProps = {
|
|
|
121
134
|
DynamicTable.propTypes = {
|
|
122
135
|
canCreate: PropTypes.bool.isRequired,
|
|
123
136
|
canDelete: PropTypes.bool.isRequired,
|
|
137
|
+
canPublish: PropTypes.bool.isRequired,
|
|
124
138
|
contentTypeName: PropTypes.string.isRequired,
|
|
125
139
|
action: PropTypes.node,
|
|
126
140
|
isBulkable: PropTypes.bool.isRequired,
|
|
@@ -139,6 +153,8 @@ DynamicTable.propTypes = {
|
|
|
139
153
|
}).isRequired,
|
|
140
154
|
onConfirmDelete: PropTypes.func.isRequired,
|
|
141
155
|
onConfirmDeleteAll: PropTypes.func.isRequired,
|
|
156
|
+
onConfirmPublishAll: PropTypes.func.isRequired,
|
|
157
|
+
onConfirmUnpublishAll: PropTypes.func.isRequired,
|
|
142
158
|
rows: PropTypes.array.isRequired,
|
|
143
159
|
};
|
|
144
160
|
|