@plone/volto 19.0.0-alpha.9 → 19.1.0
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 +26 -15
- package/AGENTS.md +47 -0
- package/CHANGELOG.md +543 -12
- package/README.md +22 -19
- package/babel.js +1 -9
- 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 +5516 -0
- package/locales/af.json +1 -1
- package/locales/ar/LC_MESSAGES/volto.po +5516 -0
- package/locales/ar.json +1 -1
- package/locales/bg/LC_MESSAGES/volto.po +5516 -0
- package/locales/bg.json +1 -1
- package/locales/bn/LC_MESSAGES/volto.po +5516 -0
- package/locales/bn.json +1 -1
- package/locales/ca/LC_MESSAGES/volto.po +551 -359
- package/locales/ca.json +1 -1
- package/locales/cs/LC_MESSAGES/volto.po +5516 -0
- package/locales/cs.json +1 -1
- package/locales/cy/LC_MESSAGES/volto.po +5516 -0
- package/locales/cy.json +1 -1
- package/locales/da/LC_MESSAGES/volto.po +5516 -0
- package/locales/da.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +222 -29
- package/locales/de.json +1 -1
- package/locales/el/LC_MESSAGES/volto.po +5516 -0
- package/locales/el.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +211 -15
- package/locales/en.json +1 -1
- package/locales/en_AU/LC_MESSAGES/volto.po +5516 -0
- package/locales/en_AU.json +1 -1
- package/locales/en_GB/LC_MESSAGES/volto.po +5516 -0
- package/locales/en_GB.json +1 -1
- package/locales/eo/LC_MESSAGES/volto.po +5516 -0
- package/locales/eo.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +336 -145
- package/locales/es.json +1 -1
- package/locales/et/LC_MESSAGES/volto.po +5516 -0
- package/locales/et.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +413 -222
- package/locales/eu.json +1 -1
- package/locales/fa/LC_MESSAGES/volto.po +5516 -0
- package/locales/fa.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +212 -20
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +369 -178
- package/locales/fr.json +1 -1
- package/locales/fu/LC_MESSAGES/volto.po +5516 -0
- package/locales/fu.json +1 -1
- package/locales/gl/LC_MESSAGES/volto.po +5516 -0
- package/locales/gl.json +1 -1
- package/locales/he/LC_MESSAGES/volto.po +5516 -0
- package/locales/he.json +1 -1
- package/locales/hi/LC_MESSAGES/volto.po +220 -23
- package/locales/hi.json +1 -1
- package/locales/hr/LC_MESSAGES/volto.po +5516 -0
- package/locales/hr.json +1 -1
- package/locales/hu/LC_MESSAGES/volto.po +5516 -0
- package/locales/hu.json +1 -1
- package/locales/hy/LC_MESSAGES/volto.po +5516 -0
- package/locales/hy.json +1 -1
- package/locales/id/LC_MESSAGES/volto.po +5516 -0
- package/locales/id.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +236 -39
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +254 -61
- package/locales/ja.json +1 -1
- package/locales/ka/LC_MESSAGES/volto.po +5516 -0
- package/locales/ka.json +1 -1
- package/locales/kn/LC_MESSAGES/volto.po +5516 -0
- package/locales/kn.json +1 -1
- package/locales/ko/LC_MESSAGES/volto.po +5516 -0
- package/locales/ko.json +1 -1
- package/locales/lt/LC_MESSAGES/volto.po +5516 -0
- package/locales/lt.json +1 -1
- package/locales/lv/LC_MESSAGES/volto.po +5516 -0
- package/locales/lv.json +1 -1
- package/locales/mi/LC_MESSAGES/volto.po +5516 -0
- package/locales/mi.json +1 -1
- package/locales/mk/LC_MESSAGES/volto.po +5516 -0
- package/locales/mk.json +1 -1
- package/locales/my/LC_MESSAGES/volto.po +5516 -0
- package/locales/my.json +1 -1
- package/locales/nb_NO/LC_MESSAGES/volto.po +5516 -0
- package/locales/nb_NO.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +264 -71
- package/locales/nl.json +1 -1
- package/locales/nn/LC_MESSAGES/volto.po +5516 -0
- package/locales/nn.json +1 -1
- package/locales/pl/LC_MESSAGES/volto.po +5516 -0
- package/locales/pl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +862 -670
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +216 -25
- package/locales/pt_BR.json +1 -1
- package/locales/rm/LC_MESSAGES/volto.po +5516 -0
- package/locales/rm.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +248 -57
- package/locales/ro.json +1 -1
- package/locales/ru/LC_MESSAGES/volto.po +211 -19
- package/locales/ru.json +1 -1
- package/locales/sk/LC_MESSAGES/volto.po +5516 -0
- package/locales/sk.json +1 -1
- package/locales/sl/LC_MESSAGES/volto.po +5516 -0
- package/locales/sl.json +1 -1
- package/locales/sm/LC_MESSAGES/volto.po +5516 -0
- package/locales/sm.json +1 -1
- package/locales/sq/LC_MESSAGES/volto.po +5516 -0
- package/locales/sq.json +1 -1
- package/locales/sr/LC_MESSAGES/volto.po +5516 -0
- package/locales/sr.json +1 -1
- package/locales/sr@cyrl/LC_MESSAGES/volto.po +5516 -0
- package/locales/sr@cyrl.json +1 -1
- package/locales/sr@latn/LC_MESSAGES/volto.po +5516 -0
- package/locales/sr@latn.json +1 -1
- package/locales/sv/LC_MESSAGES/volto.po +5516 -0
- package/locales/sv.json +1 -1
- package/locales/ta/LC_MESSAGES/volto.po +5516 -0
- package/locales/ta.json +1 -1
- package/locales/te/LC_MESSAGES/volto.po +5516 -0
- package/locales/te.json +1 -1
- package/locales/th/LC_MESSAGES/volto.po +5516 -0
- package/locales/th.json +1 -1
- package/locales/to/LC_MESSAGES/volto.po +5516 -0
- package/locales/to.json +1 -1
- package/locales/tr/LC_MESSAGES/volto.po +5516 -0
- package/locales/tr.json +1 -1
- package/locales/uk/LC_MESSAGES/volto.po +5516 -0
- package/locales/uk.json +1 -1
- package/locales/vi/LC_MESSAGES/volto.po +5516 -0
- package/locales/vi.json +1 -1
- package/locales/volto.pot +205 -14
- package/locales/zh_CN/LC_MESSAGES/volto.po +211 -19
- package/locales/zh_CN.json +1 -1
- package/locales/zh_Hant/LC_MESSAGES/volto.po +5516 -0
- package/locales/zh_Hant.json +1 -1
- package/locales/zh_Hant_HK/LC_MESSAGES/volto.po +5516 -0
- package/locales/zh_Hant_HK.json +1 -1
- package/package.json +71 -149
- package/razzle.config.js +16 -25
- package/src/actions/blockTypes/blockTypes.ts +24 -0
- package/src/actions/controlpanels/controlpanels.js +7 -12
- package/src/actions/controlpanels/controlpanels.test.js +2 -3
- package/src/components/manage/Actions/Actions.test.jsx +1 -5
- package/src/components/manage/Add/Add.jsx +15 -10
- package/src/components/manage/Add/Add.test.jsx +10 -3
- package/src/components/manage/Aliases/Aliases.test.jsx +5 -2
- package/src/components/manage/BlockChooser/BlockChooser.jsx +8 -10
- 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/Edit.jsx +19 -10
- package/src/components/manage/Blocks/Block/Order/Item.jsx +33 -14
- 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/ImageSidebar.test.jsx +2 -5
- 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/ListingBody.jsx +4 -0
- package/src/components/manage/Blocks/Maps/Body.jsx +37 -0
- package/src/components/manage/Blocks/Maps/Edit.jsx +6 -21
- package/src/components/manage/Blocks/Maps/MapsSidebar.test.jsx +1 -5
- package/src/components/manage/Blocks/Maps/View.jsx +16 -25
- 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/DefaultBody.jsx +10 -2
- 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 +20 -2
- 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 +854 -747
- package/src/components/manage/Contents/Contents.test.jsx +9 -10
- package/src/components/manage/Contents/ContentsBreadcrumbs.jsx +4 -3
- package/src/components/manage/Contents/ContentsIndexHeader.jsx +47 -81
- package/src/components/manage/Contents/ContentsIndexHeader.test.jsx +10 -3
- package/src/components/manage/Contents/ContentsItem.jsx +226 -278
- package/src/components/manage/Contents/ContentsItem.test.jsx +10 -6
- 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 +339 -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/AddonsControlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Aliases.test.jsx +8 -9
- package/src/components/manage/Controlpanels/BlockType.tsx +165 -0
- package/src/components/manage/Controlpanels/BlockTypes.tsx +145 -0
- package/src/components/manage/Controlpanels/ContentType.jsx +131 -222
- package/src/components/manage/Controlpanels/ContentType.test.jsx +13 -14
- package/src/components/manage/Controlpanels/ContentTypeLayout.test.jsx +12 -9
- package/src/components/manage/Controlpanels/ContentTypeSchema.jsx +1 -1
- package/src/components/manage/Controlpanels/ContentTypes.jsx +9 -2
- package/src/components/manage/Controlpanels/ContentTypes.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Controlpanel.jsx +122 -218
- package/src/components/manage/Controlpanels/Controlpanel.test.jsx +8 -33
- package/src/components/manage/Controlpanels/Controlpanels.jsx +28 -5
- package/src/components/manage/Controlpanels/Controlpanels.test.jsx +23 -8
- package/src/components/manage/Controlpanels/DatabaseInformation.jsx +9 -0
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/ModerateComments.jsx +8 -0
- package/src/components/manage/Controlpanels/ModerateComments.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Relations/Relations.jsx +1 -1
- package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +8 -9
- package/src/components/manage/Controlpanels/Rules/ConfigureRule.test.jsx +9 -6
- package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +8 -9
- package/src/components/manage/Controlpanels/Rules/Rules.test.jsx +7 -4
- package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +8 -9
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.test.jsx +10 -4
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +628 -631
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.ssr.test.jsx +624 -0
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +70 -10
- package/src/components/manage/Controlpanels/VersionOverview.jsx +19 -6
- package/src/components/manage/Delete/Delete.test.jsx +13 -8
- package/src/components/manage/Diff/Diff.jsx +201 -298
- package/src/components/manage/Diff/Diff.test.jsx +8 -10
- 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 +12 -11
- package/src/components/manage/Form/BlockDataForm.test.jsx +1 -5
- package/src/components/manage/Form/Field.jsx +1 -69
- package/src/components/manage/Form/Form.jsx +17 -4
- package/src/components/manage/Form/Form.test.jsx +130 -5
- package/src/components/manage/Form/InlineForm.test.jsx +1 -5
- package/src/components/manage/Form/ModalForm.jsx +175 -97
- package/src/components/manage/Form/ModalForm.test.jsx +27 -5
- package/src/components/manage/Form/__mocks__/index.tsx +9 -27
- package/src/components/manage/History/History.jsx +209 -300
- package/src/components/manage/History/History.test.jsx +20 -9
- package/src/components/manage/LinksToItem/LinksToItem.test.jsx +7 -4
- 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/ManageTranslations.test.jsx +15 -12
- package/src/components/manage/Multilingual/TranslationObject.jsx +11 -8
- package/src/components/manage/Preferences/ChangePassword.test.jsx +8 -9
- package/src/components/manage/Preferences/PersonalPreferences.jsx +8 -5
- package/src/components/manage/Preferences/PersonalPreferences.test.jsx +10 -23
- package/src/components/manage/Rules/Rules.test.jsx +5 -2
- package/src/components/manage/Sharing/Sharing.jsx +21 -15
- package/src/components/manage/Sharing/Sharing.test.jsx +9 -6
- package/src/components/manage/Sidebar/ObjectBrowser.jsx +10 -0
- package/src/components/manage/Sidebar/ObjectBrowserBody.jsx +25 -5
- package/src/components/manage/Sidebar/ObjectBrowserBody.test.jsx +52 -0
- package/src/components/manage/Sidebar/Sidebar.jsx +2 -0
- package/src/components/manage/Sidebar/Sidebar.test.jsx +4 -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.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.test.jsx +15 -0
- package/src/components/manage/Toolbar/Toolbar.jsx +109 -12
- package/src/components/manage/Toolbar/Toolbar.test.jsx +15 -10
- 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 +1 -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.jsx +111 -88
- package/src/components/manage/Widgets/ArrayWidget.test.jsx +1 -12
- 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 +98 -54
- package/src/components/manage/Widgets/DatetimeWidget.test.jsx +56 -6
- package/src/components/manage/Widgets/FileWidget.jsx +7 -0
- package/src/components/manage/Widgets/FormFieldWrapper.jsx +143 -163
- package/src/components/manage/Widgets/ImageWidget.jsx +18 -5
- package/src/components/manage/Widgets/ObjectBrowserWidget.jsx +6 -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/QuerystringWidget.test.jsx +3 -1
- 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/RecurrenceWidget/WeekdayOfTheMonthIndexField.jsx +56 -50
- package/src/components/manage/Widgets/RegistryImageWidget.jsx +1 -1
- package/src/components/manage/Widgets/RegistryImageWidget.test.jsx +1 -0
- 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.test.jsx +1 -6
- package/src/components/manage/Widgets/SelectStyling.jsx +52 -20
- 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/TextWidget.jsx +4 -0
- package/src/components/manage/Widgets/TimeWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/TokenWidget.jsx +142 -186
- package/src/components/manage/Widgets/TokenWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/UrlWidget.jsx +47 -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/App/App.test.jsx +13 -10
- 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 +14 -13
- package/src/components/theme/Image/Image.jsx +14 -5
- 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 +3 -3
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx +42 -12
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.test.jsx +6 -3
- package/src/components/theme/PasswordReset/PasswordReset.jsx +108 -191
- package/src/components/theme/PasswordReset/RequestPasswordReset.test.jsx +1 -5
- package/src/components/theme/Register/Register.test.jsx +1 -5
- package/src/components/theme/Search/Search.jsx +230 -327
- package/src/components/theme/Search/Search.test.jsx +14 -14
- package/src/components/theme/Sitemap/Sitemap.jsx +22 -30
- package/src/components/theme/Sitemap/Sitemap.stories.jsx +82 -0
- package/src/components/theme/Sitemap/Sitemap.test.jsx +18 -0
- package/src/components/theme/SlotRenderer/SlotRenderer.tsx +12 -6
- package/src/components/theme/Unauthorized/Unauthorized.jsx +27 -24
- package/src/components/theme/Unauthorized/Unauthorized.test.jsx +31 -2
- 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/View/View.test.jsx +37 -24
- package/src/components/theme/Widgets/DateWidget.jsx +4 -5
- package/src/components/theme/Widgets/DatetimeWidget.jsx +4 -5
- package/src/components/theme/Widgets/ImageWidget.test.jsx +31 -11
- package/src/components/theme/Widgets/RichTextWidget.jsx +1 -1
- package/src/config/Blocks.jsx +3 -0
- package/src/config/ControlPanels.js +2 -0
- package/src/config/Loadables.jsx +1 -5
- package/src/config/Widgets.jsx +7 -0
- package/src/config/index.js +10 -1
- 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 +3 -1
- 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/Api.js +2 -2
- 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/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/I18n/I18n.test.ts +44 -0
- package/src/helpers/I18n/I18n.ts +31 -0
- package/src/helpers/Loadable/__mocks__/Loadable.jsx +7 -22
- package/src/helpers/MessageLabels/MessageLabels.js +5 -0
- package/src/helpers/Robots/Robots.js +1 -1
- package/src/helpers/Robots/Robots.test.js +34 -0
- package/src/helpers/Url/Url.js +1 -0
- package/src/helpers/Utils/Date.js +26 -1
- package/src/helpers/Utils/Date.test.js +237 -0
- package/src/helpers/Utils/Utils.jsx +17 -0
- package/src/helpers/Utils/Utils.test.jsx +39 -0
- package/src/helpers/Utils/withSaveAsDraft.jsx +33 -9
- package/src/helpers/index.js +1 -0
- package/src/hooks/user/useUser.js +1 -1
- package/src/internalChecks.test.ts +11 -0
- package/src/middleware/api.js +14 -5
- 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 +10 -0
- package/src/server.jsx +14 -6
- package/src/start-client.jsx +21 -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/default/globals/site.variables +3 -3
- package/theme/themes/pastanaga/collections/form.overrides +22 -1
- package/theme/themes/pastanaga/elements/button.overrides +30 -3
- package/theme/themes/pastanaga/elements/segment.variables +1 -4
- package/theme/themes/pastanaga/extras/block-types.less +17 -0
- package/theme/themes/pastanaga/extras/contents.less +63 -4
- package/theme/themes/pastanaga/extras/main.less +16 -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/theme/themes/pastanaga/globals/site.variables +0 -3
- package/tsconfig.declarations.json +1 -1
- package/tsconfig.json +1 -1
- 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/Maps/Body.d.ts +9 -0
- package/types/components/manage/Blocks/Maps/View.d.ts +1 -1
- 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/Contents.d.ts +1 -1
- package/types/components/manage/Contents/ContentsIndexHeader.d.ts +6 -11
- package/types/components/manage/Contents/ContentsItem.d.ts +3 -10
- 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/ContentType.d.ts +2 -2
- package/types/components/manage/Controlpanels/Controlpanel.d.ts +2 -5
- package/types/components/manage/Controlpanels/Relations/RelationsMatrix.d.ts +1 -1
- package/types/components/manage/Controlpanels/Users/UsersControlpanel.ssr.test.d.ts +1 -0
- package/types/components/manage/Controlpanels/VersionOverview.d.ts +2 -1
- package/types/components/manage/Controlpanels/index.d.ts +3 -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/ObjectBrowserBody.test.d.ts +1 -0
- 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 +1 -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/WeekdayOfTheMonthIndexField.d.ts +22 -5
- package/types/components/manage/Widgets/SelectStyling.d.ts +1 -0
- 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/PasswordReset/PasswordReset.d.ts +6 -2
- package/types/components/theme/Search/Search.d.ts +1 -1
- 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/Extensions/withBlockSchemaEnhancer.d.ts +4 -5
- package/types/helpers/FormValidation/validators.d.ts +18 -1
- package/types/helpers/I18n/I18n.d.ts +20 -0
- package/types/helpers/Loadable/__mocks__/Loadable.d.ts +2 -2
- package/types/helpers/MessageLabels/MessageLabels.d.ts +100 -94
- package/types/helpers/Utils/Utils.d.ts +1 -0
- package/types/helpers/index.d.ts +1 -0
- package/types/reducers/blockTypes/blockTypes.d.ts +16 -0
- package/types/reducers/index.d.ts +2 -0
- package/types/routes.d.ts +7 -5
- 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/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/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/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
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
* History component.
|
|
3
|
-
* @module components/manage/History/History
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { Component } from 'react';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { useEffect, useMemo, useCallback } from 'react';
|
|
8
2
|
import Helmet from '@plone/volto/helpers/Helmet/Helmet';
|
|
9
|
-
import { Link } from 'react-router-dom';
|
|
10
|
-
import {
|
|
3
|
+
import { Link, useLocation } from 'react-router-dom';
|
|
4
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
11
5
|
import { compose } from 'redux';
|
|
12
6
|
import {
|
|
13
7
|
Container as SemanticContainer,
|
|
@@ -21,7 +15,7 @@ import map from 'lodash/map';
|
|
|
21
15
|
import reverse from 'lodash/reverse';
|
|
22
16
|
import find from 'lodash/find';
|
|
23
17
|
import { createPortal } from 'react-dom';
|
|
24
|
-
import { FormattedMessage, defineMessages,
|
|
18
|
+
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
|
25
19
|
import { asyncConnect } from '@plone/volto/helpers/AsyncConnect';
|
|
26
20
|
|
|
27
21
|
import FormattedDate from '@plone/volto/components/theme/FormattedDate/FormattedDate';
|
|
@@ -35,6 +29,7 @@ import {
|
|
|
35
29
|
} from '@plone/volto/actions/history/history';
|
|
36
30
|
import { listActions } from '@plone/volto/actions/actions/actions';
|
|
37
31
|
import { getBaseUrl } from '@plone/volto/helpers/Url/Url';
|
|
32
|
+
import { useClient } from '@plone/volto/hooks/client/useClient';
|
|
38
33
|
import config from '@plone/volto/registry';
|
|
39
34
|
|
|
40
35
|
import backSVG from '@plone/volto/icons/back.svg';
|
|
@@ -50,321 +45,235 @@ const messages = defineMessages({
|
|
|
50
45
|
},
|
|
51
46
|
});
|
|
52
47
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
* Property types.
|
|
61
|
-
* @property {Object} propTypes Property types.
|
|
62
|
-
* @static
|
|
63
|
-
*/
|
|
64
|
-
static propTypes = {
|
|
65
|
-
getHistory: PropTypes.func.isRequired,
|
|
66
|
-
revertHistory: PropTypes.func.isRequired,
|
|
67
|
-
revertRequest: PropTypes.shape({
|
|
68
|
-
loaded: PropTypes.bool,
|
|
69
|
-
loading: PropTypes.bool,
|
|
70
|
-
}).isRequired,
|
|
71
|
-
pathname: PropTypes.string.isRequired,
|
|
72
|
-
entries: PropTypes.arrayOf(
|
|
73
|
-
PropTypes.shape({
|
|
74
|
-
transition_title: PropTypes.string,
|
|
75
|
-
type: PropTypes.string,
|
|
76
|
-
action: PropTypes.string,
|
|
77
|
-
state_title: PropTypes.string,
|
|
78
|
-
time: PropTypes.string,
|
|
79
|
-
comments: PropTypes.string,
|
|
80
|
-
actor: PropTypes.shape({ fullname: PropTypes.string }),
|
|
81
|
-
}),
|
|
82
|
-
).isRequired,
|
|
83
|
-
title: PropTypes.string.isRequired,
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Constructor
|
|
88
|
-
* @method constructor
|
|
89
|
-
* @param {Object} props Component properties
|
|
90
|
-
* @constructs Workflow
|
|
91
|
-
*/
|
|
92
|
-
constructor(props) {
|
|
93
|
-
super(props);
|
|
94
|
-
this.onRevert = this.onRevert.bind(this);
|
|
95
|
-
this.state = { isClient: false };
|
|
96
|
-
}
|
|
48
|
+
const History = (props) => {
|
|
49
|
+
const { staticContext } = props;
|
|
50
|
+
const isClient = useClient();
|
|
51
|
+
const dispatch = useDispatch();
|
|
52
|
+
const location = useLocation();
|
|
53
|
+
const pathname = location.pathname;
|
|
54
|
+
const intl = useIntl();
|
|
97
55
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
*/
|
|
103
|
-
componentDidMount() {
|
|
104
|
-
this.props.getHistory(getBaseUrl(this.props.pathname));
|
|
105
|
-
this.setState({ isClient: true });
|
|
106
|
-
}
|
|
56
|
+
const objectActions = useSelector((state) => state.actions.actions.object);
|
|
57
|
+
const token = useSelector((state) => state.userSession.token);
|
|
58
|
+
const entries = useSelector((state) => state.history.entries);
|
|
59
|
+
const title = useSelector((state) => state.content.data?.title);
|
|
107
60
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
}
|
|
61
|
+
const onRevert = useCallback(
|
|
62
|
+
(event, { value }) => {
|
|
63
|
+
const baseUrl = getBaseUrl(pathname);
|
|
64
|
+
dispatch(revertHistory(baseUrl, value)).then(() => {
|
|
65
|
+
dispatch(getHistory(baseUrl));
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
[dispatch, pathname],
|
|
69
|
+
);
|
|
119
70
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
* @param {object} event Event object
|
|
124
|
-
* @param {number} value Value
|
|
125
|
-
* @returns {undefined}
|
|
126
|
-
*/
|
|
127
|
-
onRevert(event, { value }) {
|
|
128
|
-
this.props.revertHistory(getBaseUrl(this.props.pathname), value);
|
|
129
|
-
}
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
dispatch(getHistory(getBaseUrl(pathname)));
|
|
73
|
+
}, [dispatch, pathname]);
|
|
130
74
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
entries[x].prev_state_title = title;
|
|
138
|
-
title = entries[x].state_title || title;
|
|
75
|
+
const processedEntries = useMemo(() => {
|
|
76
|
+
const result = reverse(concat(entries));
|
|
77
|
+
let title = result.length > 0 ? result[0].state_title : '';
|
|
78
|
+
for (let x = 1; x < result.length; x += 1) {
|
|
79
|
+
result[x].prev_state_title = title;
|
|
80
|
+
title = result[x].state_title || title;
|
|
139
81
|
}
|
|
140
|
-
|
|
141
|
-
reverse(entries);
|
|
82
|
+
reverse(result);
|
|
142
83
|
|
|
143
|
-
|
|
144
|
-
const current_version = find(entries, (item) => item.type === 'versioning');
|
|
84
|
+
const current_version = find(result, (item) => item.type === 'versioning');
|
|
145
85
|
if (current_version) {
|
|
146
86
|
current_version.is_current = true;
|
|
147
87
|
}
|
|
148
|
-
return
|
|
149
|
-
};
|
|
88
|
+
return result;
|
|
89
|
+
}, [entries]);
|
|
150
90
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
* @returns {string} Markup for the component.
|
|
155
|
-
*/
|
|
156
|
-
render() {
|
|
157
|
-
const historyAction = find(this.props.objectActions, {
|
|
158
|
-
id: 'history',
|
|
159
|
-
});
|
|
160
|
-
const entries = this.processHistoryEntries();
|
|
91
|
+
const historyAction = find(objectActions, {
|
|
92
|
+
id: 'history',
|
|
93
|
+
});
|
|
161
94
|
|
|
162
|
-
|
|
163
|
-
|
|
95
|
+
const Container =
|
|
96
|
+
config.getComponent({ name: 'Container' }).component || SemanticContainer;
|
|
164
97
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
98
|
+
return !historyAction ? (
|
|
99
|
+
<>
|
|
100
|
+
{token ? (
|
|
101
|
+
<Forbidden pathname={pathname} staticContext={staticContext} />
|
|
102
|
+
) : (
|
|
103
|
+
<Unauthorized pathname={pathname} staticContext={staticContext} />
|
|
104
|
+
)}
|
|
105
|
+
</>
|
|
106
|
+
) : (
|
|
107
|
+
<Container id="page-history">
|
|
108
|
+
<Helmet title={intl.formatMessage(messages.history)} />
|
|
109
|
+
<Segment.Group raised>
|
|
110
|
+
<Segment className="primary">
|
|
111
|
+
<FormattedMessage
|
|
112
|
+
id="History of {title}"
|
|
113
|
+
defaultMessage="History of {title}"
|
|
114
|
+
values={{
|
|
115
|
+
title: <q>{title}</q>,
|
|
116
|
+
}}
|
|
171
117
|
/>
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
118
|
+
</Segment>
|
|
119
|
+
<Segment secondary>
|
|
120
|
+
<FormattedMessage
|
|
121
|
+
id="You can view the history of your item below."
|
|
122
|
+
defaultMessage="You can view the history of your item below."
|
|
176
123
|
/>
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
{entry.
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
124
|
+
</Segment>
|
|
125
|
+
<Table selectable compact singleLine attached>
|
|
126
|
+
<Table.Header>
|
|
127
|
+
<Table.Row>
|
|
128
|
+
<Table.HeaderCell width={1}>
|
|
129
|
+
<FormattedMessage
|
|
130
|
+
id="History Version Number"
|
|
131
|
+
defaultMessage="#"
|
|
132
|
+
/>
|
|
133
|
+
</Table.HeaderCell>
|
|
134
|
+
<Table.HeaderCell width={4}>
|
|
135
|
+
<FormattedMessage id="What" defaultMessage="What" />
|
|
136
|
+
</Table.HeaderCell>
|
|
137
|
+
<Table.HeaderCell width={4}>
|
|
138
|
+
<FormattedMessage id="Who" defaultMessage="Who" />
|
|
139
|
+
</Table.HeaderCell>
|
|
140
|
+
<Table.HeaderCell width={4}>
|
|
141
|
+
<FormattedMessage id="When" defaultMessage="When" />
|
|
142
|
+
</Table.HeaderCell>
|
|
143
|
+
<Table.HeaderCell width={4}>
|
|
144
|
+
<FormattedMessage
|
|
145
|
+
id="Change Note"
|
|
146
|
+
defaultMessage="Change Note"
|
|
147
|
+
/>
|
|
148
|
+
</Table.HeaderCell>
|
|
149
|
+
<Table.HeaderCell />
|
|
150
|
+
</Table.Row>
|
|
151
|
+
</Table.Header>
|
|
152
|
+
<Table.Body>
|
|
153
|
+
{map(processedEntries, (entry) => (
|
|
154
|
+
<Table.Row key={entry.version ?? entry.time}>
|
|
155
|
+
<Table.Cell>
|
|
156
|
+
{('version' in entry && entry.version > 0 && (
|
|
157
|
+
<Link
|
|
158
|
+
className="item"
|
|
159
|
+
to={`${getBaseUrl(pathname)}/diff?one=${
|
|
160
|
+
entry.version - 1
|
|
161
|
+
}&two=${entry.version}`}
|
|
162
|
+
>
|
|
163
|
+
{entry.version}
|
|
164
|
+
</Link>
|
|
165
|
+
)) || <span>{entry.version}</span>}
|
|
166
|
+
</Table.Cell>
|
|
167
|
+
<Table.Cell>
|
|
168
|
+
{('version' in entry && entry.version > 0 && (
|
|
169
|
+
<Link
|
|
170
|
+
className="item"
|
|
171
|
+
to={`${getBaseUrl(pathname)}/diff?one=${
|
|
172
|
+
entry.version - 1
|
|
173
|
+
}&two=${entry.version}`}
|
|
174
|
+
>
|
|
175
|
+
{entry.transition_title}
|
|
176
|
+
</Link>
|
|
177
|
+
)) || (
|
|
178
|
+
<span>
|
|
179
|
+
{entry.transition_title}
|
|
180
|
+
{entry.type === 'workflow' &&
|
|
181
|
+
` (${
|
|
182
|
+
entry.action ? `${entry.prev_state_title} → ` : ''
|
|
183
|
+
}${entry.state_title})`}
|
|
184
|
+
</span>
|
|
185
|
+
)}
|
|
186
|
+
</Table.Cell>
|
|
187
|
+
<Table.Cell>{entry.actor.fullname}</Table.Cell>
|
|
188
|
+
<Table.Cell>
|
|
189
|
+
<FormattedDate date={entry.time} />
|
|
190
|
+
</Table.Cell>
|
|
191
|
+
<Table.Cell>{entry.comments}</Table.Cell>
|
|
192
|
+
<Table.Cell>
|
|
193
|
+
{entry.type === 'versioning' && (
|
|
194
|
+
<Dropdown icon="ellipsis horizontal">
|
|
195
|
+
<Dropdown.Menu className="left">
|
|
196
|
+
{'version' in entry && entry.version > 0 && (
|
|
197
|
+
<Link
|
|
198
|
+
className="item"
|
|
199
|
+
to={`${getBaseUrl(
|
|
200
|
+
pathname,
|
|
201
|
+
)}/diff?one=${entry.version - 1}&two=${
|
|
202
|
+
entry.version
|
|
203
|
+
}`}
|
|
204
|
+
>
|
|
205
|
+
<Icon name="copy" />{' '}
|
|
206
|
+
<FormattedMessage
|
|
207
|
+
id="View changes"
|
|
208
|
+
defaultMessage="View changes"
|
|
209
|
+
/>
|
|
210
|
+
</Link>
|
|
211
|
+
)}
|
|
212
|
+
{'version' in entry && (
|
|
213
|
+
<Link
|
|
214
|
+
className="item"
|
|
215
|
+
to={`${getBaseUrl(pathname)}?version=${
|
|
216
|
+
entry.version
|
|
217
|
+
}`}
|
|
218
|
+
>
|
|
219
|
+
<Icon name="eye" />{' '}
|
|
220
|
+
<FormattedMessage
|
|
221
|
+
id="View this revision"
|
|
222
|
+
defaultMessage="View this revision"
|
|
223
|
+
/>
|
|
224
|
+
</Link>
|
|
225
|
+
)}
|
|
226
|
+
{'version' in entry &&
|
|
227
|
+
entry.may_revert &&
|
|
228
|
+
!entry.is_current && (
|
|
229
|
+
<Dropdown.Item
|
|
230
|
+
value={entry.version}
|
|
231
|
+
onClick={onRevert}
|
|
277
232
|
>
|
|
278
|
-
<Icon name="
|
|
233
|
+
<Icon name="undo" />{' '}
|
|
279
234
|
<FormattedMessage
|
|
280
|
-
id="
|
|
281
|
-
defaultMessage="
|
|
235
|
+
id="Revert to this revision"
|
|
236
|
+
defaultMessage="Revert to this revision"
|
|
282
237
|
/>
|
|
283
|
-
</
|
|
238
|
+
</Dropdown.Item>
|
|
284
239
|
)}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
)}
|
|
316
|
-
</Table.Cell>
|
|
317
|
-
</Table.Row>
|
|
318
|
-
))}
|
|
319
|
-
</Table.Body>
|
|
320
|
-
</Table>
|
|
321
|
-
</Segment.Group>
|
|
322
|
-
{this.state.isClient &&
|
|
323
|
-
createPortal(
|
|
324
|
-
<Toolbar
|
|
325
|
-
pathname={this.props.pathname}
|
|
326
|
-
hideDefaultViewButtons
|
|
327
|
-
inner={
|
|
328
|
-
<Link
|
|
329
|
-
to={`${getBaseUrl(this.props.pathname)}`}
|
|
330
|
-
className="item"
|
|
331
|
-
>
|
|
332
|
-
<IconNext
|
|
333
|
-
name={backSVG}
|
|
334
|
-
className="contents circled"
|
|
335
|
-
size="30px"
|
|
336
|
-
title={this.props.intl.formatMessage(messages.back)}
|
|
337
|
-
/>
|
|
338
|
-
</Link>
|
|
339
|
-
}
|
|
340
|
-
/>,
|
|
341
|
-
document.getElementById('toolbar'),
|
|
342
|
-
)}
|
|
343
|
-
</Container>
|
|
344
|
-
);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
240
|
+
</Dropdown.Menu>
|
|
241
|
+
</Dropdown>
|
|
242
|
+
)}
|
|
243
|
+
</Table.Cell>
|
|
244
|
+
</Table.Row>
|
|
245
|
+
))}
|
|
246
|
+
</Table.Body>
|
|
247
|
+
</Table>
|
|
248
|
+
</Segment.Group>
|
|
249
|
+
{isClient &&
|
|
250
|
+
createPortal(
|
|
251
|
+
<Toolbar
|
|
252
|
+
pathname={pathname}
|
|
253
|
+
hideDefaultViewButtons
|
|
254
|
+
inner={
|
|
255
|
+
<Link to={`${getBaseUrl(pathname)}`} className="item">
|
|
256
|
+
<IconNext
|
|
257
|
+
name={backSVG}
|
|
258
|
+
className="contents circled"
|
|
259
|
+
size="30px"
|
|
260
|
+
title={intl.formatMessage(messages.back)}
|
|
261
|
+
/>
|
|
262
|
+
</Link>
|
|
263
|
+
}
|
|
264
|
+
/>,
|
|
265
|
+
document.getElementById('toolbar'),
|
|
266
|
+
)}
|
|
267
|
+
</Container>
|
|
268
|
+
);
|
|
269
|
+
};
|
|
347
270
|
|
|
348
271
|
export default compose(
|
|
349
|
-
injectIntl,
|
|
350
272
|
asyncConnect([
|
|
351
273
|
{
|
|
352
274
|
key: 'actions',
|
|
353
|
-
// Dispatch async/await to make the operation synchronous, otherwise it returns
|
|
354
|
-
// before the promise is resolved
|
|
355
275
|
promise: async ({ location, store: { dispatch } }) =>
|
|
356
276
|
await dispatch(listActions(getBaseUrl(location.pathname))),
|
|
357
277
|
},
|
|
358
278
|
]),
|
|
359
|
-
connect(
|
|
360
|
-
(state, props) => ({
|
|
361
|
-
objectActions: state.actions.actions.object,
|
|
362
|
-
token: state.userSession.token,
|
|
363
|
-
entries: state.history.entries,
|
|
364
|
-
pathname: props.location.pathname,
|
|
365
|
-
title: state.content.data?.title,
|
|
366
|
-
revertRequest: state.history.revert,
|
|
367
|
-
}),
|
|
368
|
-
{ getHistory, revertHistory },
|
|
369
|
-
),
|
|
370
279
|
)(History);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
|
-
import { StaticRouter } from 'react-router-dom';
|
|
4
|
+
import { MemoryRouter, StaticRouter } from 'react-router-dom';
|
|
5
|
+
import { CookiesProvider } from 'react-cookie';
|
|
5
6
|
import { Provider } from 'react-intl-redux';
|
|
6
7
|
import jwt from 'jsonwebtoken';
|
|
7
8
|
|
|
@@ -89,8 +90,12 @@ describe('History', () => {
|
|
|
89
90
|
});
|
|
90
91
|
const { container } = render(
|
|
91
92
|
<Provider store={store}>
|
|
92
|
-
<
|
|
93
|
-
|
|
93
|
+
<CookiesProvider>
|
|
94
|
+
<MemoryRouter initialEntries={['/blog']}>
|
|
95
|
+
<History />
|
|
96
|
+
<div id="toolbar"></div>
|
|
97
|
+
</MemoryRouter>
|
|
98
|
+
</CookiesProvider>
|
|
94
99
|
</Provider>,
|
|
95
100
|
);
|
|
96
101
|
|
|
@@ -156,8 +161,12 @@ describe('History', () => {
|
|
|
156
161
|
});
|
|
157
162
|
const { container } = render(
|
|
158
163
|
<Provider store={store}>
|
|
159
|
-
<
|
|
160
|
-
|
|
164
|
+
<CookiesProvider>
|
|
165
|
+
<MemoryRouter initialEntries={['/blog']}>
|
|
166
|
+
<History />
|
|
167
|
+
<div id="toolbar"></div>
|
|
168
|
+
</MemoryRouter>
|
|
169
|
+
</CookiesProvider>
|
|
161
170
|
</Provider>,
|
|
162
171
|
);
|
|
163
172
|
|
|
@@ -221,10 +230,12 @@ describe('History', () => {
|
|
|
221
230
|
});
|
|
222
231
|
const { container } = render(
|
|
223
232
|
<Provider store={store}>
|
|
224
|
-
<
|
|
225
|
-
<
|
|
226
|
-
|
|
227
|
-
|
|
233
|
+
<CookiesProvider>
|
|
234
|
+
<StaticRouter context={{}} location={'/blog'}>
|
|
235
|
+
<History location={{ pathname: '/blog' }} />
|
|
236
|
+
<div id="toolbar"></div>
|
|
237
|
+
</StaticRouter>
|
|
238
|
+
</CookiesProvider>
|
|
228
239
|
</Provider>,
|
|
229
240
|
);
|
|
230
241
|
|
|
@@ -4,6 +4,7 @@ import { Provider } from 'react-intl-redux';
|
|
|
4
4
|
import configureMockStore from 'redux-mock-store';
|
|
5
5
|
import thunk from 'redux-thunk';
|
|
6
6
|
import { MemoryRouter } from 'react-router-dom';
|
|
7
|
+
import { CookiesProvider } from 'react-cookie';
|
|
7
8
|
|
|
8
9
|
import { __test__ as LinksToItem } from './LinksToItem';
|
|
9
10
|
|
|
@@ -102,10 +103,12 @@ describe('LinksToItem', () => {
|
|
|
102
103
|
});
|
|
103
104
|
const { container } = render(
|
|
104
105
|
<Provider store={store}>
|
|
105
|
-
<
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
<CookiesProvider>
|
|
107
|
+
<MemoryRouter>
|
|
108
|
+
<LinksToItem location={{ pathname: '/page-1/links-to-item' }} />
|
|
109
|
+
<div id="toolbar"></div>
|
|
110
|
+
</MemoryRouter>
|
|
111
|
+
</CookiesProvider>
|
|
109
112
|
</Provider>,
|
|
110
113
|
);
|
|
111
114
|
|