@strapi/admin 4.6.0-beta.2 → 4.6.1
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/.browserslistrc +2 -1
- package/admin/src/components/AuthenticatedApp/utils/api.js +5 -4
- package/admin/src/components/ConfigurationsProvider/index.js +21 -18
- package/admin/src/components/ConfigurationsProvider/reducer.js +1 -0
- package/admin/src/components/LeftMenu/index.js +62 -53
- package/admin/src/components/UnauthenticatedLogo/index.js +1 -1
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +20 -16
- package/admin/src/content-manager/components/DynamicTable/CellContent/RelationMultiple/index.js +5 -5
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/findLeafByPathAndReplace.js +1 -3
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +6 -5
- package/admin/src/content-manager/components/Hint/index.js +4 -17
- package/admin/src/content-manager/components/InputUID/index.js +7 -18
- package/admin/src/content-manager/components/Inputs/index.js +0 -2
- package/admin/src/content-manager/components/PreviewWysiwyg/Wrapper.js +22 -27
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +35 -14
- package/admin/src/content-manager/components/Wysiwyg/EditorLayout.js +19 -28
- package/admin/src/content-manager/components/Wysiwyg/index.js +4 -8
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/index.js +4 -3
- package/admin/src/content-manager/hooks/useLazyComponents/index.js +9 -13
- package/admin/src/content-manager/hooks/useRelation/useRelation.js +4 -4
- package/admin/src/content-manager/pages/App/LeftMenu/index.js +3 -8
- package/admin/src/content-manager/pages/App/LeftMenu/utils/index.js +1 -0
- package/admin/src/content-manager/pages/App/LeftMenu/utils/matchByTitle.js +24 -0
- package/admin/src/content-manager/pages/App/useModels.js +8 -3
- package/admin/src/content-manager/pages/App/utils/getContentTypeLinks.js +3 -2
- package/admin/src/content-manager/pages/ComponentSetttingsView/index.js +4 -4
- package/admin/src/content-manager/pages/EditSettingsView/utils/api.js +4 -2
- package/admin/src/content-manager/pages/EditView/{Informations → Information}/index.js +55 -39
- package/admin/src/content-manager/pages/EditView/{Informations → Information}/utils/getUnits.js +0 -0
- package/admin/src/content-manager/pages/EditView/index.js +3 -3
- package/admin/src/content-manager/pages/ListSettingsView/utils/api.js +4 -2
- package/admin/src/content-manager/pages/ListView/index.js +9 -9
- package/admin/src/core/store/configureStore.js +22 -4
- package/admin/src/core/utils/index.js +0 -1
- package/admin/src/hooks/useFetchEnabledPlugins/utils/api.js +3 -2
- package/admin/src/hooks/useInjectReducer/index.js +1 -0
- package/admin/src/hooks/useInjectReducer/useInjectReducer.js +19 -0
- package/admin/src/hooks/useRegenerate/index.js +3 -3
- package/admin/src/hooks/useRolesList/index.js +5 -3
- package/admin/src/hooks/useSettingsMenu/init.js +2 -25
- package/admin/src/hooks/useSettingsMenu/utils/adminLinks.js +4 -0
- package/admin/src/hooks/useSettingsMenu/utils/customAdminLinks.js +1 -0
- package/admin/src/hooks/useSettingsMenu/utils/defaultAdminLinks.js +21 -0
- package/admin/src/index.js +5 -4
- package/admin/src/pages/App/index.js +6 -2
- package/admin/src/pages/ProfilePage/utils/api.js +5 -3
- package/admin/src/pages/SettingsPage/{pages/Users/ListPage → components}/Filters/index.js +0 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +6 -5
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/index.js +4 -3
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/CustomizationInfos/index.js +142 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/{Form → CustomizationInfos}/init.js +3 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/{Form → CustomizationInfos}/reducer.js +20 -0
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/LogoInput/index.js +21 -17
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +68 -42
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/api.js +9 -3
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/utils/api.js +6 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +9 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/utils/api.js +6 -3
- package/admin/src/pages/SettingsPage/pages/Users/components/SelectRoles/index.js +3 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/index.js +3 -2
- package/admin/src/pages/SettingsPage/utils/defaultRoutes.js +0 -11
- package/admin/src/permissions/defaultPermissions.js +4 -0
- package/admin/src/translations/en.json +29 -21
- package/admin/src/translations/eu.json +796 -0
- package/admin/src/translations/languageNativeNames.js +1 -0
- package/admin/src/translations/ru.json +9 -9
- package/build/1412.936ed920.chunk.js +159 -0
- package/build/1683.c8aa7b7c.chunk.js +268 -0
- package/build/2607.2e48dbf8.chunk.js +66 -0
- package/build/2743.6d1632f9.chunk.js +45 -0
- package/build/3075.dc3894fe.chunk.js +108 -0
- package/build/3632.0317b618.chunk.js +138 -0
- package/build/4318.f96a9d4d.chunk.js +30 -0
- package/build/{3557.e7115160.chunk.js → 4855.bd092921.chunk.js} +131 -91
- package/build/{5015.f5e15fdb.chunk.js → 5015.8e3fe50b.chunk.js} +1 -1
- package/build/8633.00ccd382.chunk.js +1 -0
- package/build/9707.7290fd92.chunk.js +96 -0
- package/build/Admin-authenticatedApp.ce646f66.chunk.js +75 -0
- package/build/Admin_homePage.b1730882.chunk.js +77 -0
- package/build/Admin_marketplace.ea0316c2.chunk.js +26 -0
- package/build/Admin_pluginsPage.5c24f963.chunk.js +6 -0
- package/build/Admin_profilePage.59af1978.chunk.js +15 -0
- package/build/Admin_settingsPage.d1493824.chunk.js +178 -0
- package/build/{Upload_ConfigureTheView.9bdf41b5.chunk.js → Upload_ConfigureTheView.3f2b6e6a.chunk.js} +1 -1
- package/build/admin-app.25934eaa.chunk.js +112 -0
- package/build/admin-edit-roles-page.446b69dc.chunk.js +1 -0
- package/build/admin-edit-users.2ed69bfd.chunk.js +10 -0
- package/build/admin-users.fc003b10.chunk.js +11 -0
- package/build/{api-tokens-create-page.0e686c30.chunk.js → api-tokens-create-page.d248362d.chunk.js} +1 -1
- package/build/{api-tokens-edit-page.d6c7487b.chunk.js → api-tokens-edit-page.8516fa20.chunk.js} +1 -1
- package/build/api-tokens-list-page.44a79fda.chunk.js +16 -0
- package/build/audit-logs-settings-page.c3dce30d.chunk.js +1 -0
- package/build/content-manager.35ff9726.chunk.js +1139 -0
- package/build/content-type-builder-list-view.79e84b36.chunk.js +193 -0
- package/build/{content-type-builder-translation-de-json.29df67b8.chunk.js → content-type-builder-translation-de-json.0979cccb.chunk.js} +1 -1
- package/build/{content-type-builder-translation-dk-json.e22d2527.chunk.js → content-type-builder-translation-dk-json.e05583e9.chunk.js} +1 -1
- package/build/content-type-builder-translation-en-json.e577d595.chunk.js +1 -0
- package/build/{content-type-builder-translation-es-json.1044b252.chunk.js → content-type-builder-translation-es-json.fe4daad8.chunk.js} +1 -1
- package/build/{content-type-builder-translation-fr-json.2183e6b3.chunk.js → content-type-builder-translation-fr-json.b1eb52f6.chunk.js} +1 -1
- package/build/{content-type-builder-translation-id-json.ba3e8891.chunk.js → content-type-builder-translation-id-json.ee3b36bb.chunk.js} +1 -1
- package/build/{content-type-builder-translation-it-json.d4661201.chunk.js → content-type-builder-translation-it-json.13b3c26a.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ko-json.57ff7f51.chunk.js → content-type-builder-translation-ko-json.8a274be5.chunk.js} +1 -1
- package/build/{content-type-builder-translation-pl-json.a057b51e.chunk.js → content-type-builder-translation-pl-json.24a34349.chunk.js} +1 -1
- package/build/{content-type-builder-translation-pt-BR-json.446df9da.chunk.js → content-type-builder-translation-pt-BR-json.97f71a9d.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ru-json.8c51843e.chunk.js → content-type-builder-translation-ru-json.54d11230.chunk.js} +1 -1
- package/build/{content-type-builder-translation-sv-json.af6ecca1.chunk.js → content-type-builder-translation-sv-json.59f5e1e5.chunk.js} +1 -1
- package/build/{content-type-builder-translation-tr-json.da83a07e.chunk.js → content-type-builder-translation-tr-json.cea4d226.chunk.js} +1 -1
- package/build/{content-type-builder-translation-zh-json.42f94cb3.chunk.js → content-type-builder-translation-zh-json.faedd610.chunk.js} +1 -1
- package/build/content-type-builder.855db321.chunk.js +126 -0
- package/build/email-settings-page.d1fcc7a3.chunk.js +10 -0
- package/build/en-json.1f137a90.chunk.js +1 -0
- package/build/eu-json.fceecd8b.chunk.js +1 -0
- package/build/i18n-settings-page.b8d8753e.chunk.js +60 -0
- package/build/{i18n-translation-de-json.dc876c08.chunk.js → i18n-translation-de-json.362384a6.chunk.js} +1 -1
- package/build/{i18n-translation-dk-json.49aaf933.chunk.js → i18n-translation-dk-json.89401417.chunk.js} +1 -1
- package/build/{i18n-translation-en-json.ac9ebc1b.chunk.js → i18n-translation-en-json.60af6722.chunk.js} +1 -1
- package/build/{i18n-translation-es-json.57072ed3.chunk.js → i18n-translation-es-json.87b494d1.chunk.js} +1 -1
- package/build/{i18n-translation-fr-json.84733f34.chunk.js → i18n-translation-fr-json.57ddc77e.chunk.js} +1 -1
- package/build/{i18n-translation-ko-json.fc73fe20.chunk.js → i18n-translation-ko-json.ef4f9471.chunk.js} +1 -1
- package/build/{i18n-translation-pl-json.16e5df90.chunk.js → i18n-translation-pl-json.dfac513d.chunk.js} +1 -1
- package/build/{i18n-translation-tr-json.cb39c048.chunk.js → i18n-translation-tr-json.10f0600d.chunk.js} +1 -1
- package/build/{i18n-translation-zh-Hans-json.2cf82d2d.chunk.js → i18n-translation-zh-Hans-json.757ce62d.chunk.js} +1 -1
- package/build/{i18n-translation-zh-json.ed1d272e.chunk.js → i18n-translation-zh-json.bef2dc07.chunk.js} +1 -1
- package/build/index.html +1 -1
- package/build/main.7b151630.js +4377 -0
- package/build/ru-json.aa5cd123.chunk.js +1 -0
- package/build/runtime~main.a20d633b.js +2 -0
- package/build/sso-settings-page.b85ad080.chunk.js +41 -0
- package/build/upload-settings.ef64bbf9.chunk.js +84 -0
- package/build/upload.c5730dfa.chunk.js +33 -0
- package/build/users-advanced-settings-page.fce9908e.chunk.js +8 -0
- package/build/users-email-settings-page.343d0ad2.chunk.js +23 -0
- package/build/users-providers-settings-page.e5a9a3f1.chunk.js +99 -0
- package/build/users-roles-settings-page.66312f31.chunk.js +30 -0
- package/build/webhook-edit-page.73e51e64.chunk.js +75 -0
- package/build/webhook-list-page.1134f130.chunk.js +42 -0
- package/ee/admin/hooks/useSettingsMenu/utils/customAdminLinks.js +17 -0
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/ComboboxFilter/index.js +41 -0
- package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/Modal/ActionBody.js +1 -3
- package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/Modal/ActionItem.js +0 -0
- package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/Modal/index.js +5 -1
- package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/PaginationFooter/index.js +0 -0
- package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/TableRows/index.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/hooks/useAuditLogsData.js +47 -0
- package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/hooks/useFormatTimeStamp.js +0 -0
- package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/index.js +35 -36
- package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/utils/getActionTypesDefaultMessages.js +10 -9
- package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/utils/getDisplayedFilters.js +88 -0
- package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/utils/tableHeaders.js +0 -0
- package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ProtectedListPage/index.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Roles/ListPage/index.js +4 -2
- package/ee/admin/pages/SettingsPage/{SingleSignOn → pages/SingleSignOn}/index.js +3 -3
- package/ee/admin/pages/SettingsPage/{SingleSignOn → pages/SingleSignOn}/utils/schema.js +0 -0
- package/ee/admin/pages/SettingsPage/utils/customRoutes.js +28 -16
- package/ee/server/bootstrap.js +2 -0
- package/ee/server/migrations/audit-logs-table.js +45 -0
- package/ee/server/register.js +2 -0
- package/ee/server/routes/index.js +94 -10
- package/ee/server/services/audit-logs.js +30 -2
- package/ee/server/services/passport/sso.js +13 -1
- package/ee/server/services/passport.js +1 -4
- package/package.json +27 -32
- package/server/controllers/admin.js +19 -2
- package/server/register.js +7 -7
- package/server/services/project-settings.js +10 -6
- package/server/services/user.js +3 -1
- package/server/validation/project-settings.js +19 -10
- package/strapi-server.js +1 -1
- package/admin/src/content-manager/components/InputJSON/FieldWrapper.js +0 -40
- package/admin/src/content-manager/components/InputJSON/Label.js +0 -35
- package/admin/src/content-manager/components/InputJSON/components.js +0 -36
- package/admin/src/content-manager/components/InputJSON/index.js +0 -223
- package/admin/src/content-manager/components/InputJSON/jsonlint.js +0 -680
- package/admin/src/core/store/createReducer.js +0 -5
- package/admin/src/core/utils/axiosInstance.js +0 -38
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/components/Form/index.js +0 -85
- package/build/2235.746d3cf7.chunk.js +0 -106
- package/build/2598.01c96bd5.chunk.js +0 -159
- package/build/2743.692b1f21.chunk.js +0 -42
- package/build/4318.87affaf2.chunk.js +0 -30
- package/build/4958.1979bbf5.chunk.js +0 -276
- package/build/5052.c2eacff2.chunk.js +0 -65
- package/build/7295.4e2dfbbb.chunk.js +0 -114
- package/build/805.da20168c.chunk.js +0 -138
- package/build/8633.6f546066.chunk.js +0 -1
- package/build/874.be41e4b3.chunk.js +0 -104
- package/build/9707.a07db355.chunk.js +0 -101
- package/build/Admin-authenticatedApp.9933974c.chunk.js +0 -75
- package/build/Admin_homePage.045bb0c8.chunk.js +0 -77
- package/build/Admin_marketplace.bf3ac090.chunk.js +0 -26
- package/build/Admin_pluginsPage.d2a9a619.chunk.js +0 -6
- package/build/Admin_profilePage.5e830ceb.chunk.js +0 -15
- package/build/Admin_settingsPage.53fa00a4.chunk.js +0 -178
- package/build/admin-app.8ed108ca.chunk.js +0 -112
- package/build/admin-audit-logs.68f833bf.chunk.js +0 -1
- package/build/admin-edit-roles-page.32bfe5ea.chunk.js +0 -1
- package/build/admin-edit-users.795f155c.chunk.js +0 -10
- package/build/admin-users.cbd9bcf7.chunk.js +0 -11
- package/build/api-tokens-list-page.a55e427c.chunk.js +0 -16
- package/build/codemirror-addon-closebrackets.71aa4bbd.chunk.js +0 -2
- package/build/codemirror-addon-lint-js.405f70fb.chunk.js +0 -1
- package/build/codemirror-addon-lint.8487ad3d.chunk.js +0 -1
- package/build/codemirror-addon-mark-selection.1928c849.chunk.js +0 -1
- package/build/codemirror-css.359a2a4b.chunk.js +0 -345
- package/build/codemirror-javacript.af237b68.chunk.js +0 -1
- package/build/codemirror-theme.2fe63a16.chunk.js +0 -33
- package/build/content-manager.ad929a94.chunk.js +0 -1174
- package/build/content-type-builder-list-view.3048854d.chunk.js +0 -198
- package/build/content-type-builder-translation-en-json.08e28f4e.chunk.js +0 -1
- package/build/content-type-builder.4edd1c22.chunk.js +0 -127
- package/build/email-settings-page.7c9e6c5e.chunk.js +0 -15
- package/build/en-json.d65a13ef.chunk.js +0 -1
- package/build/i18n-settings-page.fbccdf12.chunk.js +0 -1
- package/build/main.6bbf9950.js +0 -4417
- package/build/ru-json.3b411a39.chunk.js +0 -1
- package/build/runtime~main.c2bf62af.js +0 -2
- package/build/sso-settings-page.4031de9e.chunk.js +0 -41
- package/build/upload-settings.657790fd.chunk.js +0 -89
- package/build/upload.608a9856.chunk.js +0 -38
- package/build/users-advanced-settings-page.e3ab865f.chunk.js +0 -13
- package/build/users-email-settings-page.57adf9b7.chunk.js +0 -28
- package/build/users-providers-settings-page.7d1fb45c.chunk.js +0 -1
- package/build/users-roles-settings-page.ad28ab42.chunk.js +0 -30
- package/build/webhook-edit-page.1dd6d040.chunk.js +0 -75
- package/build/webhook-list-page.98afa3ea.chunk.js +0 -42
- package/ee/server/routes/features-routes.js +0 -66
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import { Combobox, ComboboxOption } from '@strapi/design-system';
|
|
5
|
+
|
|
6
|
+
const ComboboxFilter = ({ value, options, onChange }) => {
|
|
7
|
+
const { formatMessage } = useIntl();
|
|
8
|
+
const ariaLabel = formatMessage({
|
|
9
|
+
id: 'Settings.permissions.auditLogs.filter.aria-label',
|
|
10
|
+
defaultMessage: 'Search and select an option to filter',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Combobox aria-label={ariaLabel} value={value} onChange={onChange}>
|
|
15
|
+
{options.map(({ label, customValue }) => {
|
|
16
|
+
return (
|
|
17
|
+
<ComboboxOption key={customValue} value={customValue}>
|
|
18
|
+
{label}
|
|
19
|
+
</ComboboxOption>
|
|
20
|
+
);
|
|
21
|
+
})}
|
|
22
|
+
</Combobox>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
ComboboxFilter.defaultProps = {
|
|
27
|
+
value: null,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
ComboboxFilter.propTypes = {
|
|
31
|
+
value: PropTypes.string,
|
|
32
|
+
options: PropTypes.arrayOf(
|
|
33
|
+
PropTypes.shape({
|
|
34
|
+
label: PropTypes.string.isRequired,
|
|
35
|
+
customValue: PropTypes.string.isRequired,
|
|
36
|
+
}).isRequired
|
|
37
|
+
).isRequired,
|
|
38
|
+
onChange: PropTypes.func.isRequired,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default ComboboxFilter;
|
package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/Modal/ActionBody.js
RENAMED
|
@@ -7,8 +7,7 @@ import { Box } from '@strapi/design-system/Box';
|
|
|
7
7
|
import { Flex } from '@strapi/design-system/Flex';
|
|
8
8
|
import { Typography } from '@strapi/design-system/Typography';
|
|
9
9
|
import { JSONInput } from '@strapi/design-system/JSONInput';
|
|
10
|
-
import {
|
|
11
|
-
import getDefaultMessage from '../utils/getActionTypesDefaultMessages';
|
|
10
|
+
import { getDefaultMessage } from '../utils/getActionTypesDefaultMessages';
|
|
12
11
|
import ActionItem from './ActionItem';
|
|
13
12
|
|
|
14
13
|
const ActionBody = ({ status, data, formattedDate }) => {
|
|
@@ -83,7 +82,6 @@ const ActionBody = ({ status, data, formattedDate }) => {
|
|
|
83
82
|
<JSONInput
|
|
84
83
|
value={JSON.stringify(payload, null, 2)}
|
|
85
84
|
disabled
|
|
86
|
-
height={pxToRem(150)}
|
|
87
85
|
label={formatMessage({
|
|
88
86
|
id: 'Settings.permissions.auditLogs.payload',
|
|
89
87
|
defaultMessage: 'Payload',
|
package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/Modal/ActionItem.js
RENAMED
|
File without changes
|
|
@@ -14,6 +14,10 @@ const Modal = ({ handleClose, logId }) => {
|
|
|
14
14
|
const fetchAuditLog = async (id) => {
|
|
15
15
|
const { data } = await get(`/admin/audit-logs/${id}`);
|
|
16
16
|
|
|
17
|
+
if (!data) {
|
|
18
|
+
throw new Error('Audit log not found');
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
return data;
|
|
18
22
|
};
|
|
19
23
|
|
|
@@ -46,7 +50,7 @@ const Modal = ({ handleClose, logId }) => {
|
|
|
46
50
|
|
|
47
51
|
Modal.propTypes = {
|
|
48
52
|
handleClose: PropTypes.func.isRequired,
|
|
49
|
-
logId: PropTypes.
|
|
53
|
+
logId: PropTypes.string.isRequired,
|
|
50
54
|
};
|
|
51
55
|
|
|
52
56
|
export default Modal;
|
package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/PaginationFooter/index.js
RENAMED
|
File without changes
|
package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/TableRows/index.js
RENAMED
|
@@ -8,7 +8,7 @@ import { Tbody, Td, Tr } from '@strapi/design-system/Table';
|
|
|
8
8
|
import Eye from '@strapi/icons/Eye';
|
|
9
9
|
import { onRowClick, stopPropagation } from '@strapi/helper-plugin';
|
|
10
10
|
import useFormatTimeStamp from '../hooks/useFormatTimeStamp';
|
|
11
|
-
import getDefaultMessage from '../utils/getActionTypesDefaultMessages';
|
|
11
|
+
import { getDefaultMessage } from '../utils/getActionTypesDefaultMessages';
|
|
12
12
|
|
|
13
13
|
const TableRows = ({ headers, rows, onOpenModal }) => {
|
|
14
14
|
const { formatMessage } = useIntl();
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useQuery } from 'react-query';
|
|
2
|
+
import { useNotification, useFetchClient } from '@strapi/helper-plugin';
|
|
3
|
+
import { useLocation } from 'react-router-dom';
|
|
4
|
+
|
|
5
|
+
const useAuditLogsData = ({ canRead }) => {
|
|
6
|
+
const { get } = useFetchClient();
|
|
7
|
+
const { search } = useLocation();
|
|
8
|
+
const toggleNotification = useNotification();
|
|
9
|
+
|
|
10
|
+
const fetchAuditLogsPage = async ({ queryKey }) => {
|
|
11
|
+
const search = queryKey[1];
|
|
12
|
+
const { data } = await get(`/admin/audit-logs${search}`);
|
|
13
|
+
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const fetchAllUsers = async () => {
|
|
18
|
+
const { data } = await get(`/admin/users`);
|
|
19
|
+
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const queryOptions = {
|
|
24
|
+
enabled: canRead,
|
|
25
|
+
keepPreviousData: true,
|
|
26
|
+
retry: false,
|
|
27
|
+
staleTime: 1000 * 20, // 20 seconds
|
|
28
|
+
onError: (error) => toggleNotification({ type: 'warning', message: error.message }),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const {
|
|
32
|
+
data: auditLogs,
|
|
33
|
+
isLoading,
|
|
34
|
+
isError: isAuditLogsError,
|
|
35
|
+
} = useQuery(['auditLogs', search], fetchAuditLogsPage, queryOptions);
|
|
36
|
+
|
|
37
|
+
const { data: users, isError: isUsersError } = useQuery(['auditLogsUsers'], fetchAllUsers, {
|
|
38
|
+
...queryOptions,
|
|
39
|
+
staleTime: 2 * (1000 * 60), // 2 minutes
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const hasError = isAuditLogsError || isUsersError;
|
|
43
|
+
|
|
44
|
+
return { auditLogs, users: users?.data, isLoading, hasError };
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default useAuditLogsData;
|
|
File without changes
|
|
@@ -1,53 +1,41 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import {
|
|
4
4
|
SettingsPageTitle,
|
|
5
5
|
DynamicTable,
|
|
6
6
|
useRBAC,
|
|
7
|
-
useNotification,
|
|
8
7
|
useFocusWhenNavigate,
|
|
9
|
-
|
|
8
|
+
useQueryParams,
|
|
9
|
+
AnErrorOccurred,
|
|
10
10
|
} from '@strapi/helper-plugin';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
import {
|
|
12
|
+
Box,
|
|
13
|
+
HeaderLayout,
|
|
14
|
+
ContentLayout,
|
|
15
|
+
ActionLayout,
|
|
16
|
+
Layout,
|
|
17
|
+
Main,
|
|
18
|
+
} from '@strapi/design-system';
|
|
19
|
+
import adminPermissions from '../../../../../../../admin/src/permissions';
|
|
16
20
|
import TableRows from './TableRows';
|
|
17
21
|
import tableHeaders from './utils/tableHeaders';
|
|
18
22
|
import PaginationFooter from './PaginationFooter';
|
|
19
23
|
import Modal from './Modal';
|
|
24
|
+
import Filters from '../../../../../../../admin/src/pages/SettingsPage/components/Filters';
|
|
25
|
+
import getDisplayedFilters from './utils/getDisplayedFilters';
|
|
26
|
+
import useAuditLogsData from './hooks/useAuditLogsData';
|
|
20
27
|
|
|
21
28
|
const ListView = () => {
|
|
22
29
|
const { formatMessage } = useIntl();
|
|
23
|
-
const toggleNotification = useNotification();
|
|
24
30
|
const {
|
|
25
31
|
allowedActions: { canRead },
|
|
26
32
|
} = useRBAC(adminPermissions.settings.auditLogs);
|
|
27
|
-
const {
|
|
28
|
-
const {
|
|
33
|
+
const [{ query }, setQuery] = useQueryParams();
|
|
34
|
+
const { auditLogs, users, isLoading, hasError } = useAuditLogsData({ canRead });
|
|
29
35
|
|
|
30
36
|
useFocusWhenNavigate();
|
|
31
37
|
|
|
32
|
-
const
|
|
33
|
-
const search = queryKey[1];
|
|
34
|
-
const { data } = await get(`/admin/audit-logs${search}`);
|
|
35
|
-
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const { data, isLoading } = useQuery(['auditLogs', search], fetchAuditLogsPage, {
|
|
40
|
-
enabled: canRead,
|
|
41
|
-
keepPreviousData: true,
|
|
42
|
-
retry: false,
|
|
43
|
-
staleTime: 1000 * 20,
|
|
44
|
-
onError() {
|
|
45
|
-
toggleNotification({
|
|
46
|
-
type: 'warning',
|
|
47
|
-
message: { id: 'notification.error', defaultMessage: 'An error occured' },
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
});
|
|
38
|
+
const displayedFilters = getDisplayedFilters({ formatMessage, users });
|
|
51
39
|
|
|
52
40
|
const title = formatMessage({
|
|
53
41
|
id: 'global.auditLogs',
|
|
@@ -62,7 +50,17 @@ const ListView = () => {
|
|
|
62
50
|
},
|
|
63
51
|
}));
|
|
64
52
|
|
|
65
|
-
|
|
53
|
+
if (hasError) {
|
|
54
|
+
return (
|
|
55
|
+
<Layout>
|
|
56
|
+
<ContentLayout>
|
|
57
|
+
<Box paddingTop={8}>
|
|
58
|
+
<AnErrorOccurred />
|
|
59
|
+
</Box>
|
|
60
|
+
</ContentLayout>
|
|
61
|
+
</Layout>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
66
64
|
|
|
67
65
|
return (
|
|
68
66
|
<Main aria-busy={isLoading}>
|
|
@@ -74,23 +72,24 @@ const ListView = () => {
|
|
|
74
72
|
defaultMessage: 'Logs of all the activities that happened in your environment',
|
|
75
73
|
})}
|
|
76
74
|
/>
|
|
75
|
+
<ActionLayout startActions={<Filters displayedFilters={displayedFilters} />} />
|
|
77
76
|
<ContentLayout canRead={canRead}>
|
|
78
77
|
<DynamicTable
|
|
79
78
|
contentType="Audit logs"
|
|
80
79
|
headers={headers}
|
|
81
|
-
rows={
|
|
80
|
+
rows={auditLogs?.results || []}
|
|
82
81
|
withBulkActions
|
|
83
82
|
isLoading={isLoading}
|
|
84
83
|
>
|
|
85
84
|
<TableRows
|
|
86
85
|
headers={headers}
|
|
87
|
-
rows={
|
|
88
|
-
onOpenModal={(id) =>
|
|
86
|
+
rows={auditLogs?.results || []}
|
|
87
|
+
onOpenModal={(id) => setQuery({ id })}
|
|
89
88
|
/>
|
|
90
89
|
</DynamicTable>
|
|
91
|
-
<PaginationFooter pagination={
|
|
90
|
+
<PaginationFooter pagination={auditLogs?.pagination} />
|
|
92
91
|
</ContentLayout>
|
|
93
|
-
{
|
|
92
|
+
{query?.id && <Modal handleClose={() => setQuery({ id: null }, 'remove')} logId={query.id} />}
|
|
94
93
|
</Main>
|
|
95
94
|
);
|
|
96
95
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
const actionTypes = {
|
|
2
|
-
'entry.create': 'Create entry ({model})',
|
|
3
|
-
'entry.update': 'Update entry ({model})',
|
|
4
|
-
'entry.delete': 'Delete entry ({model})',
|
|
5
|
-
'entry.publish': 'Publish entry ({model})',
|
|
6
|
-
'entry.unpublish': 'Unpublish entry ({model})',
|
|
1
|
+
export const actionTypes = {
|
|
2
|
+
'entry.create': 'Create entry{model, select, undefined {} other { ({model})}}',
|
|
3
|
+
'entry.update': 'Update entry{model, select, undefined {} other { ({model})}}',
|
|
4
|
+
'entry.delete': 'Delete entry{model, select, undefined {} other { ({model})}}',
|
|
5
|
+
'entry.publish': 'Publish entry{model, select, undefined {} other { ({model})}}',
|
|
6
|
+
'entry.unpublish': 'Unpublish entry{model, select, undefined {} other { ({model})}}',
|
|
7
7
|
'media.create': 'Create media',
|
|
8
8
|
'media.update': 'Update media',
|
|
9
9
|
'media.delete': 'Delete media',
|
|
10
|
+
'media-folder.create': 'Create media folder',
|
|
11
|
+
'media-folder.update': 'Update media folder',
|
|
12
|
+
'media-folder.delete': 'Delete media folder',
|
|
10
13
|
'user.create': 'Create user',
|
|
11
14
|
'user.update': 'Update user',
|
|
12
15
|
'user.delete': 'Delete user',
|
|
@@ -26,8 +29,6 @@ const actionTypes = {
|
|
|
26
29
|
'permission.delete': 'Delete permission',
|
|
27
30
|
};
|
|
28
31
|
|
|
29
|
-
const getDefaultMessage = (value) => {
|
|
32
|
+
export const getDefaultMessage = (value) => {
|
|
30
33
|
return actionTypes[value] || value;
|
|
31
34
|
};
|
|
32
|
-
|
|
33
|
-
export default getDefaultMessage;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import ComboboxFilter from '../ComboboxFilter';
|
|
2
|
+
import { getDefaultMessage, actionTypes } from './getActionTypesDefaultMessages';
|
|
3
|
+
|
|
4
|
+
const customOperators = [
|
|
5
|
+
{
|
|
6
|
+
intlLabel: { id: 'components.FilterOptions.FILTER_TYPES.$eq', defaultMessage: 'is' },
|
|
7
|
+
value: '$eq',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
intlLabel: { id: 'components.FilterOptions.FILTER_TYPES.$ne', defaultMessage: 'is not' },
|
|
11
|
+
value: '$ne',
|
|
12
|
+
},
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const getDisplayedFilters = ({ formatMessage, users }) => {
|
|
16
|
+
const actionOptions = Object.keys(actionTypes).map((action) => {
|
|
17
|
+
return {
|
|
18
|
+
label: formatMessage(
|
|
19
|
+
{
|
|
20
|
+
id: `Settings.permissions.auditLogs.${action}`,
|
|
21
|
+
defaultMessage: getDefaultMessage(action),
|
|
22
|
+
},
|
|
23
|
+
{ model: undefined }
|
|
24
|
+
),
|
|
25
|
+
customValue: action,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const userOptions =
|
|
30
|
+
users &&
|
|
31
|
+
users.results.map((user) => {
|
|
32
|
+
return {
|
|
33
|
+
label: formatMessage(
|
|
34
|
+
{
|
|
35
|
+
id: 'Settings.permissions.auditLogs.user.fullname',
|
|
36
|
+
defaultMessage: '{firstname} {lastname}',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
firstname: user.firstname,
|
|
40
|
+
lastname: user.lastname,
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
// Combobox expects a string value
|
|
44
|
+
customValue: user.id.toString(),
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return [
|
|
49
|
+
{
|
|
50
|
+
name: 'action',
|
|
51
|
+
metadatas: {
|
|
52
|
+
customOperators,
|
|
53
|
+
label: formatMessage({
|
|
54
|
+
id: 'Settings.permissions.auditLogs.action',
|
|
55
|
+
defaultMessage: 'Action',
|
|
56
|
+
}),
|
|
57
|
+
options: actionOptions,
|
|
58
|
+
customInput: ComboboxFilter,
|
|
59
|
+
},
|
|
60
|
+
fieldSchema: { type: 'enumeration' },
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'date',
|
|
64
|
+
metadatas: {
|
|
65
|
+
label: formatMessage({
|
|
66
|
+
id: 'Settings.permissions.auditLogs.date',
|
|
67
|
+
defaultMessage: 'Date',
|
|
68
|
+
}),
|
|
69
|
+
},
|
|
70
|
+
fieldSchema: { type: 'datetime' },
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'user',
|
|
74
|
+
metadatas: {
|
|
75
|
+
customOperators,
|
|
76
|
+
label: formatMessage({
|
|
77
|
+
id: 'Settings.permissions.auditLogs.user',
|
|
78
|
+
defaultMessage: 'User',
|
|
79
|
+
}),
|
|
80
|
+
options: userOptions,
|
|
81
|
+
customInput: ComboboxFilter,
|
|
82
|
+
},
|
|
83
|
+
fieldSchema: { type: 'relation', mainField: { name: 'id' } },
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export default getDisplayedFilters;
|
package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ListView/utils/tableHeaders.js
RENAMED
|
File without changes
|
package/{admin/src → ee/admin}/pages/SettingsPage/pages/AuditLogs/ProtectedListPage/index.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CheckPagePermissions } from '@strapi/helper-plugin';
|
|
3
|
-
import adminPermissions from '
|
|
3
|
+
import adminPermissions from '../../../../../../../admin/src/permissions';
|
|
4
4
|
import ListView from '../ListView';
|
|
5
5
|
|
|
6
6
|
const ProtectedListPage = () => (
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
LoadingIndicatorPage,
|
|
5
5
|
SearchURLQuery,
|
|
6
6
|
SettingsPageTitle,
|
|
7
|
+
getFetchClient,
|
|
7
8
|
useNotification,
|
|
8
9
|
useQueryParams,
|
|
9
10
|
useRBAC,
|
|
@@ -23,7 +24,6 @@ import { get } from 'lodash';
|
|
|
23
24
|
import matchSorter from 'match-sorter';
|
|
24
25
|
import { useIntl } from 'react-intl';
|
|
25
26
|
import { useHistory } from 'react-router-dom';
|
|
26
|
-
import { axiosInstance } from '../../../../../../../admin/src/core/utils';
|
|
27
27
|
import { useRolesList } from '../../../../../../../admin/src/hooks';
|
|
28
28
|
import adminPermissions from '../../../../../../../admin/src/permissions';
|
|
29
29
|
import EmptyRole from '../../../../../../../admin/src/pages/SettingsPage/pages/Roles/ListPage/components/EmptyRole';
|
|
@@ -72,13 +72,15 @@ const useRoleActions = ({ getData, canCreate, canDelete, canUpdate }) => {
|
|
|
72
72
|
initialState
|
|
73
73
|
);
|
|
74
74
|
|
|
75
|
+
const { post } = getFetchClient();
|
|
76
|
+
|
|
75
77
|
const handleDeleteData = async () => {
|
|
76
78
|
try {
|
|
77
79
|
dispatch({
|
|
78
80
|
type: 'ON_REMOVE_ROLES',
|
|
79
81
|
});
|
|
80
82
|
|
|
81
|
-
await
|
|
83
|
+
await post('/admin/roles/batch-delete', {
|
|
82
84
|
ids: [roleToDelete],
|
|
83
85
|
});
|
|
84
86
|
|
|
@@ -17,9 +17,9 @@ import { Select, Option } from '@strapi/design-system/Select';
|
|
|
17
17
|
import { Grid, GridItem } from '@strapi/design-system/Grid';
|
|
18
18
|
import { useIntl } from 'react-intl';
|
|
19
19
|
import isEqual from 'lodash/isEqual';
|
|
20
|
-
import { getRequestUrl } from '
|
|
21
|
-
import { useRolesList, useSettingsForm } from '
|
|
22
|
-
import adminPermissions from '
|
|
20
|
+
import { getRequestUrl } from '../../../../../../admin/src/utils';
|
|
21
|
+
import { useRolesList, useSettingsForm } from '../../../../../../admin/src/hooks';
|
|
22
|
+
import adminPermissions from '../../../../../../admin/src/permissions';
|
|
23
23
|
import schema from './utils/schema';
|
|
24
24
|
|
|
25
25
|
const ssoPermissions = {
|
|
File without changes
|
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
const
|
|
2
|
-
? [
|
|
3
|
-
{
|
|
4
|
-
async Component() {
|
|
5
|
-
const component = await import(
|
|
6
|
-
/* webpackChunkName: "sso-settings-page" */ '../SingleSignOn'
|
|
7
|
-
);
|
|
1
|
+
const routes = [];
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
: [];
|
|
3
|
+
if (strapi.features.isEnabled(strapi.features.SSO)) {
|
|
4
|
+
routes.push({
|
|
5
|
+
async Component() {
|
|
6
|
+
const component = await import(
|
|
7
|
+
/* webpackChunkName: "sso-settings-page" */ '../pages/SingleSignOn'
|
|
8
|
+
);
|
|
16
9
|
|
|
17
|
-
|
|
10
|
+
return component;
|
|
11
|
+
},
|
|
12
|
+
to: '/settings/single-sign-on',
|
|
13
|
+
exact: true,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
if (strapi.features.isEnabled(strapi.features.AUDIT_LOGS)) {
|
|
18
|
+
routes.push({
|
|
19
|
+
async Component() {
|
|
20
|
+
const component = await import(
|
|
21
|
+
/* webpackChunkName: "audit-logs-settings-page" */ '../pages/AuditLogs/ProtectedListPage'
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
return component;
|
|
25
|
+
},
|
|
26
|
+
to: '/settings/audit-logs',
|
|
27
|
+
exact: true,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default routes;
|
package/ee/server/bootstrap.js
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Migrate the audit logs table name for users coming from v4.6.0
|
|
5
|
+
*/
|
|
6
|
+
async function migrateAuditLogsTable({ oldContentTypes, contentTypes }) {
|
|
7
|
+
// Check if the audit logs table name was changed
|
|
8
|
+
const oldName = oldContentTypes?.['admin::audit-log']?.collectionName;
|
|
9
|
+
const newName = contentTypes['admin::audit-log']?.collectionName;
|
|
10
|
+
const hasRenamedAuditLogsTable = oldName === 'audit_logs' && newName === 'strapi_audit_logs';
|
|
11
|
+
|
|
12
|
+
if (!hasRenamedAuditLogsTable) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Check if the previous audit log tables exist
|
|
17
|
+
const hasAuditLogsTable = await strapi.db.getSchemaConnection().hasTable('audit_logs');
|
|
18
|
+
const hasLinkTable = await strapi.db.getSchemaConnection().hasTable('audit_logs_user_links');
|
|
19
|
+
|
|
20
|
+
if (!hasAuditLogsTable || !hasLinkTable) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Check if the existing tables match the expected schema
|
|
25
|
+
const auditLogsColumnInfo = await strapi.db.connection('audit_logs').columnInfo();
|
|
26
|
+
const linkColumnInfo = await strapi.db.connection('audit_logs_user_links').columnInfo();
|
|
27
|
+
|
|
28
|
+
if (
|
|
29
|
+
!auditLogsColumnInfo.action ||
|
|
30
|
+
!auditLogsColumnInfo.date ||
|
|
31
|
+
!auditLogsColumnInfo.payload ||
|
|
32
|
+
!linkColumnInfo.audit_log_id ||
|
|
33
|
+
!linkColumnInfo.user_id
|
|
34
|
+
) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Do the actual migrations
|
|
39
|
+
await strapi.db.getSchemaConnection().renameTable('audit_logs', 'strapi_audit_logs');
|
|
40
|
+
await strapi.db
|
|
41
|
+
.getSchemaConnection()
|
|
42
|
+
.renameTable('audit_logs_user_links', 'strapi_audit_logs_user_links');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = migrateAuditLogsTable;
|
package/ee/server/register.js
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
const { features } = require('@strapi/strapi/lib/utils/ee');
|
|
4
4
|
const executeCERegister = require('../../server/register');
|
|
5
|
+
const migrateAuditLogsTable = require('./migrations/audit-logs-table');
|
|
5
6
|
const createAuditLogsService = require('./services/audit-logs');
|
|
6
7
|
|
|
7
8
|
module.exports = async ({ strapi }) => {
|
|
8
9
|
if (features.isEnabled('audit-logs')) {
|
|
10
|
+
strapi.hook('strapi::content-types.beforeSync').register(migrateAuditLogsTable);
|
|
9
11
|
const auditLogsService = createAuditLogsService(strapi);
|
|
10
12
|
strapi.container.register('audit-logs', auditLogsService);
|
|
11
13
|
await auditLogsService.register();
|