@plone/volto 17.0.0-alpha.7 → 17.0.0-alpha.8
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 +51 -0
- package/locales/ca/LC_MESSAGES/volto.po +146 -0
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +146 -0
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +146 -0
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +146 -0
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +146 -0
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +4762 -0
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +146 -0
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +146 -0
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +146 -0
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +801 -643
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +146 -0
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +146 -0
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +146 -0
- package/locales/ro.json +1 -1
- package/locales/volto.pot +147 -1
- package/locales/zh_CN/LC_MESSAGES/volto.po +146 -0
- package/locales/zh_CN.json +1 -1
- package/package.json +1 -1
- package/packages/volto-slate/build/messages/src/blocks/Table/TableBlockEdit.json +1 -1
- package/packages/volto-slate/build/messages/src/blocks/Text/DefaultTextBlockEditor.json +1 -1
- package/packages/volto-slate/build/messages/src/blocks/Text/DetachedTextBlockEditor.json +1 -1
- package/packages/volto-slate/build/messages/src/blocks/Text/SlashMenu.json +1 -1
- package/packages/volto-slate/build/messages/src/editor/plugins/AdvancedLink/index.json +1 -1
- package/packages/volto-slate/build/messages/src/editor/plugins/Link/index.json +1 -1
- package/packages/volto-slate/build/messages/src/editor/plugins/Table/index.json +1 -1
- package/packages/volto-slate/build/messages/src/elementEditor/messages.json +1 -1
- package/packages/volto-slate/build/messages/src/widgets/HtmlSlateWidget.json +1 -1
- package/packages/volto-slate/build/messages/src/widgets/RichTextWidgetView.json +1 -1
- package/packages/volto-slate/package.json +1 -1
- package/packages/volto-slate/src/blocks/Text/SlashMenu.jsx +4 -3
- package/packages/volto-slate/src/editor/deserialize.js +0 -1
- package/razzle.config.js +5 -0
- package/src/actions/index.js +6 -0
- package/src/actions/relations/rebuild.js +25 -0
- package/src/actions/relations/relations.js +86 -0
- package/src/actions/relations/relations.test.js +15 -0
- package/src/components/index.js +1 -0
- package/src/components/manage/BlockChooser/BlockChooser.jsx +8 -3
- package/src/components/manage/BlockChooser/BlockChooser.test.jsx +5 -0
- package/src/components/manage/Contents/Contents.jsx +5 -1
- package/src/components/manage/Contents/ContentsItem.jsx +6 -0
- package/src/components/manage/Controlpanels/Controlpanels.jsx +9 -0
- package/src/components/manage/Controlpanels/Relations/BrokenRelations.jsx +66 -0
- package/src/components/manage/Controlpanels/Relations/Relations.jsx +114 -0
- package/src/components/manage/Controlpanels/Relations/RelationsListing.jsx +479 -0
- package/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx +531 -0
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx +3 -3
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipListing.jsx +51 -82
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx +79 -75
- package/src/components/manage/Toast/Toast.jsx +1 -1
- package/src/components/theme/Widgets/RelationsWidget.jsx +13 -11
- package/src/config/ControlPanels.js +2 -0
- package/src/constants/ActionTypes.js +4 -0
- package/src/constants/Languages.js +8 -4
- package/src/helpers/Html/Html.jsx +3 -1
- package/src/helpers/Html/Html.test.jsx +5 -0
- package/src/helpers/MessageLabels/MessageLabels.js +72 -0
- package/src/reducers/actions/actions.js +1 -1
- package/src/reducers/breadcrumbs/breadcrumbs.js +1 -1
- package/src/reducers/index.js +2 -0
- package/src/reducers/navigation/navigation.js +1 -1
- package/src/reducers/relations/relations.js +173 -0
- package/src/reducers/types/types.js +1 -1
- package/src/routes.js +5 -0
- package/theme/themes/pastanaga/extras/userscontrolpanel.less +99 -76
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relations reducer.
|
|
3
|
+
* @module reducers/relations/relations
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
CREATE_RELATIONS,
|
|
8
|
+
DELETE_RELATIONS,
|
|
9
|
+
LIST_RELATIONS,
|
|
10
|
+
REBUILD_RELATIONS,
|
|
11
|
+
} from '@plone/volto/constants/ActionTypes';
|
|
12
|
+
|
|
13
|
+
const initialState = {
|
|
14
|
+
relations: null,
|
|
15
|
+
stats: null,
|
|
16
|
+
create: {
|
|
17
|
+
error: null,
|
|
18
|
+
loaded: false,
|
|
19
|
+
loading: false,
|
|
20
|
+
},
|
|
21
|
+
delete: {
|
|
22
|
+
error: null,
|
|
23
|
+
loaded: false,
|
|
24
|
+
loading: false,
|
|
25
|
+
},
|
|
26
|
+
list: {
|
|
27
|
+
error: null,
|
|
28
|
+
loaded: false,
|
|
29
|
+
loading: false,
|
|
30
|
+
},
|
|
31
|
+
rebuild: {
|
|
32
|
+
error: null,
|
|
33
|
+
loaded: false,
|
|
34
|
+
loading: false,
|
|
35
|
+
},
|
|
36
|
+
subrequests: {},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get request key
|
|
41
|
+
* @function getRequestKey
|
|
42
|
+
* @param {string} actionType Action type.
|
|
43
|
+
* @returns {string} Request key.
|
|
44
|
+
*/
|
|
45
|
+
function getRequestKey(actionType) {
|
|
46
|
+
return actionType.split('_')[0].toLowerCase();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Relations reducer.
|
|
51
|
+
* @function relations
|
|
52
|
+
* @param {Object} state Current state.
|
|
53
|
+
* @param {Object} action Action to be handled.
|
|
54
|
+
* @returns {Object} New state.
|
|
55
|
+
*/
|
|
56
|
+
export default function relations(state = initialState, action = {}) {
|
|
57
|
+
switch (action.type) {
|
|
58
|
+
case `${CREATE_RELATIONS}_PENDING`:
|
|
59
|
+
case `${DELETE_RELATIONS}_PENDING`:
|
|
60
|
+
case `${REBUILD_RELATIONS}_PENDING`:
|
|
61
|
+
return {
|
|
62
|
+
...state,
|
|
63
|
+
[getRequestKey(action.type)]: {
|
|
64
|
+
loading: true,
|
|
65
|
+
loaded: false,
|
|
66
|
+
error: null,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
case `${LIST_RELATIONS}_PENDING`:
|
|
70
|
+
return action.subrequest
|
|
71
|
+
? {
|
|
72
|
+
...state,
|
|
73
|
+
subrequests: {
|
|
74
|
+
...state.subrequests,
|
|
75
|
+
[action.subrequest]: {
|
|
76
|
+
...(state.subrequests[action.subrequest] || {
|
|
77
|
+
relations: null,
|
|
78
|
+
stats: null,
|
|
79
|
+
}),
|
|
80
|
+
loaded: false,
|
|
81
|
+
loading: true,
|
|
82
|
+
error: null,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
: {
|
|
87
|
+
...state,
|
|
88
|
+
[getRequestKey(action.type)]: {
|
|
89
|
+
loading: true,
|
|
90
|
+
loaded: false,
|
|
91
|
+
error: null,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
case `${LIST_RELATIONS}_SUCCESS`:
|
|
95
|
+
return action.subrequest
|
|
96
|
+
? {
|
|
97
|
+
...state,
|
|
98
|
+
subrequests: {
|
|
99
|
+
...state.subrequests,
|
|
100
|
+
[action.subrequest]: {
|
|
101
|
+
loading: false,
|
|
102
|
+
loaded: true,
|
|
103
|
+
error: null,
|
|
104
|
+
relations: action.result.relations
|
|
105
|
+
? action.result.relations
|
|
106
|
+
: state.relations,
|
|
107
|
+
stats: null,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
: {
|
|
112
|
+
...state,
|
|
113
|
+
relations: action.result.relations
|
|
114
|
+
? action.result.relations
|
|
115
|
+
: state.relations,
|
|
116
|
+
stats: action.result.stats ? action.result : state.stats,
|
|
117
|
+
[getRequestKey(action.type)]: {
|
|
118
|
+
loading: false,
|
|
119
|
+
loaded: true,
|
|
120
|
+
error: null,
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
case `${CREATE_RELATIONS}_SUCCESS`:
|
|
124
|
+
case `${DELETE_RELATIONS}_SUCCESS`:
|
|
125
|
+
case `${REBUILD_RELATIONS}_SUCCESS`:
|
|
126
|
+
return {
|
|
127
|
+
...state,
|
|
128
|
+
[getRequestKey(action.type)]: {
|
|
129
|
+
loading: false,
|
|
130
|
+
loaded: true,
|
|
131
|
+
error: null,
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
case `${LIST_RELATIONS}_FAIL`:
|
|
135
|
+
return action.subrequest
|
|
136
|
+
? {
|
|
137
|
+
...state,
|
|
138
|
+
subrequests: {
|
|
139
|
+
...state.subrequests,
|
|
140
|
+
[action.subrequest]: {
|
|
141
|
+
relations: null,
|
|
142
|
+
stats: null,
|
|
143
|
+
loading: false,
|
|
144
|
+
loaded: false,
|
|
145
|
+
error: action.error,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
}
|
|
149
|
+
: {
|
|
150
|
+
...state,
|
|
151
|
+
relations: null,
|
|
152
|
+
stats: null,
|
|
153
|
+
[getRequestKey(action.type)]: {
|
|
154
|
+
loading: false,
|
|
155
|
+
loaded: false,
|
|
156
|
+
error: action.error,
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
case `${CREATE_RELATIONS}_FAIL`:
|
|
160
|
+
case `${DELETE_RELATIONS}_FAIL`:
|
|
161
|
+
case `${REBUILD_RELATIONS}_FAIL`:
|
|
162
|
+
return {
|
|
163
|
+
...state,
|
|
164
|
+
[getRequestKey(action.type)]: {
|
|
165
|
+
loading: false,
|
|
166
|
+
loaded: false,
|
|
167
|
+
error: action.error,
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
default:
|
|
171
|
+
return state;
|
|
172
|
+
}
|
|
173
|
+
}
|
package/src/routes.js
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
ModerateComments,
|
|
30
30
|
NotFound,
|
|
31
31
|
PasswordReset,
|
|
32
|
+
Relations,
|
|
32
33
|
Register,
|
|
33
34
|
Rules,
|
|
34
35
|
RequestPasswordReset,
|
|
@@ -224,6 +225,10 @@ export const defaultRoutes = [
|
|
|
224
225
|
path: '/controlpanel/rules',
|
|
225
226
|
component: RulesControlpanel,
|
|
226
227
|
},
|
|
228
|
+
{
|
|
229
|
+
path: '/controlpanel/relations',
|
|
230
|
+
component: Relations,
|
|
231
|
+
},
|
|
227
232
|
{
|
|
228
233
|
path: '/controlpanel/:id',
|
|
229
234
|
component: Controlpanel,
|
|
@@ -27,45 +27,48 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.controlpanel_matrix {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
.ui.action.input button.ui.icon.button {
|
|
31
|
+
background-color: transparent;
|
|
32
|
+
}
|
|
33
33
|
|
|
34
34
|
.controlpanel_select_relation {
|
|
35
|
-
|
|
36
|
-
grid-row: 1;
|
|
35
|
+
margin-bottom: 2rem;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
.controlpanel_search_wrapper {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-wrap: wrap;
|
|
41
|
+
row-gap: 3rem;
|
|
42
|
+
column-gap: 5rem;
|
|
43
|
+
justify-content: flex-start;
|
|
44
|
+
margin-bottom: 2rem;
|
|
45
|
+
& > * {
|
|
46
|
+
min-width: 30rem;
|
|
47
|
+
}
|
|
42
48
|
}
|
|
43
49
|
|
|
44
|
-
.
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
.add_potential_sources .field,
|
|
51
|
+
.add_potential_targets .field,
|
|
52
|
+
.controlpanel_search_x .field,
|
|
53
|
+
.controlpanel_search_y .field {
|
|
54
|
+
display: flex;
|
|
47
55
|
}
|
|
48
56
|
|
|
49
|
-
.
|
|
57
|
+
.controlpanel_listing_wrapper {
|
|
50
58
|
display: flex;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
gap: 1rem;
|
|
60
|
+
justify-content: flex-end;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
flex-direction: row-reverse;
|
|
63
|
+
margin-bottom: 2rem;
|
|
64
|
+
.administration_matrix {
|
|
65
|
+
flex-grow: 2;
|
|
66
|
+
min-width: 30rem;
|
|
67
|
+
}
|
|
68
|
+
.controlpanel_filter {
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: column;
|
|
57
71
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.administration_matrix {
|
|
61
|
-
display: grid;
|
|
62
|
-
height: 60rem;
|
|
63
|
-
padding-right: 0;
|
|
64
|
-
grid-column-end: 3;
|
|
65
|
-
grid-column-start: 1;
|
|
66
|
-
grid-row: 2;
|
|
67
|
-
grid-template-rows: 14rem 1fr;
|
|
68
|
-
overflow-x: scroll;
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
|
|
@@ -75,71 +78,91 @@
|
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
.label-options {
|
|
81
|
+
// display: flex;
|
|
82
|
+
// justify-content: start;
|
|
78
83
|
position: sticky;
|
|
79
|
-
z-index: 1000;
|
|
80
84
|
top: 0;
|
|
81
|
-
|
|
82
|
-
display: flex;
|
|
83
|
-
height: 14rem;
|
|
84
|
-
align-items: baseline;
|
|
85
|
-
justify-content: flex-end;
|
|
86
|
-
padding-right: 2rem;
|
|
85
|
+
z-index: 100;
|
|
87
86
|
.stickyLabelLayerBackground();
|
|
88
87
|
|
|
89
|
-
.
|
|
88
|
+
.target-labels {
|
|
89
|
+
z-index: 2;
|
|
90
|
+
top: 0;
|
|
91
|
+
left: 0;
|
|
90
92
|
display: flex;
|
|
91
|
-
|
|
93
|
+
height: 14rem;
|
|
94
|
+
align-items: baseline;
|
|
95
|
+
// justify-content: flex-end;
|
|
96
|
+
// padding-right: 5rem;
|
|
97
|
+
@media only screen and (max-width: (@largestMobileScreen)) {
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
}
|
|
100
|
+
& > div:first-child {
|
|
101
|
+
min-width: 15rem;
|
|
102
|
+
}
|
|
103
|
+
& > div:nth-child(2) {
|
|
104
|
+
flex-grow: 2;
|
|
105
|
+
display: flex;
|
|
106
|
+
}
|
|
92
107
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
.label-options-label {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: flex-end;
|
|
111
|
+
|
|
112
|
+
&.inclined {
|
|
113
|
+
width: 3.5rem;
|
|
114
|
+
height: 13rem;
|
|
115
|
+
white-space: nowrap;
|
|
97
116
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
117
|
+
div {
|
|
118
|
+
transform: rotate(315deg);
|
|
119
|
+
transform-origin: top left;
|
|
120
|
+
}
|
|
101
121
|
}
|
|
102
122
|
}
|
|
103
123
|
}
|
|
104
124
|
}
|
|
105
125
|
|
|
106
|
-
.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
126
|
+
.listing-row {
|
|
127
|
+
&:nth-child(2n) {
|
|
128
|
+
background-color: rgba(0, 0, 50, 0.05);
|
|
129
|
+
}
|
|
130
|
+
.listing-item {
|
|
131
|
+
display: flex;
|
|
132
|
+
width: 100%;
|
|
133
|
+
align-items: baseline;
|
|
134
|
+
justify-content: space-between;
|
|
135
|
+
padding: 0.5rem 0.1rem;
|
|
136
|
+
margin: 0.2rem 0;
|
|
137
|
+
|
|
138
|
+
& > div:first-child {
|
|
139
|
+
min-width: 15rem;
|
|
114
140
|
}
|
|
141
|
+
.matrix_options {
|
|
142
|
+
flex-grow: 2;
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: row;
|
|
115
145
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
146
|
+
& > div {
|
|
147
|
+
width: 3rem;
|
|
148
|
+
padding: 0.3rem 0.1rem;
|
|
149
|
+
margin-left: 0.5rem;
|
|
119
150
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
width: 100%;
|
|
123
|
-
align-items: baseline;
|
|
124
|
-
justify-content: space-between;
|
|
125
|
-
padding: 0.5rem 0.1rem;
|
|
126
|
-
margin: 0.2rem 0;
|
|
127
|
-
|
|
128
|
-
.matrix_options {
|
|
129
|
-
display: flex;
|
|
130
|
-
flex-direction: row;
|
|
131
|
-
|
|
132
|
-
& > div {
|
|
133
|
-
width: 3rem;
|
|
134
|
-
padding: 0.3rem 0.1rem;
|
|
135
|
-
margin-left: 0.5rem;
|
|
136
|
-
|
|
137
|
-
.ui.checkbox {
|
|
138
|
-
margin: auto;
|
|
139
|
-
}
|
|
151
|
+
.ui.checkbox {
|
|
152
|
+
margin: auto;
|
|
140
153
|
}
|
|
141
154
|
}
|
|
155
|
+
.ui.checkbox.toggle-target label:before {
|
|
156
|
+
border: 3px solid #826a6a;
|
|
157
|
+
}
|
|
142
158
|
}
|
|
143
159
|
}
|
|
144
160
|
}
|
|
161
|
+
|
|
162
|
+
// Rows
|
|
163
|
+
.items {
|
|
164
|
+
.not-published {
|
|
165
|
+
opacity: 0.6;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
145
168
|
}
|