@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.
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +6 -6
- package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFields.js +23 -21
- package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +21 -23
- package/admin/src/content-manager/pages/EditView/Information/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/InformationBox/InformationBoxCE.js +1 -2
- package/admin/src/content-manager/pages/EditView/InformationBox/index.js +1 -3
- package/admin/src/content-manager/pages/EditView/index.js +14 -2
- package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +24 -22
- package/admin/src/content-manager/pages/ListView/components/CellContent/RelationMultiple/index.js +61 -67
- package/admin/src/content-manager/pages/ListView/components/CellContent/RepeatableComponent/index.js +28 -21
- package/admin/src/content-manager/pages/ListView/components/TableRows/index.js +4 -0
- package/admin/src/layouts/UnauthenticatedLayout/LocaleToggle/index.js +7 -7
- package/admin/src/pages/AuthPage/components/Login/index.js +3 -5
- package/admin/src/pages/AuthPage/constants.js +3 -2
- package/admin/src/pages/AuthPage/index.js +18 -1
- package/admin/src/pages/HomePage/index.js +19 -7
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +17 -1
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +16 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +2 -4
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +15 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/index.js +36 -5
- package/admin/src/pages/SettingsPage/pages/Users/components/MagicLink/index.js +3 -5
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +1 -3
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/index.js +16 -1
- package/build/1049.758a01f5.chunk.js +1 -0
- package/build/{3528.4845cf92.chunk.js → 1386.762d6eb8.chunk.js} +1 -1
- package/build/1727.b49f0713.chunk.js +1 -0
- package/build/{5563.27e2de0c.chunk.js → 2225.15d1df72.chunk.js} +2 -2
- package/build/2379.3ba39b61.chunk.js +1 -0
- package/build/2395.c27eb585.chunk.js +26 -0
- package/build/2801.93343c11.chunk.js +1 -0
- package/build/{7394.423886bd.chunk.js → 3100.21c343fa.chunk.js} +1 -1
- package/build/311.cb0884bb.chunk.js +1 -0
- package/build/3483.642d2321.chunk.js +1 -0
- package/build/{970.89601f27.chunk.js → 3739.63e352f1.chunk.js} +52 -20
- package/build/3984.298bdb66.chunk.js +1 -0
- package/build/4546.5aac90fe.chunk.js +1 -0
- package/build/502.f6b78f85.chunk.js +1 -0
- package/build/{5542.c62d0daf.chunk.js → 5542.2415a393.chunk.js} +6 -6
- package/build/6158.f9d82db9.chunk.js +1 -0
- package/build/7030.b98dcedf.chunk.js +1 -0
- package/build/7464.fe31804b.chunk.js +1 -0
- package/build/8276.d03dc679.chunk.js +26 -0
- package/build/918.54414509.chunk.js +1 -0
- package/build/978.bab58f0a.chunk.js +1 -0
- package/build/{9932.9f3790a5.chunk.js → 9932.b5a3bb3a.chunk.js} +2 -2
- package/build/{9944.29289a16.chunk.js → 9944.7af075a5.chunk.js} +1 -1
- package/build/{Admin-authenticatedApp.7f04c595.chunk.js → Admin-authenticatedApp.b3060bbe.chunk.js} +5 -5
- package/build/Admin_InternalErrorPage.f45f2462.chunk.js +1 -0
- package/build/{Admin_homePage.be30ef4e.chunk.js → Admin_homePage.ac9dfb86.chunk.js} +23 -15
- package/build/{Admin_marketplace.74a58e20.chunk.js → Admin_marketplace.f0b87fce.chunk.js} +1 -1
- package/build/{Admin_pluginsPage.ce464189.chunk.js → Admin_pluginsPage.8728ff6e.chunk.js} +1 -1
- package/build/{Admin_profilePage.0adb571e.chunk.js → Admin_profilePage.a968035f.chunk.js} +2 -2
- package/build/Admin_settingsPage.8c600d1a.chunk.js +111 -0
- package/build/Upload_ConfigureTheView.345ac1e0.chunk.js +1 -0
- package/build/admin-app.1c3f7fd6.chunk.js +36 -0
- package/build/{admin-edit-roles-page.3fdd6b9d.chunk.js → admin-edit-roles-page.a49b9f4f.chunk.js} +4 -4
- package/build/admin-edit-users.67704088.chunk.js +10 -0
- package/build/{admin-roles-list.e17b00d7.chunk.js → admin-roles-list.0c129e98.chunk.js} +1 -1
- package/build/admin-users.3279ffb0.chunk.js +11 -0
- package/build/api-tokens-create-page.46c2ea84.chunk.js +1 -0
- package/build/{api-tokens-edit-page.9a1dd2fa.chunk.js → api-tokens-edit-page.58139df9.chunk.js} +1 -1
- package/build/{api-tokens-list-page.a103f526.chunk.js → api-tokens-list-page.505bf7e0.chunk.js} +2 -2
- package/build/audit-logs-settings-page.4b422831.chunk.js +1 -0
- package/build/content-manager.9f7f0cb8.chunk.js +1101 -0
- package/build/{content-type-builder-list-view.82cfadc0.chunk.js → content-type-builder-list-view.bf9be456.chunk.js} +4 -4
- package/build/{content-type-builder-translation-ar-json.56d8fcf4.chunk.js → content-type-builder-translation-ar-json.3e808e2f.chunk.js} +1 -1
- package/build/{content-type-builder-translation-cs-json.a5b299ca.chunk.js → content-type-builder-translation-cs-json.1ef9e106.chunk.js} +1 -1
- package/build/{content-type-builder-translation-de-json.393a76c0.chunk.js → content-type-builder-translation-de-json.63fcff7b.chunk.js} +1 -1
- package/build/{content-type-builder-translation-dk-json.fbd39bb7.chunk.js → content-type-builder-translation-dk-json.fd626b67.chunk.js} +1 -1
- package/build/{content-type-builder-translation-en-json.f592325b.chunk.js → content-type-builder-translation-en-json.9f2b9c49.chunk.js} +1 -1
- package/build/{content-type-builder-translation-es-json.9288474b.chunk.js → content-type-builder-translation-es-json.a4a361a9.chunk.js} +1 -1
- package/build/{content-type-builder-translation-fr-json.d35e269c.chunk.js → content-type-builder-translation-fr-json.499c3a46.chunk.js} +1 -1
- package/build/{content-type-builder-translation-id-json.f0513929.chunk.js → content-type-builder-translation-id-json.65255f93.chunk.js} +1 -1
- package/build/{content-type-builder-translation-it-json.aaf16753.chunk.js → content-type-builder-translation-it-json.e268ab74.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ko-json.8fe21a7f.chunk.js → content-type-builder-translation-ko-json.04cb309d.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ms-json.3b5d2d3e.chunk.js → content-type-builder-translation-ms-json.f6b743b9.chunk.js} +1 -1
- package/build/{content-type-builder-translation-nl-json.225ef5d3.chunk.js → content-type-builder-translation-nl-json.997fe8cc.chunk.js} +1 -1
- package/build/{content-type-builder-translation-pl-json.92f36be2.chunk.js → content-type-builder-translation-pl-json.634f638b.chunk.js} +1 -1
- package/build/{content-type-builder-translation-pt-BR-json.3bd10f89.chunk.js → content-type-builder-translation-pt-BR-json.6a95dc71.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ru-json.9bfe47ce.chunk.js → content-type-builder-translation-ru-json.3af65503.chunk.js} +1 -1
- package/build/{content-type-builder-translation-sk-json.d03cc18a.chunk.js → content-type-builder-translation-sk-json.c6078082.chunk.js} +1 -1
- package/build/{content-type-builder-translation-sv-json.d23dcd32.chunk.js → content-type-builder-translation-sv-json.a6df2462.chunk.js} +1 -1
- package/build/{content-type-builder-translation-th-json.7ad256e2.chunk.js → content-type-builder-translation-th-json.122277cc.chunk.js} +1 -1
- package/build/{content-type-builder-translation-tr-json.926f6191.chunk.js → content-type-builder-translation-tr-json.41f44f77.chunk.js} +1 -1
- package/build/{content-type-builder-translation-uk-json.7bf19546.chunk.js → content-type-builder-translation-uk-json.e1315acd.chunk.js} +1 -1
- package/build/{content-type-builder-translation-zh-Hans-json.415577fb.chunk.js → content-type-builder-translation-zh-Hans-json.6ff57db6.chunk.js} +1 -1
- package/build/{content-type-builder-translation-zh-json.ad24dbeb.chunk.js → content-type-builder-translation-zh-json.3532b962.chunk.js} +1 -1
- package/build/content-type-builder.7a90cece.chunk.js +170 -0
- package/build/{email-settings-page.45695daa.chunk.js → email-settings-page.d494d1eb.chunk.js} +2 -2
- package/build/{i18n-settings-page.29308d0b.chunk.js → i18n-settings-page.47f78016.chunk.js} +1 -1
- package/build/index.html +1 -1
- package/build/main.22e2d4ec.js +2856 -0
- package/build/review-workflows-settings.f1104fb9.chunk.js +110 -0
- package/build/runtime~main.437fdcbb.js +2 -0
- package/build/sso-settings-page.ed6f3f15.chunk.js +1 -0
- package/build/transfer-tokens-create-page.1597e6ab.chunk.js +1 -0
- package/build/transfer-tokens-edit-page.8741529f.chunk.js +1 -0
- package/build/{transfer-tokens-list-page.7237443d.chunk.js → transfer-tokens-list-page.22147d2c.chunk.js} +2 -2
- package/build/upload-settings.cac210a0.chunk.js +14 -0
- package/build/upload.cbfeefa5.chunk.js +58 -0
- package/build/{users-advanced-settings-page.750b1f76.chunk.js → users-advanced-settings-page.18379a56.chunk.js} +1 -1
- package/build/users-email-settings-page.a87978e5.chunk.js +9 -0
- package/build/users-providers-settings-page.8876c1ee.chunk.js +14 -0
- package/build/{users-roles-settings-page.d286426a.chunk.js → users-roles-settings-page.0431f48c.chunk.js} +2 -2
- package/build/webhook-edit-page.a91f27a1.chunk.js +33 -0
- package/build/{webhook-list-page.940a40f1.chunk.js → webhook-list-page.65e1b5bb.chunk.js} +1 -1
- package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +1 -1
- package/ee/admin/content-manager/pages/EditView/InformationBox/index.js +1 -3
- package/ee/admin/pages/AuthPage/components/Login/index.js +3 -5
- package/ee/admin/pages/HomePage/index.js +11 -0
- package/ee/admin/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/index.js +1 -3
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +2 -4
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/index.js +13 -0
- package/ee/admin/pages/SettingsPage/pages/Users/components/MagicLink/index.js +3 -5
- package/ee/admin/pages/SettingsPage/pages/Webhooks/EditView/components/EventTable/index.js +1 -3
- package/index.js +0 -14
- package/package.json +10 -18
- package/webpack.alias.js +0 -3
- package/webpack.config.js +1 -75
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/index.js +0 -5
- package/build/1386.3b2aa6a7.chunk.js +0 -3
- package/build/1970.39a2d75e.chunk.js +0 -1
- package/build/2799.cf9b491f.chunk.js +0 -1
- package/build/3269.1ea0f5a6.chunk.js +0 -1
- package/build/539.865446c0.chunk.js +0 -1
- package/build/5932.f8be7e31.chunk.js +0 -1
- package/build/7018.98feed67.chunk.js +0 -1
- package/build/7259.0e25ab5d.chunk.js +0 -1
- package/build/Admin_InternalErrorPage.8911cb49.chunk.js +0 -1
- package/build/Admin_settingsPage.36152558.chunk.js +0 -79
- package/build/Upload_ConfigureTheView.7a1cb9c9.chunk.js +0 -1
- package/build/admin-app.3ea6009c.chunk.js +0 -61
- package/build/admin-edit-users.78552758.chunk.js +0 -10
- package/build/admin-users.c23322fc.chunk.js +0 -11
- package/build/api-tokens-create-page.3dd4e921.chunk.js +0 -1
- package/build/audit-logs-settings-page.37fe915c.chunk.js +0 -1
- package/build/content-manager.552c7418.chunk.js +0 -1094
- package/build/content-type-builder.238687f9.chunk.js +0 -166
- package/build/main.3d752c03.js +0 -2927
- package/build/review-workflows-settings.93808ae0.chunk.js +0 -110
- package/build/runtime~main.87232977.js +0 -2
- package/build/sso-settings-page.0cdb96a6.chunk.js +0 -1
- package/build/transfer-tokens-create-page.de14cad4.chunk.js +0 -1
- package/build/transfer-tokens-edit-page.4f5e39af.chunk.js +0 -1
- package/build/upload-settings.cb6c14c3.chunk.js +0 -14
- package/build/upload.7e629643.chunk.js +0 -26
- package/build/users-email-settings-page.e9bcd865.chunk.js +0 -9
- package/build/users-providers-settings-page.a94253e9.chunk.js +0 -14
- 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
|
|
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,
|
|
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
|
|
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
|
-
}, [
|
|
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
|
|
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
|
-
}, [
|
|
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,
|
|
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
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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 &&
|
|
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
|
};
|
|
@@ -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
|
-
<
|
|
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,
|
|
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
|
|
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
|
-
<
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
106
|
+
<Menu.Item key={field} onSelect={() => handleAddField(field)}>
|
|
105
107
|
{metadatas[field].list.label || field}
|
|
106
|
-
</
|
|
108
|
+
</Menu.Item>
|
|
107
109
|
))}
|
|
108
|
-
</
|
|
109
|
-
</
|
|
110
|
+
</Menu.Content>
|
|
111
|
+
</Menu.Root>
|
|
110
112
|
</Flex>
|
|
111
113
|
</>
|
|
112
114
|
);
|
package/admin/src/content-manager/pages/ListView/components/CellContent/RelationMultiple/index.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
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
|
-
() =>
|
|
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
|
-
<
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
<
|
|
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
|
-
</
|
|
76
|
+
</Menu.Item>
|
|
97
77
|
)}
|
|
98
78
|
|
|
99
79
|
{status === 'success' && (
|
|
100
80
|
<>
|
|
101
81
|
{data?.results.map((entry) => (
|
|
102
|
-
<
|
|
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
|
-
</
|
|
89
|
+
</Menu.Item>
|
|
110
90
|
))}
|
|
111
91
|
|
|
112
92
|
{data?.pagination.total > 10 && (
|
|
113
|
-
<
|
|
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
|
-
</
|
|
101
|
+
</Menu.Item>
|
|
122
102
|
)}
|
|
123
103
|
</>
|
|
124
104
|
)}
|
|
125
|
-
</
|
|
126
|
-
</
|
|
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;
|
package/admin/src/content-manager/pages/ListView/components/CellContent/RepeatableComponent/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { Badge,
|
|
4
|
-
import {
|
|
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
|
-
<
|
|
36
|
-
<
|
|
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
|
-
<
|
|
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
|
-
</
|
|
39
|
+
</Menu.Item>
|
|
43
40
|
))}
|
|
44
|
-
</
|
|
45
|
-
</
|
|
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;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
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
|
-
<
|
|
20
|
-
{Object.
|
|
21
|
-
<
|
|
22
|
-
{
|
|
23
|
-
</
|
|
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
|
-
</
|
|
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
|
|
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
|
-
|
|
17
|
+
LoginCE.defaultProps = {
|
|
18
18
|
onSubmit: (e) => e.preventDefault(),
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
|
|
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'],
|