@plone/volto 16.31.9 → 16.31.11
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.draft +2 -2
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +12 -0
- 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/package.json +1 -1
- package/src/components/manage/Blocks/Search/components/SortOn.jsx +82 -55
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx +2 -2
- package/theme/themes/pastanaga/extras/blocks.less +6 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Button } from 'semantic-ui-react';
|
|
3
2
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
4
3
|
import cx from 'classnames';
|
|
@@ -31,6 +30,10 @@ const messages = defineMessages({
|
|
|
31
30
|
id: 'Descending',
|
|
32
31
|
defaultMessage: 'Descending',
|
|
33
32
|
},
|
|
33
|
+
sortedOn: {
|
|
34
|
+
id: 'Sorted on',
|
|
35
|
+
defaultMessage: 'Sorted on',
|
|
36
|
+
},
|
|
34
37
|
});
|
|
35
38
|
|
|
36
39
|
const SortOn = (props) => {
|
|
@@ -48,9 +51,17 @@ const SortOn = (props) => {
|
|
|
48
51
|
const { sortable_indexes } = querystring;
|
|
49
52
|
const Select = reactSelect.default;
|
|
50
53
|
|
|
51
|
-
const
|
|
54
|
+
const defaultSortOn = data?.query?.sort_on || '';
|
|
55
|
+
const activeSortOn = sortOn || defaultSortOn;
|
|
56
|
+
|
|
57
|
+
let { sortOnOptions = [] } = data;
|
|
58
|
+
sortOnOptions = [defaultSortOn, ...sortOnOptions];
|
|
59
|
+
sortOnOptions = [...new Set(sortOnOptions)];
|
|
52
60
|
|
|
53
|
-
const
|
|
61
|
+
const showSelectField = sortOnOptions.length > 1;
|
|
62
|
+
if (!showSelectField && !activeSortOn) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
54
65
|
const value = {
|
|
55
66
|
value: activeSortOn || intl.formatMessage(messages.noSelection),
|
|
56
67
|
label:
|
|
@@ -62,59 +73,75 @@ const SortOn = (props) => {
|
|
|
62
73
|
return (
|
|
63
74
|
<div className="search-sort-wrapper">
|
|
64
75
|
<div className="search-sort-on">
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
{showSelectField ? (
|
|
77
|
+
<>
|
|
78
|
+
<span className="sort-label">
|
|
79
|
+
{intl.formatMessage(messages.sortOn)}
|
|
80
|
+
</span>
|
|
81
|
+
<Select
|
|
82
|
+
id="select-search-sort-on"
|
|
83
|
+
name="select-searchblock-sort-on"
|
|
84
|
+
className="search-react-select-container"
|
|
85
|
+
classNamePrefix="react-select"
|
|
86
|
+
placeholder={intl.formatMessage(messages.sortOn)}
|
|
87
|
+
styles={sortOnSelectStyles}
|
|
88
|
+
theme={selectTheme}
|
|
89
|
+
components={{ DropdownIndicator, Option }}
|
|
90
|
+
options={[
|
|
91
|
+
...sortOnOptions.map((k) => ({
|
|
92
|
+
value: k,
|
|
93
|
+
label:
|
|
94
|
+
sortable_indexes[k]?.title ||
|
|
95
|
+
k ||
|
|
96
|
+
intl.formatMessage(messages.noSelection),
|
|
97
|
+
})),
|
|
98
|
+
]}
|
|
99
|
+
isSearchable={false}
|
|
100
|
+
value={value}
|
|
101
|
+
onChange={(data) => {
|
|
102
|
+
!isEditMode && setSortOn(data.value);
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
</>
|
|
106
|
+
) : (
|
|
107
|
+
<span className="sorted-label">
|
|
108
|
+
{intl.formatMessage(messages.sortedOn)}
|
|
109
|
+
<span className="sorted-label-value">{value.label}</span>
|
|
110
|
+
</span>
|
|
111
|
+
)}
|
|
89
112
|
</div>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
{activeSortOn ? (
|
|
114
|
+
<>
|
|
115
|
+
<Button
|
|
116
|
+
icon
|
|
117
|
+
basic
|
|
118
|
+
compact
|
|
119
|
+
title={intl.formatMessage(messages.ascending)}
|
|
120
|
+
className={cx({
|
|
121
|
+
active: sortOrder === 'ascending',
|
|
122
|
+
})}
|
|
123
|
+
onClick={() => {
|
|
124
|
+
!isEditMode && setSortOrder('ascending');
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
<Icon name={downSVG} size="25px" />
|
|
128
|
+
</Button>
|
|
129
|
+
<Button
|
|
130
|
+
icon
|
|
131
|
+
basic
|
|
132
|
+
compact
|
|
133
|
+
title={intl.formatMessage(messages.descending)}
|
|
134
|
+
className={cx({
|
|
135
|
+
active: sortOrder === 'descending',
|
|
136
|
+
})}
|
|
137
|
+
onClick={() => {
|
|
138
|
+
!isEditMode && setSortOrder('descending');
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
<Icon name={upSVG} size="25px" />
|
|
142
|
+
</Button>
|
|
143
|
+
</>
|
|
144
|
+
) : null}
|
|
118
145
|
</div>
|
|
119
146
|
);
|
|
120
147
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* TODO Enrich with features of user control panel. Then replace user control panel.
|
|
4
4
|
*/
|
|
5
5
|
import React, { useEffect } from 'react';
|
|
6
|
-
import { find
|
|
6
|
+
import { find } from 'lodash';
|
|
7
7
|
import { Portal } from 'react-portal';
|
|
8
8
|
import { useHistory } from 'react-router';
|
|
9
9
|
import { Link, useLocation } from 'react-router-dom';
|
|
@@ -38,7 +38,7 @@ const UserGroupMembershipPanel = () => {
|
|
|
38
38
|
(state) => state.controlpanels.systeminformation,
|
|
39
39
|
);
|
|
40
40
|
const can_use_group_membership_panel = systeminformation
|
|
41
|
-
?
|
|
41
|
+
? parseFloat(systeminformation?.plone_restapi_version.slice(0, 4)) >= 8.24
|
|
42
42
|
: false;
|
|
43
43
|
const actions = useSelector((state) => state.actions?.actions ?? {});
|
|
44
44
|
const ploneSetupAction = find(actions.user, {
|
|
@@ -1077,6 +1077,12 @@ body.has-toolbar.has-sidebar-collapsed .ui.wrapper > .ui.inner.block.full {
|
|
|
1077
1077
|
flex-direction: row;
|
|
1078
1078
|
align-items: center;
|
|
1079
1079
|
margin-right: 0.5em;
|
|
1080
|
+
|
|
1081
|
+
.sorted-label-value {
|
|
1082
|
+
margin-right: 0.5em;
|
|
1083
|
+
margin-left: 0.7em;
|
|
1084
|
+
color: @lightGrey;
|
|
1085
|
+
}
|
|
1080
1086
|
}
|
|
1081
1087
|
|
|
1082
1088
|
.sort-label {
|