@plone/volto 17.0.0-alpha.20 → 17.0.0-alpha.22
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/.gitignore~ +71 -0
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +49 -0
- package/cypress/support/commands.js +2 -1
- package/cypress/support/e2e.js +1 -2
- package/locales/ca/LC_MESSAGES/volto.po +24 -5
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +37 -18
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +25 -6
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +25 -6
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +24 -5
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +24 -5
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +24 -5
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +250 -231
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +24 -5
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +24 -5
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +24 -5
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +25 -6
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +24 -5
- package/locales/ro.json +1 -1
- package/locales/volto.pot +25 -6
- package/locales/zh_CN/LC_MESSAGES/volto.po +24 -5
- package/locales/zh_CN.json +1 -1
- package/news/4547.breaking~ +1 -0
- package/package.json +6 -6
- package/packages/volto-slate/package.json +1 -1
- package/src/actions/relations/rebuild.js +7 -7
- package/src/components/index.js +1 -0
- package/src/components/manage/Actions/Actions.jsx +133 -243
- package/src/components/manage/Blocks/Container/Edit.jsx +4 -1
- package/src/components/manage/Blocks/Container/EditBlockWrapper.jsx +1 -0
- package/src/components/manage/Blocks/Grid/Edit.jsx +13 -1
- package/src/components/manage/Blocks/Image/Edit.jsx +40 -5
- package/src/components/manage/Blocks/Image/Edit.test.jsx +2 -0
- package/src/components/manage/Blocks/Image/ImageSidebar.jsx +64 -15
- package/src/components/manage/Blocks/Image/View.jsx +26 -5
- package/src/components/manage/Blocks/Image/View.test.jsx +20 -0
- package/src/components/manage/Blocks/Image/schema.js +1 -9
- package/src/components/manage/Blocks/Image/utils.js +14 -0
- package/src/components/manage/Blocks/LeadImage/Edit.jsx +32 -10
- package/src/components/manage/Blocks/LeadImage/Edit.test.jsx +11 -1
- package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx +28 -9
- package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.test.jsx +8 -2
- package/src/components/manage/Blocks/LeadImage/View.jsx +50 -38
- package/src/components/manage/Blocks/LeadImage/View.test.jsx +11 -1
- package/src/components/manage/Blocks/Listing/SummaryTemplate.jsx +1 -1
- package/src/components/manage/Blocks/Maps/Edit.jsx +135 -209
- package/src/components/manage/Blocks/Search/SearchBlockView.jsx +3 -2
- package/src/components/manage/Blocks/Teaser/DefaultBody.jsx +13 -23
- package/src/components/manage/Contents/Contents.jsx +8 -6
- package/src/components/manage/Contents/ContentsPropertiesModal.jsx +1 -13
- package/src/components/manage/Controlpanels/Groups/RenderGroups.jsx +2 -2
- package/src/components/manage/Controlpanels/Relations/BrokenRelations.jsx +30 -7
- package/src/components/manage/Controlpanels/Relations/Relations.jsx +2 -2
- package/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx +53 -59
- package/src/components/manage/Controlpanels/Users/RenderUsers.jsx +2 -2
- package/src/components/manage/Delete/Delete.jsx +96 -171
- package/src/components/manage/Sidebar/AlignBlock.jsx +1 -1
- package/src/components/manage/Widgets/SelectUtils.js +1 -1
- package/src/components/manage/Workflow/Workflow.jsx +75 -184
- package/src/components/theme/Image/Image.jsx +96 -0
- package/src/components/theme/Image/Image.test.jsx +125 -0
- package/src/components/theme/Logo/Logo.jsx +2 -0
- package/src/components/theme/PasswordReset/RequestPasswordReset.jsx +95 -170
- package/src/components/theme/PreviewImage/PreviewImage.jsx +25 -14
- package/src/components/theme/PreviewImage/PreviewImage.test.js +39 -16
- package/src/components/theme/View/AlbumView.jsx +11 -15
- package/src/components/theme/View/EventView.jsx +30 -23
- package/src/components/theme/View/ImageView.jsx +5 -2
- package/src/components/theme/View/ImageView.test.jsx +4 -0
- package/src/components/theme/View/ListingView.jsx +5 -3
- package/src/components/theme/View/NewsItemView.jsx +7 -13
- package/src/components/theme/View/SummaryView.jsx +4 -3
- package/src/config/Blocks.jsx +2 -0
- package/src/config/Components.jsx +3 -1
- package/src/config/index.js~ +223 -0
- package/src/express-middleware/files.js +8 -6
- package/src/express-middleware/images.js +7 -1
- package/src/helpers/MessageLabels/MessageLabels.js +6 -0
- package/src/helpers/Url/Url.js +22 -1
- package/src/helpers/Url/Url.test.js +41 -0
- package/src/reducers/relations/relations.js +1 -1
- package/test-setup-config.js +9 -1
- package/theme/themes/pastanaga/extras/blocks.less +3 -1
- package/theme/themes/pastanaga/extras/main.less +5 -0
- package/packages/volto-slate/build/messages/src/blocks/Table/TableBlockEdit.json +0 -90
- package/packages/volto-slate/build/messages/src/blocks/Text/DefaultTextBlockEditor.json +0 -6
- package/packages/volto-slate/build/messages/src/blocks/Text/DetachedTextBlockEditor.json +0 -6
- package/packages/volto-slate/build/messages/src/blocks/Text/SlashMenu.json +0 -6
- package/packages/volto-slate/build/messages/src/editor/plugins/AdvancedLink/index.json +0 -10
- package/packages/volto-slate/build/messages/src/editor/plugins/Link/index.json +0 -10
- package/packages/volto-slate/build/messages/src/editor/plugins/Table/index.json +0 -30
- package/packages/volto-slate/build/messages/src/elementEditor/messages.json +0 -10
- package/packages/volto-slate/build/messages/src/widgets/HtmlSlateWidget.json +0 -6
- package/packages/volto-slate/build/messages/src/widgets/RichTextWidgetView.json +0 -6
- package/src/components/manage/Blocks/Teaser/utils.js +0 -44
- package/src/components/manage/Blocks/Teaser/utils.test.jsx +0 -229
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "Delete table",
|
|
4
|
-
"defaultMessage": "Delete table"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"id": "Insert row before",
|
|
8
|
-
"defaultMessage": "Insert row before"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"id": "Insert row after",
|
|
12
|
-
"defaultMessage": "Insert row after"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"id": "Delete row",
|
|
16
|
-
"defaultMessage": "Delete row"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"id": "Insert col before",
|
|
20
|
-
"defaultMessage": "Insert col before"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"id": "Insert col after",
|
|
24
|
-
"defaultMessage": "Insert col after"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"id": "Delete col",
|
|
28
|
-
"defaultMessage": "Delete col"
|
|
29
|
-
}
|
|
30
|
-
]
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "An error has occurred while editing \"{name}\" field. We have been notified and we are looking into it. Please save your work and retry. If the issue persists please contact the site administrator.",
|
|
4
|
-
"defaultMessage": "An error has occurred while editing \"{name}\" field. We have been notified and we are looking into it. Please save your work and retry. If the issue persists please contact the site administrator."
|
|
5
|
-
}
|
|
6
|
-
]
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "An error has occurred while rendering \"{name}\" field. We have been notified and we are looking into it. If the issue persists please contact the site administrator.",
|
|
4
|
-
"defaultMessage": "An error has occurred while rendering \"{name}\" field. We have been notified and we are looking into it. If the issue persists please contact the site administrator."
|
|
5
|
-
}
|
|
6
|
-
]
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { isInternalURL } from '@plone/volto/helpers';
|
|
2
|
-
import config from '@plone/volto/registry';
|
|
3
|
-
|
|
4
|
-
export function getTeaserImageURL({ href, image, align }) {
|
|
5
|
-
// The default scale used in teasers is the 'teaser' scale
|
|
6
|
-
// except if it's customized otherwise in the teaser block settings
|
|
7
|
-
// or if the teaser is center (top)
|
|
8
|
-
const imageScale =
|
|
9
|
-
align === 'center'
|
|
10
|
-
? 'great'
|
|
11
|
-
: config.blocks.blocksConfig['teaser'].imageScale || 'teaser';
|
|
12
|
-
|
|
13
|
-
if (image) {
|
|
14
|
-
// If the image is overriden locally in the teaser block
|
|
15
|
-
if (isInternalURL(image['@id'])) {
|
|
16
|
-
// If it's internal check if image_scales catalog info is present
|
|
17
|
-
if (image?.image_scales?.[image?.image_field]) {
|
|
18
|
-
return `${image['@id']}/${
|
|
19
|
-
image.image_scales[image.image_field]?.[0].scales[imageScale]
|
|
20
|
-
?.download || image.image_scales[image.image_field]?.[0].download
|
|
21
|
-
}`;
|
|
22
|
-
} else {
|
|
23
|
-
// If not, fallback to content scale URL shortcut
|
|
24
|
-
return `${image['@id']}/@@images/${image.image_field}/${imageScale}`;
|
|
25
|
-
}
|
|
26
|
-
} else {
|
|
27
|
-
// If it's external, return the plain URL
|
|
28
|
-
return image['@id'];
|
|
29
|
-
}
|
|
30
|
-
} else {
|
|
31
|
-
// If the image is not overriden
|
|
32
|
-
if (href?.image_scales?.[href?.image_field]) {
|
|
33
|
-
return `${href['@id']}/${
|
|
34
|
-
href.image_scales[href.image_field]?.[0].scales[imageScale]?.download ||
|
|
35
|
-
href.image_scales[href.image_field]?.[0].download
|
|
36
|
-
}`;
|
|
37
|
-
} else {
|
|
38
|
-
// If not, fallback to content scale URL shortcut
|
|
39
|
-
return `${href['@id']}/@@images/${
|
|
40
|
-
href.image_field || 'preview_image'
|
|
41
|
-
}/${imageScale}`;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { getTeaserImageURL } from './utils';
|
|
2
|
-
import config from '@plone/volto/registry';
|
|
3
|
-
|
|
4
|
-
beforeAll(() => {
|
|
5
|
-
config.blocks.blocksConfig.teaser = {};
|
|
6
|
-
config.blocks.blocksConfig.teaser.imageScale = 'teaser';
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
describe('getTeaserImageURL tests', () => {
|
|
10
|
-
it('getTeaserImageURL internal URL - no overriden', () => {
|
|
11
|
-
const align = 'left';
|
|
12
|
-
const href = {
|
|
13
|
-
'@id': '/document',
|
|
14
|
-
image_field: 'preview_image',
|
|
15
|
-
image_scales: {
|
|
16
|
-
preview_image: [
|
|
17
|
-
{
|
|
18
|
-
download: '@@images/default_original_URL',
|
|
19
|
-
scales: {
|
|
20
|
-
teaser: {
|
|
21
|
-
download: '@@images/teaser_scale_URL',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
const image = undefined;
|
|
29
|
-
expect(getTeaserImageURL({ href, image, align })).toBe(
|
|
30
|
-
'/document/@@images/teaser_scale_URL',
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('getTeaserImageURL internal URL - no overriden - no scale', () => {
|
|
35
|
-
const align = 'left';
|
|
36
|
-
const href = {
|
|
37
|
-
'@id': '/document',
|
|
38
|
-
image_field: 'preview_image',
|
|
39
|
-
image_scales: {
|
|
40
|
-
preview_image: [
|
|
41
|
-
{
|
|
42
|
-
download: '@@images/default_original_URL',
|
|
43
|
-
scales: {},
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
const image = undefined;
|
|
49
|
-
expect(getTeaserImageURL({ href, image, align })).toBe(
|
|
50
|
-
'/document/@@images/default_original_URL',
|
|
51
|
-
);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('getTeaserImageURL internal URL - no overriden - no catalog image info', () => {
|
|
55
|
-
const align = 'left';
|
|
56
|
-
const href = {
|
|
57
|
-
'@id': '/document',
|
|
58
|
-
image_field: 'image',
|
|
59
|
-
image_scales: {
|
|
60
|
-
preview_image: [
|
|
61
|
-
{
|
|
62
|
-
download: '@@images/default_original_URL',
|
|
63
|
-
scales: {},
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
const image = undefined;
|
|
69
|
-
expect(getTeaserImageURL({ href, image, align })).toBe(
|
|
70
|
-
'/document/@@images/image/teaser',
|
|
71
|
-
);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('getTeaserImageURL internal URL - no overriden - center', () => {
|
|
75
|
-
const align = 'center';
|
|
76
|
-
const href = {
|
|
77
|
-
'@id': '/document',
|
|
78
|
-
image_field: 'preview_image',
|
|
79
|
-
image_scales: {
|
|
80
|
-
preview_image: [
|
|
81
|
-
{
|
|
82
|
-
download: '@@images/default_original_URL',
|
|
83
|
-
scales: {
|
|
84
|
-
great: {
|
|
85
|
-
download: '@@images/great_scale_URL',
|
|
86
|
-
},
|
|
87
|
-
teaser: {
|
|
88
|
-
download: '@@images/teaser_scale_URL',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
const image = undefined;
|
|
96
|
-
expect(getTeaserImageURL({ href, image, align })).toBe(
|
|
97
|
-
'/document/@@images/great_scale_URL',
|
|
98
|
-
);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it('getTeaserImageURL internal URL - no overriden - center - no great scale', () => {
|
|
102
|
-
const align = 'center';
|
|
103
|
-
const href = {
|
|
104
|
-
'@id': '/document',
|
|
105
|
-
image_field: 'preview_image',
|
|
106
|
-
image_scales: {
|
|
107
|
-
preview_image: [
|
|
108
|
-
{
|
|
109
|
-
download: '@@images/default_original_URL',
|
|
110
|
-
scales: {
|
|
111
|
-
teaser: {
|
|
112
|
-
download: '@@images/teaser_scale_URL',
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
const image = undefined;
|
|
120
|
-
expect(getTeaserImageURL({ href, image, align })).toBe(
|
|
121
|
-
'/document/@@images/default_original_URL',
|
|
122
|
-
);
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('getTeaserImageURL internal URL - image overriden', () => {
|
|
126
|
-
const align = 'left';
|
|
127
|
-
const href = {
|
|
128
|
-
'@id': '/document',
|
|
129
|
-
image_field: 'preview_image',
|
|
130
|
-
image_scales: {
|
|
131
|
-
preview_image: [
|
|
132
|
-
{
|
|
133
|
-
download: '@@images/default_original_URL',
|
|
134
|
-
scales: {
|
|
135
|
-
teaser: {
|
|
136
|
-
download: '@@images/teaser_scale_URL',
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
const image = {
|
|
144
|
-
'@id': '/document/image',
|
|
145
|
-
image_field: 'image',
|
|
146
|
-
image_scales: {
|
|
147
|
-
image: [
|
|
148
|
-
{
|
|
149
|
-
download: '@@images/overriden_image_default_original_URL',
|
|
150
|
-
scales: {
|
|
151
|
-
teaser: {
|
|
152
|
-
download: '@@images/overriden_image_teaser_scale_URL',
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
expect(getTeaserImageURL({ href, image, align })).toBe(
|
|
160
|
-
'/document/image/@@images/overriden_image_teaser_scale_URL',
|
|
161
|
-
);
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
it('getTeaserImageURL internal URL - image overriden - center - no great scale', () => {
|
|
165
|
-
const align = 'center';
|
|
166
|
-
const href = {
|
|
167
|
-
'@id': '/document',
|
|
168
|
-
image_field: 'preview_image',
|
|
169
|
-
image_scales: {
|
|
170
|
-
preview_image: [
|
|
171
|
-
{
|
|
172
|
-
download: '@@images/default_original_URL',
|
|
173
|
-
scales: {
|
|
174
|
-
teaser: {
|
|
175
|
-
download: '@@images/teaser_scale_URL',
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
],
|
|
180
|
-
},
|
|
181
|
-
};
|
|
182
|
-
const image = {
|
|
183
|
-
'@id': '/document/image',
|
|
184
|
-
image_field: 'image',
|
|
185
|
-
image_scales: {
|
|
186
|
-
image: [
|
|
187
|
-
{
|
|
188
|
-
download: '@@images/overriden_image_default_original_URL',
|
|
189
|
-
scales: {
|
|
190
|
-
teaser: {
|
|
191
|
-
download: '@@images/overriden_image_teaser_scale_URL',
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
],
|
|
196
|
-
},
|
|
197
|
-
};
|
|
198
|
-
expect(getTeaserImageURL({ href, image, align })).toBe(
|
|
199
|
-
'/document/image/@@images/overriden_image_default_original_URL',
|
|
200
|
-
);
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
it('getTeaserImageURL internal URL - image overriden - external', () => {
|
|
204
|
-
const align = 'left';
|
|
205
|
-
const href = {
|
|
206
|
-
'@id': '/document',
|
|
207
|
-
image_field: 'preview_image',
|
|
208
|
-
image_scales: {
|
|
209
|
-
preview_image: [
|
|
210
|
-
{
|
|
211
|
-
download: '@@images/default_original_URL',
|
|
212
|
-
scales: {
|
|
213
|
-
teaser: {
|
|
214
|
-
download: '@@images/teaser_scale_URL',
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
],
|
|
219
|
-
},
|
|
220
|
-
};
|
|
221
|
-
const image = {
|
|
222
|
-
'@id': 'https://plone.org/document/image.png',
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
expect(getTeaserImageURL({ href, image, align })).toBe(
|
|
226
|
-
'https://plone.org/document/image.png',
|
|
227
|
-
);
|
|
228
|
-
});
|
|
229
|
-
});
|