@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.
Files changed (37) hide show
  1. package/.changelog.draft +2 -2
  2. package/.yarn/install-state.gz +0 -0
  3. package/CHANGELOG.md +12 -0
  4. package/locales/ca/LC_MESSAGES/volto.po +5 -0
  5. package/locales/ca.json +1 -1
  6. package/locales/de/LC_MESSAGES/volto.po +5 -0
  7. package/locales/de.json +1 -1
  8. package/locales/en/LC_MESSAGES/volto.po +5 -0
  9. package/locales/en.json +1 -1
  10. package/locales/es/LC_MESSAGES/volto.po +5 -0
  11. package/locales/es.json +1 -1
  12. package/locales/eu/LC_MESSAGES/volto.po +5 -0
  13. package/locales/eu.json +1 -1
  14. package/locales/fi/LC_MESSAGES/volto.po +5 -0
  15. package/locales/fi.json +1 -1
  16. package/locales/fr/LC_MESSAGES/volto.po +5 -0
  17. package/locales/fr.json +1 -1
  18. package/locales/it/LC_MESSAGES/volto.po +5 -0
  19. package/locales/it.json +1 -1
  20. package/locales/ja/LC_MESSAGES/volto.po +5 -0
  21. package/locales/ja.json +1 -1
  22. package/locales/nl/LC_MESSAGES/volto.po +5 -0
  23. package/locales/nl.json +1 -1
  24. package/locales/pt/LC_MESSAGES/volto.po +5 -0
  25. package/locales/pt.json +1 -1
  26. package/locales/pt_BR/LC_MESSAGES/volto.po +5 -0
  27. package/locales/pt_BR.json +1 -1
  28. package/locales/ro/LC_MESSAGES/volto.po +5 -0
  29. package/locales/ro.json +1 -1
  30. package/locales/volto.pot +6 -1
  31. package/locales/zh_CN/LC_MESSAGES/volto.po +5 -0
  32. package/locales/zh_CN.json +1 -1
  33. package/package.json +1 -1
  34. package/packages/volto-slate/package.json +1 -1
  35. package/src/components/manage/Blocks/Search/components/SortOn.jsx +82 -55
  36. package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx +2 -2
  37. package/theme/themes/pastanaga/extras/blocks.less +6 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plone/volto-slate",
3
- "version": "16.31.9",
3
+ "version": "16.31.11",
4
4
  "description": "Slate.js integration with Volto",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -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 activeSortOn = sortOn || data?.query?.sort_on || '';
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 { sortOnOptions = [] } = data;
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
- <span className="sort-label">
66
- {intl.formatMessage(messages.sortOn)}
67
- </span>
68
- <Select
69
- id="select-search-sort-on"
70
- name="select-searchblock-sort-on"
71
- className="search-react-select-container"
72
- classNamePrefix="react-select"
73
- placeholder={intl.formatMessage(messages.sortOn)}
74
- styles={sortOnSelectStyles}
75
- theme={selectTheme}
76
- components={{ DropdownIndicator, Option }}
77
- options={[
78
- ...sortOnOptions.map((k) => ({
79
- value: k,
80
- label: sortable_indexes[k]?.title || k,
81
- })),
82
- ]}
83
- isSearchable={false}
84
- value={value}
85
- onChange={(data) => {
86
- !isEditMode && setSortOn(data.value);
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
- <Button
91
- icon
92
- basic
93
- compact
94
- title={intl.formatMessage(messages.ascending)}
95
- className={cx({
96
- active: sortOrder === 'ascending',
97
- })}
98
- onClick={() => {
99
- !isEditMode && setSortOrder('ascending');
100
- }}
101
- >
102
- <Icon name={upSVG} size="25px" />
103
- </Button>
104
- <Button
105
- icon
106
- basic
107
- compact
108
- title={intl.formatMessage(messages.descending)}
109
- className={cx({
110
- active: sortOrder === 'descending',
111
- })}
112
- onClick={() => {
113
- !isEditMode && setSortOrder('descending');
114
- }}
115
- >
116
- <Icon name={downSVG} size="25px" />
117
- </Button>
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, toNumber } from 'lodash';
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
- ? toNumber(systeminformation?.plone_restapi_version.slice(0, 4)) >= 8.24
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 {