@plone/volto 18.0.0-alpha.13 → 18.0.0-alpha.15
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 +33 -0
- package/jest-setup-afterenv.js +2 -0
- package/locales/ca/LC_MESSAGES/volto.po +6 -0
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +6 -0
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +6 -0
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +6 -0
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +6 -0
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +6 -0
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +6 -0
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +6 -0
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +6 -0
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +6 -0
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +6 -0
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +6 -0
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +6 -0
- package/locales/ro.json +1 -1
- package/locales/volto.pot +7 -1
- package/locales/zh_CN/LC_MESSAGES/volto.po +6 -0
- package/locales/zh_CN.json +1 -1
- package/package.json +28 -23
- package/src/components/manage/Add/Add.jsx +9 -11
- package/src/components/manage/Add/Add.test.jsx +11 -13
- package/src/components/manage/Aliases/Aliases.jsx +6 -6
- package/src/components/manage/Aliases/Aliases.test.jsx +7 -7
- package/src/components/manage/BlockChooser/BlockChooser.test.jsx +0 -1
- package/src/components/manage/BlockChooser/BlockChooserButton.jsx +6 -6
- package/src/components/manage/BlockChooser/BlockChooserSearch.test.jsx +0 -1
- package/src/components/manage/Blocks/Block/Settings.test.jsx +0 -1
- package/src/components/manage/Blocks/Container/NewBlockAddButton.jsx +20 -19
- package/src/components/manage/Blocks/Image/View.test.jsx +0 -1
- package/src/components/manage/Blocks/Table/Edit.jsx +7 -6
- package/src/components/manage/Contents/Contents.jsx +6 -6
- package/src/components/manage/Contents/Contents.test.jsx +7 -7
- package/src/components/manage/Contents/ContentsPropertiesModal.test.jsx +4 -4
- package/src/components/manage/Controlpanels/AddonsControlpanel.jsx +6 -6
- package/src/components/manage/Controlpanels/AddonsControlpanel.test.jsx +6 -7
- package/src/components/manage/Controlpanels/Aliases.jsx +6 -6
- package/src/components/manage/Controlpanels/Aliases.test.jsx +6 -7
- package/src/components/manage/Controlpanels/ContentType.jsx +6 -6
- package/src/components/manage/Controlpanels/ContentType.test.jsx +7 -7
- package/src/components/manage/Controlpanels/ContentTypeLayout.jsx +93 -85
- package/src/components/manage/Controlpanels/ContentTypeLayout.test.jsx +7 -7
- package/src/components/manage/Controlpanels/ContentTypeSchema.jsx +6 -6
- package/src/components/manage/Controlpanels/ContentTypes.jsx +6 -6
- package/src/components/manage/Controlpanels/ContentTypes.test.jsx +7 -7
- package/src/components/manage/Controlpanels/Controlpanel.jsx +6 -6
- package/src/components/manage/Controlpanels/Controlpanel.test.jsx +7 -7
- package/src/components/manage/Controlpanels/Controlpanels.jsx +6 -6
- package/src/components/manage/Controlpanels/Controlpanels.test.jsx +10 -10
- package/src/components/manage/Controlpanels/DatabaseInformation.jsx +6 -6
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx +6 -6
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.test.jsx +7 -7
- package/src/components/manage/Controlpanels/ModerateComments.jsx +6 -6
- package/src/components/manage/Controlpanels/ModerateComments.test.jsx +7 -7
- package/src/components/manage/Controlpanels/Relations/Relations.jsx +13 -7
- package/src/components/manage/Controlpanels/Rules/AddRule.jsx +6 -6
- package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +6 -7
- package/src/components/manage/Controlpanels/Rules/ConfigureRule.jsx +6 -6
- package/src/components/manage/Controlpanels/Rules/ConfigureRule.test.jsx +6 -7
- package/src/components/manage/Controlpanels/Rules/EditRule.jsx +6 -6
- package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +6 -7
- package/src/components/manage/Controlpanels/Rules/Rules.jsx +6 -6
- package/src/components/manage/Controlpanels/Rules/Rules.test.jsx +6 -7
- package/src/components/manage/Controlpanels/Rules/components/{VariableModal.test.jsx → VariableModal.test.jsx.removed} +6 -7
- package/src/components/manage/Controlpanels/UndoControlpanel.jsx +6 -6
- package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +7 -7
- package/src/components/manage/Controlpanels/UpgradeControlPanel.jsx +6 -6
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx +14 -8
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.test.jsx +7 -7
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +6 -6
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +7 -7
- package/src/components/manage/Delete/Delete.jsx +6 -6
- package/src/components/manage/Delete/Delete.test.jsx +10 -10
- package/src/components/manage/Diff/Diff.jsx +6 -6
- package/src/components/manage/Diff/Diff.test.jsx +2 -3
- package/src/components/manage/Edit/Edit.jsx +10 -11
- package/src/components/manage/Edit/Edit.test.jsx +14 -10
- package/src/components/manage/Form/BlockDataForm.test.jsx +0 -1
- package/src/components/manage/Form/Form.jsx +148 -122
- package/src/components/manage/Form/Form.test.jsx +7 -0
- package/src/components/manage/Form/ModalForm.test.jsx +0 -1
- package/src/components/manage/History/History.jsx +6 -6
- package/src/components/manage/History/History.test.jsx +14 -13
- package/src/components/manage/LinksToItem/LinksToItem.jsx +78 -49
- package/src/components/manage/LinksToItem/LinksToItem.test.jsx +7 -7
- package/src/components/manage/Multilingual/ManageTranslations.jsx +13 -7
- package/src/components/manage/Multilingual/ManageTranslations.test.jsx +6 -7
- package/src/components/manage/Preferences/ChangePassword.jsx +6 -6
- package/src/components/manage/Preferences/ChangePassword.test.jsx +13 -7
- package/src/components/manage/Preferences/PersonalInformation.test.jsx +15 -3
- package/src/components/manage/Preferences/PersonalPreferences.test.jsx +8 -3
- package/src/components/manage/Rules/Rules.jsx +6 -6
- package/src/components/manage/Rules/Rules.test.jsx +7 -7
- package/src/components/manage/Sharing/Sharing.jsx +6 -6
- package/src/components/manage/Sharing/Sharing.test.jsx +7 -7
- package/src/components/manage/Sidebar/ObjectBrowser.jsx +1 -1
- package/src/components/manage/Sidebar/Sidebar.jsx +2 -0
- package/src/components/manage/Sidebar/SidebarPopup.jsx +28 -21
- package/src/components/manage/Sidebar/SidebarPortal.jsx +7 -6
- package/src/components/manage/Toolbar/Toolbar.jsx +35 -2
- package/src/components/manage/Widgets/ArrayWidget.jsx +3 -1
- package/src/components/manage/Widgets/FileWidget.jsx +1 -1
- package/src/components/manage/Widgets/ObjectBrowserWidget.test.jsx +4 -4
- package/src/components/manage/Widgets/ObjectListWidget.test.js +0 -1
- package/src/components/manage/Widgets/ObjectWidget.test.jsx +0 -1
- package/src/components/manage/Widgets/SchemaWidget.test.jsx +4 -4
- package/src/components/manage/Widgets/SchemaWidgetFieldset.test.jsx +5 -5
- package/src/components/manage/Widgets/UrlWidget.test.jsx +4 -4
- package/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx +4 -4
- package/src/components/theme/Comments/Comments.jsx +7 -8
- package/src/components/theme/Comments/Comments.test.jsx +7 -0
- package/src/components/theme/Component/Component.test.jsx +0 -1
- package/src/components/theme/ContactForm/ContactForm.jsx +6 -6
- package/src/components/theme/ContactForm/ContactForm.test.jsx +12 -10
- package/src/components/theme/Footer/Footer.test.jsx +0 -1
- package/src/components/theme/Logo/Logo.Multilingual.test.jsx +3 -1
- package/src/components/theme/Logo/Logo.jsx +18 -12
- package/src/components/theme/Logo/Logo.test.jsx +4 -1
- package/src/components/theme/Logout/Logout.test.jsx +8 -5
- package/src/components/theme/PasswordReset/PasswordReset.test.jsx +7 -0
- package/src/components/theme/PasswordReset/RequestPasswordReset.test.jsx +7 -0
- package/src/components/theme/Register/Register.test.jsx +7 -0
- package/src/components/theme/Search/Search.jsx +6 -6
- package/src/components/theme/Search/Search.test.jsx +13 -10
- package/src/components/theme/SlotRenderer/SlotRenderer.test.jsx +55 -0
- package/src/components/theme/SlotRenderer/SlotRenderer.tsx +54 -0
- package/src/components/theme/View/View.jsx +9 -6
- package/src/components/theme/View/View.test.jsx +28 -18
- package/src/config/index.js +3 -1
- package/src/helpers/AsyncConnect/AsyncConnect.test.js +0 -2
- package/src/helpers/Blocks/Blocks.js +5 -2
- package/src/helpers/Slots/index.tsx +12 -0
- package/src/helpers/Utils/UseDetectClickOutside.stories.jsx +8 -8
- package/src/helpers/index.js +1 -0
- package/src/start-client.jsx +3 -3
- package/test-setup-config.js +1 -0
- package/theme/themes/pastanaga/extras/toolbar.less +4 -4
- package/tsconfig.declarations.json +1 -0
- package/types/components/manage/Actions/Actions.d.ts +1 -1
- package/types/components/manage/Add/Add.d.ts +1 -4
- package/types/components/manage/Aliases/Aliases.d.ts +1 -4
- package/types/components/manage/AnchorPlugin/components/Link/index.d.ts +1 -1
- package/types/components/manage/BlockChooser/BlockChooserButton.d.ts +2 -2
- package/types/components/manage/BlockChooser/BlockChooserSearch.d.ts +1 -1
- package/types/components/manage/Blocks/Block/BlocksForm.d.ts +1 -1
- package/types/components/manage/Blocks/Block/DefaultEdit.d.ts +1 -1
- package/types/components/manage/Blocks/Block/DefaultView.d.ts +1 -1
- package/types/components/manage/Blocks/Block/Edit.d.ts +1 -3
- package/types/components/manage/Blocks/Block/Style.d.ts +1 -1
- package/types/components/manage/Blocks/Container/Data.d.ts +1 -1
- package/types/components/manage/Blocks/Container/Edit.d.ts +1 -1
- package/types/components/manage/Blocks/Container/EditBlockWrapper.d.ts +1 -1
- package/types/components/manage/Blocks/Container/NewBlockAddButton.d.ts +1 -1
- package/types/components/manage/Blocks/Container/SimpleContainerToolbar.d.ts +1 -1
- package/types/components/manage/Blocks/Description/Edit.d.ts +1 -1
- package/types/components/manage/Blocks/Description/View.d.ts +1 -1
- package/types/components/manage/Blocks/Grid/Edit.d.ts +1 -1
- package/types/components/manage/Blocks/Grid/View.d.ts +1 -1
- package/types/components/manage/Blocks/HTML/View.d.ts +1 -1
- package/types/components/manage/Blocks/HeroImageLeft/Data.d.ts +1 -1
- package/types/components/manage/Blocks/HeroImageLeft/Edit.d.ts +1 -4
- package/types/components/manage/Blocks/HeroImageLeft/View.d.ts +1 -1
- package/types/components/manage/Blocks/Image/Edit.d.ts +1 -4
- package/types/components/manage/Blocks/Image/ImageSidebar.d.ts +1 -1
- package/types/components/manage/Blocks/Image/View.d.ts +2 -2
- package/types/components/manage/Blocks/Image/schema.d.ts +1 -1
- package/types/components/manage/Blocks/LeadImage/View.d.ts +1 -1
- package/types/components/manage/Blocks/Listing/DefaultNoResultsComponent.d.ts +1 -1
- package/types/components/manage/Blocks/Listing/DefaultTemplate.d.ts +1 -1
- package/types/components/manage/Blocks/Listing/Edit.d.ts +1 -1
- package/types/components/manage/Blocks/Listing/GalleryNoResultsComponent.d.ts +1 -1
- package/types/components/manage/Blocks/Listing/ImageGallery.d.ts +1 -1
- package/types/components/manage/Blocks/Listing/ListingData.d.ts +1 -1
- package/types/components/manage/Blocks/Listing/SummaryTemplate.d.ts +1 -1
- package/types/components/manage/Blocks/Listing/View.d.ts +1 -1
- package/types/components/manage/Blocks/Maps/Edit.d.ts +1 -1
- package/types/components/manage/Blocks/Maps/MapsSidebar.d.ts +1 -1
- package/types/components/manage/Blocks/Search/SearchBlockEdit.d.ts +1 -1
- package/types/components/manage/Blocks/Search/SearchBlockView.d.ts +2 -2
- package/types/components/manage/Blocks/Search/components/CheckboxFacet.d.ts +1 -1
- package/types/components/manage/Blocks/Search/components/DateRangeFacetFilterListEntry.d.ts +1 -1
- package/types/components/manage/Blocks/Search/components/Facets.d.ts +1 -1
- package/types/components/manage/Blocks/Search/components/FilterList.d.ts +1 -1
- package/types/components/manage/Blocks/Search/components/SearchDetails.d.ts +1 -1
- package/types/components/manage/Blocks/Search/components/SearchInput.d.ts +1 -1
- package/types/components/manage/Blocks/Search/components/SelectFacetFilterListEntry.d.ts +1 -1
- package/types/components/manage/Blocks/Search/components/ToggleFacet.d.ts +1 -1
- package/types/components/manage/Blocks/Search/components/ToggleFacetFilterListEntry.d.ts +1 -1
- package/types/components/manage/Blocks/Search/hocs/withQueryString.d.ts +1 -1
- package/types/components/manage/Blocks/Search/hocs/withSearch.d.ts +1 -1
- package/types/components/manage/Blocks/Search/layout/LeftColumnFacets.d.ts +1 -1
- package/types/components/manage/Blocks/Search/layout/RightColumnFacets.d.ts +1 -1
- package/types/components/manage/Blocks/Search/layout/TopSideFacets.d.ts +1 -1
- package/types/components/manage/Blocks/Search/utils.d.ts +2 -2
- package/types/components/manage/Blocks/Search/widgets/SelectMetadataField.d.ts +1 -1
- package/types/components/manage/Blocks/Table/Cell.d.ts +1 -1
- package/types/components/manage/Blocks/Table/View.d.ts +1 -1
- package/types/components/manage/Blocks/Teaser/Body.d.ts +1 -1
- package/types/components/manage/Blocks/Teaser/Data.d.ts +1 -1
- package/types/components/manage/Blocks/Teaser/DefaultBody.d.ts +1 -1
- package/types/components/manage/Blocks/Teaser/Edit.d.ts +1 -1
- package/types/components/manage/Blocks/Teaser/View.d.ts +1 -1
- package/types/components/manage/Blocks/Text/Edit.d.ts +1 -1
- package/types/components/manage/Blocks/Title/Edit.d.ts +1 -1
- package/types/components/manage/Blocks/Title/View.d.ts +1 -1
- package/types/components/manage/Blocks/ToC/Edit.d.ts +1 -1
- package/types/components/manage/Blocks/Video/Body.d.ts +1 -1
- package/types/components/manage/Blocks/Video/VideoSidebar.d.ts +1 -1
- package/types/components/manage/Blocks/Video/View.d.ts +1 -1
- package/types/components/manage/Contents/Contents.d.ts +2 -7
- package/types/components/manage/Contents/ContentsBreadcrumbs.d.ts +1 -1
- package/types/components/manage/Contents/ContentsBreadcrumbsHomeItem.d.ts +1 -1
- package/types/components/manage/Contents/ContentsBreadcrumbsRootItem.d.ts +1 -1
- package/types/components/manage/Contents/ContentsPropertiesModal.d.ts +1 -1
- package/types/components/manage/Contents/ContentsRenameModal.d.ts +1 -1
- package/types/components/manage/Contents/ContentsRenameModal.stories.d.ts +1 -1
- package/types/components/manage/Contents/ContentsTagsModal.d.ts +1 -1
- package/types/components/manage/Contents/ContentsTagsModal.stories.d.ts +1 -1
- package/types/components/manage/Contents/ContentsUploadModal.d.ts +1 -4
- package/types/components/manage/Contents/ContentsWorkflowModal.d.ts +1 -1
- package/types/components/manage/Contents/circle.d.ts +1 -1
- package/types/components/manage/Controlpanels/AddonsControlpanel.d.ts +1 -4
- package/types/components/manage/Controlpanels/Aliases.d.ts +1 -4
- package/types/components/manage/Controlpanels/ContentType.d.ts +1 -4
- package/types/components/manage/Controlpanels/ContentTypeLayout.d.ts +1 -4
- package/types/components/manage/Controlpanels/ContentTypeSchema.d.ts +1 -4
- package/types/components/manage/Controlpanels/ContentTypes.d.ts +1 -4
- package/types/components/manage/Controlpanels/DatabaseInformation.d.ts +1 -4
- package/types/components/manage/Controlpanels/Groups/GroupsControlpanel.d.ts +1 -4
- package/types/components/manage/Controlpanels/ModerateComments.d.ts +1 -4
- package/types/components/manage/Controlpanels/Relations/BrokenRelations.d.ts +1 -1
- package/types/components/manage/Controlpanels/Relations/Relations.d.ts +1 -1
- package/types/components/manage/Controlpanels/Relations/RelationsListing.d.ts +1 -1
- package/types/components/manage/Controlpanels/Relations/RelationsMatrix.d.ts +3 -5
- package/types/components/manage/Controlpanels/Rules/AddRule.d.ts +1 -4
- package/types/components/manage/Controlpanels/Rules/ConfigureRule.d.ts +1 -4
- package/types/components/manage/Controlpanels/Rules/EditRule.d.ts +1 -4
- package/types/components/manage/Controlpanels/Rules/Rules.d.ts +1 -4
- package/types/components/manage/Controlpanels/Rules/components/VariableModal.d.ts +1 -4
- package/types/components/manage/Controlpanels/UndoControlpanel.d.ts +1 -4
- package/types/components/manage/Controlpanels/UpgradeControlPanel.d.ts +1 -4
- package/types/components/manage/Controlpanels/Users/RenderUsers.d.ts +1 -4
- package/types/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.d.ts +1 -1
- package/types/components/manage/Controlpanels/Users/UserGroupMembershipListing.d.ts +1 -1
- package/types/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.d.ts +1 -1
- package/types/components/manage/Controlpanels/Users/UsersControlpanel.d.ts +1 -4
- package/types/components/manage/Controlpanels/VersionOverview.d.ts +1 -1
- package/types/components/manage/Delete/Delete.d.ts +1 -1
- package/types/components/manage/Display/Display.d.ts +1 -4
- package/types/components/manage/Edit/Edit.d.ts +2 -7
- package/types/components/manage/Form/BlockDataForm.d.ts +1 -1
- package/types/components/manage/Form/BlocksToolbar.d.ts +2 -4
- package/types/components/manage/Form/UndoToolbar.d.ts +1 -1
- package/types/components/manage/History/History.d.ts +1 -4
- package/types/components/manage/LinkDetectionPlugin/link-detection-plugin.d.ts +1 -1
- package/types/components/manage/LinkMore/LinkMore.d.ts +1 -1
- package/types/components/manage/LinksToItem/LinksToItem.d.ts +1 -1
- package/types/components/manage/Messages/Messages.d.ts +1 -1
- package/types/components/manage/Multilingual/CreateTranslation.d.ts +1 -1
- package/types/components/manage/Multilingual/ManageTranslations.d.ts +3 -5
- package/types/components/manage/Multilingual/TranslationObject.d.ts +1 -1
- package/types/components/manage/Pluggable/Pluggable.stories.d.ts +4 -4
- package/types/components/manage/Pluggable/index.d.ts +21 -3
- package/types/components/manage/Preferences/PersonalPreferences.d.ts +1 -4
- package/types/components/manage/Rules/Rules.d.ts +1 -4
- package/types/components/manage/Sidebar/AlignBlock.d.ts +1 -1
- package/types/components/manage/Sidebar/ObjectBrowser.d.ts +3 -5
- package/types/components/manage/Sidebar/ObjectBrowserBody.d.ts +1 -4
- package/types/components/manage/Sidebar/ObjectBrowserNav.d.ts +1 -1
- package/types/components/manage/Sidebar/SidebarPopup.d.ts +1 -1
- package/types/components/manage/Sidebar/SidebarPortal.d.ts +2 -1
- package/types/components/manage/TemplateChooser/TemplateChooser.d.ts +1 -1
- package/types/components/manage/TextLineEdit/TextLineEdit.d.ts +1 -1
- package/types/components/manage/TextLineEdit/TextLineEdit.stories.d.ts +1 -1
- package/types/components/manage/Toast/Toast.d.ts +1 -1
- package/types/components/manage/Toolbar/PersonalTools.d.ts +1 -1
- package/types/components/manage/Toolbar/StandardWrapper.d.ts +1 -1
- package/types/components/manage/Toolbar/Stats.d.ts +1 -1
- package/types/components/manage/Toolbar/Toolbar.d.ts +1 -4
- package/types/components/manage/UniversalLink/UniversalLink.d.ts +1 -1
- package/types/components/manage/Widgets/AlignWidget.d.ts +1 -1
- package/types/components/manage/Widgets/AlignWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/ArrayWidget.d.ts +1 -3
- package/types/components/manage/Widgets/ArrayWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/ButtonsWidget.d.ts +1 -1
- package/types/components/manage/Widgets/ButtonsWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/CheckboxWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/ColorPickerWidget.d.ts +1 -2
- package/types/components/manage/Widgets/DatetimeWidget.d.ts +1 -1
- package/types/components/manage/Widgets/DatetimeWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/EmailWidget.d.ts +1 -1
- package/types/components/manage/Widgets/EmailWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/FileWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/FormFieldWrapper.stories.d.ts +1 -1
- package/types/components/manage/Widgets/IdWidget.d.ts +1 -4
- package/types/components/manage/Widgets/IdWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/ImageSizeWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/InternalUrlWidget.d.ts +4 -6
- package/types/components/manage/Widgets/InternalUrlWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/NumberWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/ObjectBrowserWidget.d.ts +1 -1
- package/types/components/manage/Widgets/ObjectBrowserWidget.stories.d.ts +7 -7
- package/types/components/manage/Widgets/ObjectListWidget.d.ts +1 -1
- package/types/components/manage/Widgets/ObjectListWidget.stories.d.ts +2 -2
- package/types/components/manage/Widgets/ObjectWidget.d.ts +1 -1
- package/types/components/manage/Widgets/ObjectWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/PasswordWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/QueryWidget.d.ts +1 -3
- package/types/components/manage/Widgets/QueryWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/QuerystringWidget.d.ts +1 -1
- package/types/components/manage/Widgets/RecurrenceWidget/ByMonthDayField.d.ts +16 -2
- package/types/components/manage/Widgets/RecurrenceWidget/ByMonthField.d.ts +20 -2
- package/types/components/manage/Widgets/RecurrenceWidget/ByYearField.d.ts +22 -2
- package/types/components/manage/Widgets/RecurrenceWidget/EndField.d.ts +16 -2
- package/types/components/manage/Widgets/ReferenceWidget.d.ts +1 -4
- package/types/components/manage/Widgets/SchemaWidget.d.ts +1 -4
- package/types/components/manage/Widgets/SelectAutoComplete.d.ts +1 -3
- package/types/components/manage/Widgets/SelectAutocompleteWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/SelectStyling.d.ts +1 -1
- package/types/components/manage/Widgets/SelectWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/TextWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/TextareaWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/TokenWidget.d.ts +1 -4
- package/types/components/manage/Widgets/TokenWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/UrlWidget.d.ts +4 -6
- package/types/components/manage/Widgets/UrlWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/VocabularyTermsWidget.d.ts +1 -1
- package/types/components/manage/Widgets/VocabularyTermsWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/WysiwygWidget.d.ts +2 -5
- package/types/components/manage/Widgets/WysiwygWidget.stories.d.ts +1 -1
- package/types/components/manage/Widgets/story.d.ts +1 -1
- package/types/components/theme/Anontools/Anontools.d.ts +1 -1
- package/types/components/theme/AppExtras/AppExtras.d.ts +1 -1
- package/types/components/theme/Avatar/Avatar.d.ts +1 -1
- package/types/components/theme/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/types/components/theme/Comments/Comment.stories.d.ts +1 -1
- package/types/components/theme/Comments/CommentEditModal.d.ts +1 -1
- package/types/components/theme/Comments/CommentEditModal.stories.d.ts +1 -1
- package/types/components/theme/Component/Component.d.ts +1 -1
- package/types/components/theme/ConnectionRefused/ConnectionRefused.d.ts +1 -1
- package/types/components/theme/ContactForm/ContactForm.d.ts +1 -1
- package/types/components/theme/ContactForm/ContactForm.stories.d.ts +1 -1
- package/types/components/theme/ContentMetadataTags/ContentMetadataTags.d.ts +1 -1
- package/types/components/theme/Error/ErrorBoundary.d.ts +1 -0
- package/types/components/theme/Error/ServerError.d.ts +1 -1
- package/types/components/theme/EventDetails/EventDetails.d.ts +1 -1
- package/types/components/theme/EventDetails/EventDetails.stories.d.ts +1 -1
- package/types/components/theme/Forbidden/Forbidden.d.ts +1 -1
- package/types/components/theme/FormattedDate/FormattedDate.d.ts +1 -1
- package/types/components/theme/FormattedDate/FormattedDate.stories.d.ts +1 -1
- package/types/components/theme/FormattedDate/FormattedRelativeDate.d.ts +1 -1
- package/types/components/theme/FormattedDate/FormattedRelativeDate.stories.d.ts +1 -1
- package/types/components/theme/Header/Header.d.ts +1 -1
- package/types/components/theme/Header/Header.stories.d.ts +1 -1
- package/types/components/theme/Image/Image.d.ts +1 -1
- package/types/components/theme/LanguageSelector/LanguageSelector.d.ts +1 -1
- package/types/components/theme/Login/Login.d.ts +1 -1
- package/types/components/theme/Login/Login.stories.d.ts +1 -1
- package/types/components/theme/Logo/Logo.stories.d.ts +1 -1
- package/types/components/theme/Logout/Logout.d.ts +1 -1
- package/types/components/theme/MultilingualRedirector/MultilingualRedirector.d.ts +1 -1
- package/types/components/theme/Navigation/ContextNavigation.d.ts +1 -1
- package/types/components/theme/Navigation/ContextNavigation.stories.d.ts +2 -2
- package/types/components/theme/Navigation/NavItem.d.ts +1 -1
- package/types/components/theme/Navigation/NavItems.d.ts +1 -1
- package/types/components/theme/Navigation/Navigation.d.ts +1 -1
- package/types/components/theme/Navigation/withContentNavigation.d.ts +1 -1
- package/types/components/theme/NotFound/NotFound.d.ts +1 -1
- package/types/components/theme/OutdatedBrowser/OutdatedBrowser.d.ts +1 -1
- package/types/components/theme/PasswordReset/RequestPasswordReset.d.ts +1 -1
- package/types/components/theme/Popup/Popup.d.ts +1 -1
- package/types/components/theme/PreviewImage/PreviewImage.d.ts +1 -1
- package/types/components/theme/Search/Search.d.ts +2 -7
- package/types/components/theme/Search/SearchTags.d.ts +1 -1
- package/types/components/theme/SearchWidget/SearchWidget.d.ts +1 -1
- package/types/components/theme/SearchWidget/SearchWidget.stories.d.ts +1 -1
- package/types/components/theme/Sitemap/Sitemap.d.ts +2 -6
- package/types/components/theme/SkipLinks/SkipLinks.d.ts +1 -1
- package/types/components/theme/SlotRenderer/SlotRenderer.d.ts +7 -0
- package/types/components/theme/SlotRenderer/SlotRenderer.test.d.ts +1 -0
- package/types/components/theme/TsTest/TsTest.d.ts +1 -2
- package/types/components/theme/Unauthorized/Unauthorized.d.ts +1 -1
- package/types/components/theme/View/AlbumView.d.ts +1 -1
- package/types/components/theme/View/EventDatesInfo.d.ts +1 -1
- package/types/components/theme/View/LinkView.d.ts +1 -1
- package/types/components/theme/View/RenderBlocks.d.ts +1 -1
- package/types/components/theme/View/View.d.ts +1 -4
- package/types/components/theme/Widgets/ArrayWidget.d.ts +1 -1
- package/types/components/theme/Widgets/BooleanWidget.d.ts +14 -2
- package/types/components/theme/Widgets/DateWidget.d.ts +1 -1
- package/types/components/theme/Widgets/DatetimeWidget.d.ts +1 -1
- package/types/components/theme/Widgets/DescriptionWidget.d.ts +1 -1
- package/types/components/theme/Widgets/EmailWidget.d.ts +1 -1
- package/types/components/theme/Widgets/FileWidget.d.ts +1 -1
- package/types/components/theme/Widgets/ImageWidget.d.ts +1 -1
- package/types/components/theme/Widgets/PasswordWidget.d.ts +1 -1
- package/types/components/theme/Widgets/RelationWidget.d.ts +1 -1
- package/types/components/theme/Widgets/RelationsWidget.d.ts +1 -1
- package/types/components/theme/Widgets/RichTextWidget.d.ts +1 -1
- package/types/components/theme/Widgets/SelectWidget.d.ts +1 -1
- package/types/components/theme/Widgets/TextWidget.d.ts +1 -1
- package/types/components/theme/Widgets/TitleWidget.d.ts +1 -1
- package/types/components/theme/Widgets/TokenWidget.d.ts +1 -1
- package/types/components/theme/Widgets/UrlWidget.d.ts +1 -1
- package/types/config/Blocks.d.ts +1 -1
- package/types/config/RichTextEditor/ToHTML.d.ts +10 -10
- package/types/config/Views.d.ts +5 -5
- package/types/config/Widgets.d.ts +1 -3
- package/types/helpers/AsyncConnect/AsyncConnect.d.ts +2 -2
- package/types/helpers/Extensions/withBlockExtensions.d.ts +1 -1
- package/types/helpers/Extensions/withBlockSchemaEnhancer.d.ts +3 -3
- package/types/helpers/Helmet/Helmet.d.ts +6 -10
- package/types/helpers/LanguageMap/LanguageMap.d.ts +878 -1
- package/types/helpers/Slots/index.d.ts +7 -0
- package/types/helpers/Utils/Date.d.ts +2 -2
- package/types/helpers/Utils/UseDetectClickOutside.stories.d.ts +2 -2
- package/types/helpers/Utils/Utils.d.ts +1 -1
- package/types/helpers/index.d.ts +1 -0
- package/types/reducers/blocksClipboard/blocksClipboard.d.ts +1 -1
- package/types/routes.d.ts +3 -3
- package/types/storybook.d.ts +3 -3
- package/src/components/manage/Multilingual/CreateTranslation.test.jsx +0 -46
- package/src/helpers/Utils/usePagination.test.js +0 -115
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { StaticRouter } from 'react-router-dom';
|
|
5
5
|
import { Provider } from 'react-intl-redux';
|
|
@@ -9,9 +9,7 @@ import FakeTimers from '@sinonjs/fake-timers';
|
|
|
9
9
|
import History from './History';
|
|
10
10
|
|
|
11
11
|
const mockStore = configureStore();
|
|
12
|
-
jest.mock('
|
|
13
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
14
|
-
}));
|
|
12
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
15
13
|
|
|
16
14
|
const FIXED_SYSTEM_TIME = '2017-04-23T15:38:00.000Z';
|
|
17
15
|
|
|
@@ -87,13 +85,14 @@ describe('History', () => {
|
|
|
87
85
|
messages: {},
|
|
88
86
|
},
|
|
89
87
|
});
|
|
90
|
-
const
|
|
88
|
+
const { container } = render(
|
|
91
89
|
<Provider store={store}>
|
|
92
90
|
<History location={{ pathname: '/blog' }} />
|
|
91
|
+
<div id="toolbar"></div>
|
|
93
92
|
</Provider>,
|
|
94
93
|
);
|
|
95
|
-
|
|
96
|
-
expect(
|
|
94
|
+
|
|
95
|
+
expect(container).toMatchSnapshot();
|
|
97
96
|
});
|
|
98
97
|
|
|
99
98
|
it('redirects if unassigned', () => {
|
|
@@ -153,13 +152,14 @@ describe('History', () => {
|
|
|
153
152
|
messages: {},
|
|
154
153
|
},
|
|
155
154
|
});
|
|
156
|
-
const
|
|
155
|
+
const { container } = render(
|
|
157
156
|
<Provider store={store}>
|
|
158
157
|
<History location={{ pathname: '/blog' }} />
|
|
158
|
+
<div id="toolbar"></div>
|
|
159
159
|
</Provider>,
|
|
160
160
|
);
|
|
161
|
-
|
|
162
|
-
expect(
|
|
161
|
+
|
|
162
|
+
expect(container).toMatchSnapshot();
|
|
163
163
|
});
|
|
164
164
|
|
|
165
165
|
it('redirects if unassigned, no token gives unauthorized', () => {
|
|
@@ -217,14 +217,15 @@ describe('History', () => {
|
|
|
217
217
|
messages: {},
|
|
218
218
|
},
|
|
219
219
|
});
|
|
220
|
-
const
|
|
220
|
+
const { container } = render(
|
|
221
221
|
<Provider store={store}>
|
|
222
222
|
<StaticRouter context={{}} location={'/blog'}>
|
|
223
223
|
<History location={{ pathname: '/blog' }} />
|
|
224
|
+
<div id="toolbar"></div>
|
|
224
225
|
</StaticRouter>
|
|
225
226
|
</Provider>,
|
|
226
227
|
);
|
|
227
|
-
|
|
228
|
-
expect(
|
|
228
|
+
|
|
229
|
+
expect(container).toMatchSnapshot();
|
|
229
230
|
});
|
|
230
231
|
});
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* LinksToItem component
|
|
3
3
|
* @module components/manage/LinksToItem/LinksToItem
|
|
4
4
|
*/
|
|
5
|
-
import { useEffect } from 'react';
|
|
5
|
+
import React, { useEffect, useState } from 'react';
|
|
6
6
|
import { find } from 'lodash';
|
|
7
7
|
import { Helmet } from '@plone/volto/helpers';
|
|
8
8
|
import { Link } from 'react-router-dom';
|
|
9
|
-
import {
|
|
9
|
+
import { createPortal } from 'react-dom';
|
|
10
10
|
import { Container, Segment, Table } from 'semantic-ui-react';
|
|
11
11
|
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
|
12
12
|
import { useDispatch, useSelector } from 'react-redux';
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
UniversalLink,
|
|
20
20
|
Unauthorized,
|
|
21
21
|
} from '@plone/volto/components';
|
|
22
|
-
import { compose } from 'redux';
|
|
23
22
|
|
|
24
23
|
import { getBaseUrl } from '@plone/volto/helpers';
|
|
25
24
|
import backSVG from '@plone/volto/icons/back.svg';
|
|
@@ -57,6 +56,12 @@ const LinksToItem = (props) => {
|
|
|
57
56
|
id: 'plone_setup',
|
|
58
57
|
});
|
|
59
58
|
|
|
59
|
+
const [isClient, setIsClient] = useState(false);
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
setIsClient(true);
|
|
63
|
+
}, []);
|
|
64
|
+
|
|
60
65
|
useEffect(() => {
|
|
61
66
|
dispatch(queryRelations(null, false, itempath, null, [itempath]));
|
|
62
67
|
}, [dispatch, itempath]);
|
|
@@ -101,41 +106,46 @@ const LinksToItem = (props) => {
|
|
|
101
106
|
<Table selectable compact singleLine attached>
|
|
102
107
|
{
|
|
103
108
|
<Table.Body>
|
|
104
|
-
{Object.keys(links_ordered).map((relationtype) => {
|
|
109
|
+
{Object.keys(links_ordered).map((relationtype, index) => {
|
|
110
|
+
// TODO: keys driven by links_ordered[relationtype][index]['@id'])
|
|
105
111
|
return [].concat(
|
|
106
112
|
[
|
|
107
|
-
<
|
|
108
|
-
<Table.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
id="Linking this item with hyperlink in text"
|
|
112
|
-
defaultMessage="Linking this item with hyperlink in text"
|
|
113
|
-
/>
|
|
114
|
-
) : relationtype === 'relatedItems' ? (
|
|
115
|
-
<FormattedMessage
|
|
116
|
-
id="Referencing this item as related item"
|
|
117
|
-
defaultMessage="Referencing this item as related item"
|
|
118
|
-
/>
|
|
119
|
-
) : (
|
|
120
|
-
<>
|
|
113
|
+
<React.Fragment key={index}>
|
|
114
|
+
<Table.Row>
|
|
115
|
+
<Table.HeaderCell>
|
|
116
|
+
{relationtype === 'isReferencing' ? (
|
|
121
117
|
<FormattedMessage
|
|
122
|
-
id="
|
|
123
|
-
defaultMessage="
|
|
124
|
-
values={{ relationship: <q>{relationtype}</q> }}
|
|
118
|
+
id="Linking this item with hyperlink in text"
|
|
119
|
+
defaultMessage="Linking this item with hyperlink in text"
|
|
125
120
|
/>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
121
|
+
) : relationtype === 'relatedItems' ? (
|
|
122
|
+
<FormattedMessage
|
|
123
|
+
id="Referencing this item as related item"
|
|
124
|
+
defaultMessage="Referencing this item as related item"
|
|
125
|
+
/>
|
|
126
|
+
) : (
|
|
127
|
+
<>
|
|
128
|
+
<FormattedMessage
|
|
129
|
+
id="Referencing this item with {relationship}"
|
|
130
|
+
defaultMessage="Referencing this item with {relationship}"
|
|
131
|
+
values={{
|
|
132
|
+
relationship: <q>{relationtype}</q>,
|
|
133
|
+
}}
|
|
134
|
+
/>
|
|
135
|
+
</>
|
|
136
|
+
)}
|
|
137
|
+
</Table.HeaderCell>
|
|
138
|
+
<Table.HeaderCell>
|
|
139
|
+
<FormattedMessage
|
|
140
|
+
id="Review state"
|
|
141
|
+
defaultMessage="Review state"
|
|
142
|
+
/>
|
|
143
|
+
</Table.HeaderCell>
|
|
144
|
+
<Table.HeaderCell>
|
|
145
|
+
<FormattedMessage id="Type" defaultMessage="Type" />
|
|
146
|
+
</Table.HeaderCell>
|
|
147
|
+
</Table.Row>
|
|
148
|
+
</React.Fragment>,
|
|
139
149
|
],
|
|
140
150
|
links_ordered[relationtype].map((link) => {
|
|
141
151
|
return (
|
|
@@ -173,8 +183,8 @@ const LinksToItem = (props) => {
|
|
|
173
183
|
</Segment>
|
|
174
184
|
)}
|
|
175
185
|
</Segment.Group>
|
|
176
|
-
{
|
|
177
|
-
|
|
186
|
+
{isClient &&
|
|
187
|
+
createPortal(
|
|
178
188
|
<Toolbar
|
|
179
189
|
pathname={pathname}
|
|
180
190
|
hideDefaultViewButtons
|
|
@@ -208,22 +218,41 @@ const LinksToItem = (props) => {
|
|
|
208
218
|
</>
|
|
209
219
|
</>
|
|
210
220
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
221
|
+
/>,
|
|
222
|
+
document.getElementById('toolbar'),
|
|
223
|
+
)}
|
|
214
224
|
</Container>
|
|
215
225
|
);
|
|
216
226
|
};
|
|
217
227
|
|
|
218
228
|
export const __test__ = LinksToItem;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
229
|
+
|
|
230
|
+
export default asyncConnect([
|
|
231
|
+
{
|
|
232
|
+
key: 'content',
|
|
233
|
+
// Dispatch async/await to make the operation synchronous, otherwise it returns
|
|
234
|
+
// before the promise is resolved
|
|
235
|
+
promise: async ({ location, store: { dispatch } }) => {
|
|
236
|
+
const pathname = getBaseUrl(location.pathname);
|
|
237
|
+
return await dispatch(getContent(pathname));
|
|
227
238
|
},
|
|
228
|
-
|
|
229
|
-
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
key: 'actions',
|
|
242
|
+
// Dispatch async/await to make the operation synchronous, otherwise it returns
|
|
243
|
+
// before the promise is resolved
|
|
244
|
+
promise: async ({ location, store: { dispatch } }) =>
|
|
245
|
+
await dispatch(listActions(getBaseUrl(location.pathname))),
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
key: 'relations',
|
|
249
|
+
// Dispatch async/await to make the operation synchronous, otherwise it returns
|
|
250
|
+
// before the promise is resolved
|
|
251
|
+
promise: async ({ location, store: { dispatch } }) => {
|
|
252
|
+
const pathname = getBaseUrl(location.pathname);
|
|
253
|
+
return await dispatch(
|
|
254
|
+
queryRelations(null, false, pathname, null, [pathname]),
|
|
255
|
+
);
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
])(LinksToItem);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
4
|
import configureMockStore from 'redux-mock-store';
|
|
5
5
|
import thunk from 'redux-thunk';
|
|
@@ -10,9 +10,8 @@ import { __test__ as LinksToItem } from './LinksToItem';
|
|
|
10
10
|
const middlewares = [thunk];
|
|
11
11
|
const mockStore = configureMockStore(middlewares);
|
|
12
12
|
|
|
13
|
-
jest.mock('
|
|
14
|
-
|
|
15
|
-
}));
|
|
13
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
14
|
+
|
|
16
15
|
jest.mock('../Toolbar/More', () => jest.fn(() => <div className="More" />));
|
|
17
16
|
|
|
18
17
|
describe('LinksToItem', () => {
|
|
@@ -99,14 +98,15 @@ describe('LinksToItem', () => {
|
|
|
99
98
|
messages: {},
|
|
100
99
|
},
|
|
101
100
|
});
|
|
102
|
-
const
|
|
101
|
+
const { container } = render(
|
|
103
102
|
<Provider store={store}>
|
|
104
103
|
<MemoryRouter>
|
|
105
104
|
<LinksToItem location={{ pathname: '/page-1/links-to-item' }} />
|
|
105
|
+
<div id="toolbar"></div>
|
|
106
106
|
</MemoryRouter>
|
|
107
107
|
</Provider>,
|
|
108
108
|
);
|
|
109
|
-
|
|
110
|
-
expect(
|
|
109
|
+
|
|
110
|
+
expect(container).toMatchSnapshot();
|
|
111
111
|
});
|
|
112
112
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { Button, Container, Segment, Table } from 'semantic-ui-react';
|
|
3
3
|
import { Helmet } from '@plone/volto/helpers';
|
|
4
4
|
import { flattenToAppURL, getBaseUrl, langmap } from '@plone/volto/helpers';
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from '@plone/volto/actions';
|
|
16
16
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
17
17
|
import { useSelector, useDispatch } from 'react-redux';
|
|
18
|
-
import {
|
|
18
|
+
import { createPortal } from 'react-dom';
|
|
19
19
|
import { toast } from 'react-toastify';
|
|
20
20
|
|
|
21
21
|
import addSVG from '@plone/volto/icons/add.svg';
|
|
@@ -64,6 +64,12 @@ const ManageTranslations = (props) => {
|
|
|
64
64
|
const content = useSelector((state) => state.content.data);
|
|
65
65
|
const dispatch = useDispatch();
|
|
66
66
|
|
|
67
|
+
const [isClient, setIsClient] = useState(false);
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
setIsClient(true);
|
|
71
|
+
}, []);
|
|
72
|
+
|
|
67
73
|
const { isObjectBrowserOpen, openObjectBrowser } = props;
|
|
68
74
|
|
|
69
75
|
const currentSelectedItem = React.useRef(null);
|
|
@@ -269,8 +275,8 @@ const ManageTranslations = (props) => {
|
|
|
269
275
|
</Table.Body>
|
|
270
276
|
</Table>
|
|
271
277
|
)}
|
|
272
|
-
{
|
|
273
|
-
|
|
278
|
+
{isClient &&
|
|
279
|
+
createPortal(
|
|
274
280
|
<Toolbar
|
|
275
281
|
pathname={pathname}
|
|
276
282
|
hideDefaultViewButtons
|
|
@@ -284,9 +290,9 @@ const ManageTranslations = (props) => {
|
|
|
284
290
|
/>
|
|
285
291
|
</Link>
|
|
286
292
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
293
|
+
/>,
|
|
294
|
+
document.getElementById('toolbar'),
|
|
295
|
+
)}
|
|
290
296
|
</Segment.Group>
|
|
291
297
|
</Container>
|
|
292
298
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
5
|
import { MemoryRouter } from 'react-router-dom';
|
|
@@ -12,9 +12,7 @@ beforeAll(() => {
|
|
|
12
12
|
config.settings.supportedLanguages = ['de', 'es'];
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
jest.mock('
|
|
16
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
17
|
-
}));
|
|
15
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
18
16
|
|
|
19
17
|
const mockStore = configureStore();
|
|
20
18
|
|
|
@@ -36,7 +34,7 @@ describe('ManageTranslations', () => {
|
|
|
36
34
|
},
|
|
37
35
|
},
|
|
38
36
|
});
|
|
39
|
-
const
|
|
37
|
+
const { container } = render(
|
|
40
38
|
<Provider store={store}>
|
|
41
39
|
<MemoryRouter>
|
|
42
40
|
<ManageTranslations
|
|
@@ -48,10 +46,11 @@ describe('ManageTranslations', () => {
|
|
|
48
46
|
},
|
|
49
47
|
}}
|
|
50
48
|
/>
|
|
49
|
+
<div id="toolbar"></div>
|
|
51
50
|
</MemoryRouter>
|
|
52
51
|
</Provider>,
|
|
53
52
|
);
|
|
54
|
-
|
|
55
|
-
expect(
|
|
53
|
+
|
|
54
|
+
expect(container).toMatchSnapshot();
|
|
56
55
|
});
|
|
57
56
|
});
|
|
@@ -9,7 +9,7 @@ import { Helmet } from '@plone/volto/helpers';
|
|
|
9
9
|
import { connect } from 'react-redux';
|
|
10
10
|
import { compose } from 'redux';
|
|
11
11
|
import { Link, withRouter } from 'react-router-dom';
|
|
12
|
-
import {
|
|
12
|
+
import { createPortal } from 'react-dom';
|
|
13
13
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
14
14
|
import { Container } from 'semantic-ui-react';
|
|
15
15
|
import jwtDecode from 'jwt-decode';
|
|
@@ -195,8 +195,8 @@ class ChangePassword extends Component {
|
|
|
195
195
|
onCancel={this.onCancel}
|
|
196
196
|
loading={this.props.loading}
|
|
197
197
|
/>
|
|
198
|
-
{this.state.isClient &&
|
|
199
|
-
|
|
198
|
+
{this.state.isClient &&
|
|
199
|
+
createPortal(
|
|
200
200
|
<Toolbar
|
|
201
201
|
pathname={this.props.pathname}
|
|
202
202
|
hideDefaultViewButtons
|
|
@@ -213,9 +213,9 @@ class ChangePassword extends Component {
|
|
|
213
213
|
/>
|
|
214
214
|
</Link>
|
|
215
215
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
/>,
|
|
217
|
+
document.getElementById('toolbar'),
|
|
218
|
+
)}
|
|
219
219
|
</Container>
|
|
220
220
|
);
|
|
221
221
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
4
|
import configureStore from 'redux-mock-store';
|
|
5
5
|
import jwt from 'jsonwebtoken';
|
|
@@ -9,9 +9,7 @@ import ChangePassword from './ChangePassword';
|
|
|
9
9
|
|
|
10
10
|
const mockStore = configureStore();
|
|
11
11
|
|
|
12
|
-
jest.mock('
|
|
13
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
14
|
-
}));
|
|
12
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
15
13
|
|
|
16
14
|
describe('ChangePassword', () => {
|
|
17
15
|
it('renders a change password component', () => {
|
|
@@ -28,15 +26,23 @@ describe('ChangePassword', () => {
|
|
|
28
26
|
loading: false,
|
|
29
27
|
},
|
|
30
28
|
},
|
|
29
|
+
content: {
|
|
30
|
+
data: {},
|
|
31
|
+
create: {
|
|
32
|
+
loading: false,
|
|
33
|
+
loaded: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
31
36
|
});
|
|
32
|
-
const
|
|
37
|
+
const { container } = render(
|
|
33
38
|
<Provider store={store}>
|
|
34
39
|
<MemoryRouter>
|
|
35
40
|
<ChangePassword location={{ pathname: '/blog' }} />
|
|
41
|
+
<div id="toolbar"></div>
|
|
36
42
|
</MemoryRouter>
|
|
37
43
|
</Provider>,
|
|
38
44
|
);
|
|
39
|
-
|
|
40
|
-
expect(
|
|
45
|
+
|
|
46
|
+
expect(container).toMatchSnapshot();
|
|
41
47
|
});
|
|
42
48
|
});
|
|
@@ -18,9 +18,7 @@ const userSchema = {
|
|
|
18
18
|
loading: false,
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
jest.mock('
|
|
22
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
23
|
-
}));
|
|
21
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
24
22
|
|
|
25
23
|
describe('PersonalInformation', () => {
|
|
26
24
|
it('renders a personal information component', async () => {
|
|
@@ -42,6 +40,13 @@ describe('PersonalInformation', () => {
|
|
|
42
40
|
locale: 'en',
|
|
43
41
|
messages: {},
|
|
44
42
|
},
|
|
43
|
+
content: {
|
|
44
|
+
data: {},
|
|
45
|
+
create: {
|
|
46
|
+
loading: false,
|
|
47
|
+
loaded: true,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
45
50
|
});
|
|
46
51
|
const component = renderer.create(
|
|
47
52
|
<Provider store={store}>
|
|
@@ -76,6 +81,13 @@ describe('PersonalInformation', () => {
|
|
|
76
81
|
locale: 'en',
|
|
77
82
|
messages: {},
|
|
78
83
|
},
|
|
84
|
+
content: {
|
|
85
|
+
data: {},
|
|
86
|
+
create: {
|
|
87
|
+
loading: false,
|
|
88
|
+
loaded: true,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
79
91
|
});
|
|
80
92
|
const component = renderer.create(
|
|
81
93
|
<Provider store={store}>
|
|
@@ -8,9 +8,7 @@ import PersonalPreferences from './PersonalPreferences';
|
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
|
|
11
|
-
jest.mock('
|
|
12
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
13
|
-
}));
|
|
11
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
14
12
|
|
|
15
13
|
jest.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
16
14
|
beforeAll(
|
|
@@ -31,6 +29,13 @@ describe('PersonalPreferences', () => {
|
|
|
31
29
|
itemsTotal: 1,
|
|
32
30
|
},
|
|
33
31
|
},
|
|
32
|
+
content: {
|
|
33
|
+
data: {},
|
|
34
|
+
create: {
|
|
35
|
+
loading: false,
|
|
36
|
+
loaded: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
34
39
|
});
|
|
35
40
|
const { container } = render(
|
|
36
41
|
<Provider store={store}>
|
|
@@ -8,7 +8,7 @@ import { Helmet } from '@plone/volto/helpers';
|
|
|
8
8
|
import { connect } from 'react-redux';
|
|
9
9
|
import { compose } from 'redux';
|
|
10
10
|
import { Link } from 'react-router-dom';
|
|
11
|
-
import {
|
|
11
|
+
import { createPortal } from 'react-dom';
|
|
12
12
|
import {
|
|
13
13
|
Button,
|
|
14
14
|
Checkbox,
|
|
@@ -484,8 +484,8 @@ class Rules extends Component {
|
|
|
484
484
|
</Button>
|
|
485
485
|
</React.Fragment>
|
|
486
486
|
)}
|
|
487
|
-
{this.state.isClient &&
|
|
488
|
-
|
|
487
|
+
{this.state.isClient &&
|
|
488
|
+
createPortal(
|
|
489
489
|
<Toolbar
|
|
490
490
|
pathname={this.props.pathname}
|
|
491
491
|
hideDefaultViewButtons
|
|
@@ -502,9 +502,9 @@ class Rules extends Component {
|
|
|
502
502
|
/>
|
|
503
503
|
</Link>
|
|
504
504
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
505
|
+
/>,
|
|
506
|
+
document.getElementById('toolbar'),
|
|
507
|
+
)}
|
|
508
508
|
</Container>
|
|
509
509
|
);
|
|
510
510
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
4
|
import configureMockStore from 'redux-mock-store';
|
|
5
5
|
import thunk from 'redux-thunk';
|
|
@@ -9,9 +9,8 @@ import Rules from './Rules';
|
|
|
9
9
|
const middlewares = [thunk];
|
|
10
10
|
const mockStore = configureMockStore(middlewares);
|
|
11
11
|
|
|
12
|
-
jest.mock('
|
|
13
|
-
|
|
14
|
-
}));
|
|
12
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
13
|
+
|
|
15
14
|
jest.mock('../Toolbar/More', () => jest.fn(() => <div className="More" />));
|
|
16
15
|
|
|
17
16
|
describe('Rules', () => {
|
|
@@ -65,12 +64,13 @@ describe('Rules', () => {
|
|
|
65
64
|
messages: {},
|
|
66
65
|
},
|
|
67
66
|
});
|
|
68
|
-
const
|
|
67
|
+
const { container } = render(
|
|
69
68
|
<Provider store={store}>
|
|
70
69
|
<Rules location={{ pathname: '/blog/rules' }} />
|
|
70
|
+
<div id="toolbar"></div>
|
|
71
71
|
</Provider>,
|
|
72
72
|
);
|
|
73
|
-
|
|
74
|
-
expect(
|
|
73
|
+
|
|
74
|
+
expect(container).toMatchSnapshot();
|
|
75
75
|
});
|
|
76
76
|
});
|
|
@@ -10,7 +10,7 @@ import { connect } from 'react-redux';
|
|
|
10
10
|
import { compose } from 'redux';
|
|
11
11
|
import { Link, withRouter } from 'react-router-dom';
|
|
12
12
|
import { find, isEqual, map } from 'lodash';
|
|
13
|
-
import {
|
|
13
|
+
import { createPortal } from 'react-dom';
|
|
14
14
|
import {
|
|
15
15
|
Button,
|
|
16
16
|
Checkbox,
|
|
@@ -505,8 +505,8 @@ class SharingComponent extends Component {
|
|
|
505
505
|
</Form>
|
|
506
506
|
</Plug>
|
|
507
507
|
</Segment.Group>
|
|
508
|
-
{this.state.isClient &&
|
|
509
|
-
|
|
508
|
+
{this.state.isClient &&
|
|
509
|
+
createPortal(
|
|
510
510
|
<Toolbar
|
|
511
511
|
pathname={this.props.pathname}
|
|
512
512
|
hideDefaultViewButtons
|
|
@@ -523,9 +523,9 @@ class SharingComponent extends Component {
|
|
|
523
523
|
/>
|
|
524
524
|
</Link>
|
|
525
525
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
526
|
+
/>,
|
|
527
|
+
document.getElementById('toolbar'),
|
|
528
|
+
)}
|
|
529
529
|
</Container>
|
|
530
530
|
);
|
|
531
531
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
5
|
import jwt from 'jsonwebtoken';
|
|
@@ -10,9 +10,7 @@ import Sharing from './Sharing';
|
|
|
10
10
|
|
|
11
11
|
const mockStore = configureStore();
|
|
12
12
|
|
|
13
|
-
jest.mock('
|
|
14
|
-
Portal: jest.fn(() => <div id="Portal" />),
|
|
15
|
-
}));
|
|
13
|
+
jest.mock('../Toolbar/Toolbar', () => jest.fn(() => <div id="Portal" />));
|
|
16
14
|
|
|
17
15
|
describe('Sharing', () => {
|
|
18
16
|
it('renders a sharing component', () => {
|
|
@@ -57,16 +55,18 @@ describe('Sharing', () => {
|
|
|
57
55
|
messages: {},
|
|
58
56
|
},
|
|
59
57
|
});
|
|
60
|
-
|
|
58
|
+
|
|
59
|
+
const { container } = render(
|
|
61
60
|
<Provider store={store}>
|
|
62
61
|
<PluggablesProvider>
|
|
63
62
|
<MemoryRouter>
|
|
64
63
|
<Sharing location={{ pathname: '/blog' }} />
|
|
64
|
+
<div id="toolbar"></div>
|
|
65
65
|
</MemoryRouter>
|
|
66
66
|
</PluggablesProvider>
|
|
67
67
|
</Provider>,
|
|
68
68
|
);
|
|
69
|
-
|
|
70
|
-
expect(
|
|
69
|
+
|
|
70
|
+
expect(container).toMatchSnapshot();
|
|
71
71
|
});
|
|
72
72
|
});
|