@strapi/plugin-documentation 4.20.5 → 5.0.0-alpha.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/admin/src/hooks/useDocumentation.js +9 -7
- package/admin/src/index.js +5 -19
- package/admin/src/pages/PluginPage/index.jsx +12 -28
- package/admin/src/pages/PluginPage/tests/index.test.jsx +13 -14
- package/admin/src/pages/SettingsPage/index.jsx +138 -146
- package/admin/src/pages/SettingsPage/tests/index.test.jsx +6 -13
- package/admin/src/utils/prefixPluginTranslations.js +13 -0
- package/dist/_chunks/EditViewPage-kgrZ8rEg-N3ylaYYT.mjs +84382 -0
- package/dist/_chunks/EditViewPage-kgrZ8rEg-N3ylaYYT.mjs.map +1 -0
- package/dist/_chunks/EditViewPage-kgrZ8rEg-QXBi74pP.js +84410 -0
- package/dist/_chunks/EditViewPage-kgrZ8rEg-QXBi74pP.js.map +1 -0
- package/dist/_chunks/ListViewPage-BNB0ptO7-Y0blKENS.js +1617 -0
- package/dist/_chunks/ListViewPage-BNB0ptO7-Y0blKENS.js.map +1 -0
- package/dist/_chunks/ListViewPage-BNB0ptO7-qPG-Y69A.mjs +1594 -0
- package/dist/_chunks/ListViewPage-BNB0ptO7-qPG-Y69A.mjs.map +1 -0
- package/dist/_chunks/ReviewWorkflowsColumn-56Z6l-FH-j4yjCkjD.js +33 -0
- package/dist/_chunks/ReviewWorkflowsColumn-56Z6l-FH-j4yjCkjD.js.map +1 -0
- package/dist/_chunks/ReviewWorkflowsColumn-56Z6l-FH-jOwjGO3o.mjs +33 -0
- package/dist/_chunks/ReviewWorkflowsColumn-56Z6l-FH-jOwjGO3o.mjs.map +1 -0
- package/dist/_chunks/constants-evLWZCaJ-Oxpg3z7Q.mjs +190 -0
- package/dist/_chunks/constants-evLWZCaJ-Oxpg3z7Q.mjs.map +1 -0
- package/dist/_chunks/constants-evLWZCaJ-ZpfIp8P_.js +209 -0
- package/dist/_chunks/constants-evLWZCaJ-ZpfIp8P_.js.map +1 -0
- package/dist/_chunks/{index-8QCog8RN.js → index-7OS1Qe_4.js} +15 -13
- package/dist/_chunks/index-7OS1Qe_4.js.map +1 -0
- package/dist/_chunks/{index-6c_gUVrM.mjs → index-JM6LA3Oe.mjs} +26 -24
- package/dist/_chunks/index-JM6LA3Oe.mjs.map +1 -0
- package/dist/_chunks/index-R7UT09YY.js +17934 -0
- package/dist/_chunks/index-R7UT09YY.js.map +1 -0
- package/dist/_chunks/index-lggLaJiY.mjs +17909 -0
- package/dist/_chunks/index-lggLaJiY.mjs.map +1 -0
- package/dist/_chunks/{index-r8UM9pKc.js → index-ri1exVbc.js} +29 -27
- package/dist/_chunks/index-ri1exVbc.js.map +1 -0
- package/dist/_chunks/{index-SdK6c8ae.mjs → index-ynnbYrP0.mjs} +12 -10
- package/dist/_chunks/index-ynnbYrP0.mjs.map +1 -0
- package/dist/_chunks/{useDocumentation-uuvchj5L.js → useDocumentation-GsX6iQVe.js} +15 -13
- package/dist/_chunks/useDocumentation-GsX6iQVe.js.map +1 -0
- package/dist/_chunks/{useDocumentation-DcjdYl47.mjs → useDocumentation-jTKQvwxD.mjs} +11 -9
- package/dist/_chunks/useDocumentation-jTKQvwxD.mjs.map +1 -0
- package/dist/_chunks/useSyncRbac-83vFRiaG-5ec8lrUQ.js +57 -0
- package/dist/_chunks/useSyncRbac-83vFRiaG-5ec8lrUQ.js.map +1 -0
- package/dist/_chunks/useSyncRbac-83vFRiaG-oJpvBKQE.mjs +39 -0
- package/dist/_chunks/useSyncRbac-83vFRiaG-oJpvBKQE.mjs.map +1 -0
- package/dist/admin/index.js +1 -2
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +1 -2
- package/dist/admin/index.mjs.map +1 -1
- package/dist/style.css +84 -0
- package/package.json +13 -13
- package/server/controllers/documentation.js +2 -2
- package/server/middlewares/restrict-access.js +1 -1
- package/server/services/__mocks__/mock-content-types.js +0 -5
- package/server/services/documentation.js +2 -3
- package/server/services/override.js +1 -1
- package/dist/_chunks/index-6c_gUVrM.mjs.map +0 -1
- package/dist/_chunks/index-8QCog8RN.js.map +0 -1
- package/dist/_chunks/index-SdK6c8ae.mjs.map +0 -1
- package/dist/_chunks/index-iIEENwT0.js +0 -169
- package/dist/_chunks/index-iIEENwT0.js.map +0 -1
- package/dist/_chunks/index-r8UM9pKc.js.map +0 -1
- package/dist/_chunks/index-uTcHJZnf.mjs +0 -167
- package/dist/_chunks/index-uTcHJZnf.mjs.map +0 -1
- package/dist/_chunks/useDocumentation-DcjdYl47.mjs.map +0 -1
- package/dist/_chunks/useDocumentation-uuvchj5L.js.map +0 -1
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { fixtures } from '@strapi/admin-test-utils';
|
|
4
4
|
import { lightTheme, ThemeProvider } from '@strapi/design-system';
|
|
5
|
-
import {
|
|
5
|
+
import { RBACContext } from '@strapi/helper-plugin';
|
|
6
|
+
import { NotificationsProvider } from '@strapi/strapi/admin';
|
|
6
7
|
import { fireEvent, render as renderRTL, waitFor } from '@testing-library/react';
|
|
7
8
|
import userEvent from '@testing-library/user-event';
|
|
8
9
|
import { rest } from 'msw';
|
|
@@ -54,9 +55,7 @@ describe('SettingsPage', () => {
|
|
|
54
55
|
it('renders the setting page correctly', async () => {
|
|
55
56
|
const { getByRole, queryByText, getByText } = render();
|
|
56
57
|
|
|
57
|
-
expect(queryByText('
|
|
58
|
-
|
|
59
|
-
await waitFor(() => expect(queryByText('Plugin settings are loading')).not.toBeInTheDocument());
|
|
58
|
+
await waitFor(() => expect(queryByText('Loading content.')).not.toBeInTheDocument());
|
|
60
59
|
|
|
61
60
|
expect(getByRole('heading', { name: 'Documentation' })).toBeInTheDocument();
|
|
62
61
|
expect(getByText('Configure the documentation plugin')).toBeInTheDocument();
|
|
@@ -81,9 +80,7 @@ describe('SettingsPage', () => {
|
|
|
81
80
|
|
|
82
81
|
const { getByLabelText, queryByText } = render();
|
|
83
82
|
|
|
84
|
-
expect(queryByText('
|
|
85
|
-
|
|
86
|
-
await waitFor(() => expect(queryByText('Plugin settings are loading')).not.toBeInTheDocument());
|
|
83
|
+
await waitFor(() => expect(queryByText('Loading content.')).not.toBeInTheDocument());
|
|
87
84
|
|
|
88
85
|
expect(getByLabelText('Password')).toBeInTheDocument();
|
|
89
86
|
|
|
@@ -93,9 +90,7 @@ describe('SettingsPage', () => {
|
|
|
93
90
|
it('should render the password field when the Restricted Access checkbox is checked', async () => {
|
|
94
91
|
const { getByRole, getByLabelText, queryByText } = render();
|
|
95
92
|
|
|
96
|
-
expect(queryByText('
|
|
97
|
-
|
|
98
|
-
await waitFor(() => expect(queryByText('Plugin settings are loading')).not.toBeInTheDocument());
|
|
93
|
+
await waitFor(() => expect(queryByText('Loading content.')).not.toBeInTheDocument());
|
|
99
94
|
|
|
100
95
|
fireEvent.click(getByRole('checkbox', { name: 'Restricted Access' }));
|
|
101
96
|
|
|
@@ -107,9 +102,7 @@ describe('SettingsPage', () => {
|
|
|
107
102
|
it('should allow me to type a password and save that settings change successfully', async () => {
|
|
108
103
|
const { getByRole, getByLabelText, queryByText, user, getByText } = render();
|
|
109
104
|
|
|
110
|
-
expect(queryByText('
|
|
111
|
-
|
|
112
|
-
await waitFor(() => expect(queryByText('Plugin settings are loading')).not.toBeInTheDocument());
|
|
105
|
+
await waitFor(() => expect(queryByText('Loading content.')).not.toBeInTheDocument());
|
|
113
106
|
|
|
114
107
|
fireEvent.click(getByRole('checkbox', { name: 'Restricted Access' }));
|
|
115
108
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const prefixPluginTranslations = (trad, pluginId) => {
|
|
2
|
+
if (!pluginId) {
|
|
3
|
+
throw new TypeError("pluginId can't be empty");
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
return Object.keys(trad).reduce((acc, current) => {
|
|
7
|
+
acc[`${pluginId}.${current}`] = trad[current];
|
|
8
|
+
|
|
9
|
+
return acc;
|
|
10
|
+
}, {});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { prefixPluginTranslations };
|