@plone/volto 18.0.0-alpha.17 → 18.0.0-alpha.19
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 +48 -2
- package/locales/ca/LC_MESSAGES/volto.po +17 -42
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +15 -40
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +14 -39
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +15 -40
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +15 -40
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +15 -40
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +15 -40
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +15 -40
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +15 -40
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +14 -39
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +15 -40
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +15 -40
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +15 -40
- package/locales/ro.json +1 -1
- package/locales/volto.pot +15 -40
- package/locales/zh_CN/LC_MESSAGES/volto.po +15 -40
- package/locales/zh_CN.json +1 -1
- package/package.json +11 -21
- package/src/components/index.js +0 -6
- package/src/components/manage/Add/Add.jsx +1 -1
- package/src/components/manage/Blocks/Search/SearchBlockEdit.jsx +8 -2
- package/src/components/manage/Blocks/Search/hocs/withSearch.jsx +2 -2
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx +33 -5
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.test.jsx +12 -0
- package/src/components/manage/Controlpanels/Groups/RenderGroups.jsx +22 -11
- package/src/components/manage/Controlpanels/Groups/RenderGroups.test.jsx +21 -0
- package/src/components/manage/Controlpanels/Users/RenderUsers.jsx +30 -21
- package/src/components/manage/Controlpanels/Users/RenderUsers.test.jsx +27 -1
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipListing.jsx +29 -7
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +51 -3
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +8 -0
- package/src/components/manage/Form/Form.jsx +1 -1
- package/src/components/theme/SlotRenderer/SlotRenderer.tsx +8 -1
- package/src/config/Blocks.jsx +63 -67
- package/src/config/Loadables.jsx +0 -22
- package/src/config/Widgets.jsx +0 -2
- package/src/config/index.js +0 -13
- package/src/helpers/User/User.js +29 -0
- package/src/helpers/index.js +6 -1
- package/test-setup-config.js +0 -30
- package/types/components/index.d.ts +0 -6
- package/types/config/Blocks.d.ts +0 -51
- package/types/config/Loadables.d.ts +0 -10
- package/types/config/Widgets.d.ts +0 -2
- package/types/helpers/User/User.d.ts +18 -0
- package/types/helpers/index.d.ts +1 -1
- package/webpack-plugins/webpack-bundle-analyze-plugin.js +1 -1
- package/src/components/manage/AnchorPlugin/components/Link/index.jsx +0 -37
- package/src/components/manage/AnchorPlugin/components/LinkButton/index.jsx +0 -126
- package/src/components/manage/AnchorPlugin/index.jsx +0 -82
- package/src/components/manage/AnchorPlugin/linkStrategy.js +0 -21
- package/src/components/manage/AnchorPlugin/utils/EditorUtils.js +0 -47
- package/src/components/manage/Blocks/HeroImageLeft/Data.jsx +0 -29
- package/src/components/manage/Blocks/HeroImageLeft/Edit.jsx +0 -493
- package/src/components/manage/Blocks/HeroImageLeft/Edit.test.jsx +0 -58
- package/src/components/manage/Blocks/HeroImageLeft/View.jsx +0 -37
- package/src/components/manage/Blocks/HeroImageLeft/View.test.jsx +0 -9
- package/src/components/manage/Blocks/HeroImageLeft/schema.js +0 -43
- package/src/components/manage/Blocks/Table/Cell.jsx +0 -206
- package/src/components/manage/Blocks/Table/Cell.test.jsx +0 -19
- package/src/components/manage/Blocks/Table/Edit.jsx +0 -748
- package/src/components/manage/Blocks/Table/Edit.test.jsx +0 -44
- package/src/components/manage/Blocks/Table/Readme.md +0 -5
- package/src/components/manage/Blocks/Table/View.jsx +0 -51
- package/src/components/manage/Blocks/Table/View.test.jsx +0 -41
- package/src/components/manage/Blocks/Text/Edit.jsx +0 -372
- package/src/components/manage/Blocks/Text/Edit.test.jsx +0 -46
- package/src/components/manage/Blocks/Text/Readme.md +0 -5
- package/src/components/manage/Blocks/Text/Schema.jsx +0 -31
- package/src/components/manage/Blocks/Text/View.jsx +0 -26
- package/src/components/manage/Blocks/Text/View.test.jsx +0 -28
- package/src/components/manage/LinkDetectionPlugin/link-detection-plugin.jsx +0 -227
- package/src/components/manage/LinkDetectionPlugin/utils.js +0 -12
- package/src/components/manage/Widgets/WysiwygWidget.jsx +0 -350
- package/src/components/manage/Widgets/WysiwygWidget.stories.jsx +0 -24
- package/src/components/manage/Widgets/WysiwygWidget.test.jsx +0 -37
- package/src/config/RichTextEditor/Blocks.jsx +0 -29
- package/src/config/RichTextEditor/FromHTML.jsx +0 -8
- package/src/config/RichTextEditor/Plugins.jsx +0 -59
- package/src/config/RichTextEditor/Styles.jsx +0 -69
- package/src/config/RichTextEditor/ToHTML.jsx +0 -262
- package/src/config/RichTextEditor/index.js +0 -25
package/src/config/Blocks.jsx
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl';
|
|
2
|
+
import { cloneDeep } from 'lodash';
|
|
2
3
|
|
|
3
4
|
import ViewTitleBlock from '@plone/volto/components/manage/Blocks/Title/View';
|
|
4
5
|
import ViewDescriptionBlock from '@plone/volto/components/manage/Blocks/Description/View';
|
|
5
6
|
import ViewToCBlock from '@plone/volto/components/manage/Blocks/ToC/View';
|
|
6
|
-
import ViewTextBlock from '@plone/volto/components/manage/Blocks/Text/View';
|
|
7
7
|
import ViewImageBlock from '@plone/volto/components/manage/Blocks/Image/View';
|
|
8
8
|
import ViewLeadImageBlock from '@plone/volto/components/manage/Blocks/LeadImage/View';
|
|
9
9
|
import ViewListingBlock from '@plone/volto/components/manage/Blocks/Listing/View';
|
|
10
10
|
import ViewVideoBlock from '@plone/volto/components/manage/Blocks/Video/View';
|
|
11
|
-
import ViewHeroImageLeftBlock from '@plone/volto/components/manage/Blocks/HeroImageLeft/View';
|
|
12
11
|
import ViewMapBlock from '@plone/volto/components/manage/Blocks/Maps/View';
|
|
13
12
|
import ViewHTMLBlock from '@plone/volto/components/manage/Blocks/HTML/View';
|
|
14
|
-
import ViewTableBlock from '@plone/volto/components/manage/Blocks/Table/View';
|
|
15
13
|
|
|
16
14
|
import EditTitleBlock from '@plone/volto/components/manage/Blocks/Title/Edit';
|
|
17
15
|
import EditDescriptionBlock from '@plone/volto/components/manage/Blocks/Description/Edit';
|
|
18
16
|
import EditToCBlock from '@plone/volto/components/manage/Blocks/ToC/Edit';
|
|
19
|
-
import EditTextBlock from '@plone/volto/components/manage/Blocks/Text/Edit';
|
|
20
17
|
import EditImageBlock from '@plone/volto/components/manage/Blocks/Image/Edit';
|
|
21
18
|
import EditLeadImageBlock from '@plone/volto/components/manage/Blocks/LeadImage/Edit';
|
|
22
19
|
import EditListingBlock from '@plone/volto/components/manage/Blocks/Listing/Edit';
|
|
@@ -25,20 +22,15 @@ import GalleryNoResultsComponent from '@plone/volto/components/manage/Blocks/Lis
|
|
|
25
22
|
import DefaultListingBlockTemplate from '@plone/volto/components/manage/Blocks/Listing/DefaultTemplate';
|
|
26
23
|
import SummaryListingBlockTemplate from '@plone/volto/components/manage/Blocks/Listing/SummaryTemplate';
|
|
27
24
|
import EditVideoBlock from '@plone/volto/components/manage/Blocks/Video/Edit';
|
|
28
|
-
import EditHeroImageLeftBlock from '@plone/volto/components/manage/Blocks/HeroImageLeft/Edit';
|
|
29
25
|
import EditMapBlock from '@plone/volto/components/manage/Blocks/Maps/Edit';
|
|
30
26
|
import EditHTMLBlock from '@plone/volto/components/manage/Blocks/HTML/Edit';
|
|
31
|
-
import EditTableBlock from '@plone/volto/components/manage/Blocks/Table/Edit';
|
|
32
27
|
|
|
33
28
|
import descriptionSVG from '@plone/volto/icons/description.svg';
|
|
34
29
|
import titleSVG from '@plone/volto/icons/text.svg';
|
|
35
|
-
import textSVG from '@plone/volto/icons/subtext.svg';
|
|
36
30
|
import cameraSVG from '@plone/volto/icons/camera.svg';
|
|
37
31
|
import videoSVG from '@plone/volto/icons/videocamera.svg';
|
|
38
32
|
import globeSVG from '@plone/volto/icons/globe.svg';
|
|
39
33
|
import codeSVG from '@plone/volto/icons/code.svg';
|
|
40
|
-
import heroSVG from '@plone/volto/icons/hero.svg';
|
|
41
|
-
import tableSVG from '@plone/volto/icons/table.svg';
|
|
42
34
|
import listingBlockSVG from '@plone/volto/icons/content-listing.svg';
|
|
43
35
|
import tocSVG from '@plone/volto/icons/list-bullet.svg';
|
|
44
36
|
import searchSVG from '@plone/volto/icons/zoom.svg';
|
|
@@ -47,7 +39,6 @@ import imagesSVG from '@plone/volto/icons/images.svg';
|
|
|
47
39
|
|
|
48
40
|
import ImageGalleryListingBlockTemplate from '@plone/volto/components/manage/Blocks/Listing/ImageGallery';
|
|
49
41
|
import BlockSettingsSchema from '@plone/volto/components/manage/Blocks/Block/Schema';
|
|
50
|
-
import TextSettingsSchema from '@plone/volto/components/manage/Blocks/Text/Schema';
|
|
51
42
|
import ImageSettingsSchema from '@plone/volto/components/manage/Blocks/Image/LayoutSchema';
|
|
52
43
|
import ToCSettingsSchema from '@plone/volto/components/manage/Blocks/ToC/Schema';
|
|
53
44
|
|
|
@@ -79,7 +70,6 @@ import { getImageBlockSizes } from '@plone/volto/components/manage/Blocks/Image/
|
|
|
79
70
|
import { getLeadImageBlockSizes } from '@plone/volto/components/manage/Blocks/LeadImage/utils';
|
|
80
71
|
|
|
81
72
|
// block sidebar schemas (not the Dexterity Layout block settings schemas)
|
|
82
|
-
import HeroImageLeftBlockSchema from '@plone/volto/components/manage/Blocks/HeroImageLeft/schema';
|
|
83
73
|
import ListingBlockSchema from '@plone/volto/components/manage/Blocks/Listing/schema';
|
|
84
74
|
import SearchBlockSchema from '@plone/volto/components/manage/Blocks/Search/schema';
|
|
85
75
|
|
|
@@ -191,6 +181,63 @@ defineMessages({
|
|
|
191
181
|
id: 'toggleFacet',
|
|
192
182
|
defaultMessage: 'Toggle',
|
|
193
183
|
},
|
|
184
|
+
// BBB Table messages
|
|
185
|
+
Table: {
|
|
186
|
+
id: 'Table',
|
|
187
|
+
defaultMessage: 'Table',
|
|
188
|
+
},
|
|
189
|
+
cell: {
|
|
190
|
+
id: 'Cell',
|
|
191
|
+
defaultMessage: 'Cell',
|
|
192
|
+
},
|
|
193
|
+
insertRowBefore: {
|
|
194
|
+
id: 'Insert row before',
|
|
195
|
+
defaultMessage: 'Insert row before',
|
|
196
|
+
},
|
|
197
|
+
insertRowAfter: {
|
|
198
|
+
id: 'Insert row after',
|
|
199
|
+
defaultMessage: 'Insert row after',
|
|
200
|
+
},
|
|
201
|
+
deleteRow: {
|
|
202
|
+
id: 'Delete row',
|
|
203
|
+
defaultMessage: 'Delete row',
|
|
204
|
+
},
|
|
205
|
+
insertColBefore: {
|
|
206
|
+
id: 'Insert col before',
|
|
207
|
+
defaultMessage: 'Insert col before',
|
|
208
|
+
},
|
|
209
|
+
insertColAfter: {
|
|
210
|
+
id: 'Insert col after',
|
|
211
|
+
defaultMessage: 'Insert col after',
|
|
212
|
+
},
|
|
213
|
+
deleteCol: {
|
|
214
|
+
id: 'Delete col',
|
|
215
|
+
defaultMessage: 'Delete col',
|
|
216
|
+
},
|
|
217
|
+
fixed: {
|
|
218
|
+
id: 'Fixed width table cells',
|
|
219
|
+
defaultMessage: 'Fixed width columns',
|
|
220
|
+
},
|
|
221
|
+
compact: {
|
|
222
|
+
id: 'Make the table compact',
|
|
223
|
+
defaultMessage: 'Reduce cell padding',
|
|
224
|
+
},
|
|
225
|
+
basic: {
|
|
226
|
+
id: 'Reduce complexity',
|
|
227
|
+
defaultMessage: 'Minimalistic table design',
|
|
228
|
+
},
|
|
229
|
+
celled: {
|
|
230
|
+
id: 'Divide each row into separate cells',
|
|
231
|
+
defaultMessage: 'Add border to inner columns',
|
|
232
|
+
},
|
|
233
|
+
striped: {
|
|
234
|
+
id: 'Stripe alternate rows with color',
|
|
235
|
+
defaultMessage: 'Alternate row background color',
|
|
236
|
+
},
|
|
237
|
+
headerCell: {
|
|
238
|
+
id: 'Header cell',
|
|
239
|
+
defaultMessage: 'Header cell',
|
|
240
|
+
},
|
|
194
241
|
});
|
|
195
242
|
|
|
196
243
|
const groupBlocksOrder = [
|
|
@@ -230,25 +277,6 @@ const blocksConfig = {
|
|
|
230
277
|
blockHasOwnFocusManagement: true,
|
|
231
278
|
sidebarTab: 0,
|
|
232
279
|
},
|
|
233
|
-
text: {
|
|
234
|
-
id: 'text',
|
|
235
|
-
title: 'Text',
|
|
236
|
-
icon: textSVG,
|
|
237
|
-
group: 'text',
|
|
238
|
-
view: ViewTextBlock,
|
|
239
|
-
edit: EditTextBlock,
|
|
240
|
-
schema: TextSettingsSchema,
|
|
241
|
-
restricted: false,
|
|
242
|
-
mostUsed: false,
|
|
243
|
-
blockHasOwnFocusManagement: true,
|
|
244
|
-
sidebarTab: 0,
|
|
245
|
-
blockHasValue: (data) => {
|
|
246
|
-
const isEmpty =
|
|
247
|
-
!data.text ||
|
|
248
|
-
(data.text?.blocks?.length === 1 && data.text.blocks[0].text === '');
|
|
249
|
-
return !isEmpty;
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
280
|
image: {
|
|
253
281
|
id: 'image',
|
|
254
282
|
title: 'Image',
|
|
@@ -335,21 +363,6 @@ const blocksConfig = {
|
|
|
335
363
|
mostUsed: false,
|
|
336
364
|
sidebarTab: 1,
|
|
337
365
|
},
|
|
338
|
-
hero: {
|
|
339
|
-
id: 'hero',
|
|
340
|
-
title: 'Hero',
|
|
341
|
-
icon: heroSVG,
|
|
342
|
-
group: 'common',
|
|
343
|
-
view: ViewHeroImageLeftBlock,
|
|
344
|
-
edit: EditHeroImageLeftBlock,
|
|
345
|
-
schema: BlockSettingsSchema,
|
|
346
|
-
blockSchema: HeroImageLeftBlockSchema,
|
|
347
|
-
restricted: false,
|
|
348
|
-
mostUsed: false,
|
|
349
|
-
blockHasOwnFocusManagement: true,
|
|
350
|
-
sidebarTab: 1,
|
|
351
|
-
},
|
|
352
|
-
|
|
353
366
|
maps: {
|
|
354
367
|
id: 'maps',
|
|
355
368
|
title: 'Maps',
|
|
@@ -374,19 +387,6 @@ const blocksConfig = {
|
|
|
374
387
|
mostUsed: false,
|
|
375
388
|
sidebarTab: 0,
|
|
376
389
|
},
|
|
377
|
-
table: {
|
|
378
|
-
id: 'table',
|
|
379
|
-
title: 'Table',
|
|
380
|
-
icon: tableSVG,
|
|
381
|
-
group: 'common',
|
|
382
|
-
view: ViewTableBlock,
|
|
383
|
-
edit: EditTableBlock,
|
|
384
|
-
schema: BlockSettingsSchema,
|
|
385
|
-
restricted: false,
|
|
386
|
-
mostUsed: false,
|
|
387
|
-
blockHasOwnFocusManagement: true,
|
|
388
|
-
sidebarTab: 1,
|
|
389
|
-
},
|
|
390
390
|
search: {
|
|
391
391
|
id: 'search',
|
|
392
392
|
title: 'Search',
|
|
@@ -519,15 +519,11 @@ const blocksConfig = {
|
|
|
519
519
|
// for the grid block, since we need to modify how the inner teaser
|
|
520
520
|
// block behave in it (= no schemaEnhancer fields for teasers inside a grid)
|
|
521
521
|
// Afterwards, it can be further customized in add-ons using the same technique.
|
|
522
|
-
blocksConfig.gridBlock.blocksConfig =
|
|
523
|
-
blocksConfig.gridBlock.blocksConfig.teaser =
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
blocksConfig.gridBlock.blocksConfig.image = {
|
|
528
|
-
...blocksConfig.image,
|
|
529
|
-
schemaEnhancer: gridImageDisableSizeAndPositionHandlersSchema,
|
|
530
|
-
};
|
|
522
|
+
blocksConfig.gridBlock.blocksConfig = cloneDeep(blocksConfig);
|
|
523
|
+
blocksConfig.gridBlock.blocksConfig.teaser.schemaEnhancer =
|
|
524
|
+
gridTeaserDisableStylingSchema;
|
|
525
|
+
blocksConfig.gridBlock.blocksConfig.image.schemaEnhancer =
|
|
526
|
+
gridImageDisableSizeAndPositionHandlersSchema;
|
|
531
527
|
|
|
532
528
|
const requiredBlocks = ['title'];
|
|
533
529
|
|
package/src/config/Loadables.jsx
CHANGED
|
@@ -35,26 +35,4 @@ export const loadables = {
|
|
|
35
35
|
reactDndHtml5Backend: loadable.lib(() => import('react-dnd-html5-backend')),
|
|
36
36
|
reactBeautifulDnd: loadable.lib(() => import('react-beautiful-dnd')),
|
|
37
37
|
rrule: loadable.lib(() => import('rrule')),
|
|
38
|
-
|
|
39
|
-
// draftjs libs
|
|
40
|
-
immutableLib: loadable.lib(() => import('immutable')),
|
|
41
|
-
draftJs: loadable.lib(() => import('draft-js')),
|
|
42
|
-
draftJsLibIsSoftNewlineEvent: loadable.lib(
|
|
43
|
-
() => import('draft-js/lib/isSoftNewlineEvent'),
|
|
44
|
-
),
|
|
45
|
-
draftJsFilters: loadable.lib(() => import('draftjs-filters')),
|
|
46
|
-
draftJsInlineToolbarPlugin: loadable.lib(
|
|
47
|
-
() => import('draft-js-inline-toolbar-plugin'),
|
|
48
|
-
),
|
|
49
|
-
draftJsImportHtml: loadable.lib(() => import('draft-js-import-html')),
|
|
50
|
-
draftJsBlockBreakoutPlugin: loadable.lib(
|
|
51
|
-
() => import('draft-js-block-breakout-plugin'),
|
|
52
|
-
),
|
|
53
|
-
draftJsCreateInlineStyleButton: loadable.lib(
|
|
54
|
-
() => import('draft-js-buttons/lib/utils/createInlineStyleButton'),
|
|
55
|
-
),
|
|
56
|
-
draftJsCreateBlockStyleButton: loadable.lib(
|
|
57
|
-
() => import('draft-js-buttons/lib/utils/createBlockStyleButton'),
|
|
58
|
-
),
|
|
59
|
-
draftJsPluginsUtils: loadable.lib(() => import('draft-js-plugins-utils')),
|
|
60
38
|
};
|
package/src/config/Widgets.jsx
CHANGED
|
@@ -18,7 +18,6 @@ import SelectWidget from '@plone/volto/components/manage/Widgets/SelectWidget';
|
|
|
18
18
|
import TextareaWidget from '@plone/volto/components/manage/Widgets/TextareaWidget';
|
|
19
19
|
import TextWidget from '@plone/volto/components/manage/Widgets/TextWidget';
|
|
20
20
|
import TokenWidget from '@plone/volto/components/manage/Widgets/TokenWidget';
|
|
21
|
-
import WysiwygWidget from '@plone/volto/components/manage/Widgets/WysiwygWidget';
|
|
22
21
|
import UrlWidget from '@plone/volto/components/manage/Widgets/UrlWidget';
|
|
23
22
|
import InternalUrlWidget from '@plone/volto/components/manage/Widgets/InternalUrlWidget';
|
|
24
23
|
import EmailWidget from '@plone/volto/components/manage/Widgets/EmailWidget';
|
|
@@ -77,7 +76,6 @@ export const widgetMapping = {
|
|
|
77
76
|
site_logo: RegistryImageWidget,
|
|
78
77
|
},
|
|
79
78
|
widget: {
|
|
80
|
-
richtext: WysiwygWidget,
|
|
81
79
|
textarea: TextareaWidget,
|
|
82
80
|
datetime: DatetimeWidget,
|
|
83
81
|
date: DatetimeWidget,
|
package/src/config/index.js
CHANGED
|
@@ -27,8 +27,6 @@ import {
|
|
|
27
27
|
filterControlPanelsSchema,
|
|
28
28
|
} from './ControlPanels';
|
|
29
29
|
|
|
30
|
-
import { richtextEditorSettings, richtextViewSettings } from './RichTextEditor';
|
|
31
|
-
|
|
32
30
|
import applyAddonConfiguration, { addonsInfo } from 'load-volto-addons';
|
|
33
31
|
|
|
34
32
|
import ConfigRegistry from '@plone/volto/registry';
|
|
@@ -112,8 +110,6 @@ let config = {
|
|
|
112
110
|
legacyTraverse: process.env.RAZZLE_LEGACY_TRAVERSE || false,
|
|
113
111
|
cookieExpires: 15552000, //in seconds. Default is 6 month (15552000)
|
|
114
112
|
nonContentRoutes,
|
|
115
|
-
richtextEditorSettings, // Part of draftjs support, to be removed
|
|
116
|
-
richtextViewSettings, // Part of draftjs support, to be removed
|
|
117
113
|
imageObjects: ['Image'],
|
|
118
114
|
reservedIds: ['login', 'layout', 'plone', 'zip', 'properties'],
|
|
119
115
|
downloadableObjects: ['File'], //list of content-types for which the direct download of the file will be carried out if the user is not authenticated
|
|
@@ -145,15 +141,6 @@ let config = {
|
|
|
145
141
|
'reactBeautifulDnd',
|
|
146
142
|
// 'diffLib',
|
|
147
143
|
],
|
|
148
|
-
draftEditor: [
|
|
149
|
-
'immutableLib',
|
|
150
|
-
'draftJs',
|
|
151
|
-
'draftJsLibIsSoftNewlineEvent',
|
|
152
|
-
'draftJsFilters',
|
|
153
|
-
'draftJsInlineToolbarPlugin',
|
|
154
|
-
'draftJsImportHtml',
|
|
155
|
-
'draftJsBlockBreakoutPlugin',
|
|
156
|
-
],
|
|
157
144
|
},
|
|
158
145
|
appExtras: [],
|
|
159
146
|
maxResponseSize: 2000000000, // This is superagent default (200 mb)
|
package/src/helpers/User/User.js
CHANGED
|
@@ -12,3 +12,32 @@ import { intersection } from 'lodash';
|
|
|
12
12
|
export function userHasRoles(user, roles = []) {
|
|
13
13
|
return intersection(user?.roles ?? [], roles).length > 0;
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Checks if the user is Manager.
|
|
18
|
+
* @method isManager
|
|
19
|
+
* @returns {boolean}
|
|
20
|
+
*/
|
|
21
|
+
export function isManager(user) {
|
|
22
|
+
return userHasRoles(user, ['Manager']);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Checks if the user can assing group.
|
|
27
|
+
* @method canAssignGroup
|
|
28
|
+
* @returns {boolean}
|
|
29
|
+
*/
|
|
30
|
+
export function canAssignGroup(isManager, group) {
|
|
31
|
+
if (isManager) return true;
|
|
32
|
+
return !group.roles.includes('Manager');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Checks if the user can assign role.
|
|
37
|
+
* @method canDeleteGroup
|
|
38
|
+
* @returns {boolean}
|
|
39
|
+
*/
|
|
40
|
+
export function canAssignRole(isManager, role) {
|
|
41
|
+
if (isManager) return true;
|
|
42
|
+
return role.id !== 'Manager';
|
|
43
|
+
}
|
package/src/helpers/index.js
CHANGED
|
@@ -116,7 +116,12 @@ export {
|
|
|
116
116
|
composeSchema,
|
|
117
117
|
} from './Extensions';
|
|
118
118
|
export { asyncConnect } from './AsyncConnect';
|
|
119
|
-
export {
|
|
119
|
+
export {
|
|
120
|
+
userHasRoles,
|
|
121
|
+
isManager,
|
|
122
|
+
canAssignGroup,
|
|
123
|
+
canAssignRole,
|
|
124
|
+
} from './User/User';
|
|
120
125
|
// export { injectLazyLibs } from './Loadable/Loadable';
|
|
121
126
|
export { useDetectClickOutside } from './Utils/useDetectClickOutside';
|
|
122
127
|
export { useEvent } from './Utils/useEvent';
|
package/test-setup-config.js
CHANGED
|
@@ -10,15 +10,6 @@ import React from 'react';
|
|
|
10
10
|
import config from '@plone/volto/registry';
|
|
11
11
|
import { loadables } from '@plone/volto/config/Loadables';
|
|
12
12
|
import { nonContentRoutes } from '@plone/volto/config/NonContentRoutes';
|
|
13
|
-
import ToHTMLRenderers, {
|
|
14
|
-
options as ToHTMLOptions,
|
|
15
|
-
} from '@plone/volto/config/RichTextEditor/ToHTML';
|
|
16
|
-
import {
|
|
17
|
-
extendedBlockRenderMap,
|
|
18
|
-
blockStyleFn,
|
|
19
|
-
listBlockTypes,
|
|
20
|
-
} from '@plone/volto/config/RichTextEditor/Blocks';
|
|
21
|
-
import FromHTMLCustomBlockFn from '@plone/volto/config/RichTextEditor/FromHTML';
|
|
22
13
|
import { contentIcons } from '@plone/volto/config/ContentIcons';
|
|
23
14
|
import {
|
|
24
15
|
styleClassNameConverters,
|
|
@@ -33,25 +24,6 @@ import {
|
|
|
33
24
|
|
|
34
25
|
import ListingBlockSchema from '@plone/volto/components/manage/Blocks/Listing/schema';
|
|
35
26
|
|
|
36
|
-
// we need to do a redefinition here because of circular import issues
|
|
37
|
-
// because draftjs-based components are not really tested, this is basically
|
|
38
|
-
// dummy code.
|
|
39
|
-
const richtextEditorSettings = (props) => {
|
|
40
|
-
return {
|
|
41
|
-
extendedBlockRenderMap,
|
|
42
|
-
blockStyleFn,
|
|
43
|
-
listBlockTypes,
|
|
44
|
-
FromHTMLCustomBlockFn,
|
|
45
|
-
// richTextEditorPlugins: plugins,
|
|
46
|
-
// richTextEditorInlineToolbarButtons: inlineToolbarButtons,
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const richtextViewSettings = {
|
|
51
|
-
ToHTMLRenderers,
|
|
52
|
-
ToHTMLOptions,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
27
|
config.set('settings', {
|
|
56
28
|
apiPath: 'http://localhost:8080/Plone',
|
|
57
29
|
publicURL: 'http://localhost:3000',
|
|
@@ -60,8 +32,6 @@ config.set('settings', {
|
|
|
60
32
|
defaultPageSize: 25,
|
|
61
33
|
isMultilingual: false,
|
|
62
34
|
nonContentRoutes,
|
|
63
|
-
richtextEditorSettings,
|
|
64
|
-
richtextViewSettings,
|
|
65
35
|
contentIcons: contentIcons,
|
|
66
36
|
loadables,
|
|
67
37
|
lazyBundles: {
|
|
@@ -135,27 +135,22 @@ export { default as SchemaWidgetFieldset } from "@plone/volto/components/manage/
|
|
|
135
135
|
export { default as SelectWidget } from "@plone/volto/components/manage/Widgets/SelectWidget";
|
|
136
136
|
export { default as TextareaWidget } from "@plone/volto/components/manage/Widgets/TextareaWidget";
|
|
137
137
|
export { default as TextWidget } from "@plone/volto/components/manage/Widgets/TextWidget";
|
|
138
|
-
export { default as WysiwygWidget } from "@plone/volto/components/manage/Widgets/WysiwygWidget";
|
|
139
138
|
export { default as ObjectWidget } from "@plone/volto/components/manage/Widgets/ObjectWidget";
|
|
140
139
|
export { default as ObjectListWidget } from "@plone/volto/components/manage/Widgets/ObjectListWidget";
|
|
141
140
|
export { default as EditDefaultBlock } from "@plone/volto/components/manage/Blocks/Block/DefaultEdit";
|
|
142
141
|
export { default as EditDescriptionBlock } from "@plone/volto/components/manage/Blocks/Description/Edit";
|
|
143
142
|
export { default as EditTitleBlock } from "@plone/volto/components/manage/Blocks/Title/Edit";
|
|
144
143
|
export { default as EditToCBlock } from "@plone/volto/components/manage/Blocks/ToC/Edit";
|
|
145
|
-
export { default as EditTextBlock } from "@plone/volto/components/manage/Blocks/Text/Edit";
|
|
146
144
|
export { default as EditImageBlock } from "@plone/volto/components/manage/Blocks/Image/Edit";
|
|
147
145
|
export { default as EditListingBlock } from "@plone/volto/components/manage/Blocks/Listing/Edit";
|
|
148
146
|
export { default as EditVideoBlock } from "@plone/volto/components/manage/Blocks/Video/Edit";
|
|
149
147
|
export { default as EditBlock } from "@plone/volto/components/manage/Blocks/Block/Edit";
|
|
150
|
-
export { default as EditHeroImageLeftBlock } from "@plone/volto/components/manage/Blocks/HeroImageLeft/Edit";
|
|
151
|
-
export { default as ViewHeroImageLeftBlock } from "@plone/volto/components/manage/Blocks/HeroImageLeft/View";
|
|
152
148
|
export { default as EditMapBlock } from "@plone/volto/components/manage/Blocks/Maps/Edit";
|
|
153
149
|
export { default as EditHTMLBlock } from "@plone/volto/components/manage/Blocks/HTML/Edit";
|
|
154
150
|
export { default as ViewDefaultBlock } from "@plone/volto/components/manage/Blocks/Block/DefaultView";
|
|
155
151
|
export { default as ViewDescriptionBlock } from "@plone/volto/components/manage/Blocks/Description/View";
|
|
156
152
|
export { default as ViewTitleBlock } from "@plone/volto/components/manage/Blocks/Title/View";
|
|
157
153
|
export { default as ViewToCBlock } from "@plone/volto/components/manage/Blocks/ToC/View";
|
|
158
|
-
export { default as ViewTextBlock } from "@plone/volto/components/manage/Blocks/Text/View";
|
|
159
154
|
export { default as ViewImageBlock } from "@plone/volto/components/manage/Blocks/Image/View";
|
|
160
155
|
export { default as ViewListingBlock } from "@plone/volto/components/manage/Blocks/Listing/View";
|
|
161
156
|
export { default as ViewVideoBlock } from "@plone/volto/components/manage/Blocks/Video/View";
|
|
@@ -170,7 +165,6 @@ export { default as LeadImageSidebar } from "@plone/volto/components/manage/Bloc
|
|
|
170
165
|
export { default as Style } from "@plone/volto/components/manage/Blocks/Block/Style";
|
|
171
166
|
export { default as BlockSettingsSidebar } from "@plone/volto/components/manage/Blocks/Block/Settings";
|
|
172
167
|
export { default as BlockSettingsSchema } from "@plone/volto/components/manage/Blocks/Block/Schema";
|
|
173
|
-
export { default as TextSettingsSchema } from "@plone/volto/components/manage/Blocks/Text/Schema";
|
|
174
168
|
export { default as ImageSettingsSchema } from "@plone/volto/components/manage/Blocks/Image/LayoutSchema";
|
|
175
169
|
export { default as ToCSettingsSchema } from "@plone/volto/components/manage/Blocks/ToC/Schema";
|
|
176
170
|
export { default as MaybeWrap } from "@plone/volto/components/manage/MaybeWrap/MaybeWrap";
|
package/types/config/Blocks.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="@plone/registry/node_modules/@plone/types/src/modules" />
|
|
2
1
|
export const groupBlocksOrder: {
|
|
3
2
|
id: string;
|
|
4
3
|
title: string;
|
|
@@ -9,49 +8,9 @@ export namespace blocksConfig {
|
|
|
9
8
|
namespace blocksConfig {
|
|
10
9
|
namespace teaser {
|
|
11
10
|
export { gridTeaserDisableStylingSchema as schemaEnhancer };
|
|
12
|
-
export let id: string;
|
|
13
|
-
export let title: string;
|
|
14
|
-
export { imagesSVG as icon };
|
|
15
|
-
export let group: string;
|
|
16
|
-
export { TeaserViewBlock as view };
|
|
17
|
-
export { TeaserEditBlock as edit };
|
|
18
|
-
export let restricted: boolean;
|
|
19
|
-
export let mostUsed: boolean;
|
|
20
|
-
export let sidebarTab: number;
|
|
21
|
-
export { TeaserSchema as blockSchema };
|
|
22
|
-
export { TeaserBlockDataAdapter as dataAdapter };
|
|
23
|
-
export let variations: {
|
|
24
|
-
id: string;
|
|
25
|
-
isDefault: boolean;
|
|
26
|
-
title: string;
|
|
27
|
-
template: {
|
|
28
|
-
(props: any): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
propTypes: {
|
|
30
|
-
data: any;
|
|
31
|
-
isEditMode: any;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
}[];
|
|
35
11
|
}
|
|
36
12
|
namespace image {
|
|
37
13
|
export { gridImageDisableSizeAndPositionHandlersSchema as schemaEnhancer };
|
|
38
|
-
let id_1: string;
|
|
39
|
-
export { id_1 as id };
|
|
40
|
-
let title_1: string;
|
|
41
|
-
export { title_1 as title };
|
|
42
|
-
export { cameraSVG as icon };
|
|
43
|
-
let group_1: string;
|
|
44
|
-
export { group_1 as group };
|
|
45
|
-
export { ViewImageBlock as view };
|
|
46
|
-
export { EditImageBlock as edit };
|
|
47
|
-
export { ImageSettingsSchema as schema };
|
|
48
|
-
let restricted_1: boolean;
|
|
49
|
-
export { restricted_1 as restricted };
|
|
50
|
-
let mostUsed_1: boolean;
|
|
51
|
-
export { mostUsed_1 as mostUsed };
|
|
52
|
-
let sidebarTab_1: number;
|
|
53
|
-
export { sidebarTab_1 as sidebarTab };
|
|
54
|
-
export { getImageBlockSizes as getSizes };
|
|
55
14
|
}
|
|
56
15
|
}
|
|
57
16
|
}
|
|
@@ -59,14 +18,4 @@ export namespace blocksConfig {
|
|
|
59
18
|
export const initialBlocks: {};
|
|
60
19
|
export const initialBlocksFocus: {};
|
|
61
20
|
import { gridTeaserDisableStylingSchema } from '@plone/volto/components/manage/Blocks/Teaser/schema';
|
|
62
|
-
import imagesSVG from '@plone/volto/icons/images.svg';
|
|
63
|
-
import TeaserViewBlock from '@plone/volto/components/manage/Blocks/Teaser/View';
|
|
64
|
-
import TeaserEditBlock from '@plone/volto/components/manage/Blocks/Teaser/Edit';
|
|
65
|
-
import { TeaserSchema } from '@plone/volto/components/manage/Blocks/Teaser/schema';
|
|
66
|
-
import { TeaserBlockDataAdapter } from '@plone/volto/components/manage/Blocks/Teaser/adapter';
|
|
67
21
|
import { gridImageDisableSizeAndPositionHandlersSchema } from '@plone/volto/components/manage/Blocks/Image/schema';
|
|
68
|
-
import cameraSVG from '@plone/volto/icons/camera.svg';
|
|
69
|
-
import ViewImageBlock from '@plone/volto/components/manage/Blocks/Image/View';
|
|
70
|
-
import EditImageBlock from '@plone/volto/components/manage/Blocks/Image/Edit';
|
|
71
|
-
import ImageSettingsSchema from '@plone/volto/components/manage/Blocks/Image/LayoutSchema';
|
|
72
|
-
import { getImageBlockSizes } from '@plone/volto/components/manage/Blocks/Image/utils';
|
|
@@ -17,14 +17,4 @@ export namespace loadables {
|
|
|
17
17
|
let reactDndHtml5Backend: any;
|
|
18
18
|
let reactBeautifulDnd: any;
|
|
19
19
|
let rrule: any;
|
|
20
|
-
let immutableLib: any;
|
|
21
|
-
let draftJs: any;
|
|
22
|
-
let draftJsLibIsSoftNewlineEvent: any;
|
|
23
|
-
let draftJsFilters: any;
|
|
24
|
-
let draftJsInlineToolbarPlugin: any;
|
|
25
|
-
let draftJsImportHtml: any;
|
|
26
|
-
let draftJsBlockBreakoutPlugin: any;
|
|
27
|
-
let draftJsCreateInlineStyleButton: any;
|
|
28
|
-
let draftJsCreateBlockStyleButton: any;
|
|
29
|
-
let draftJsPluginsUtils: any;
|
|
30
20
|
}
|
|
@@ -11,7 +11,6 @@ export namespace widgetMapping {
|
|
|
11
11
|
export { RegistryImageWidget as site_logo };
|
|
12
12
|
}
|
|
13
13
|
export namespace widget {
|
|
14
|
-
export { WysiwygWidget as richtext };
|
|
15
14
|
export { TextareaWidget as textarea };
|
|
16
15
|
export { DatetimeWidget as datetime };
|
|
17
16
|
export { DatetimeWidget as date };
|
|
@@ -112,7 +111,6 @@ import QuerystringWidget from '@plone/volto/components/manage/Widgets/Querystrin
|
|
|
112
111
|
import UrlWidget from '@plone/volto/components/manage/Widgets/UrlWidget';
|
|
113
112
|
import IdWidget from '@plone/volto/components/manage/Widgets/IdWidget';
|
|
114
113
|
import RegistryImageWidget from '@plone/volto/components/manage/Widgets/RegistryImageWidget';
|
|
115
|
-
import WysiwygWidget from '@plone/volto/components/manage/Widgets/WysiwygWidget';
|
|
116
114
|
import TextareaWidget from '@plone/volto/components/manage/Widgets/TextareaWidget';
|
|
117
115
|
import PasswordWidget from '@plone/volto/components/manage/Widgets/PasswordWidget';
|
|
118
116
|
import FileWidget from '@plone/volto/components/manage/Widgets/FileWidget';
|
|
@@ -4,3 +4,21 @@
|
|
|
4
4
|
* @returns {boolean}
|
|
5
5
|
*/
|
|
6
6
|
export function userHasRoles(user: any, roles?: any[]): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Checks if the user is Manager.
|
|
9
|
+
* @method isManager
|
|
10
|
+
* @returns {boolean}
|
|
11
|
+
*/
|
|
12
|
+
export function isManager(user: any): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Checks if the user can assing group.
|
|
15
|
+
* @method canAssignGroup
|
|
16
|
+
* @returns {boolean}
|
|
17
|
+
*/
|
|
18
|
+
export function canAssignGroup(isManager: any, group: any): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Checks if the user can assign role.
|
|
21
|
+
* @method canDeleteGroup
|
|
22
|
+
* @returns {boolean}
|
|
23
|
+
*/
|
|
24
|
+
export function canAssignRole(isManager: any, role: any): boolean;
|
package/types/helpers/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export { default as langmap } from "./LanguageMap/LanguageMap";
|
|
|
8
8
|
export { default as Helmet } from "./Helmet/Helmet";
|
|
9
9
|
export { messages } from "./MessageLabels/MessageLabels";
|
|
10
10
|
export { asyncConnect } from "./AsyncConnect";
|
|
11
|
-
export { userHasRoles } from "./User/User";
|
|
12
11
|
export { useDetectClickOutside } from "./Utils/useDetectClickOutside";
|
|
13
12
|
export { useEvent } from "./Utils/useEvent";
|
|
14
13
|
export { usePrevious } from "./Utils/usePrevious";
|
|
@@ -27,4 +26,5 @@ export { getBoolean, getVocabName, getVocabFromHint, getVocabFromField, getVocab
|
|
|
27
26
|
export { default as FormValidation, validateFileUploadSize, tryParseJSON } from "./FormValidation/FormValidation";
|
|
28
27
|
export { difference, getColor, getInitials, safeWrapper, applyConfig, withServerErrorCode, parseDateTime, toGettextLang, normalizeLanguageName, toReactIntlLang, toLangUnderscoreRegion, toBackendLang, hasApiExpander, replaceItemOfArray, cloneDeepSchema, arrayRange, reorderArray, isInteractiveElement, slugify, normalizeString } from "@plone/volto/helpers/Utils/Utils";
|
|
29
28
|
export { withBlockSchemaEnhancer, withVariationSchemaEnhancer, withBlockExtensions, applySchemaEnhancer, resolveExtension, resolveBlockExtensions, addStyling, composeSchema } from "./Extensions";
|
|
29
|
+
export { userHasRoles, isManager, canAssignGroup, canAssignRole } from "./User/User";
|
|
30
30
|
export { getCurrentStateMapping, getWorkflowOptions } from "./Workflows/Workflows";
|
|
@@ -7,7 +7,7 @@ const offline = process.env.OFFLINE_BUNDLE_ANALYZE === 'true' ? true : false;
|
|
|
7
7
|
|
|
8
8
|
const defaultOptions = {
|
|
9
9
|
concatenateModules: false,
|
|
10
|
-
analyzerHost: '
|
|
10
|
+
analyzerHost: '127.0.0.1',
|
|
11
11
|
analyzerMode: offline ? 'static' : 'server',
|
|
12
12
|
generateStatsFile: true,
|
|
13
13
|
statsFilename: 'stats.json',
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
|
|
4
|
-
|
|
5
|
-
const propTypes = {
|
|
6
|
-
className: PropTypes.string,
|
|
7
|
-
children: PropTypes.node.isRequired,
|
|
8
|
-
entityKey: PropTypes.string,
|
|
9
|
-
getEditorState: PropTypes.func.isRequired,
|
|
10
|
-
target: PropTypes.string,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const Link = ({ children, className, entityKey, getEditorState, target }) => {
|
|
14
|
-
const entity = getEditorState().getCurrentContent().getEntity(entityKey);
|
|
15
|
-
const entityData = entity ? entity.get('data') : undefined;
|
|
16
|
-
const href = (entityData && entityData.url) || undefined;
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<a
|
|
20
|
-
className={className}
|
|
21
|
-
title={href}
|
|
22
|
-
href={isInternalURL(href) ? flattenToAppURL(href) : href}
|
|
23
|
-
target={target}
|
|
24
|
-
rel="noopener noreferrer"
|
|
25
|
-
>
|
|
26
|
-
{children}
|
|
27
|
-
</a>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
Link.propTypes = propTypes;
|
|
32
|
-
Link.defaultProps = {
|
|
33
|
-
className: null,
|
|
34
|
-
entityKey: null,
|
|
35
|
-
target: null,
|
|
36
|
-
};
|
|
37
|
-
export default Link;
|