@plone/volto 19.0.0-alpha.3 → 19.0.0-alpha.30
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/.eslintignore +2 -0
- package/.eslintrc +37 -6
- package/CHANGELOG.md +534 -2
- package/README.md +23 -21
- package/babel.js +1 -9
- package/cypress/docker/prefixed-rules.yml +26 -0
- package/cypress/docker/prefixed.yml +24 -0
- package/cypress/support/commands.js +12 -6
- package/cypress/support/guillotina.js +1 -0
- package/cypress.config.js +1 -0
- package/global-test-setup.js +1 -2
- package/locales/af/LC_MESSAGES/volto.po +5500 -0
- package/locales/af.json +1 -1
- package/locales/ar/LC_MESSAGES/volto.po +5500 -0
- package/locales/ar.json +1 -1
- package/locales/bg/LC_MESSAGES/volto.po +5500 -0
- package/locales/bg.json +1 -1
- package/locales/bn/LC_MESSAGES/volto.po +5500 -0
- package/locales/bn.json +1 -1
- package/locales/ca/LC_MESSAGES/volto.po +559 -349
- package/locales/ca.json +1 -1
- package/locales/cs/LC_MESSAGES/volto.po +5500 -0
- package/locales/cs.json +1 -1
- package/locales/cy/LC_MESSAGES/volto.po +5500 -0
- package/locales/cy.json +1 -1
- package/locales/da/LC_MESSAGES/volto.po +5500 -0
- package/locales/da.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +232 -21
- package/locales/de.json +1 -1
- package/locales/el/LC_MESSAGES/volto.po +5500 -0
- package/locales/el.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +226 -11
- package/locales/en.json +1 -1
- package/locales/en_AU/LC_MESSAGES/volto.po +5500 -0
- package/locales/en_AU.json +1 -1
- package/locales/en_GB/LC_MESSAGES/volto.po +5500 -0
- package/locales/en_GB.json +1 -1
- package/locales/eo/LC_MESSAGES/volto.po +5500 -0
- package/locales/eo.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +321 -111
- package/locales/es.json +1 -1
- package/locales/et/LC_MESSAGES/volto.po +5500 -0
- package/locales/et.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +404 -194
- package/locales/eu.json +1 -1
- package/locales/fa/LC_MESSAGES/volto.po +5500 -0
- package/locales/fa.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +221 -11
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +220 -10
- package/locales/fr.json +1 -1
- package/locales/fu/LC_MESSAGES/volto.po +5500 -0
- package/locales/fu.json +1 -1
- package/locales/gl/LC_MESSAGES/volto.po +5501 -0
- package/locales/gl.json +1 -1
- package/locales/he/LC_MESSAGES/volto.po +5500 -0
- package/locales/he.json +1 -1
- package/locales/hi/LC_MESSAGES/volto.po +225 -10
- package/locales/hi.json +1 -1
- package/locales/hr/LC_MESSAGES/volto.po +5500 -0
- package/locales/hr.json +1 -1
- package/locales/hu/LC_MESSAGES/volto.po +5500 -0
- package/locales/hu.json +1 -1
- package/locales/hy/LC_MESSAGES/volto.po +5500 -0
- package/locales/hy.json +1 -1
- package/locales/id/LC_MESSAGES/volto.po +5500 -0
- package/locales/id.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +239 -24
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +264 -53
- package/locales/ja.json +1 -1
- package/locales/ka/LC_MESSAGES/volto.po +5500 -0
- package/locales/ka.json +1 -1
- package/locales/kn/LC_MESSAGES/volto.po +5500 -0
- package/locales/kn.json +1 -1
- package/locales/ko/LC_MESSAGES/volto.po +5500 -0
- package/locales/ko.json +1 -1
- package/locales/lt/LC_MESSAGES/volto.po +5500 -0
- package/locales/lt.json +1 -1
- package/locales/lv/LC_MESSAGES/volto.po +5500 -0
- package/locales/lv.json +1 -1
- package/locales/mi/LC_MESSAGES/volto.po +5500 -0
- package/locales/mi.json +1 -1
- package/locales/mk/LC_MESSAGES/volto.po +5500 -0
- package/locales/mk.json +1 -1
- package/locales/my/LC_MESSAGES/volto.po +5500 -0
- package/locales/my.json +1 -1
- package/locales/nb_NO/LC_MESSAGES/volto.po +5500 -0
- package/locales/nb_NO.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +243 -32
- package/locales/nl.json +1 -1
- package/locales/nn/LC_MESSAGES/volto.po +5500 -0
- package/locales/nn.json +1 -1
- package/locales/pl/LC_MESSAGES/volto.po +5500 -0
- package/locales/pl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +869 -659
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +229 -19
- package/locales/pt_BR.json +1 -1
- package/locales/rm/LC_MESSAGES/volto.po +5500 -0
- package/locales/rm.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +252 -42
- package/locales/ro.json +1 -1
- package/locales/ru/LC_MESSAGES/volto.po +220 -10
- package/locales/ru.json +1 -1
- package/locales/sk/LC_MESSAGES/volto.po +5500 -0
- package/locales/sk.json +1 -1
- package/locales/sl/LC_MESSAGES/volto.po +5500 -0
- package/locales/sl.json +1 -1
- package/locales/sm/LC_MESSAGES/volto.po +5500 -0
- package/locales/sm.json +1 -1
- package/locales/sq/LC_MESSAGES/volto.po +5500 -0
- package/locales/sq.json +1 -1
- package/locales/sr/LC_MESSAGES/volto.po +5500 -0
- package/locales/sr.json +1 -1
- package/locales/sr@cyrl/LC_MESSAGES/volto.po +5500 -0
- package/locales/sr@cyrl.json +1 -1
- package/locales/sr@latn/LC_MESSAGES/volto.po +5500 -0
- package/locales/sr@latn.json +1 -1
- package/locales/sv/LC_MESSAGES/volto.po +5500 -0
- package/locales/sv.json +1 -1
- package/locales/ta/LC_MESSAGES/volto.po +5501 -0
- package/locales/ta.json +1 -1
- package/locales/te/LC_MESSAGES/volto.po +5500 -0
- package/locales/te.json +1 -1
- package/locales/th/LC_MESSAGES/volto.po +5500 -0
- package/locales/th.json +1 -1
- package/locales/to/LC_MESSAGES/volto.po +5500 -0
- package/locales/to.json +1 -1
- package/locales/tr/LC_MESSAGES/volto.po +5501 -0
- package/locales/tr.json +1 -1
- package/locales/uk/LC_MESSAGES/volto.po +5500 -0
- package/locales/uk.json +1 -1
- package/locales/vi/LC_MESSAGES/volto.po +5500 -0
- package/locales/vi.json +1 -1
- package/locales/volto.pot +220 -10
- package/locales/zh_CN/LC_MESSAGES/volto.po +221 -10
- package/locales/zh_CN.json +1 -1
- package/locales/zh_Hant/LC_MESSAGES/volto.po +5500 -0
- package/locales/zh_Hant.json +1 -1
- package/locales/zh_Hant_HK/LC_MESSAGES/volto.po +5500 -0
- package/locales/zh_Hant_HK.json +1 -1
- package/package.json +72 -146
- package/razzle.config.js +32 -25
- package/src/actions/blockTypes/blockTypes.ts +24 -0
- package/src/components/manage/Actions/Actions.test.jsx +1 -5
- package/src/components/manage/Add/Add.jsx +15 -10
- package/src/components/manage/BlockChooser/BlockChooser.jsx +1 -0
- package/src/components/manage/Blocks/Block/BlocksForm.jsx +10 -7
- package/src/components/manage/Blocks/Block/BlocksForm.test.jsx +3 -14
- package/src/components/manage/Blocks/Block/EditBlockWrapper.jsx +9 -4
- package/src/components/manage/Blocks/Block/Order/Item.jsx +27 -13
- package/src/components/manage/Blocks/Block/Order/Item.test.jsx +90 -0
- package/src/components/manage/Blocks/Block/Order/Order.jsx +116 -67
- package/src/components/manage/Blocks/Block/Order/utilities.js +28 -11
- package/src/components/manage/Blocks/Block/Settings.test.jsx +1 -5
- package/src/components/manage/Blocks/Grid/View.jsx +14 -11
- package/src/components/manage/Blocks/Grid/context.js +3 -0
- package/src/components/manage/Blocks/HTML/Edit.test.jsx +1 -5
- package/src/components/manage/Blocks/Image/Edit.jsx +5 -1
- package/src/components/manage/Blocks/Image/ImageSidebar.test.jsx +2 -5
- package/src/components/manage/Blocks/LeadImage/Edit.jsx +2 -2
- package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx +1 -1
- package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.test.jsx +2 -5
- package/src/components/manage/Blocks/Listing/Edit.jsx +1 -0
- package/src/components/manage/Blocks/Listing/ImageGallery.jsx +6 -4
- package/src/components/manage/Blocks/Listing/ListingBody.jsx +4 -0
- package/src/components/manage/Blocks/Maps/Edit.jsx +2 -1
- package/src/components/manage/Blocks/Maps/MapsSidebar.test.jsx +1 -5
- package/src/components/manage/Blocks/Search/SearchBlockView.jsx +21 -4
- package/src/components/manage/Blocks/Search/components/DateRangeFacet.test.jsx +1 -6
- package/src/components/manage/Blocks/Search/components/SelectFacet.jsx +22 -1
- package/src/components/manage/Blocks/Search/components/SelectFacet.test.jsx +1 -6
- package/src/components/manage/Blocks/Search/components/SortOn.jsx +8 -2
- package/src/components/manage/Blocks/Search/components/ToggleFacet.jsx +14 -0
- package/src/components/manage/Blocks/Teaser/Data.jsx +21 -7
- package/src/components/manage/Blocks/Teaser/DefaultBody.jsx +11 -3
- package/src/components/manage/Blocks/Teaser/View.jsx +0 -1
- package/src/components/manage/Blocks/Teaser/utils.js +13 -0
- package/src/components/manage/Blocks/Teaser/utils.test.js +34 -0
- package/src/components/manage/Blocks/Title/Edit.jsx +5 -0
- package/src/components/manage/Blocks/Video/Body.jsx +69 -43
- package/src/components/manage/Blocks/Video/Body.test.jsx +122 -5
- package/src/components/manage/Blocks/Video/Edit.jsx +22 -3
- package/src/components/manage/Blocks/Video/Edit.test.jsx +6 -0
- package/src/components/manage/Blocks/Video/VideoSidebar.test.jsx +1 -5
- package/src/components/manage/Blocks/Video/View.jsx +1 -0
- package/src/components/manage/Blocks/Video/View.test.jsx +29 -15
- package/src/components/manage/Blocks/Video/schema.js +14 -1
- package/src/components/manage/Contents/Contents.jsx +697 -659
- package/src/components/manage/Contents/Contents.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsBreadcrumbs.jsx +6 -5
- package/src/components/manage/Contents/ContentsItem.jsx +1 -1
- package/src/components/manage/Contents/ContentsPropertiesModal.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsRenameModal.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsTagsModal.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsWorkflowModal.test.jsx +1 -5
- package/src/components/manage/Contents/DropZoneContent.jsx +338 -0
- package/src/components/manage/Contents/__mocks__/index.tsx +2 -18
- package/src/components/manage/Controlpanels/AddonsControlpanel.jsx +7 -0
- package/src/components/manage/Controlpanels/Aliases.test.jsx +1 -5
- package/src/components/manage/Controlpanels/BlockType.tsx +166 -0
- package/src/components/manage/Controlpanels/BlockTypes.tsx +145 -0
- package/src/components/manage/Controlpanels/ContentType.jsx +1 -1
- package/src/components/manage/Controlpanels/ContentType.test.jsx +1 -5
- package/src/components/manage/Controlpanels/ContentTypeSchema.jsx +1 -1
- package/src/components/manage/Controlpanels/Controlpanels.jsx +28 -5
- package/src/components/manage/Controlpanels/Controlpanels.test.jsx +10 -0
- package/src/components/manage/Controlpanels/DatabaseInformation.jsx +9 -0
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx +3 -2
- package/src/components/manage/Controlpanels/ModerateComments.jsx +8 -0
- package/src/components/manage/Controlpanels/Relations/Relations.jsx +1 -1
- package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +1 -5
- package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +1 -5
- package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +1 -5
- package/src/components/manage/Controlpanels/Users/RenderUsers.jsx +156 -175
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.test.jsx +3 -0
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +575 -631
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +58 -11
- package/src/components/manage/Diff/Diff.jsx +201 -298
- package/src/components/manage/Diff/Diff.test.jsx +1 -6
- package/src/components/manage/Diff/DiffField.test.jsx +1 -6
- package/src/components/manage/Display/Display.test.jsx +2 -11
- package/src/components/manage/Edit/Edit.test.jsx +1 -5
- package/src/components/manage/Form/BlockDataForm.test.jsx +1 -5
- package/src/components/manage/Form/Form.jsx +3 -3
- package/src/components/manage/Form/Form.test.jsx +1 -5
- package/src/components/manage/Form/InlineForm.jsx +2 -2
- package/src/components/manage/Form/InlineForm.test.jsx +1 -5
- package/src/components/manage/Form/ModalForm.jsx +12 -10
- package/src/components/manage/Form/ModalForm.test.jsx +27 -5
- package/src/components/manage/Form/__mocks__/index.tsx +9 -27
- package/src/components/manage/Multilingual/CompareLanguages.jsx +6 -6
- package/src/components/manage/Multilingual/CreateTranslation.jsx +16 -13
- package/src/components/manage/Multilingual/ManageTranslations.jsx +5 -5
- package/src/components/manage/Multilingual/TranslationObject.jsx +11 -8
- package/src/components/manage/Preferences/ChangePassword.test.jsx +1 -5
- package/src/components/manage/Preferences/PersonalPreferences.jsx +8 -5
- package/src/components/manage/Preferences/PersonalPreferences.test.jsx +1 -17
- package/src/components/manage/Sharing/Sharing.jsx +21 -15
- package/src/components/manage/Sidebar/ObjectBrowser.jsx +3 -0
- package/src/components/manage/Sidebar/ObjectBrowserBody.jsx +18 -2
- package/src/components/manage/Sidebar/ObjectBrowserNav.jsx +2 -1
- package/src/components/manage/Sidebar/SidebarPortal.test.tsx +42 -0
- package/src/components/manage/Sidebar/SidebarPortal.tsx +48 -0
- package/src/components/manage/TemplateChooser/TemplateChooser.jsx +2 -1
- package/src/components/manage/TemplateChooser/TemplateChooser.test.jsx +1 -0
- package/src/components/manage/Toast/Toast.jsx +32 -0
- package/src/components/manage/Toast/Toast.test.jsx +9 -5
- package/src/components/manage/Toolbar/PersonalTools.jsx +2 -1
- package/src/components/manage/Toolbar/PersonalTools.test.jsx +15 -0
- package/src/components/manage/Toolbar/Toolbar.jsx +14 -4
- package/src/components/manage/Toolbar/Types.crash.test.jsx +48 -0
- package/src/components/manage/Toolbar/Types.jsx +6 -4
- package/src/components/manage/UniversalLink/UniversalLink.test.jsx +16 -0
- package/src/components/manage/UniversalLink/UniversalLink.tsx +2 -0
- package/src/components/manage/Widgets/AlignWidget.stories.jsx +9 -0
- package/src/components/manage/Widgets/AlignWidget.test.tsx +95 -0
- package/src/components/manage/Widgets/{AlignWidget.jsx → AlignWidget.tsx} +23 -7
- package/src/components/manage/Widgets/ArrayWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/BlockAlignment.stories.tsx +104 -0
- package/src/components/manage/Widgets/BlockAlignment.test.tsx +104 -0
- package/src/components/manage/Widgets/BlockAlignment.tsx +88 -0
- package/src/components/manage/Widgets/BlockWidth.stories.tsx +69 -0
- package/src/components/manage/Widgets/BlockWidth.test.tsx +62 -0
- package/src/components/manage/Widgets/BlockWidth.tsx +101 -0
- package/src/components/manage/Widgets/ButtonsWidget.stories.jsx +61 -0
- package/src/components/manage/Widgets/ButtonsWidget.test.tsx +138 -0
- package/src/components/manage/Widgets/ButtonsWidget.tsx +195 -0
- package/src/components/manage/Widgets/CheckboxGroupWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/DatetimeWidget.jsx +102 -53
- package/src/components/manage/Widgets/DatetimeWidget.test.jsx +56 -6
- package/src/components/manage/Widgets/FileWidget.jsx +21 -8
- package/src/components/manage/Widgets/FormFieldWrapper.jsx +146 -168
- package/src/components/manage/Widgets/ImageWidget.jsx +177 -38
- package/src/components/manage/Widgets/InternalUrlWidget.jsx +2 -0
- package/src/components/manage/Widgets/ObjectBrowserWidget.jsx +8 -0
- package/src/components/manage/Widgets/ObjectListWidget.test.jsx +2 -11
- package/src/components/manage/Widgets/ObjectWidget.test.jsx +1 -5
- package/src/components/manage/Widgets/QueryWidget.jsx +137 -9
- package/src/components/manage/Widgets/RadioGroupWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/RegistryImageWidget.jsx +1 -1
- package/src/components/manage/Widgets/RegistryImageWidget.test.jsx +4 -2
- package/src/components/manage/Widgets/SchemaWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/SchemaWidgetFieldset.test.jsx +1 -6
- package/src/components/manage/Widgets/SelectAutoComplete.jsx +29 -12
- package/src/components/manage/Widgets/SelectAutoComplete.test.jsx +1 -6
- package/src/components/manage/Widgets/SelectWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/Size.stories.tsx +69 -0
- package/src/components/manage/Widgets/Size.test.tsx +59 -0
- package/src/components/manage/Widgets/Size.tsx +78 -0
- package/src/components/manage/Widgets/TimeWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/TokenWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/UrlWidget.jsx +49 -18
- package/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx +2 -11
- package/src/components/manage/Widgets/__mocks__/index.tsx +33 -51
- package/src/components/manage/Widgets/index.tsx +21 -0
- package/src/components/manage/Workflow/Workflow.test.jsx +2 -11
- package/src/components/theme/AlternateHrefLangs/AlternateHrefLangs.jsx +1 -0
- package/src/components/theme/AlternateHrefLangs/AlternateHrefLangs.test.jsx +30 -0
- package/src/components/theme/App/App.jsx +5 -1
- package/src/components/theme/Avatar/Avatar.jsx +2 -1
- package/src/components/theme/Comments/CommentEditModal.test.jsx +1 -5
- package/src/components/theme/Comments/Comments.test.jsx +2 -11
- package/src/components/theme/ConnectionRefused/ConnectionRefused.jsx +3 -2
- package/src/components/theme/ContactForm/ContactForm.test.jsx +1 -5
- package/src/components/theme/Image/Image.jsx +25 -13
- package/src/components/theme/Image/Image.test.jsx +247 -146
- package/src/components/theme/InjectPloneComponentsCSS/InjectPloneComponentsCSS.tsx +7 -0
- package/src/components/theme/LanguageSelector/LanguageSelector.tsx +89 -0
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx +42 -12
- package/src/components/theme/PasswordReset/PasswordReset.jsx +108 -191
- package/src/components/theme/PasswordReset/RequestPasswordReset.test.jsx +1 -5
- package/src/components/theme/PreviewImage/PreviewImage.jsx +1 -1
- package/src/components/theme/Register/Register.test.jsx +1 -5
- package/src/components/theme/RequestTimeout/RequestTimeout.jsx +1 -1
- package/src/components/theme/Sitemap/Sitemap.stories.jsx +82 -0
- package/src/components/theme/SlotRenderer/SlotRenderer.tsx +12 -6
- package/src/components/theme/Unauthorized/Unauthorized.jsx +35 -25
- package/src/components/theme/Unauthorized/Unauthorized.test.jsx +28 -1
- package/src/components/theme/VideoEmbed/VideoEmbed.jsx +100 -0
- package/src/components/theme/View/EventDatesInfo.test.jsx +1 -6
- package/src/components/theme/View/EventView.stories.jsx +89 -0
- package/src/components/theme/View/EventView.test.jsx +1 -6
- package/src/components/theme/View/FileView.stories.jsx +50 -0
- package/src/components/theme/View/ImageView.jsx +2 -1
- package/src/components/theme/View/ImageView.test.jsx +3 -0
- package/src/components/theme/View/LinkView.stories.jsx +57 -0
- package/src/components/theme/View/ListingView.stories.jsx +70 -0
- package/src/components/theme/View/NewsItemView.stories.jsx +58 -0
- package/src/components/theme/View/RenderBlocks.jsx +8 -10
- package/src/components/theme/View/RenderBlocks.stories.jsx +112 -0
- package/src/components/theme/View/RenderBlocks.test.jsx +14 -4
- package/src/components/theme/View/SummaryView.stories.jsx +71 -0
- package/src/components/theme/View/TabularView.stories.jsx +66 -0
- package/src/components/theme/View/View.jsx +8 -1
- package/src/components/theme/Widgets/ImageWidget.jsx +2 -1
- package/src/components/theme/Widgets/ImageWidget.test.jsx +31 -11
- package/src/config/Blocks.jsx +3 -0
- package/src/config/ControlPanels.js +3 -0
- package/src/config/Widgets.jsx +7 -0
- package/src/config/index.js +19 -12
- package/src/config/server.js +0 -2
- package/src/config/slots.js +19 -0
- package/src/config/validation.ts +8 -0
- package/src/constants/ActionTypes.js +1 -0
- package/src/express-middleware/devproxy.js +22 -5
- package/src/express-middleware/files.js +1 -0
- package/src/express-middleware/files.test.js +59 -0
- package/src/express-middleware/images.js +1 -0
- package/src/express-middleware/images.test.js +50 -0
- package/src/helpers/Api/APIResourceWithAuth.js +8 -3
- package/src/helpers/Api/Api.js +7 -4
- package/src/helpers/AsyncConnect/ssr.js +4 -1
- package/src/helpers/AuthToken/AuthToken.js +1 -6
- package/src/helpers/Blocks/Blocks.js +113 -28
- package/src/helpers/Blocks/Blocks.test.js +100 -0
- package/src/helpers/Content/Content.js +23 -0
- package/src/helpers/Content/Content.test.js +39 -0
- package/src/helpers/Content/withClientSideContent.jsx +35 -0
- package/src/helpers/Extensions/withBlockSchemaEnhancer.jsx +4 -1
- package/src/helpers/FormValidation/FormValidation.test.js +31 -0
- package/src/helpers/FormValidation/validators.ts +52 -6
- package/src/helpers/Html/Html.jsx +13 -4
- package/src/helpers/Loadable/__mocks__/Loadable.jsx +7 -22
- package/src/helpers/MessageLabels/MessageLabels.js +10 -0
- package/src/helpers/Sitemap/Sitemap.js +4 -4
- package/src/helpers/Url/Url.js +33 -2
- package/src/helpers/Url/Url.test.js +62 -0
- package/src/helpers/Utils/Utils.jsx +17 -0
- package/src/helpers/Utils/Utils.test.jsx +39 -0
- package/src/hooks/user/useUser.js +1 -1
- package/src/internalChecks.test.ts +11 -0
- package/src/middleware/api.js +17 -8
- package/src/middleware/storeProtectLoadUtils.test.js +3 -3
- package/src/reducers/blockTypes/blockTypes.js +38 -0
- package/src/reducers/content/content.js +3 -18
- package/src/reducers/diff/diff.js +5 -1
- package/src/reducers/diff/diff.test.js +60 -4
- package/src/reducers/index.js +2 -0
- package/src/reducers/querystring/querystring.js +8 -1
- package/src/reducers/users/users.js +1 -1
- package/src/routes.js +13 -1
- package/src/server.jsx +47 -13
- package/src/start-client.jsx +9 -2
- package/src/start-server.js +9 -3
- package/test-addons-loader.js +3 -0
- package/test-setup-globals.js +56 -2
- package/theme/themes/default/elements/segment.variables +9 -16
- package/theme/themes/pastanaga/collections/form.overrides +1 -1
- package/theme/themes/pastanaga/elements/segment.variables +1 -4
- package/theme/themes/pastanaga/extras/block-types.less +17 -0
- package/theme/themes/pastanaga/extras/blocks.less +19 -0
- package/theme/themes/pastanaga/extras/contents.less +75 -0
- package/theme/themes/pastanaga/extras/main.less +20 -4
- package/theme/themes/pastanaga/extras/toolbar.less +10 -5
- package/theme/themes/pastanaga/extras/videoembed.less +22 -0
- package/theme/themes/pastanaga/extras/widgets.less +79 -0
- package/tsconfig.declarations.json +1 -1
- package/tsconfig.json +4 -5
- package/types/actions/blockTypes/blockTypes.d.ts +7 -0
- package/types/components/index.d.ts +1 -1
- package/types/components/manage/Blocks/Block/Order/Item.test.d.ts +1 -0
- package/types/components/manage/Blocks/Block/Order/utilities.d.ts +2 -1
- package/types/components/manage/Blocks/Grid/context.d.ts +1 -0
- package/types/components/manage/Blocks/Teaser/utils.d.ts +5 -0
- package/types/components/manage/Blocks/Video/Body.d.ts +4 -2
- package/types/components/manage/Blocks/Video/schema.d.ts +4 -0
- package/types/components/manage/Contents/DropZoneContent.d.ts +2 -0
- package/types/components/manage/Contents/__mocks__/index.d.ts +2 -2
- package/types/components/manage/Controlpanels/BlockType.d.ts +7 -0
- package/types/components/manage/Controlpanels/BlockTypes.d.ts +7 -0
- package/types/components/manage/Controlpanels/Relations/RelationsMatrix.d.ts +1 -1
- package/types/components/manage/Controlpanels/Users/RenderUsers.d.ts +18 -2
- package/types/components/manage/Controlpanels/Users/UsersControlpanel.d.ts +6 -2
- package/types/components/manage/Controlpanels/index.d.ts +2 -2
- package/types/components/manage/Diff/Diff.d.ts +7 -2
- package/types/components/manage/Form/__mocks__/index.d.ts +8 -8
- package/types/components/manage/Multilingual/ManageTranslations.d.ts +1 -1
- package/types/components/manage/Sidebar/ObjectBrowser.d.ts +1 -1
- package/types/components/manage/Sidebar/SidebarPortal.d.ts +7 -15
- package/types/components/manage/Toolbar/Types.crash.test.d.ts +1 -0
- package/types/components/manage/Widgets/AlignWidget.d.ts +8 -10
- package/types/components/manage/Widgets/AlignWidget.stories.d.ts +1 -0
- package/types/components/manage/Widgets/BlockAlignment.d.ts +7 -0
- package/types/components/manage/Widgets/BlockAlignment.stories.d.ts +8 -0
- package/types/components/manage/Widgets/BlockWidth.d.ts +7 -0
- package/types/components/manage/Widgets/BlockWidth.stories.d.ts +6 -0
- package/types/components/manage/Widgets/ButtonsWidget.d.ts +48 -1
- package/types/components/manage/Widgets/ButtonsWidget.stories.d.ts +3 -0
- package/types/components/manage/Widgets/FormFieldWrapper.d.ts +28 -5
- package/types/components/manage/Widgets/ImageWidget.d.ts +41 -1
- package/types/components/manage/Widgets/InternalUrlWidget.d.ts +1 -1
- package/types/components/manage/Widgets/ObjectBrowserWidget.d.ts +2 -0
- package/types/components/manage/Widgets/QueryWidget.d.ts +5 -2
- package/types/components/manage/Widgets/RecurrenceWidget/Utils.d.ts +12 -18
- package/types/components/manage/Widgets/Size.d.ts +7 -0
- package/types/components/manage/Widgets/Size.stories.d.ts +6 -0
- package/types/components/manage/Widgets/UrlWidget.d.ts +1 -1
- package/types/components/manage/Widgets/__mocks__/index.d.ts +33 -33
- package/types/components/manage/Widgets/index.d.ts +11 -6
- package/types/components/theme/ConnectionRefused/ConnectionRefused.d.ts +2 -2
- package/types/components/theme/InjectPloneComponentsCSS/InjectPloneComponentsCSS.d.ts +3 -0
- package/types/components/theme/LanguageSelector/LanguageSelector.d.ts +3 -10
- package/types/components/theme/PasswordReset/PasswordReset.d.ts +6 -2
- package/types/components/theme/Sitemap/Sitemap.stories.d.ts +13 -0
- package/types/components/theme/SlotRenderer/SlotRenderer.d.ts +4 -5
- package/types/components/theme/Unauthorized/Unauthorized.d.ts +2 -2
- package/types/components/theme/VideoEmbed/VideoEmbed.d.ts +2 -0
- package/types/components/theme/View/EventView.stories.d.ts +19 -0
- package/types/components/theme/View/FileView.stories.d.ts +18 -0
- package/types/components/theme/View/LinkView.stories.d.ts +18 -0
- package/types/components/theme/View/ListingView.stories.d.ts +24 -0
- package/types/components/theme/View/NewsItemView.stories.d.ts +23 -0
- package/types/components/theme/View/RenderBlocks.stories.d.ts +23 -0
- package/types/components/theme/View/SummaryView.stories.d.ts +23 -0
- package/types/components/theme/View/TabularView.stories.d.ts +23 -0
- package/types/config/ControlPanels.d.ts +1 -0
- package/types/config/Views.d.ts +1 -1
- package/types/config/Widgets.d.ts +6 -0
- package/types/config/slots.d.ts +7 -0
- package/types/constants/ActionTypes.d.ts +1 -0
- package/types/helpers/Blocks/Blocks.d.ts +4 -0
- package/types/helpers/Content/Content.d.ts +7 -0
- package/types/helpers/Content/withClientSideContent.d.ts +1 -0
- package/types/helpers/Extensions/withBlockSchemaEnhancer.d.ts +4 -5
- package/types/helpers/FormValidation/validators.d.ts +18 -1
- package/types/helpers/Helmet/Helmet.d.ts +1 -1
- package/types/helpers/Loadable/__mocks__/Loadable.d.ts +2 -2
- package/types/helpers/MessageLabels/MessageLabels.d.ts +105 -93
- package/types/helpers/Url/Url.d.ts +14 -0
- package/types/helpers/Url/bulkFlattenToAppURL.d.ts +5 -0
- package/types/helpers/Utils/Utils.d.ts +1 -0
- package/types/reducers/blockTypes/blockTypes.d.ts +16 -0
- package/types/reducers/index.d.ts +3 -0
- package/types/routes.d.ts +7 -5
- package/types/start-client.d.ts +0 -1
- package/vitest.config.mjs +84 -42
- package/webpack-plugins/webpack-less-plugin.js +1 -1
- package/webpack-plugins/webpack-scss-plugin.js +172 -0
- package/cypress/downloads/downloads.html +0 -0
- package/jest-addons-loader.js +0 -3
- package/jest-extender-plugin.js +0 -39
- package/jest-setup-afterenv.js +0 -2
- package/jest-svgsystem-transform.js +0 -10
- package/package-why.json +0 -34
- package/patches/patchit.sh +0 -2
- package/patches/razzle-jest.patch +0 -10
- package/src/components/manage/Contents/__mocks__/index.vitest.tsx +0 -5
- package/src/components/manage/Form/__mocks__/index.vitest.tsx +0 -73
- package/src/components/manage/Sidebar/SidebarPortal.jsx +0 -47
- package/src/components/manage/Sidebar/SidebarPortal.test.jsx +0 -26
- package/src/components/manage/Widgets/AlignWidget.test.jsx +0 -59
- package/src/components/manage/Widgets/ButtonsWidget.jsx +0 -41
- package/src/components/manage/Widgets/ButtonsWidget.test.jsx +0 -70
- package/src/components/manage/Widgets/__mocks__/index.vitest.tsx +0 -41
- package/src/components/theme/LanguageSelector/LanguageSelector.jsx +0 -79
- package/src/helpers/Loadable/__mocks__/Loadable.vitest.jsx +0 -39
- package/test-setup-globals-vitest.js +0 -46
- package/theme/themes/pastanaga/extras/utils.less +0 -63
- /package/src/components/theme/LanguageSelector/{LanguageSelector.test.jsx → LanguageSelector.test.tsx} +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
2
|
+
import ButtonsWidget, {
|
|
3
|
+
type ActionInfo,
|
|
4
|
+
type ButtonsWidgetProps,
|
|
5
|
+
} from './ButtonsWidget';
|
|
6
|
+
import type { IntlShape } from 'react-intl';
|
|
7
|
+
import type { StyleDefinition } from '@plone/types';
|
|
8
|
+
|
|
9
|
+
const messages = defineMessages({
|
|
10
|
+
s: {
|
|
11
|
+
id: 'Small',
|
|
12
|
+
defaultMessage: 'Small',
|
|
13
|
+
},
|
|
14
|
+
m: {
|
|
15
|
+
id: 'Medium',
|
|
16
|
+
defaultMessage: 'Medium',
|
|
17
|
+
},
|
|
18
|
+
l: {
|
|
19
|
+
id: 'Large',
|
|
20
|
+
defaultMessage: 'Large',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const defaultActionsInfo = ({
|
|
25
|
+
intl,
|
|
26
|
+
}: {
|
|
27
|
+
intl: IntlShape;
|
|
28
|
+
}): Record<string, ActionInfo> => ({
|
|
29
|
+
s: ['S', intl.formatMessage(messages.s)],
|
|
30
|
+
m: ['M', intl.formatMessage(messages.m)],
|
|
31
|
+
l: ['L', intl.formatMessage(messages.l)],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const DEFAULT_ACTIONS: StyleDefinition[] = [
|
|
35
|
+
{
|
|
36
|
+
name: 's',
|
|
37
|
+
label: 'Small',
|
|
38
|
+
style: undefined,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'm',
|
|
42
|
+
label: 'Medium',
|
|
43
|
+
style: undefined,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'l',
|
|
47
|
+
label: 'Large',
|
|
48
|
+
style: undefined,
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const SizeWidget = (props: ButtonsWidgetProps) => {
|
|
53
|
+
const intl = useIntl();
|
|
54
|
+
|
|
55
|
+
const { actions = DEFAULT_ACTIONS, actionsInfoMap, filterActions } = props;
|
|
56
|
+
const filteredActions =
|
|
57
|
+
filterActions && filterActions.length > 0
|
|
58
|
+
? actions.filter((action) => {
|
|
59
|
+
const actionName = typeof action === 'string' ? action : action.name;
|
|
60
|
+
return filterActions.includes(actionName);
|
|
61
|
+
})
|
|
62
|
+
: actions;
|
|
63
|
+
|
|
64
|
+
const actionsInfo = {
|
|
65
|
+
...defaultActionsInfo({ intl }),
|
|
66
|
+
...actionsInfoMap,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<ButtonsWidget
|
|
71
|
+
{...props}
|
|
72
|
+
actions={filteredActions}
|
|
73
|
+
actionsInfoMap={actionsInfo}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default SizeWidget;
|
|
@@ -6,12 +6,7 @@ import { waitFor, render, screen } from '@testing-library/react';
|
|
|
6
6
|
|
|
7
7
|
const mockStore = configureStore();
|
|
8
8
|
|
|
9
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
10
|
-
return await import(
|
|
11
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
12
|
-
);
|
|
13
|
-
});
|
|
14
|
-
|
|
9
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
15
10
|
beforeAll(async () => {
|
|
16
11
|
const { __setLoadables } = await import(
|
|
17
12
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -7,12 +7,7 @@ import TokenWidget from './TokenWidget';
|
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
9
|
|
|
10
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
11
|
-
return await import(
|
|
12
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
13
|
-
);
|
|
14
|
-
});
|
|
15
|
-
|
|
10
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
16
11
|
beforeAll(async () => {
|
|
17
12
|
const { __setLoadables } = await import(
|
|
18
13
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* UrlWidget component.
|
|
3
3
|
* @module components/manage/Widgets/UrlWidget
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
import React, { useState } from 'react';
|
|
7
6
|
import PropTypes from 'prop-types';
|
|
8
7
|
import { Input, Button } from 'semantic-ui-react';
|
|
@@ -14,10 +13,10 @@ import {
|
|
|
14
13
|
flattenToAppURL,
|
|
15
14
|
URLUtils,
|
|
16
15
|
} from '@plone/volto/helpers/Url/Url';
|
|
16
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
17
17
|
import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser';
|
|
18
18
|
import clearSVG from '@plone/volto/icons/clear.svg';
|
|
19
19
|
import navTreeSVG from '@plone/volto/icons/nav.svg';
|
|
20
|
-
|
|
21
20
|
/** Widget to edit urls
|
|
22
21
|
*
|
|
23
22
|
* This is the default widget used for the `remoteUrl` field. You can also use
|
|
@@ -30,6 +29,24 @@ import navTreeSVG from '@plone/volto/icons/nav.svg';
|
|
|
30
29
|
* }
|
|
31
30
|
* ```
|
|
32
31
|
*/
|
|
32
|
+
const messages = defineMessages({
|
|
33
|
+
urlMissing: {
|
|
34
|
+
id: 'URL is missing',
|
|
35
|
+
defaultMessage: 'URL is missing',
|
|
36
|
+
},
|
|
37
|
+
urlInvalid: {
|
|
38
|
+
id: 'URL is invalid',
|
|
39
|
+
defaultMessage: 'URL is invalid',
|
|
40
|
+
},
|
|
41
|
+
clearUrl: {
|
|
42
|
+
id: 'Clear URL',
|
|
43
|
+
defaultMessage: 'Clear URL',
|
|
44
|
+
},
|
|
45
|
+
openUrlBrowser: {
|
|
46
|
+
id: 'Open URL browser',
|
|
47
|
+
defaultMessage: 'Open URL browser',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
33
50
|
export const UrlWidget = (props) => {
|
|
34
51
|
const {
|
|
35
52
|
id,
|
|
@@ -40,9 +57,10 @@ export const UrlWidget = (props) => {
|
|
|
40
57
|
maxLength,
|
|
41
58
|
placeholder,
|
|
42
59
|
isDisabled,
|
|
60
|
+
required,
|
|
43
61
|
} = props;
|
|
44
62
|
const inputId = `field-${id}`;
|
|
45
|
-
|
|
63
|
+
const intl = useIntl();
|
|
46
64
|
const [value, setValue] = useState(flattenToAppURL(props.value));
|
|
47
65
|
const [isInvalid, setIsInvalid] = useState(false);
|
|
48
66
|
/**
|
|
@@ -54,24 +72,20 @@ export const UrlWidget = (props) => {
|
|
|
54
72
|
const clear = () => {
|
|
55
73
|
setValue('');
|
|
56
74
|
onChange(id, undefined);
|
|
75
|
+
setIsInvalid(false);
|
|
57
76
|
};
|
|
58
|
-
|
|
59
77
|
const onChangeValue = (_value) => {
|
|
60
78
|
let newValue = _value;
|
|
61
79
|
if (newValue?.length > 0) {
|
|
62
80
|
if (isInvalid && URLUtils.isUrl(URLUtils.normalizeUrl(newValue))) {
|
|
63
81
|
setIsInvalid(false);
|
|
64
82
|
}
|
|
65
|
-
|
|
66
83
|
if (isInternalURL(newValue)) {
|
|
67
84
|
newValue = flattenToAppURL(newValue);
|
|
68
85
|
}
|
|
69
86
|
}
|
|
70
|
-
|
|
71
87
|
setValue(newValue);
|
|
72
|
-
|
|
73
88
|
newValue = isInternalURL(newValue) ? addAppURL(newValue) : newValue;
|
|
74
|
-
|
|
75
89
|
if (!isInternalURL(newValue) && newValue.length > 0) {
|
|
76
90
|
const checkedURL = URLUtils.checkAndNormalizeUrl(newValue);
|
|
77
91
|
newValue = checkedURL.url;
|
|
@@ -79,10 +93,15 @@ export const UrlWidget = (props) => {
|
|
|
79
93
|
setIsInvalid(true);
|
|
80
94
|
}
|
|
81
95
|
}
|
|
82
|
-
|
|
83
96
|
onChange(id, newValue === '' ? undefined : newValue);
|
|
84
97
|
};
|
|
85
|
-
|
|
98
|
+
// A11y: if the field is required and the user leaves it empty, we mark it as missing
|
|
99
|
+
const handleBlur = ({ target }) => {
|
|
100
|
+
if (required && (!target.value || target.value === '')) {
|
|
101
|
+
setIsInvalid(true);
|
|
102
|
+
}
|
|
103
|
+
onBlur(id, target.value === '' ? undefined : target.value);
|
|
104
|
+
};
|
|
86
105
|
return (
|
|
87
106
|
<FormFieldWrapper {...props} className="url wide">
|
|
88
107
|
<div className="wrapper">
|
|
@@ -90,24 +109,38 @@ export const UrlWidget = (props) => {
|
|
|
90
109
|
id={inputId}
|
|
91
110
|
name={id}
|
|
92
111
|
type="url"
|
|
112
|
+
required={required}
|
|
113
|
+
aria-required={required}
|
|
114
|
+
aria-invalid={isInvalid}
|
|
115
|
+
aria-errormessage={isInvalid ? `${inputId}-error` : undefined}
|
|
116
|
+
onBlur={handleBlur}
|
|
93
117
|
value={value || ''}
|
|
94
118
|
disabled={isDisabled}
|
|
95
119
|
placeholder={placeholder}
|
|
96
120
|
onChange={({ target }) => onChangeValue(target.value)}
|
|
97
|
-
onBlur={({ target }) =>
|
|
98
|
-
onBlur(id, target.value === '' ? undefined : target.value)
|
|
99
|
-
}
|
|
100
121
|
onClick={() => onClick()}
|
|
101
122
|
minLength={minLength || null}
|
|
102
123
|
maxLength={maxLength || null}
|
|
103
124
|
error={isInvalid}
|
|
104
125
|
/>
|
|
126
|
+
{isInvalid && (
|
|
127
|
+
<span
|
|
128
|
+
id={`${inputId}-error`}
|
|
129
|
+
role="alert"
|
|
130
|
+
className="visually-hidden"
|
|
131
|
+
>
|
|
132
|
+
{value?.length > 0
|
|
133
|
+
? intl.formatMessage(messages.urlInvalid)
|
|
134
|
+
: intl.formatMessage(messages.urlMissing)}
|
|
135
|
+
</span>
|
|
136
|
+
)}
|
|
105
137
|
{value?.length > 0 ? (
|
|
106
138
|
<Button.Group>
|
|
107
139
|
<Button
|
|
140
|
+
type="button"
|
|
108
141
|
basic
|
|
109
142
|
className="cancel"
|
|
110
|
-
aria-label=
|
|
143
|
+
aria-label={intl.formatMessage(messages.clearUrl)}
|
|
111
144
|
onClick={(e) => {
|
|
112
145
|
e.preventDefault();
|
|
113
146
|
e.stopPropagation();
|
|
@@ -120,9 +153,10 @@ export const UrlWidget = (props) => {
|
|
|
120
153
|
) : (
|
|
121
154
|
<Button.Group>
|
|
122
155
|
<Button
|
|
156
|
+
type="button"
|
|
123
157
|
basic
|
|
124
158
|
icon
|
|
125
|
-
aria-label=
|
|
159
|
+
aria-label={intl.formatMessage(messages.openUrlBrowser)}
|
|
126
160
|
onClick={(e) => {
|
|
127
161
|
e.preventDefault();
|
|
128
162
|
e.stopPropagation();
|
|
@@ -143,7 +177,6 @@ export const UrlWidget = (props) => {
|
|
|
143
177
|
</FormFieldWrapper>
|
|
144
178
|
);
|
|
145
179
|
};
|
|
146
|
-
|
|
147
180
|
/**
|
|
148
181
|
* Property types
|
|
149
182
|
* @property {Object} propTypes Property types.
|
|
@@ -164,7 +197,6 @@ UrlWidget.propTypes = {
|
|
|
164
197
|
openObjectBrowser: PropTypes.func.isRequired,
|
|
165
198
|
placeholder: PropTypes.string,
|
|
166
199
|
};
|
|
167
|
-
|
|
168
200
|
/**
|
|
169
201
|
* Default properties.
|
|
170
202
|
* @property {Object} defaultProps Default properties.
|
|
@@ -181,5 +213,4 @@ UrlWidget.defaultProps = {
|
|
|
181
213
|
minLength: null,
|
|
182
214
|
maxLength: null,
|
|
183
215
|
};
|
|
184
|
-
|
|
185
216
|
export default withObjectBrowser(UrlWidget);
|
|
@@ -4,17 +4,8 @@ import configureStore from 'redux-mock-store';
|
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
5
|
import VocabularyTermsWidget from './VocabularyTermsWidget';
|
|
6
6
|
|
|
7
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
8
|
-
|
|
9
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
10
|
-
);
|
|
11
|
-
});
|
|
12
|
-
vi.mock('@plone/volto/components/manage/Form', async () => {
|
|
13
|
-
return await import(
|
|
14
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
15
|
-
);
|
|
16
|
-
});
|
|
17
|
-
|
|
7
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
8
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
18
9
|
beforeAll(async () => {
|
|
19
10
|
const { __setLoadables } = await import(
|
|
20
11
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -1,59 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
vi.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
vi.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const PasswordWidget = jest.fn(() => <div id="PasswordWidget" />);
|
|
24
|
-
export const QueryWidget = jest.fn(() => <div id="QueryWidget" />);
|
|
25
|
-
export const QuerySortOnWidget = jest.fn(() => <div id="QuerySortOnWidget" />);
|
|
26
|
-
export const QuerystringWidget = jest.fn(() => <div id="QuerystringWidget" />);
|
|
27
|
-
export const SchemaWidget = jest.fn(() => <div id="SchemaWidget" />);
|
|
28
|
-
export const SelectWidget = jest.fn(() => <div id="SelectWidget" />);
|
|
29
|
-
export const TextareaWidget = jest.fn(() => <div id="TextareaWidget" />);
|
|
30
|
-
export const TextWidget = jest.fn(() => <div id="TextWidget" />);
|
|
31
|
-
export const TokenWidget = jest.fn(() => <div id="TokenWidget" />);
|
|
32
|
-
export const WysiwygWidget = jest.fn(() => <div id="WysiwygWidget" />);
|
|
33
|
-
export const UrlWidget = jest.fn(() => <div id="UrlWidget" />);
|
|
34
|
-
export const InternalUrlWidget = jest.fn(() => <div id="InternalUrlWidget" />);
|
|
35
|
-
export const EmailWidget = jest.fn(() => <div id="EmailWidget" />);
|
|
36
|
-
export const NumberWidget = jest.fn(() => <div id="NumberWidget" />);
|
|
37
|
-
export const ImageSizeWidget = jest.fn(() => <div id="ImageSizeWidget" />);
|
|
38
|
-
export const RegistryImageWidget = jest.fn(() => (
|
|
1
|
+
export const AlignWidget = vi.fn(() => <div id="AlignWidget" />);
|
|
2
|
+
export const ButtonsWidget = vi.fn(() => <div id="ButtonsWidget" />);
|
|
3
|
+
export const ArrayWidget = vi.fn(() => <div id="ArrayWidget" />);
|
|
4
|
+
export const CheckboxWidget = vi.fn(() => <div id="CheckboxWidget" />);
|
|
5
|
+
export const FileWidget = vi.fn(() => <div id="FileWidget" />);
|
|
6
|
+
export const IdWidget = vi.fn(() => <div id="IdWidget" />);
|
|
7
|
+
export const PasswordWidget = vi.fn(() => <div id="PasswordWidget" />);
|
|
8
|
+
export const QueryWidget = vi.fn(() => <div id="QueryWidget" />);
|
|
9
|
+
export const QuerySortOnWidget = vi.fn(() => <div id="QuerySortOnWidget" />);
|
|
10
|
+
export const QuerystringWidget = vi.fn(() => <div id="QuerystringWidget" />);
|
|
11
|
+
export const SchemaWidget = vi.fn(() => <div id="SchemaWidget" />);
|
|
12
|
+
export const SelectWidget = vi.fn(() => <div id="SelectWidget" />);
|
|
13
|
+
export const TextareaWidget = vi.fn(() => <div id="TextareaWidget" />);
|
|
14
|
+
export const TextWidget = vi.fn(() => <div id="TextWidget" />);
|
|
15
|
+
export const TokenWidget = vi.fn(() => <div id="TokenWidget" />);
|
|
16
|
+
export const WysiwygWidget = vi.fn(() => <div id="WysiwygWidget" />);
|
|
17
|
+
export const UrlWidget = vi.fn(() => <div id="UrlWidget" />);
|
|
18
|
+
export const InternalUrlWidget = vi.fn(() => <div id="InternalUrlWidget" />);
|
|
19
|
+
export const EmailWidget = vi.fn(() => <div id="EmailWidget" />);
|
|
20
|
+
export const NumberWidget = vi.fn(() => <div id="NumberWidget" />);
|
|
21
|
+
export const ImageSizeWidget = vi.fn(() => <div id="ImageSizeWidget" />);
|
|
22
|
+
export const RegistryImageWidget = vi.fn(() => (
|
|
39
23
|
<div id="RegistryImageWidget" />
|
|
40
24
|
));
|
|
41
|
-
export const ReferenceWidget =
|
|
42
|
-
export const ObjectBrowserWidget =
|
|
25
|
+
export const ReferenceWidget = vi.fn(() => <div id="ReferenceWidget" />);
|
|
26
|
+
export const ObjectBrowserWidget = vi.fn(() => (
|
|
43
27
|
<div id="ObjectBrowserWidget" />
|
|
44
28
|
));
|
|
45
|
-
export const ObjectWidget =
|
|
46
|
-
export const ObjectListWidget =
|
|
47
|
-
export const VocabularyTermsWidget =
|
|
29
|
+
export const ObjectWidget = vi.fn(() => <div id="ObjectWidget" />);
|
|
30
|
+
export const ObjectListWidget = vi.fn(() => <div id="ObjectListWidget" />);
|
|
31
|
+
export const VocabularyTermsWidget = vi.fn(() => (
|
|
48
32
|
<div id="VocabularyTermsWidget" />
|
|
49
33
|
));
|
|
50
|
-
export const SelectMetadataWidget =
|
|
34
|
+
export const SelectMetadataWidget = vi.fn(() => (
|
|
51
35
|
<div id="SelectMetadataWidget" />
|
|
52
36
|
));
|
|
53
|
-
export const SelectAutoComplete =
|
|
54
|
-
|
|
55
|
-
));
|
|
56
|
-
export const
|
|
57
|
-
export const
|
|
58
|
-
export const RecurrenceWidget = jest.fn(() => <div id="RecurrenceWidget" />);
|
|
59
|
-
export const FormFieldWrapper = jest.fn(() => <div id="FormFieldWrapper" />);
|
|
37
|
+
export const SelectAutoComplete = vi.fn(() => <div id="SelectAutoComplete" />);
|
|
38
|
+
export const ColorPickerWidget = vi.fn(() => <div id="ColorPickerWidget" />);
|
|
39
|
+
export const DatetimeWidget = vi.fn(() => <div id="DatetimeWidget" />);
|
|
40
|
+
export const RecurrenceWidget = vi.fn(() => <div id="RecurrenceWidget" />);
|
|
41
|
+
export const FormFieldWrapper = vi.fn(() => <div id="FormFieldWrapper" />);
|
|
@@ -265,3 +265,24 @@ export const FormFieldWrapper = loadable(
|
|
|
265
265
|
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/FormFieldWrapper'
|
|
266
266
|
),
|
|
267
267
|
);
|
|
268
|
+
|
|
269
|
+
export const Size = loadable(
|
|
270
|
+
() =>
|
|
271
|
+
import(
|
|
272
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/Size'
|
|
273
|
+
),
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
export const BlockAlignment = loadable(
|
|
277
|
+
() =>
|
|
278
|
+
import(
|
|
279
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/BlockAlignment'
|
|
280
|
+
),
|
|
281
|
+
);
|
|
282
|
+
|
|
283
|
+
export const BlockWidth = loadable(
|
|
284
|
+
() =>
|
|
285
|
+
import(
|
|
286
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/BlockWidth'
|
|
287
|
+
),
|
|
288
|
+
);
|
|
@@ -7,17 +7,8 @@ import Workflow from './Workflow';
|
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
9
|
|
|
10
|
-
vi.mock('@plone/volto/components/manage/Widgets'
|
|
11
|
-
|
|
12
|
-
'@plone/volto/components/manage/Widgets/__mocks__/index.vitest.tsx'
|
|
13
|
-
);
|
|
14
|
-
});
|
|
15
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable', async () => {
|
|
16
|
-
return await import(
|
|
17
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
18
|
-
);
|
|
19
|
-
});
|
|
20
|
-
|
|
10
|
+
vi.mock('@plone/volto/components/manage/Widgets');
|
|
11
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
21
12
|
beforeAll(async () => {
|
|
22
13
|
const { __setLoadables } = await import(
|
|
23
14
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -35,6 +35,36 @@ describe('AlternateHrefLangs', () => {
|
|
|
35
35
|
expect(helmetLinks.length).toBe(0);
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
it('multilingual site, content without language field, renders nothing', () => {
|
|
39
|
+
config.settings.publicURL = 'https://plone.org';
|
|
40
|
+
config.settings.supportedLanguages = ['en', 'es'];
|
|
41
|
+
|
|
42
|
+
const content = {
|
|
43
|
+
'@id': 'http://localhost:8080/Plone/en/newsroom/news',
|
|
44
|
+
'@components': {
|
|
45
|
+
translations: {
|
|
46
|
+
items: [{ '@id': 'http://localhost:8080/Plone/es', language: 'es' }],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const store = mockStore({
|
|
52
|
+
intl: {
|
|
53
|
+
locale: 'en',
|
|
54
|
+
messages: {},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
renderer.create(
|
|
59
|
+
<Provider store={store}>
|
|
60
|
+
<AlternateHrefLangs content={content} />
|
|
61
|
+
</Provider>,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const helmetLinks = Helmet.peek().linkTags;
|
|
65
|
+
expect(helmetLinks.length).toBe(0);
|
|
66
|
+
});
|
|
67
|
+
|
|
38
68
|
it('multilingual site, with some translations', () => {
|
|
39
69
|
config.settings.publicURL = 'https://plone.org';
|
|
40
70
|
config.settings.supportedLanguages = ['en', 'es', 'eu'];
|
|
@@ -45,6 +45,7 @@ import MultilingualRedirector from '@plone/volto/components/theme/MultilingualRe
|
|
|
45
45
|
import WorkingCopyToastsFactory from '@plone/volto/components/manage/WorkingCopyToastsFactory/WorkingCopyToastsFactory';
|
|
46
46
|
import LockingToastsFactory from '@plone/volto/components/manage/LockingToastsFactory/LockingToastsFactory';
|
|
47
47
|
import RouteAnnouncer from '@plone/volto/components/theme/RouteAnnouncer/RouteAnnouncer';
|
|
48
|
+
import SlotRenderer from '@plone/volto/components/theme/SlotRenderer/SlotRenderer';
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* @export
|
|
@@ -159,6 +160,7 @@ export class App extends Component {
|
|
|
159
160
|
'public-ui': !isCmsUI,
|
|
160
161
|
})}
|
|
161
162
|
/>
|
|
163
|
+
<SlotRenderer name="aboveApp" content={this.props.content} />
|
|
162
164
|
<SkipLinks />
|
|
163
165
|
<Header pathname={path} />
|
|
164
166
|
<Breadcrumbs pathname={path} />
|
|
@@ -174,7 +176,9 @@ export class App extends Component {
|
|
|
174
176
|
<main ref={this.mainRef}>
|
|
175
177
|
<OutdatedBrowser />
|
|
176
178
|
{this.props.connectionRefused ? (
|
|
177
|
-
<ConnectionRefusedView
|
|
179
|
+
<ConnectionRefusedView
|
|
180
|
+
staticContext={this.props.staticContext}
|
|
181
|
+
/>
|
|
178
182
|
) : this.state.hasError ? (
|
|
179
183
|
<Error
|
|
180
184
|
message={this.state.error.message}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { getInitials } from '@plone/volto/helpers/Utils/Utils';
|
|
8
|
+
import Image from '@plone/volto/components/theme/Image/Image';
|
|
8
9
|
|
|
9
10
|
const defaultSize = 30;
|
|
10
11
|
const defaultColor = 'Teal';
|
|
@@ -15,7 +16,7 @@ const Avatar = ({ src, title, text, size, color, className }) => {
|
|
|
15
16
|
return (
|
|
16
17
|
<div className={className} title={title}>
|
|
17
18
|
{src ? (
|
|
18
|
-
<
|
|
19
|
+
<Image src={src} alt={title} />
|
|
19
20
|
) : (
|
|
20
21
|
<svg width={size} height={size}>
|
|
21
22
|
<circle cx={radius} cy={radius} r={radius} fill={color} />
|
|
@@ -7,11 +7,7 @@ import CommentEditModal from './CommentEditModal';
|
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
9
|
|
|
10
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
11
|
-
return await import(
|
|
12
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
13
|
-
);
|
|
14
|
-
});
|
|
10
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
15
11
|
|
|
16
12
|
describe('CommentEditModal', () => {
|
|
17
13
|
it('renders a comment edit modal component', () => {
|
|
@@ -19,17 +19,8 @@ vi.mock('moment', () => ({
|
|
|
19
19
|
})),
|
|
20
20
|
}));
|
|
21
21
|
|
|
22
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
23
|
-
|
|
24
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
25
|
-
);
|
|
26
|
-
});
|
|
27
|
-
vi.mock('@plone/volto/components/manage/Form', async () => {
|
|
28
|
-
return await import(
|
|
29
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
30
|
-
);
|
|
31
|
-
});
|
|
32
|
-
|
|
22
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
23
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
33
24
|
beforeAll(async () => {
|
|
34
25
|
const { __setLoadables } = await import(
|
|
35
26
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Connection refused error page.
|
|
3
3
|
* @module components/theme/ConnectionRefused/ConnectionRefused
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -7,6 +7,7 @@ import React from 'react';
|
|
|
7
7
|
import { FormattedMessage } from 'react-intl';
|
|
8
8
|
import { Container } from 'semantic-ui-react';
|
|
9
9
|
import config from '@plone/volto/registry';
|
|
10
|
+
import { withServerErrorCode } from '@plone/volto/helpers/Utils/Utils';
|
|
10
11
|
|
|
11
12
|
const ConnectionRefused = () => (
|
|
12
13
|
<Container
|
|
@@ -71,4 +72,4 @@ const ConnectionRefused = () => (
|
|
|
71
72
|
</Container>
|
|
72
73
|
);
|
|
73
74
|
|
|
74
|
-
export default ConnectionRefused;
|
|
75
|
+
export default withServerErrorCode(503)(ConnectionRefused);
|
|
@@ -9,11 +9,7 @@ vi.mock('../../manage/Toolbar/Toolbar', () => ({
|
|
|
9
9
|
default: vi.fn(() => <div id="Portal" />),
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
13
|
-
return await import(
|
|
14
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
15
|
-
);
|
|
16
|
-
});
|
|
12
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
17
13
|
|
|
18
14
|
const mockStore = configureStore();
|
|
19
15
|
describe('Contact form', () => {
|