@eeacms/volto-clms-theme 1.1.98 → 1.1.100
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 +9 -3
- package/package.json +1 -1
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/custom.less +4 -0
- package/src/components/CLMSDownloadCartView/AreaNaming.jsx +3 -3
- package/src/components/CLMSDownloadCartView/cart-table.less +10 -1
- package/src/components/CclModal/CclModal.jsx +2 -2
- package/src/customizations/volto/actions/users/users.js +189 -0
- package/theme/site/extras/modal.less +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
### [1.1.
|
|
7
|
+
### [1.1.100](https://github.com/eea/volto-clms-theme/compare/1.1.99...1.1.100) - 21 December 2023
|
|
8
8
|
|
|
9
|
-
#### :
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- delete user action override [Unai - [`355567f`](https://github.com/eea/volto-clms-theme/commit/355567fda27b835a41f35a2c97c725f8009714f7)]
|
|
12
|
+
### [1.1.99](https://github.com/eea/volto-clms-theme/compare/1.1.98...1.1.99) - 21 December 2023
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
#### :hammer_and_wrench: Others
|
|
15
|
+
|
|
16
|
+
- cart modal last fixes [Unai - [`e4d316e`](https://github.com/eea/volto-clms-theme/commit/e4d316e2e3662e2e798d9c3bbbdfb9a99ea942d7)]
|
|
17
|
+
### [1.1.98](https://github.com/eea/volto-clms-theme/compare/1.1.97...1.1.98) - 18 December 2023
|
|
12
18
|
|
|
13
19
|
### [1.1.97](https://github.com/eea/volto-clms-theme/compare/1.1.96...1.1.97) - 18 December 2023
|
|
14
20
|
|
package/package.json
CHANGED
|
@@ -22,19 +22,19 @@ export const AreaNaming = (areaProps) => {
|
|
|
22
22
|
<React.Fragment>
|
|
23
23
|
<div className="tools">
|
|
24
24
|
<button
|
|
25
|
-
className="ccl-button ccl-button--default"
|
|
25
|
+
className="tool-button ccl-button ccl-button--default"
|
|
26
26
|
onClick={() => zoomIn()}
|
|
27
27
|
>
|
|
28
28
|
Zoom in
|
|
29
29
|
</button>
|
|
30
30
|
<button
|
|
31
|
-
className="ccl-button ccl-button--default"
|
|
31
|
+
className="tool-button ccl-button ccl-button--default"
|
|
32
32
|
onClick={() => zoomOut()}
|
|
33
33
|
>
|
|
34
34
|
Zoom out
|
|
35
35
|
</button>
|
|
36
36
|
<button
|
|
37
|
-
className="ccl-button ccl-button--default"
|
|
37
|
+
className="tool-button ccl-button ccl-button--default"
|
|
38
38
|
onClick={() => resetTransform()}
|
|
39
39
|
>
|
|
40
40
|
Reset zoom
|
|
@@ -104,5 +104,14 @@ div.mb-2 {
|
|
|
104
104
|
|
|
105
105
|
.tools {
|
|
106
106
|
margin-bottom: 1.5rem;
|
|
107
|
-
margin-inline:
|
|
107
|
+
margin-inline: 4rem;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.tool-button {
|
|
111
|
+
margin-inline: 0.5rem !important;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.react-transform-wrapper {
|
|
115
|
+
margin-bottom: 1rem !important;
|
|
116
|
+
margin-inline: 2rem !important;
|
|
108
117
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Segment, Modal } from 'semantic-ui-react';
|
|
3
3
|
import Draggable from 'react-draggable';
|
|
4
4
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
|
-
import {
|
|
5
|
+
import { faArrowsAlt } from '@fortawesome/free-solid-svg-icons';
|
|
6
6
|
|
|
7
7
|
function CclModal(props) {
|
|
8
8
|
let {
|
|
@@ -42,7 +42,7 @@ function CclModal(props) {
|
|
|
42
42
|
></span>
|
|
43
43
|
</div>
|
|
44
44
|
<Segment compact className="handle">
|
|
45
|
-
<FontAwesomeIcon icon={
|
|
45
|
+
<FontAwesomeIcon icon={faArrowsAlt} size="lg" />
|
|
46
46
|
</Segment>
|
|
47
47
|
|
|
48
48
|
{children}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Users actions.
|
|
3
|
+
* @module actions/users/users
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { stringify } from 'query-string';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
CREATE_USER,
|
|
10
|
+
DELETE_USER,
|
|
11
|
+
GET_USER,
|
|
12
|
+
INITIAL_PASSWORD,
|
|
13
|
+
LIST_USERS,
|
|
14
|
+
RESET_PASSWORD,
|
|
15
|
+
UPDATE_PASSWORD,
|
|
16
|
+
UPDATE_USER,
|
|
17
|
+
} from '@plone/volto/constants/ActionTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create user function.
|
|
21
|
+
* @function createUser
|
|
22
|
+
* @param {Object|Array} content User data.
|
|
23
|
+
* @returns {Object} Create user action.
|
|
24
|
+
*/
|
|
25
|
+
export function createUser(content, sendPasswordReset = null) {
|
|
26
|
+
return {
|
|
27
|
+
type: CREATE_USER,
|
|
28
|
+
request: {
|
|
29
|
+
op: 'post',
|
|
30
|
+
path: '/@users',
|
|
31
|
+
data: sendPasswordReset ? { ...content, sendPasswordReset } : content,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Delete user function.
|
|
38
|
+
* @function deleteUser
|
|
39
|
+
* @param {string} id User id
|
|
40
|
+
* @returns {Object} Delete user action.
|
|
41
|
+
*/
|
|
42
|
+
export function deleteUser(id) {
|
|
43
|
+
return {
|
|
44
|
+
type: DELETE_USER,
|
|
45
|
+
request: {
|
|
46
|
+
op: 'del',
|
|
47
|
+
path: `/@users/${id}?delete_memberareas=0&delete_localroles=0`,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get user function
|
|
54
|
+
* @function getUser
|
|
55
|
+
* @param {string} id User id
|
|
56
|
+
* @returns {Object} Get user action
|
|
57
|
+
*/
|
|
58
|
+
export function getUser(id) {
|
|
59
|
+
return {
|
|
60
|
+
type: GET_USER,
|
|
61
|
+
request: {
|
|
62
|
+
op: 'get',
|
|
63
|
+
path: `/@users/${id}`,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* List users function
|
|
70
|
+
* 'query' and 'search' are mutually exclusive parameters. 'search' wins.
|
|
71
|
+
* Query either for username or search for username, fullname, email.
|
|
72
|
+
* @function listUsers
|
|
73
|
+
* @param {string} query for username
|
|
74
|
+
* @param {string} search for username, fullname, email.
|
|
75
|
+
* @param {list} groups_filter restrict to group membership
|
|
76
|
+
* @param {int} limit
|
|
77
|
+
* @returns {Object} List users action
|
|
78
|
+
*/
|
|
79
|
+
export function listUsers(options = {}) {
|
|
80
|
+
const { query = '', search = '', groups_filter = [], limit = null } = options;
|
|
81
|
+
let path = '/@users';
|
|
82
|
+
|
|
83
|
+
var searchParams = new URLSearchParams();
|
|
84
|
+
if (query) {
|
|
85
|
+
searchParams.append('query', query);
|
|
86
|
+
}
|
|
87
|
+
if (search) {
|
|
88
|
+
searchParams.append('search', search);
|
|
89
|
+
}
|
|
90
|
+
limit && searchParams.append('limit', limit);
|
|
91
|
+
const searchParamsToString = searchParams.toString();
|
|
92
|
+
|
|
93
|
+
let filterarg =
|
|
94
|
+
groups_filter.length > 0
|
|
95
|
+
? stringify(
|
|
96
|
+
{ 'groups-filter': groups_filter },
|
|
97
|
+
{ arrayFormat: 'colon-list-separator' },
|
|
98
|
+
)
|
|
99
|
+
: '';
|
|
100
|
+
|
|
101
|
+
if (searchParamsToString) {
|
|
102
|
+
path += `?${searchParamsToString}`;
|
|
103
|
+
}
|
|
104
|
+
if (filterarg) {
|
|
105
|
+
path += searchParamsToString ? '&' : '?';
|
|
106
|
+
path += filterarg;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
type: LIST_USERS,
|
|
110
|
+
request: {
|
|
111
|
+
op: 'get',
|
|
112
|
+
path: path,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Update user function
|
|
119
|
+
* @function updateUser
|
|
120
|
+
* @param {string} id User id
|
|
121
|
+
* @param {Object} user User data.
|
|
122
|
+
* @returns {Object} Update user action.
|
|
123
|
+
*/
|
|
124
|
+
export function updateUser(id, user) {
|
|
125
|
+
return {
|
|
126
|
+
type: UPDATE_USER,
|
|
127
|
+
request: { op: 'patch', path: `/@users/${id}`, data: user },
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Update password function
|
|
133
|
+
* @function updatePassword
|
|
134
|
+
* @param {string} id User id
|
|
135
|
+
* @param {string} oldPassword Old password.
|
|
136
|
+
* @param {string} newPassword New password.
|
|
137
|
+
* @returns {Object} Update password action.
|
|
138
|
+
*/
|
|
139
|
+
export function updatePassword(id, oldPassword, newPassword) {
|
|
140
|
+
return {
|
|
141
|
+
type: UPDATE_PASSWORD,
|
|
142
|
+
request: {
|
|
143
|
+
op: 'post',
|
|
144
|
+
path: `/@users/${id}/reset-password`,
|
|
145
|
+
data: {
|
|
146
|
+
old_password: oldPassword,
|
|
147
|
+
new_password: newPassword,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Set initial password function
|
|
155
|
+
* @function setInitialPassword
|
|
156
|
+
* @param {string} id User id
|
|
157
|
+
* @param {string} token One time user token.
|
|
158
|
+
* @param {string} newPassword New password.
|
|
159
|
+
* @returns {Object} Set initial password action.
|
|
160
|
+
*/
|
|
161
|
+
export function setInitialPassword(id, token, newPassword) {
|
|
162
|
+
return {
|
|
163
|
+
type: INITIAL_PASSWORD,
|
|
164
|
+
request: {
|
|
165
|
+
op: 'post',
|
|
166
|
+
path: `/@users/${id}/reset-password`,
|
|
167
|
+
data: {
|
|
168
|
+
reset_token: token,
|
|
169
|
+
new_password: newPassword,
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Reset password function
|
|
177
|
+
* @function resetPassword
|
|
178
|
+
* @param {string} id User id
|
|
179
|
+
* @returns {Object} Reset password action.
|
|
180
|
+
*/
|
|
181
|
+
export function resetPassword(id) {
|
|
182
|
+
return {
|
|
183
|
+
type: RESET_PASSWORD,
|
|
184
|
+
request: {
|
|
185
|
+
op: 'post',
|
|
186
|
+
path: `/@users/${id}/reset-password`,
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
}
|