@plone/volto 17.0.0-alpha.24 → 17.0.0-alpha.25
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/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +41 -0
- package/CONTRIBUTING.md +5 -1
- package/README.md +2 -1
- package/locales/ca/LC_MESSAGES/volto.po +5 -0
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +5 -0
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +5 -0
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +5 -0
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +5 -0
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +5 -0
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +5 -0
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +5 -0
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +5 -0
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +5 -0
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +5 -0
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +5 -0
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +5 -0
- package/locales/ro.json +1 -1
- package/locales/volto.pot +6 -1
- package/locales/zh_CN/LC_MESSAGES/volto.po +5 -0
- package/locales/zh_CN.json +1 -1
- package/package.json +1 -1
- package/packages/volto-slate/build/messages/src/blocks/Table/TableBlockEdit.json +90 -0
- package/packages/volto-slate/build/messages/src/blocks/Text/DefaultTextBlockEditor.json +6 -0
- package/packages/volto-slate/build/messages/src/blocks/Text/DetachedTextBlockEditor.json +6 -0
- package/packages/volto-slate/build/messages/src/blocks/Text/SlashMenu.json +6 -0
- package/packages/volto-slate/build/messages/src/editor/plugins/AdvancedLink/index.json +10 -0
- package/packages/volto-slate/build/messages/src/editor/plugins/Link/index.json +10 -0
- package/packages/volto-slate/build/messages/src/editor/plugins/Table/index.json +30 -0
- package/packages/volto-slate/build/messages/src/elementEditor/messages.json +10 -0
- package/packages/volto-slate/build/messages/src/widgets/HtmlSlateWidget.json +6 -0
- package/packages/volto-slate/build/messages/src/widgets/RichTextWidgetView.json +6 -0
- package/packages/volto-slate/package.json +1 -1
- package/src/actions/index.js +1 -0
- package/src/actions/relations/relations.js +17 -0
- package/src/components/manage/Blocks/Image/schema.js +5 -1
- package/src/components/manage/Blocks/Listing/withQuerystringResults.jsx +18 -11
- package/src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx +4 -3
- package/src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.test.jsx +44 -0
- package/src/components/manage/Contents/Contents.jsx +27 -0
- package/src/components/manage/Controlpanels/Relations/BrokenRelations.jsx +11 -9
- package/src/components/manage/Controlpanels/Relations/Relations.jsx +3 -3
- package/src/components/manage/Controlpanels/Relations/RelationsListing.jsx +8 -7
- package/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx +15 -9
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +25 -10
- package/src/components/manage/Diff/DiffField.jsx +25 -1
- package/src/components/manage/LinksToItem/LinksToItem.jsx +1 -1
- package/src/components/manage/LinksToItem/LinksToItem.test.jsx +1 -1
- package/src/components/manage/Sharing/Sharing.jsx +11 -5
- package/src/components/manage/Widgets/FormFieldWrapper.jsx +1 -1
- package/src/components/theme/Comments/Comment.stories.jsx +84 -0
- package/src/components/theme/Comments/Comments.jsx +273 -378
- package/src/components/theme/Logout/Logout.jsx +36 -83
- package/src/components/theme/Search/SearchTags.jsx +30 -60
- package/src/components/theme/Sitemap/Sitemap.jsx +24 -13
- package/src/components/theme/Sitemap/Sitemap.test.jsx +23 -2
- package/src/constants/ActionTypes.js +1 -0
- package/src/reducers/relations/relations.js +74 -46
- package/src/server.jsx +9 -0
- package/theme/themes/pastanaga/collections/form.overrides +46 -0
- package/theme/themes/pastanaga/elements/input.overrides +6 -0
- package/theme/themes/pastanaga/elements/label.overrides +10 -0
- package/.gitignore~ +0 -71
- package/news/4547.breaking~ +0 -1
- package/package.json~ +0 -444
- package/src/config/index.js~ +0 -223
|
@@ -17,7 +17,11 @@ import {
|
|
|
17
17
|
import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser';
|
|
18
18
|
import { messages } from '@plone/volto/helpers';
|
|
19
19
|
import { Icon, Toast } from '@plone/volto/components';
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
getRelationStats,
|
|
22
|
+
queryRelations,
|
|
23
|
+
rebuildRelations,
|
|
24
|
+
} from '@plone/volto/actions';
|
|
21
25
|
import RelationsListing from './RelationsListing';
|
|
22
26
|
import BrokenRelations from './BrokenRelations';
|
|
23
27
|
import helpSVG from '@plone/volto/icons/help.svg';
|
|
@@ -39,12 +43,14 @@ const RelationsMatrix = (props) => {
|
|
|
39
43
|
id: 'plone_setup',
|
|
40
44
|
});
|
|
41
45
|
|
|
42
|
-
const relationtypes = useSelector(
|
|
46
|
+
const relationtypes = useSelector(
|
|
47
|
+
(state) => state.relations?.stats?.data?.stats,
|
|
48
|
+
);
|
|
43
49
|
const relationsListError = useSelector(
|
|
44
|
-
(state) => state.relations?.
|
|
50
|
+
(state) => state.relations?.stats?.error?.response?.body?.error,
|
|
45
51
|
);
|
|
46
52
|
const brokenRelations = useSelector(
|
|
47
|
-
(state) => state.relations?.stats?.broken,
|
|
53
|
+
(state) => state.relations?.stats?.data?.broken,
|
|
48
54
|
);
|
|
49
55
|
|
|
50
56
|
let filter_options = useSelector((state) => state.groups.filter_groups);
|
|
@@ -67,7 +73,7 @@ const RelationsMatrix = (props) => {
|
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
useEffect(() => {
|
|
70
|
-
dispatch(
|
|
76
|
+
dispatch(getRelationStats());
|
|
71
77
|
}, [dispatch]);
|
|
72
78
|
|
|
73
79
|
const onReset = (event) => {
|
|
@@ -128,9 +134,7 @@ const RelationsMatrix = (props) => {
|
|
|
128
134
|
const rebuildRelationsHandler = (flush = false) => {
|
|
129
135
|
dispatch(rebuildRelations(flush))
|
|
130
136
|
.then(() => {
|
|
131
|
-
dispatch(
|
|
132
|
-
})
|
|
133
|
-
.then(() => {
|
|
137
|
+
dispatch(getRelationStats());
|
|
134
138
|
dispatch(queryRelations(null, true, 'broken'));
|
|
135
139
|
})
|
|
136
140
|
.then(() => {
|
|
@@ -443,7 +447,9 @@ const RelationsMatrix = (props) => {
|
|
|
443
447
|
) : null}
|
|
444
448
|
</div>
|
|
445
449
|
) : (
|
|
446
|
-
<p>
|
|
450
|
+
<p>
|
|
451
|
+
<b>{relationsListError?.type}</b> {relationsListError?.message}
|
|
452
|
+
</p>
|
|
447
453
|
)}
|
|
448
454
|
</Tab.Pane>
|
|
449
455
|
),
|
|
@@ -107,6 +107,7 @@ class UsersControlpanel extends Component {
|
|
|
107
107
|
isClient: false,
|
|
108
108
|
currentPage: 0,
|
|
109
109
|
pageSize: 10,
|
|
110
|
+
loginUsingEmail: false,
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
113
|
|
|
@@ -122,6 +123,14 @@ class UsersControlpanel extends Component {
|
|
|
122
123
|
}
|
|
123
124
|
};
|
|
124
125
|
|
|
126
|
+
// Because username field needs to be disabled if email login is enabled!
|
|
127
|
+
checkLoginUsingEmailStatus = async () => {
|
|
128
|
+
await this.props.getControlpanel('security');
|
|
129
|
+
this.setState({
|
|
130
|
+
loginUsingEmail: this.props.controlPanelData?.data.use_email_as_login,
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
|
|
125
134
|
/**
|
|
126
135
|
* Component did mount
|
|
127
136
|
* @method componentDidMount
|
|
@@ -132,6 +141,7 @@ class UsersControlpanel extends Component {
|
|
|
132
141
|
isClient: true,
|
|
133
142
|
});
|
|
134
143
|
this.fetchData();
|
|
144
|
+
this.checkLoginUsingEmailStatus();
|
|
135
145
|
}
|
|
136
146
|
|
|
137
147
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
@@ -425,7 +435,7 @@ class UsersControlpanel extends Component {
|
|
|
425
435
|
id: 'default',
|
|
426
436
|
title: 'FIXME: User Data',
|
|
427
437
|
fields: [
|
|
428
|
-
'username',
|
|
438
|
+
...(!this.state.loginUsingEmail ? ['username'] : []),
|
|
429
439
|
'fullname',
|
|
430
440
|
'email',
|
|
431
441
|
'password',
|
|
@@ -436,15 +446,19 @@ class UsersControlpanel extends Component {
|
|
|
436
446
|
},
|
|
437
447
|
],
|
|
438
448
|
properties: {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
449
|
+
...(!this.state.loginUsingEmail
|
|
450
|
+
? {
|
|
451
|
+
username: {
|
|
452
|
+
title: this.props.intl.formatMessage(
|
|
453
|
+
messages.addUserFormUsernameTitle,
|
|
454
|
+
),
|
|
455
|
+
type: 'string',
|
|
456
|
+
description: this.props.intl.formatMessage(
|
|
457
|
+
messages.addUserFormUsernameDescription,
|
|
458
|
+
),
|
|
459
|
+
},
|
|
460
|
+
}
|
|
461
|
+
: {}),
|
|
448
462
|
fullname: {
|
|
449
463
|
title: this.props.intl.formatMessage(
|
|
450
464
|
messages.addUserFormFullnameTitle,
|
|
@@ -670,6 +684,7 @@ export default compose(
|
|
|
670
684
|
createRequest: state.users.create,
|
|
671
685
|
loadRolesRequest: state.roles,
|
|
672
686
|
inheritedRole: state.authRole.authenticatedRole,
|
|
687
|
+
controlPanelData: state.controlpanels?.controlpanel,
|
|
673
688
|
}),
|
|
674
689
|
(dispatch) =>
|
|
675
690
|
bindActionCreators(
|
|
@@ -17,6 +17,7 @@ import { useSelector } from 'react-redux';
|
|
|
17
17
|
import { Api } from '@plone/volto/helpers';
|
|
18
18
|
import configureStore from '@plone/volto/store';
|
|
19
19
|
import { DefaultView } from '@plone/volto/components/';
|
|
20
|
+
import { serializeNodes } from '@plone/volto-slate/editor/render';
|
|
20
21
|
|
|
21
22
|
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
22
23
|
|
|
@@ -69,7 +70,7 @@ const DiffField = ({
|
|
|
69
70
|
.replace('\u202F', ' '),
|
|
70
71
|
);
|
|
71
72
|
break;
|
|
72
|
-
case 'json':
|
|
73
|
+
case 'json': {
|
|
73
74
|
const api = new Api();
|
|
74
75
|
const history = createBrowserHistory();
|
|
75
76
|
const store = configureStore(window.__data, history, api);
|
|
@@ -90,6 +91,29 @@ const DiffField = ({
|
|
|
90
91
|
),
|
|
91
92
|
);
|
|
92
93
|
break;
|
|
94
|
+
}
|
|
95
|
+
case 'slate': {
|
|
96
|
+
const api = new Api();
|
|
97
|
+
const history = createBrowserHistory();
|
|
98
|
+
const store = configureStore(window.__data, history, api);
|
|
99
|
+
parts = diffWords(
|
|
100
|
+
ReactDOMServer.renderToStaticMarkup(
|
|
101
|
+
<Provider store={store}>
|
|
102
|
+
<ConnectedRouter history={history}>
|
|
103
|
+
{serializeNodes(one)}
|
|
104
|
+
</ConnectedRouter>
|
|
105
|
+
</Provider>,
|
|
106
|
+
),
|
|
107
|
+
ReactDOMServer.renderToStaticMarkup(
|
|
108
|
+
<Provider store={store}>
|
|
109
|
+
<ConnectedRouter history={history}>
|
|
110
|
+
{serializeNodes(two)}
|
|
111
|
+
</ConnectedRouter>
|
|
112
|
+
</Provider>,
|
|
113
|
+
),
|
|
114
|
+
);
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
93
117
|
case 'textarea':
|
|
94
118
|
default:
|
|
95
119
|
parts = diffWords(one, two);
|
|
@@ -44,7 +44,7 @@ const LinksToItem = (props) => {
|
|
|
44
44
|
|
|
45
45
|
const title = useSelector((state) => state.content.data?.title || '');
|
|
46
46
|
const myrelations = useSelector(
|
|
47
|
-
(state) => state.relations.subrequests[itempath]?.
|
|
47
|
+
(state) => state.relations.subrequests[itempath]?.data,
|
|
48
48
|
);
|
|
49
49
|
const actions = useSelector((state) => state.actions?.actions ?? {});
|
|
50
50
|
const ploneSetupAction = find(actions.user, {
|
|
@@ -246,9 +246,9 @@ class SharingComponent extends Component {
|
|
|
246
246
|
* @returns {undefined}
|
|
247
247
|
*/
|
|
248
248
|
onToggleInherit() {
|
|
249
|
-
this.setState({
|
|
250
|
-
inherit: !
|
|
251
|
-
});
|
|
249
|
+
this.setState((state) => ({
|
|
250
|
+
inherit: !state.inherit,
|
|
251
|
+
}));
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
/**
|
|
@@ -404,9 +404,15 @@ class SharingComponent extends Component {
|
|
|
404
404
|
<Segment attached>
|
|
405
405
|
<Form.Field>
|
|
406
406
|
<Checkbox
|
|
407
|
-
|
|
407
|
+
id="inherit-permissions-checkbox"
|
|
408
|
+
name="inherit-permissions-checkbox"
|
|
409
|
+
defaultChecked={this.state.inherit}
|
|
408
410
|
onChange={this.onToggleInherit}
|
|
409
|
-
label={
|
|
411
|
+
label={
|
|
412
|
+
<label htmlFor="inherit-permissions-checkbox">
|
|
413
|
+
{this.props.intl.formatMessage(messages.inherit)}
|
|
414
|
+
</label>
|
|
415
|
+
}
|
|
410
416
|
/>
|
|
411
417
|
</Form.Field>
|
|
412
418
|
<p className="help">
|
|
@@ -96,7 +96,7 @@ class FormFieldWrapper extends Component {
|
|
|
96
96
|
{this.props.children}
|
|
97
97
|
|
|
98
98
|
{map(error, (message) => (
|
|
99
|
-
<Label key={message} basic color="red"
|
|
99
|
+
<Label key={message} basic color="red" className="form-error-label">
|
|
100
100
|
{message}
|
|
101
101
|
</Label>
|
|
102
102
|
))}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { injectIntl } from 'react-intl';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import CommentsComponent from './Comments';
|
|
4
|
+
import { RealStoreWrapper as Wrapper } from '@plone/volto/storybook';
|
|
5
|
+
|
|
6
|
+
const IntlCommentsComponent = injectIntl(CommentsComponent);
|
|
7
|
+
|
|
8
|
+
function StoryComponent(args) {
|
|
9
|
+
return (
|
|
10
|
+
<Wrapper
|
|
11
|
+
customStore={{
|
|
12
|
+
comments: {
|
|
13
|
+
items: [
|
|
14
|
+
{
|
|
15
|
+
'@id': 'someurl',
|
|
16
|
+
comment_id: '1614094601171408',
|
|
17
|
+
...args,
|
|
18
|
+
is_deletable: true,
|
|
19
|
+
is_editable: true,
|
|
20
|
+
can_reply: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
permissions: {
|
|
24
|
+
view_comments: true,
|
|
25
|
+
can_reply: true,
|
|
26
|
+
},
|
|
27
|
+
add: {
|
|
28
|
+
loading: false,
|
|
29
|
+
loaded: true,
|
|
30
|
+
},
|
|
31
|
+
delete: {
|
|
32
|
+
loading: false,
|
|
33
|
+
loaded: true,
|
|
34
|
+
},
|
|
35
|
+
update: {
|
|
36
|
+
loading: false,
|
|
37
|
+
loaded: true,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
intl: {
|
|
41
|
+
locale: 'en',
|
|
42
|
+
messages: {},
|
|
43
|
+
},
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<div id="toolbar" style={{ display: 'none' }} />
|
|
47
|
+
<IntlCommentsComponent {...args} />
|
|
48
|
+
</Wrapper>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const CommentsModal = StoryComponent.bind({});
|
|
53
|
+
CommentsModal.args = {
|
|
54
|
+
author_name: 'admin',
|
|
55
|
+
creation_date: '2017-11-06T19:36:01',
|
|
56
|
+
text: { data: 'Plone 6' },
|
|
57
|
+
};
|
|
58
|
+
export default {
|
|
59
|
+
title: 'Public components/Comments/Comments Modal',
|
|
60
|
+
component: CommentsComponent,
|
|
61
|
+
decorators: [
|
|
62
|
+
(Story) => (
|
|
63
|
+
<div className="ui segment form attached" style={{ width: '400px' }}>
|
|
64
|
+
<Story />
|
|
65
|
+
</div>
|
|
66
|
+
),
|
|
67
|
+
],
|
|
68
|
+
argTypes: {
|
|
69
|
+
creation_date: {
|
|
70
|
+
control: 'date',
|
|
71
|
+
description: 'Date comment was created',
|
|
72
|
+
},
|
|
73
|
+
author_name: {
|
|
74
|
+
control: 'text',
|
|
75
|
+
description: 'Comment author name',
|
|
76
|
+
},
|
|
77
|
+
text: {
|
|
78
|
+
data: {
|
|
79
|
+
control: 'date',
|
|
80
|
+
},
|
|
81
|
+
description: 'Comment text',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|