@plone/volto 18.29.0 → 18.29.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/CHANGELOG.md +12 -0
- package/cypress.config.js +1 -0
- package/locales/es/LC_MESSAGES/volto.po +14 -14
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +3 -3
- package/locales/eu.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +3 -3
- package/locales/nl.json +1 -1
- package/locales/ta/LC_MESSAGES/volto.po +54 -53
- package/locales/ta.json +1 -1
- package/news/7428.feat +1 -0
- package/package.json +8 -8
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +575 -630
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +4 -3
- package/src/components/manage/Widgets/ImageWidget.jsx +11 -4
- package/types/components/manage/Controlpanels/Users/UsersControlpanel.d.ts +6 -2
- package/types/components/manage/Controlpanels/index.d.ts +1 -1
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { render, act } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
5
6
|
import jwt from 'jsonwebtoken';
|
|
6
7
|
|
|
7
8
|
import UsersControlpanel from './UsersControlpanel';
|
|
@@ -41,10 +42,10 @@ describe('UsersControlpanel', () => {
|
|
|
41
42
|
const { container } = await act(async () => {
|
|
42
43
|
return render(
|
|
43
44
|
<Provider store={store}>
|
|
44
|
-
|
|
45
|
-
<UsersControlpanel
|
|
45
|
+
<MemoryRouter initialEntries={['/controlpanel/users']}>
|
|
46
|
+
<UsersControlpanel />
|
|
46
47
|
<div id="toolbar"></div>
|
|
47
|
-
|
|
48
|
+
</MemoryRouter>
|
|
48
49
|
</Provider>,
|
|
49
50
|
);
|
|
50
51
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import { Button, Dimmer, Loader, Message } from 'semantic-ui-react';
|
|
3
3
|
import { useIntl, defineMessages } from 'react-intl';
|
|
4
|
-
import { useDispatch } from 'react-redux';
|
|
4
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
5
5
|
import { useLocation } from 'react-router-dom';
|
|
6
6
|
import loadable from '@loadable/component';
|
|
7
7
|
import { connect } from 'react-redux';
|
|
@@ -14,6 +14,7 @@ import config from '@plone/volto/registry';
|
|
|
14
14
|
import {
|
|
15
15
|
flattenToAppURL,
|
|
16
16
|
getBaseUrl,
|
|
17
|
+
getParentUrl,
|
|
17
18
|
isInternalURL,
|
|
18
19
|
normalizeUrl,
|
|
19
20
|
removeProtocol,
|
|
@@ -109,6 +110,9 @@ const UnconnectedImageInput = (props) => {
|
|
|
109
110
|
const linkEditor = useLinkEditor();
|
|
110
111
|
const location = useLocation();
|
|
111
112
|
const dispatch = useDispatch();
|
|
113
|
+
const isFolderish = useSelector(
|
|
114
|
+
(state) => state?.content?.data?.is_folderish,
|
|
115
|
+
);
|
|
112
116
|
const contextUrl = location.pathname;
|
|
113
117
|
|
|
114
118
|
const [uploading, setUploading] = React.useState(false);
|
|
@@ -156,6 +160,8 @@ const UnconnectedImageInput = (props) => {
|
|
|
156
160
|
|
|
157
161
|
const handleUpload = React.useCallback(
|
|
158
162
|
(eventOrFile) => {
|
|
163
|
+
let uploadUrl = getBaseUrl(contextUrl);
|
|
164
|
+
if (!isFolderish) uploadUrl = getParentUrl(uploadUrl);
|
|
159
165
|
if (restrictFileUpload === true) return;
|
|
160
166
|
eventOrFile.target && eventOrFile.stopPropagation();
|
|
161
167
|
|
|
@@ -171,7 +177,7 @@ const UnconnectedImageInput = (props) => {
|
|
|
171
177
|
const fields = fileData.match(/^data:(.*);(.*),(.*)$/);
|
|
172
178
|
dispatch(
|
|
173
179
|
createContent(
|
|
174
|
-
|
|
180
|
+
uploadUrl,
|
|
175
181
|
{
|
|
176
182
|
'@type': 'Image',
|
|
177
183
|
title: file.name,
|
|
@@ -188,11 +194,12 @@ const UnconnectedImageInput = (props) => {
|
|
|
188
194
|
});
|
|
189
195
|
},
|
|
190
196
|
[
|
|
197
|
+
contextUrl,
|
|
198
|
+
isFolderish,
|
|
191
199
|
restrictFileUpload,
|
|
192
200
|
intl.formatMessage,
|
|
193
201
|
dispatch,
|
|
194
|
-
props,
|
|
195
|
-
contextUrl,
|
|
202
|
+
props.block,
|
|
196
203
|
requestId,
|
|
197
204
|
],
|
|
198
205
|
);
|
|
@@ -4,7 +4,7 @@ export declare const RulesControlpanel: import("@loadable/component").LoadableCl
|
|
|
4
4
|
export declare const AddRuleControlpanel: import("@loadable/component").LoadableClassComponent<any>;
|
|
5
5
|
export declare const EditRuleControlpanel: import("@loadable/component").LoadableClassComponent<any>;
|
|
6
6
|
export declare const ConfigureRuleControlpanel: import("@loadable/component").LoadableClassComponent<any>;
|
|
7
|
-
export declare const UsersControlpanel: import("@loadable/component").
|
|
7
|
+
export declare const UsersControlpanel: import("@loadable/component").LoadableComponent<unknown>;
|
|
8
8
|
export declare const RenderUsers: import("@loadable/component").LoadableComponent<any>;
|
|
9
9
|
export declare const UserGroupMembershipControlPanel: import("@loadable/component").LoadableComponent<unknown>;
|
|
10
10
|
export declare const GroupsControlpanel: import("@loadable/component").LoadableClassComponent<any>;
|