@plone/volto 19.0.0-alpha.35 → 19.0.0-alpha.37
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/CHANGELOG.md +54 -0
- package/README.md +1 -1
- package/locales/af/LC_MESSAGES/volto.po +29 -13
- package/locales/af.json +1 -1
- package/locales/ar/LC_MESSAGES/volto.po +29 -13
- package/locales/ar.json +1 -1
- package/locales/bg/LC_MESSAGES/volto.po +29 -13
- package/locales/bg.json +1 -1
- package/locales/bn/LC_MESSAGES/volto.po +29 -13
- package/locales/bn.json +1 -1
- package/locales/ca/LC_MESSAGES/volto.po +32 -16
- package/locales/ca.json +1 -1
- package/locales/cs/LC_MESSAGES/volto.po +30 -14
- package/locales/cs.json +1 -1
- package/locales/cy/LC_MESSAGES/volto.po +29 -13
- package/locales/cy.json +1 -1
- package/locales/da/LC_MESSAGES/volto.po +29 -13
- package/locales/da.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +32 -16
- package/locales/de.json +1 -1
- package/locales/el/LC_MESSAGES/volto.po +29 -13
- package/locales/el.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +25 -10
- package/locales/en.json +1 -1
- package/locales/en_AU/LC_MESSAGES/volto.po +29 -13
- package/locales/en_AU.json +1 -1
- package/locales/en_GB/LC_MESSAGES/volto.po +29 -13
- package/locales/en_GB.json +1 -1
- package/locales/eo/LC_MESSAGES/volto.po +29 -13
- package/locales/eo.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +67 -52
- package/locales/es.json +1 -1
- package/locales/et/LC_MESSAGES/volto.po +29 -13
- package/locales/et.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +55 -40
- package/locales/eu.json +1 -1
- package/locales/fa/LC_MESSAGES/volto.po +29 -13
- package/locales/fa.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +30 -14
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +208 -193
- package/locales/fr.json +1 -1
- package/locales/fu/LC_MESSAGES/volto.po +29 -13
- package/locales/fu.json +1 -1
- package/locales/gl/LC_MESSAGES/volto.po +58 -43
- package/locales/gl.json +1 -1
- package/locales/he/LC_MESSAGES/volto.po +29 -13
- package/locales/he.json +1 -1
- package/locales/hi/LC_MESSAGES/volto.po +34 -18
- package/locales/hi.json +1 -1
- package/locales/hr/LC_MESSAGES/volto.po +30 -14
- package/locales/hr.json +1 -1
- package/locales/hu/LC_MESSAGES/volto.po +29 -13
- package/locales/hu.json +1 -1
- package/locales/hy/LC_MESSAGES/volto.po +29 -13
- package/locales/hy.json +1 -1
- package/locales/id/LC_MESSAGES/volto.po +29 -13
- package/locales/id.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +34 -18
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +29 -13
- package/locales/ja.json +1 -1
- package/locales/ka/LC_MESSAGES/volto.po +29 -13
- package/locales/ka.json +1 -1
- package/locales/kn/LC_MESSAGES/volto.po +29 -13
- package/locales/kn.json +1 -1
- package/locales/ko/LC_MESSAGES/volto.po +29 -13
- package/locales/ko.json +1 -1
- package/locales/lt/LC_MESSAGES/volto.po +30 -14
- package/locales/lt.json +1 -1
- package/locales/lv/LC_MESSAGES/volto.po +29 -13
- package/locales/lv.json +1 -1
- package/locales/mi/LC_MESSAGES/volto.po +29 -13
- package/locales/mi.json +1 -1
- package/locales/mk/LC_MESSAGES/volto.po +29 -13
- package/locales/mk.json +1 -1
- package/locales/my/LC_MESSAGES/volto.po +29 -13
- package/locales/my.json +1 -1
- package/locales/nb_NO/LC_MESSAGES/volto.po +29 -13
- package/locales/nb_NO.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +69 -53
- package/locales/nl.json +1 -1
- package/locales/nn/LC_MESSAGES/volto.po +29 -13
- package/locales/nn.json +1 -1
- package/locales/pl/LC_MESSAGES/volto.po +30 -14
- package/locales/pl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +30 -14
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +54 -39
- package/locales/pt_BR.json +1 -1
- package/locales/rm/LC_MESSAGES/volto.po +29 -13
- package/locales/rm.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +30 -15
- package/locales/ro.json +1 -1
- package/locales/ru/LC_MESSAGES/volto.po +30 -14
- package/locales/ru.json +1 -1
- package/locales/sk/LC_MESSAGES/volto.po +30 -14
- package/locales/sk.json +1 -1
- package/locales/sl/LC_MESSAGES/volto.po +29 -13
- package/locales/sl.json +1 -1
- package/locales/sm/LC_MESSAGES/volto.po +29 -13
- package/locales/sm.json +1 -1
- package/locales/sq/LC_MESSAGES/volto.po +29 -13
- package/locales/sq.json +1 -1
- package/locales/sr/LC_MESSAGES/volto.po +30 -14
- package/locales/sr.json +1 -1
- package/locales/sr@cyrl/LC_MESSAGES/volto.po +29 -13
- package/locales/sr@cyrl.json +1 -1
- package/locales/sr@latn/LC_MESSAGES/volto.po +29 -13
- package/locales/sr@latn.json +1 -1
- package/locales/sv/LC_MESSAGES/volto.po +31 -15
- package/locales/sv.json +1 -1
- package/locales/ta/LC_MESSAGES/volto.po +30 -15
- package/locales/ta.json +1 -1
- package/locales/te/LC_MESSAGES/volto.po +29 -13
- package/locales/te.json +1 -1
- package/locales/th/LC_MESSAGES/volto.po +29 -13
- package/locales/th.json +1 -1
- package/locales/to/LC_MESSAGES/volto.po +29 -13
- package/locales/to.json +1 -1
- package/locales/tr/LC_MESSAGES/volto.po +29 -14
- package/locales/tr.json +1 -1
- package/locales/uk/LC_MESSAGES/volto.po +30 -14
- package/locales/uk.json +1 -1
- package/locales/vi/LC_MESSAGES/volto.po +29 -13
- package/locales/vi.json +1 -1
- package/locales/volto.pot +26 -11
- package/locales/zh_CN/LC_MESSAGES/volto.po +29 -14
- package/locales/zh_CN.json +1 -1
- package/locales/zh_Hant/LC_MESSAGES/volto.po +29 -13
- package/locales/zh_Hant.json +1 -1
- package/locales/zh_Hant_HK/LC_MESSAGES/volto.po +29 -13
- package/locales/zh_Hant_HK.json +1 -1
- package/package.json +10 -10
- package/src/components/manage/Add/Add.test.jsx +10 -3
- package/src/components/manage/Aliases/Aliases.test.jsx +5 -2
- package/src/components/manage/BlockChooser/BlockChooser.jsx +7 -10
- package/src/components/manage/Blocks/Block/Edit.jsx +19 -10
- package/src/components/manage/Blocks/Block/Order/Item.jsx +9 -4
- package/src/components/manage/Contents/Contents.test.jsx +7 -4
- package/src/components/manage/Contents/DropZoneContent.jsx +1 -0
- package/src/components/manage/Controlpanels/AddonsControlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Aliases.test.jsx +7 -4
- package/src/components/manage/Controlpanels/BlockType.tsx +2 -3
- package/src/components/manage/Controlpanels/ContentType.test.jsx +12 -9
- package/src/components/manage/Controlpanels/ContentTypeLayout.test.jsx +12 -9
- package/src/components/manage/Controlpanels/ContentTypes.jsx +9 -2
- package/src/components/manage/Controlpanels/ContentTypes.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Controlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Controlpanels.test.jsx +13 -8
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/ModerateComments.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Rules/ConfigureRule.test.jsx +9 -6
- package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Rules/Rules.test.jsx +7 -4
- package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +58 -5
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.ssr.test.jsx +624 -0
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +21 -8
- package/src/components/manage/Delete/Delete.test.jsx +13 -8
- package/src/components/manage/Diff/Diff.test.jsx +7 -4
- package/src/components/manage/Edit/Edit.test.jsx +11 -6
- package/src/components/manage/Form/Form.jsx +6 -1
- package/src/components/manage/Form/ModalForm.jsx +164 -88
- package/src/components/manage/History/History.test.jsx +15 -8
- package/src/components/manage/LinksToItem/LinksToItem.test.jsx +7 -4
- package/src/components/manage/Multilingual/ManageTranslations.test.jsx +15 -12
- package/src/components/manage/Preferences/ChangePassword.test.jsx +7 -4
- package/src/components/manage/Preferences/PersonalPreferences.test.jsx +9 -6
- package/src/components/manage/Rules/Rules.test.jsx +5 -2
- package/src/components/manage/Sharing/Sharing.test.jsx +9 -6
- package/src/components/manage/Sidebar/ObjectBrowser.jsx +7 -0
- package/src/components/manage/Sidebar/ObjectBrowserBody.jsx +7 -3
- package/src/components/manage/Sidebar/ObjectBrowserBody.test.jsx +52 -0
- package/src/components/manage/Sidebar/Sidebar.jsx +2 -0
- package/src/components/manage/Sidebar/Sidebar.test.jsx +4 -1
- package/src/components/manage/Toolbar/Toolbar.jsx +89 -7
- package/src/components/manage/Toolbar/Toolbar.test.jsx +15 -10
- package/src/components/manage/Widgets/FormFieldWrapper.jsx +7 -5
- package/src/components/manage/Widgets/ObjectBrowserWidget.jsx +1 -0
- package/src/components/manage/Widgets/QuerystringWidget.test.jsx +3 -1
- package/src/components/manage/Widgets/TextWidget.jsx +4 -0
- package/src/components/manage/Widgets/TokenWidget.jsx +142 -186
- package/src/components/theme/App/App.test.jsx +13 -10
- package/src/components/theme/ContactForm/ContactForm.test.jsx +13 -8
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.test.jsx +6 -3
- package/src/components/theme/Search/Search.jsx +218 -328
- package/src/components/theme/Search/Search.test.jsx +14 -14
- package/src/components/theme/Sitemap/Sitemap.jsx +22 -30
- package/src/components/theme/Sitemap/Sitemap.test.jsx +18 -0
- package/src/components/theme/Unauthorized/Unauthorized.jsx +23 -30
- package/src/components/theme/Unauthorized/Unauthorized.test.jsx +6 -4
- package/src/components/theme/View/View.test.jsx +37 -24
- package/src/config/index.js +1 -0
- package/src/helpers/Api/Api.js +2 -2
- package/src/helpers/I18n/I18n.test.ts +44 -0
- package/src/helpers/I18n/I18n.ts +31 -0
- package/src/helpers/Robots/Robots.js +1 -1
- package/src/helpers/Robots/Robots.test.js +34 -0
- package/src/helpers/index.js +1 -0
- package/theme/themes/pastanaga/collections/form.overrides +21 -0
- package/theme/themes/pastanaga/elements/button.overrides +30 -3
- package/types/components/manage/Controlpanels/Relations/RelationsMatrix.d.ts +1 -1
- package/types/components/manage/Controlpanels/Users/UsersControlpanel.d.ts +2 -6
- package/types/components/manage/Controlpanels/Users/UsersControlpanel.ssr.test.d.ts +1 -0
- package/types/components/manage/Controlpanels/index.d.ts +1 -1
- package/types/components/manage/Multilingual/ManageTranslations.d.ts +1 -1
- package/types/components/manage/Sidebar/ObjectBrowser.d.ts +1 -1
- package/types/components/manage/Sidebar/ObjectBrowserBody.test.d.ts +1 -0
- package/types/components/manage/Widgets/ImageWidget.d.ts +1 -1
- package/types/components/manage/Widgets/InternalUrlWidget.d.ts +1 -1
- package/types/components/manage/Widgets/UrlWidget.d.ts +1 -1
- package/types/components/manage/Widgets/index.d.ts +2 -2
- package/types/components/theme/Search/Search.d.ts +1 -1
- package/types/helpers/I18n/I18n.d.ts +20 -0
- package/types/helpers/index.d.ts +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
|
+
import { CookiesProvider } from 'react-cookie';
|
|
4
5
|
import configureMockStore from 'redux-mock-store';
|
|
5
6
|
import thunk from 'redux-thunk';
|
|
6
7
|
|
|
@@ -23,12 +24,14 @@ describe('ConfigureRule', () => {
|
|
|
23
24
|
});
|
|
24
25
|
const { container } = render(
|
|
25
26
|
<Provider store={store}>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
<CookiesProvider>
|
|
28
|
+
<>
|
|
29
|
+
<ConfigureRule
|
|
30
|
+
location={{ pathname: '/controlpanel/rules/:id/configure' }}
|
|
31
|
+
/>
|
|
32
|
+
<div id="toolbar"></div>
|
|
33
|
+
</>
|
|
34
|
+
</CookiesProvider>
|
|
32
35
|
</Provider>,
|
|
33
36
|
);
|
|
34
37
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
|
+
import { CookiesProvider } from 'react-cookie';
|
|
4
5
|
import configureMockStore from 'redux-mock-store';
|
|
5
6
|
import thunk from 'redux-thunk';
|
|
6
7
|
|
|
@@ -25,10 +26,12 @@ describe('EditRule', () => {
|
|
|
25
26
|
});
|
|
26
27
|
const { container } = render(
|
|
27
28
|
<Provider store={store}>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
<CookiesProvider>
|
|
30
|
+
<>
|
|
31
|
+
<EditRule location={{ pathname: '/controlpanel/rules/:id/edit' }} />
|
|
32
|
+
<div id="toolbar"></div>
|
|
33
|
+
</>
|
|
34
|
+
</CookiesProvider>
|
|
32
35
|
</Provider>,
|
|
33
36
|
);
|
|
34
37
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
|
+
import { CookiesProvider } from 'react-cookie';
|
|
4
5
|
import configureMockStore from 'redux-mock-store';
|
|
5
6
|
import thunk from 'redux-thunk';
|
|
6
7
|
|
|
@@ -66,10 +67,12 @@ describe('Rules', () => {
|
|
|
66
67
|
});
|
|
67
68
|
const { container } = render(
|
|
68
69
|
<Provider store={store}>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
<CookiesProvider>
|
|
71
|
+
<>
|
|
72
|
+
<Rules location={{ pathname: '/controlpanel/rules' }} />
|
|
73
|
+
<div id="toolbar"></div>
|
|
74
|
+
</>
|
|
75
|
+
</CookiesProvider>
|
|
73
76
|
</Provider>,
|
|
74
77
|
);
|
|
75
78
|
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
|
+
import { CookiesProvider } from 'react-cookie';
|
|
5
6
|
|
|
6
7
|
import UndoControlpanel from './UndoControlpanel';
|
|
7
8
|
|
|
@@ -107,10 +108,12 @@ describe('UndoControlpanel', () => {
|
|
|
107
108
|
store.dispatch = vi.fn(() => Promise.resolve());
|
|
108
109
|
const { container } = render(
|
|
109
110
|
<Provider store={store}>
|
|
110
|
-
<
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
<CookiesProvider>
|
|
112
|
+
<div>
|
|
113
|
+
<UndoControlpanel location={{ pathname: '/blog' }} />
|
|
114
|
+
<div id="toolbar"></div>
|
|
115
|
+
</div>
|
|
116
|
+
</CookiesProvider>
|
|
114
117
|
</Provider>,
|
|
115
118
|
);
|
|
116
119
|
|
|
@@ -3,6 +3,7 @@ import { render } from '@testing-library/react';
|
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
5
|
import { MemoryRouter } from 'react-router-dom';
|
|
6
|
+
import { CookiesProvider } from 'react-cookie';
|
|
6
7
|
|
|
7
8
|
import UserGroupMembershipControlPanel from './UserGroupMembershipControlPanel';
|
|
8
9
|
|
|
@@ -55,10 +56,12 @@ describe('UserGroupMembershipControlPanel', () => {
|
|
|
55
56
|
});
|
|
56
57
|
const { container } = render(
|
|
57
58
|
<Provider store={store}>
|
|
58
|
-
<
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
<CookiesProvider>
|
|
60
|
+
<MemoryRouter>
|
|
61
|
+
<UserGroupMembershipControlPanel />
|
|
62
|
+
<div id="toolbar"></div>
|
|
63
|
+
</MemoryRouter>
|
|
64
|
+
</CookiesProvider>
|
|
62
65
|
</Provider>,
|
|
63
66
|
);
|
|
64
67
|
|
|
@@ -13,6 +13,7 @@ import { listRoles } from '@plone/volto/actions/roles/roles';
|
|
|
13
13
|
import { listGroups, updateGroup } from '@plone/volto/actions/groups/groups';
|
|
14
14
|
import { getControlpanel } from '@plone/volto/actions/controlpanels/controlpanels';
|
|
15
15
|
import { getUserSchema } from '@plone/volto/actions/userschema/userschema';
|
|
16
|
+
import { asyncConnect } from '@plone/volto/helpers/AsyncConnect';
|
|
16
17
|
import jwtDecode from 'jwt-decode';
|
|
17
18
|
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
18
19
|
import Toast from '@plone/volto/components/manage/Toast/Toast';
|
|
@@ -57,7 +58,8 @@ import {
|
|
|
57
58
|
* UsersControlpanel functional component.
|
|
58
59
|
* @function UsersControlpanel
|
|
59
60
|
*/
|
|
60
|
-
const UsersControlpanel = () => {
|
|
61
|
+
const UsersControlpanel = (props) => {
|
|
62
|
+
const { staticContext } = props;
|
|
61
63
|
const intl = useIntl();
|
|
62
64
|
const dispatch = useDispatch();
|
|
63
65
|
|
|
@@ -143,7 +145,10 @@ const UsersControlpanel = () => {
|
|
|
143
145
|
await listUsersAction();
|
|
144
146
|
setEntries(users);
|
|
145
147
|
}
|
|
146
|
-
|
|
148
|
+
// Only fetch user schema if it hasn't been loaded yet (e.g. by asyncConnect SSR)
|
|
149
|
+
if (!userschema?.loaded) {
|
|
150
|
+
await getUserSchemaAction();
|
|
151
|
+
}
|
|
147
152
|
await getUserAction(userId);
|
|
148
153
|
}, [
|
|
149
154
|
getControlpanelAction,
|
|
@@ -152,6 +157,7 @@ const UsersControlpanel = () => {
|
|
|
152
157
|
listGroupsAction,
|
|
153
158
|
listUsersAction,
|
|
154
159
|
users,
|
|
160
|
+
userschema,
|
|
155
161
|
getUserSchemaAction,
|
|
156
162
|
getUserAction,
|
|
157
163
|
userId,
|
|
@@ -451,6 +457,8 @@ const UsersControlpanel = () => {
|
|
|
451
457
|
|
|
452
458
|
useEffect(() => {
|
|
453
459
|
setIsClient(true);
|
|
460
|
+
// Skip fetching if the store already has an error.
|
|
461
|
+
if (loadRolesRequest?.error) return;
|
|
454
462
|
fetchData();
|
|
455
463
|
checkLoginUsingEmailStatus();
|
|
456
464
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
@@ -471,8 +479,14 @@ const UsersControlpanel = () => {
|
|
|
471
479
|
}
|
|
472
480
|
}, [loadRolesRequest?.error, loadRolesRequest?.loading]);
|
|
473
481
|
|
|
474
|
-
|
|
475
|
-
|
|
482
|
+
const effectiveError =
|
|
483
|
+
error ||
|
|
484
|
+
(loadRolesRequest?.error && !loadRolesRequest?.loading
|
|
485
|
+
? loadRolesRequest.error
|
|
486
|
+
: null);
|
|
487
|
+
|
|
488
|
+
if (effectiveError) {
|
|
489
|
+
return <Error error={effectiveError} staticContext={staticContext} />;
|
|
476
490
|
}
|
|
477
491
|
|
|
478
492
|
const usernameToDelete = userToDelete ? userToDelete.username : '';
|
|
@@ -729,4 +743,43 @@ const UsersControlpanel = () => {
|
|
|
729
743
|
);
|
|
730
744
|
};
|
|
731
745
|
|
|
732
|
-
export default
|
|
746
|
+
export default asyncConnect([
|
|
747
|
+
{
|
|
748
|
+
key: 'controlpanels',
|
|
749
|
+
promise: ({ store: { dispatch, getState } }) => {
|
|
750
|
+
return dispatch(getControlpanel('usergroup')).then(() => {
|
|
751
|
+
const state = getState();
|
|
752
|
+
const many_users = state.controlpanels?.controlpanel?.data?.many_users;
|
|
753
|
+
if (!many_users) {
|
|
754
|
+
dispatch(listUsers());
|
|
755
|
+
dispatch(listGroups());
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
},
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
key: 'roles',
|
|
762
|
+
promise: ({ store: { dispatch } }) => {
|
|
763
|
+
return dispatch(listRoles());
|
|
764
|
+
},
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
key: 'userschema',
|
|
768
|
+
promise: ({ store: { dispatch } }) => {
|
|
769
|
+
return dispatch(getUserSchema());
|
|
770
|
+
},
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
key: 'user',
|
|
774
|
+
promise: ({ store: { dispatch, getState } }) => {
|
|
775
|
+
const state = getState();
|
|
776
|
+
const token = state.userSession.token;
|
|
777
|
+
if (token) {
|
|
778
|
+
const userId = jwtDecode(token).sub;
|
|
779
|
+
if (userId) {
|
|
780
|
+
return dispatch(getUser(userId));
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
},
|
|
785
|
+
])(UsersControlpanel);
|