@plone/volto 17.0.0-alpha.2 → 17.0.0-alpha.20
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/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +530 -15
- package/CONTRIBUTING.md +1 -1
- package/README.md +11 -14
- package/addon-registry.js +34 -0
- package/create-theme-addons-loader.js +79 -0
- package/cypress/support/commands.js +56 -4
- package/cypress/support/volto-slate.js +4 -5
- package/docker-compose.yml +1 -1
- package/locales/ca/LC_MESSAGES/volto.po +272 -6
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +291 -25
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +271 -5
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +281 -15
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +272 -6
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +4882 -0
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +272 -6
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +273 -7
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +272 -6
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +927 -649
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +272 -6
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +281 -15
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +272 -6
- package/locales/ro.json +1 -1
- package/locales/volto.pot +272 -6
- package/locales/zh_CN/LC_MESSAGES/volto.po +272 -6
- package/locales/zh_CN.json +1 -1
- package/package.json +5 -3
- package/packages/volto-slate/build/messages/src/blocks/Table/TableBlockEdit.json +1 -1
- package/packages/volto-slate/build/messages/src/blocks/Text/DefaultTextBlockEditor.json +1 -1
- package/packages/volto-slate/build/messages/src/blocks/Text/DetachedTextBlockEditor.json +1 -1
- package/packages/volto-slate/build/messages/src/blocks/Text/SlashMenu.json +1 -1
- package/packages/volto-slate/build/messages/src/editor/plugins/AdvancedLink/index.json +1 -1
- package/packages/volto-slate/build/messages/src/editor/plugins/Link/index.json +1 -1
- package/packages/volto-slate/build/messages/src/editor/plugins/Table/index.json +1 -1
- package/packages/volto-slate/build/messages/src/elementEditor/messages.json +1 -1
- package/packages/volto-slate/build/messages/src/widgets/HtmlSlateWidget.json +1 -1
- package/packages/volto-slate/build/messages/src/widgets/RichTextWidgetView.json +1 -1
- package/packages/volto-slate/package.json +1 -1
- package/packages/volto-slate/src/actions/index.js +1 -1
- package/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx +21 -212
- package/packages/volto-slate/src/blocks/Table/schema.js +122 -0
- package/packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx +8 -3
- package/packages/volto-slate/src/blocks/Text/SlashMenu.jsx +4 -3
- package/packages/volto-slate/src/blocks/Text/TextBlockView.jsx +20 -16
- package/packages/volto-slate/src/blocks/Text/extensions/withDeserializers.js +3 -1
- package/packages/volto-slate/src/blocks/Text/index.js +10 -2
- package/packages/volto-slate/src/editor/config.jsx +5 -4
- package/packages/volto-slate/src/editor/deserialize.js +0 -1
- package/packages/volto-slate/src/editor/index.js +4 -4
- package/packages/volto-slate/src/editor/less/slate.less +28 -0
- package/packages/volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx +14 -4
- package/packages/volto-slate/src/editor/plugins/StyleMenu/utils.js +14 -5
- package/packages/volto-slate/src/editor/render.jsx +68 -8
- package/packages/volto-slate/src/editor/ui/SlateContextToolbar.jsx +2 -2
- package/packages/volto-slate/src/editor/ui/index.js +15 -15
- package/packages/volto-slate/src/index.js +2 -2
- package/packages/volto-slate/src/utils/blocks.js +7 -0
- package/packages/volto-slate/src/widgets/RichTextWidget.jsx +15 -8
- package/razzle.config.js +28 -0
- package/src/actions/index.js +6 -0
- package/src/actions/language/language.js +9 -8
- package/src/actions/querystringsearch/querystringsearch.js +20 -14
- package/src/actions/relations/rebuild.js +25 -0
- package/src/actions/relations/relations.js +86 -0
- package/src/actions/relations/relations.test.js +15 -0
- package/src/components/index.js +2 -0
- package/src/components/manage/Add/Add.jsx +2 -2
- package/src/components/manage/AnchorPlugin/index.jsx +2 -2
- package/src/components/manage/AnchorPlugin/utils/EditorUtils.js +3 -1
- package/src/components/manage/BlockChooser/BlockChooser.jsx +14 -5
- package/src/components/manage/BlockChooser/BlockChooser.test.jsx +5 -0
- package/src/components/manage/Blocks/Block/BlocksForm.jsx +19 -2
- package/src/components/manage/Blocks/Block/Edit.jsx +1 -1
- package/src/components/manage/Blocks/Block/Style.jsx +2 -2
- package/src/components/manage/Blocks/Container/Data.jsx +32 -0
- package/src/components/manage/Blocks/Container/Edit.jsx +174 -0
- package/src/components/manage/Blocks/Container/EditBlockWrapper.jsx +120 -0
- package/src/components/manage/Blocks/Container/NewBlockAddButton.jsx +84 -0
- package/src/components/manage/Blocks/Container/SimpleContainerToolbar.jsx +54 -0
- package/src/components/manage/Blocks/Grid/Edit.jsx +33 -0
- package/src/components/manage/Blocks/Grid/View.jsx +43 -0
- package/src/components/manage/Blocks/Grid/adapter.js +14 -0
- package/src/components/manage/Blocks/Grid/grid-1.svg +6 -0
- package/src/components/manage/Blocks/Grid/grid-2.svg +9 -0
- package/src/components/manage/Blocks/Grid/grid-3.svg +10 -0
- package/src/components/manage/Blocks/Grid/grid-4.svg +11 -0
- package/src/components/manage/Blocks/Grid/schema.js +35 -0
- package/src/components/manage/Blocks/Grid/templates.js +47 -0
- package/src/components/manage/Blocks/HeroImageLeft/Edit.jsx +6 -1
- package/src/components/manage/Blocks/Image/Edit.jsx +11 -7
- package/src/components/manage/Blocks/Image/ImageSidebar.jsx +2 -1
- package/src/components/manage/Blocks/Image/schema.js +11 -0
- package/src/components/manage/Blocks/Listing/DefaultTemplate.jsx +18 -3
- package/src/components/manage/Blocks/Listing/Edit.jsx +0 -14
- package/src/components/manage/Blocks/Listing/ListingBody.jsx +30 -8
- package/src/components/manage/Blocks/Listing/ListingBody.test.jsx +20 -0
- package/src/components/manage/Blocks/Listing/getAsyncData.js +9 -3
- package/src/components/manage/Blocks/Listing/withQuerystringResults.jsx +26 -18
- package/src/components/manage/Blocks/Search/SearchBlockEdit.jsx +5 -4
- package/src/components/manage/Blocks/Search/SearchBlockView.jsx +2 -1
- package/src/components/manage/Blocks/Search/components/DateRangeFacet.jsx +4 -1
- package/src/components/manage/Blocks/Search/components/Facets.jsx +64 -4
- package/src/components/manage/Blocks/Search/components/SearchInput.jsx +9 -2
- package/src/components/manage/Blocks/Search/components/index.js +13 -13
- package/src/components/manage/Blocks/Search/hocs/index.js +2 -2
- package/src/components/manage/Blocks/Search/hocs/withQueryString.jsx +2 -2
- package/src/components/manage/Blocks/Search/hocs/withSearch.jsx +43 -15
- package/src/components/manage/Blocks/Search/layout/LeftColumnFacets.jsx +17 -5
- package/src/components/manage/Blocks/Search/layout/RightColumnFacets.jsx +17 -5
- package/src/components/manage/Blocks/Search/layout/TopSideFacets.jsx +21 -5
- package/src/components/manage/Blocks/Search/schema.js +16 -1
- package/src/components/manage/Blocks/Teaser/Body.jsx +0 -1
- package/src/components/manage/Blocks/Teaser/DefaultBody.jsx +20 -15
- package/src/components/manage/Blocks/Teaser/schema.js +5 -0
- package/src/components/manage/Blocks/Title/View.jsx +15 -5
- package/src/components/manage/Blocks/Title/View.test.jsx +16 -1
- package/src/components/manage/Blocks/ToC/Schema.jsx +5 -1
- package/src/components/manage/Blocks/ToC/View.jsx +8 -1
- package/src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx +17 -4
- package/src/components/manage/Blocks/ToC/variations/HorizontalMenu.jsx +148 -10
- package/src/components/manage/Blocks/ToC/variations/index.js +3 -1
- package/src/components/manage/Contents/Contents.jsx +39 -26
- package/src/components/manage/Contents/ContentsItem.jsx +6 -0
- package/src/components/manage/Contents/ContentsUploadModal.jsx +10 -5
- package/src/components/manage/Controlpanels/AddonsControlpanel.jsx +3 -3
- package/src/components/manage/Controlpanels/Controlpanels.jsx +199 -224
- package/src/components/manage/Controlpanels/Controlpanels.test.jsx +46 -7
- package/src/components/manage/Controlpanels/Relations/BrokenRelations.jsx +66 -0
- package/src/components/manage/Controlpanels/Relations/Relations.jsx +114 -0
- package/src/components/manage/Controlpanels/Relations/RelationsListing.jsx +479 -0
- package/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx +531 -0
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx +3 -3
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipListing.jsx +51 -82
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx +79 -75
- package/src/components/manage/DragDropList/DragDropList.jsx +18 -13
- package/src/components/manage/Form/Form.jsx +5 -3
- package/src/components/manage/Form/InlineForm.jsx +39 -9
- package/src/components/manage/Form/InlineFormState.js +8 -0
- package/src/components/manage/History/History.jsx +11 -1
- package/src/components/manage/LinksToItem/LinksToItem.jsx +209 -0
- package/src/components/manage/LinksToItem/LinksToItem.test.jsx +97 -0
- package/src/components/manage/Multilingual/CreateTranslation.jsx +2 -2
- package/src/components/manage/Multilingual/TranslationObject.jsx +4 -3
- package/src/components/manage/Preferences/ChangePassword.jsx +2 -2
- package/src/components/manage/Preferences/PersonalPreferences.jsx +2 -2
- package/src/components/manage/Sharing/Sharing.jsx +5 -1
- package/src/components/manage/TemplateChooser/TemplateChooser.jsx +38 -0
- package/src/components/manage/TemplateChooser/TemplateChooser.test.jsx +34 -0
- package/src/components/manage/TemplateChooser/template.svg +10 -0
- package/src/components/manage/Toast/Toast.jsx +2 -2
- package/src/components/manage/Toolbar/More.jsx +15 -0
- package/src/components/manage/Toolbar/Types.jsx +2 -2
- package/src/components/manage/UniversalLink/UniversalLink.jsx +2 -6
- package/src/components/manage/UniversalLink/UniversalLink.test.jsx +36 -0
- package/src/components/manage/Widgets/ColorPickerWidget.jsx +6 -1
- package/src/components/manage/Widgets/DatetimeWidget.jsx +9 -5
- package/src/components/manage/Widgets/FileWidget.jsx +2 -1
- package/src/components/manage/Widgets/ObjectListWidget.jsx +3 -8
- package/src/components/manage/Widgets/RecurrenceWidget/ByDayField.jsx +2 -1
- package/src/components/manage/Widgets/RecurrenceWidget/MonthOfTheYearField.jsx +2 -1
- package/src/components/manage/Widgets/RecurrenceWidget/Occurences.jsx +2 -1
- package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +8 -3
- package/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthField.jsx +2 -1
- package/src/components/manage/Widgets/SelectUtils.js +1 -1
- package/src/components/manage/Widgets/SelectWidget.jsx +1 -1
- package/src/components/theme/Anontools/Anontools.jsx +44 -72
- package/src/components/theme/Anontools/Anontools.stories.jsx +16 -6
- package/src/components/theme/Anontools/Anontools.test.jsx +16 -2
- package/src/components/theme/Breadcrumbs/Breadcrumbs.jsx +52 -99
- package/src/components/theme/Breadcrumbs/Breadcrumbs.stories.jsx +14 -13
- package/src/components/theme/Comments/CommentEditModal.jsx +63 -115
- package/src/components/theme/Component/Component.jsx +1 -1
- package/src/components/theme/ContactForm/ContactForm.jsx +108 -192
- package/src/components/theme/ContactForm/ContactForm.stories.jsx +1 -1
- package/src/components/theme/ContactForm/ContactForm.test.jsx +2 -3
- package/src/components/theme/Footer/Footer.jsx +2 -13
- package/src/components/theme/Header/Header.jsx +37 -63
- package/src/components/theme/Header/Header.test.jsx +18 -0
- package/src/components/theme/Icon/Icon.jsx +2 -2
- package/src/components/theme/LanguageSelector/LanguageSelector.js +8 -3
- package/src/components/theme/Login/Login.jsx +1 -0
- package/src/components/theme/Logo/Logo.jsx +2 -1
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx +2 -2
- package/src/components/theme/Navigation/NavItem.jsx +4 -2
- package/src/components/theme/NotFound/NotFound.jsx +55 -41
- package/src/components/theme/PasswordReset/PasswordReset.jsx +7 -4
- package/src/components/theme/PasswordReset/RequestPasswordReset.jsx +1 -1
- package/src/components/theme/SearchWidget/SearchWidget.jsx +38 -98
- package/src/components/theme/Sitemap/Sitemap.jsx +5 -3
- package/src/components/theme/View/AlbumView.jsx +9 -1
- package/src/components/theme/View/DefaultView.jsx +1 -1
- package/src/components/theme/View/EventDatesInfo.jsx +2 -1
- package/src/components/theme/View/EventView.jsx +6 -2
- package/src/components/theme/View/FileView.jsx +23 -18
- package/src/components/theme/View/ImageView.jsx +37 -32
- package/src/components/theme/View/LinkView.jsx +53 -78
- package/src/components/theme/View/ListingView.jsx +33 -27
- package/src/components/theme/View/NewsItemView.jsx +10 -5
- package/src/components/theme/View/RenderBlocks.jsx +56 -21
- package/src/components/theme/View/RenderEmptyBlock.jsx +5 -0
- package/src/components/theme/View/SummaryView.jsx +47 -38
- package/src/components/theme/View/TabularView.jsx +59 -53
- package/src/components/theme/Widgets/DateWidget.jsx +2 -1
- package/src/components/theme/Widgets/DatetimeWidget.jsx +2 -1
- package/src/components/theme/Widgets/RelationsWidget.jsx +13 -11
- package/src/config/Blocks.jsx +44 -0
- package/src/config/ControlPanels.js +2 -0
- package/src/config/NonContentRoutes.jsx +1 -0
- package/src/config/RichTextEditor/Blocks.jsx +2 -2
- package/src/config/RichTextEditor/FromHTML.jsx +2 -2
- package/src/config/RichTextEditor/Styles.jsx +1 -1
- package/src/config/Widgets.jsx +2 -0
- package/src/config/index.js +24 -0
- package/src/config/server.js +2 -0
- package/src/constants/ActionTypes.js +4 -0
- package/src/constants/Indexes.js +3 -1
- package/src/constants/Languages.js +8 -4
- package/src/express-middleware/devproxy.js +1 -1
- package/src/express-middleware/files.js +3 -3
- package/src/express-middleware/images.js +4 -4
- package/src/express-middleware/ok.js +16 -0
- package/src/express-middleware/robotstxt.js +1 -1
- package/src/express-middleware/sitemap.js +37 -5
- package/src/express-middleware/static.js +3 -3
- package/src/helpers/Api/Api.js +1 -1
- package/src/helpers/Blocks/Blocks.js +48 -0
- package/src/helpers/Blocks/Blocks.test.js +79 -0
- package/src/helpers/Extensions/index.js +2 -1
- package/src/helpers/Extensions/withBlockSchemaEnhancer.js +15 -11
- package/src/helpers/Extensions/withBlockSchemaEnhancer.test.js +145 -0
- package/src/helpers/FormValidation/FormValidation.js +40 -2
- package/src/helpers/FormValidation/FormValidation.test.js +73 -0
- package/src/helpers/Html/Html.jsx +3 -1
- package/src/helpers/Html/Html.test.jsx +5 -0
- package/src/helpers/MessageLabels/MessageLabels.js +80 -0
- package/src/helpers/Robots/Robots.js +24 -6
- package/src/helpers/ScrollToTop/ScrollToTop.jsx +5 -3
- package/src/helpers/Sitemap/Sitemap.js +44 -2
- package/src/helpers/Url/Url.js +27 -6
- package/src/helpers/Url/Url.test.js +26 -0
- package/src/helpers/Utils/UseDetectClickOutside.stories.jsx +191 -0
- package/src/helpers/Utils/Utils.js +63 -13
- package/src/helpers/Utils/Utils.test.js +4 -4
- package/src/helpers/Utils/usePagination.js +67 -14
- package/src/helpers/Utils/usePagination.test.js +115 -0
- package/src/helpers/index.js +20 -10
- package/src/hooks/client/useClient.js +11 -0
- package/src/hooks/clipboard/useClipboard.js +26 -0
- package/src/hooks/index.js +2 -0
- package/src/icons/grid-block.svg +11 -0
- package/src/middleware/Api.test.js +54 -0
- package/src/middleware/api.js +24 -6
- package/src/middleware/index.js +2 -2
- package/src/reducers/actions/actions.js +8 -6
- package/src/reducers/actions/actions.test.js +70 -0
- package/src/reducers/breadcrumbs/breadcrumbs.js +1 -1
- package/src/reducers/index.js +2 -0
- package/src/reducers/navigation/navigation.js +1 -1
- package/src/reducers/relations/relations.js +173 -0
- package/src/reducers/types/types.js +1 -1
- package/src/routes.js +14 -0
- package/src/server.jsx +28 -23
- package/src/start-server.js +2 -2
- package/test-setup-config.js +2 -0
- package/theme/themes/pastanaga/extras/blocks.less +3 -1
- package/theme/themes/pastanaga/extras/contents.less +1 -0
- package/theme/themes/pastanaga/extras/grid.less +426 -0
- package/theme/themes/pastanaga/extras/main.less +3 -1
- package/theme/themes/pastanaga/extras/search.less +6 -0
- package/theme/themes/pastanaga/extras/sidebar.less +4 -0
- package/theme/themes/pastanaga/extras/toc.less +29 -0
- package/theme/themes/pastanaga/extras/userscontrolpanel.less +99 -76
- package/.changelog.draft +0 -31
- package/.editorconfig +0 -36
- package/.storybook/main.js +0 -127
- package/.storybook/manager.js +0 -15
- package/.storybook/preview.js +0 -21
- package/.storybook/static/previewImage.svg +0 -48
- package/.yarnrc.yml +0 -5
- package/jsdoc.json +0 -16
- package/netlify.toml +0 -5
- package/pyvenv.cfg +0 -3
- package/share/man/man1/ttx.1 +0 -225
- package/src/components/theme/Header/Header.md +0 -27
- package/towncrier.toml +0 -33
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
* @module components/manage/Controlpanels/Controlpanels
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import React, { Component } from 'react';
|
|
7
6
|
import PropTypes from 'prop-types';
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
8
|
import { connect } from 'react-redux';
|
|
9
9
|
import { compose } from 'redux';
|
|
10
10
|
import { Link } from 'react-router-dom';
|
|
11
11
|
import { concat, filter, last, map, uniqBy } from 'lodash';
|
|
12
12
|
import { Portal } from 'react-portal';
|
|
13
|
-
import { Helmet } from '@plone/volto/helpers';
|
|
13
|
+
import { asyncConnect, Helmet } from '@plone/volto/helpers';
|
|
14
14
|
import { Container, Grid, Header, Message, Segment } from 'semantic-ui-react';
|
|
15
|
-
import { FormattedMessage, defineMessages,
|
|
15
|
+
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
|
16
16
|
|
|
17
17
|
import { listControlpanels, getSystemInformation } from '@plone/volto/actions';
|
|
18
18
|
import { Error, Icon, Toolbar, VersionOverview } from '@plone/volto/components';
|
|
@@ -90,189 +90,139 @@ const messages = defineMessages({
|
|
|
90
90
|
id: 'Content Rules',
|
|
91
91
|
defaultMessage: 'Content Rules',
|
|
92
92
|
},
|
|
93
|
+
relations: {
|
|
94
|
+
id: 'Relations',
|
|
95
|
+
defaultMessage: 'Relations',
|
|
96
|
+
},
|
|
93
97
|
});
|
|
94
98
|
|
|
95
99
|
/**
|
|
96
100
|
* Controlpanels container class.
|
|
97
|
-
* @class Controlpanels
|
|
98
|
-
* @extends Component
|
|
99
101
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
controlpanels: PropTypes.arrayOf(
|
|
109
|
-
PropTypes.shape({
|
|
110
|
-
'@id': PropTypes.string,
|
|
111
|
-
group: PropTypes.string,
|
|
112
|
-
title: PropTypes.string,
|
|
113
|
-
}),
|
|
114
|
-
).isRequired,
|
|
115
|
-
pathname: PropTypes.string.isRequired,
|
|
116
|
-
};
|
|
102
|
+
function Controlpanels({
|
|
103
|
+
controlpanels,
|
|
104
|
+
controlpanelsRequest,
|
|
105
|
+
systemInformation,
|
|
106
|
+
pathname,
|
|
107
|
+
}) {
|
|
108
|
+
const intl = useIntl();
|
|
109
|
+
const [isClient, setIsClient] = useState(false);
|
|
117
110
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
* @param {Object} props Component properties
|
|
122
|
-
* @constructs EditComponent
|
|
123
|
-
*/
|
|
124
|
-
constructor(props) {
|
|
125
|
-
super(props);
|
|
126
|
-
this.state = {
|
|
127
|
-
error: null,
|
|
128
|
-
isClient: false,
|
|
129
|
-
};
|
|
130
|
-
}
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
setIsClient(true);
|
|
113
|
+
}, []);
|
|
131
114
|
|
|
132
|
-
|
|
133
|
-
* Component did mount
|
|
134
|
-
* @method componentDidMount
|
|
135
|
-
* @returns {undefined}
|
|
136
|
-
*/
|
|
137
|
-
componentDidMount() {
|
|
138
|
-
this.props.listControlpanels();
|
|
139
|
-
this.props.getSystemInformation();
|
|
140
|
-
this.setState({ isClient: true });
|
|
141
|
-
}
|
|
115
|
+
const error = controlpanelsRequest?.error;
|
|
142
116
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (
|
|
146
|
-
this.props.controlpanelsRequest.loading &&
|
|
147
|
-
nextProps.controlpanelsRequest.error
|
|
148
|
-
) {
|
|
149
|
-
this.setState({
|
|
150
|
-
error: nextProps.controlpanelsRequest.error,
|
|
151
|
-
});
|
|
152
|
-
}
|
|
117
|
+
if (error) {
|
|
118
|
+
return <Error error={error} />;
|
|
153
119
|
}
|
|
154
120
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
121
|
+
let customcontrolpanels = config.settings.controlpanels
|
|
122
|
+
? config.settings.controlpanels.map((el) => {
|
|
123
|
+
el.group =
|
|
124
|
+
intl.formatMessage({
|
|
125
|
+
id: el.group,
|
|
126
|
+
defaultMessage: el.group,
|
|
127
|
+
}) || el.group;
|
|
128
|
+
return el;
|
|
129
|
+
})
|
|
130
|
+
: [];
|
|
131
|
+
const { filterControlPanels } = config.settings;
|
|
165
132
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
'@id': '/groups',
|
|
230
|
-
group: this.props.intl.formatMessage(
|
|
231
|
-
messages.usersControlPanelCategory,
|
|
232
|
-
),
|
|
233
|
-
title: this.props.intl.formatMessage(messages.groups),
|
|
234
|
-
},
|
|
235
|
-
],
|
|
236
|
-
),
|
|
237
|
-
(controlpanel) => ({
|
|
238
|
-
...controlpanel,
|
|
239
|
-
id: last(controlpanel['@id'].split('/')),
|
|
240
|
-
}),
|
|
241
|
-
);
|
|
242
|
-
const groups = map(uniqBy(controlpanels, 'group'), 'group');
|
|
243
|
-
const { controlPanelsIcons: icons } = config.settings;
|
|
133
|
+
const filteredControlPanels = map(
|
|
134
|
+
concat(filterControlPanels(controlpanels), customcontrolpanels, [
|
|
135
|
+
{
|
|
136
|
+
'@id': '/addons',
|
|
137
|
+
group: intl.formatMessage(messages.general),
|
|
138
|
+
title: intl.formatMessage(messages.addons),
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
'@id': '/database',
|
|
142
|
+
group: intl.formatMessage(messages.general),
|
|
143
|
+
title: intl.formatMessage(messages.database),
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
'@id': '/rules',
|
|
147
|
+
group: intl.formatMessage(messages.content),
|
|
148
|
+
title: intl.formatMessage(messages.contentRules),
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
'@id': '/undo',
|
|
152
|
+
group: intl.formatMessage(messages.general),
|
|
153
|
+
title: intl.formatMessage(messages.undo),
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
'@id': '/aliases',
|
|
157
|
+
group: intl.formatMessage(messages.general),
|
|
158
|
+
title: intl.formatMessage(messages.urlmanagement),
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
'@id': '/relations',
|
|
162
|
+
group: intl.formatMessage(messages.content),
|
|
163
|
+
title: intl.formatMessage(messages.relations),
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
'@id': '/moderate-comments',
|
|
167
|
+
group: intl.formatMessage(messages.content),
|
|
168
|
+
title: intl.formatMessage(messages.moderatecomments),
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
'@id': '/users',
|
|
172
|
+
group: intl.formatMessage(messages.usersControlPanelCategory),
|
|
173
|
+
title: intl.formatMessage(messages.users),
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
'@id': '/usergroupmembership',
|
|
177
|
+
group: intl.formatMessage(messages.usersControlPanelCategory),
|
|
178
|
+
title: intl.formatMessage(messages.usergroupmemberbership),
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
'@id': '/groups',
|
|
182
|
+
group: intl.formatMessage(messages.usersControlPanelCategory),
|
|
183
|
+
title: intl.formatMessage(messages.groups),
|
|
184
|
+
},
|
|
185
|
+
]),
|
|
186
|
+
(controlpanel) => ({
|
|
187
|
+
...controlpanel,
|
|
188
|
+
id: last(controlpanel['@id'].split('/')),
|
|
189
|
+
}),
|
|
190
|
+
);
|
|
191
|
+
const groups = map(uniqBy(filteredControlPanels, 'group'), 'group');
|
|
192
|
+
const { controlPanelsIcons: icons } = config.settings;
|
|
244
193
|
|
|
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
|
-
<Grid
|
|
274
|
-
|
|
275
|
-
|
|
194
|
+
return (
|
|
195
|
+
<div className="view-wrapper">
|
|
196
|
+
<Helmet title={intl.formatMessage(messages.sitesetup)} />
|
|
197
|
+
<Container className="controlpanel">
|
|
198
|
+
<Segment.Group raised>
|
|
199
|
+
<Segment className="primary">
|
|
200
|
+
<FormattedMessage id="Site Setup" defaultMessage="Site Setup" />
|
|
201
|
+
</Segment>
|
|
202
|
+
{systemInformation && systemInformation.upgrade && (
|
|
203
|
+
<Message attached warning>
|
|
204
|
+
<FormattedMessage
|
|
205
|
+
id="The site configuration is outdated and needs to be upgraded."
|
|
206
|
+
defaultMessage="The site configuration is outdated and needs to be upgraded."
|
|
207
|
+
/>{' '}
|
|
208
|
+
<Link to={`/controlpanel/plone-upgrade`}>
|
|
209
|
+
<FormattedMessage
|
|
210
|
+
id="Please continue with the upgrade."
|
|
211
|
+
defaultMessage="Please continue with the upgrade."
|
|
212
|
+
/>
|
|
213
|
+
</Link>
|
|
214
|
+
</Message>
|
|
215
|
+
)}
|
|
216
|
+
{map(groups, (group) => [
|
|
217
|
+
<Segment key={`header-${group}`} secondary>
|
|
218
|
+
{group}
|
|
219
|
+
</Segment>,
|
|
220
|
+
<Segment key={`body-${group}`} attached>
|
|
221
|
+
<Grid doubling columns={6}>
|
|
222
|
+
<Grid.Row>
|
|
223
|
+
{map(
|
|
224
|
+
filter(filteredControlPanels, { group }),
|
|
225
|
+
(controlpanel) => (
|
|
276
226
|
<Grid.Column key={controlpanel.id}>
|
|
277
227
|
<Link to={`/controlpanel/${controlpanel.id}`}>
|
|
278
228
|
<Header as="h3" icon textAlign="center">
|
|
@@ -286,58 +236,83 @@ class Controlpanels extends Component {
|
|
|
286
236
|
</Header>
|
|
287
237
|
</Link>
|
|
288
238
|
</Grid.Column>
|
|
289
|
-
)
|
|
290
|
-
|
|
291
|
-
</Grid>
|
|
292
|
-
</
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
</Segment>
|
|
302
|
-
<Segment attached>
|
|
303
|
-
{this.props.systemInformation ? (
|
|
304
|
-
<VersionOverview {...this.props.systemInformation} />
|
|
305
|
-
) : null}
|
|
306
|
-
</Segment>
|
|
307
|
-
</Segment.Group>
|
|
308
|
-
</Container>
|
|
309
|
-
{this.state.isClient && (
|
|
310
|
-
<Portal node={document.getElementById('toolbar')}>
|
|
311
|
-
<Toolbar
|
|
312
|
-
pathname={this.props.pathname}
|
|
313
|
-
hideDefaultViewButtons
|
|
314
|
-
inner={
|
|
315
|
-
<Link to="/" className="item">
|
|
316
|
-
<Icon
|
|
317
|
-
name={backSVG}
|
|
318
|
-
className="contents circled"
|
|
319
|
-
size="30px"
|
|
320
|
-
title={this.props.intl.formatMessage(messages.back)}
|
|
321
|
-
/>
|
|
322
|
-
</Link>
|
|
323
|
-
}
|
|
239
|
+
),
|
|
240
|
+
)}
|
|
241
|
+
</Grid.Row>
|
|
242
|
+
</Grid>
|
|
243
|
+
</Segment>,
|
|
244
|
+
])}
|
|
245
|
+
</Segment.Group>
|
|
246
|
+
<Segment.Group raised>
|
|
247
|
+
<Segment className="primary">
|
|
248
|
+
<FormattedMessage
|
|
249
|
+
id="Version Overview"
|
|
250
|
+
defaultMessage="Version Overview"
|
|
324
251
|
/>
|
|
325
|
-
</
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
252
|
+
</Segment>
|
|
253
|
+
<Segment attached>
|
|
254
|
+
{systemInformation ? (
|
|
255
|
+
<VersionOverview {...systemInformation} />
|
|
256
|
+
) : null}
|
|
257
|
+
</Segment>
|
|
258
|
+
</Segment.Group>
|
|
259
|
+
</Container>
|
|
260
|
+
{isClient && (
|
|
261
|
+
<Portal node={document.getElementById('toolbar')}>
|
|
262
|
+
<Toolbar
|
|
263
|
+
pathname={pathname}
|
|
264
|
+
hideDefaultViewButtons
|
|
265
|
+
inner={
|
|
266
|
+
<Link to="/" className="item">
|
|
267
|
+
<Icon
|
|
268
|
+
name={backSVG}
|
|
269
|
+
className="contents circled"
|
|
270
|
+
size="30px"
|
|
271
|
+
title={intl.formatMessage(messages.back)}
|
|
272
|
+
/>
|
|
273
|
+
</Link>
|
|
274
|
+
}
|
|
275
|
+
/>
|
|
276
|
+
</Portal>
|
|
277
|
+
)}
|
|
278
|
+
</div>
|
|
279
|
+
);
|
|
330
280
|
}
|
|
331
281
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
282
|
+
/**
|
|
283
|
+
* Property types.
|
|
284
|
+
* @property {Object} propTypes Property types.
|
|
285
|
+
* @static
|
|
286
|
+
*/
|
|
287
|
+
Controlpanels.propTypes = {
|
|
288
|
+
controlpanels: PropTypes.arrayOf(
|
|
289
|
+
PropTypes.shape({
|
|
290
|
+
'@id': PropTypes.string,
|
|
291
|
+
group: PropTypes.string,
|
|
292
|
+
title: PropTypes.string,
|
|
340
293
|
}),
|
|
341
|
-
|
|
342
|
-
|
|
294
|
+
).isRequired,
|
|
295
|
+
pathname: PropTypes.string.isRequired,
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export default compose(
|
|
299
|
+
connect((state, props) => ({
|
|
300
|
+
controlpanels: state.controlpanels.controlpanels,
|
|
301
|
+
controlpanelsRequest: state.controlpanels.list,
|
|
302
|
+
pathname: props.location.pathname,
|
|
303
|
+
systemInformation: state.controlpanels.systeminformation,
|
|
304
|
+
})),
|
|
305
|
+
|
|
306
|
+
asyncConnect([
|
|
307
|
+
{
|
|
308
|
+
key: 'controlpanels',
|
|
309
|
+
promise: async ({ location, store: { dispatch } }) =>
|
|
310
|
+
await dispatch(listControlpanels()),
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
key: 'systemInformation',
|
|
314
|
+
promise: async ({ location, store: { dispatch } }) =>
|
|
315
|
+
await dispatch(getSystemInformation()),
|
|
316
|
+
},
|
|
317
|
+
]),
|
|
343
318
|
)(Controlpanels);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import renderer from 'react-test-renderer';
|
|
3
|
-
import configureStore from 'redux-mock-store';
|
|
4
2
|
import { Provider } from 'react-intl-redux';
|
|
5
3
|
import { MemoryRouter } from 'react-router-dom';
|
|
4
|
+
import renderer from 'react-test-renderer';
|
|
5
|
+
import configureStore from 'redux-mock-store';
|
|
6
6
|
|
|
7
|
-
import Controlpanels from './Controlpanels';
|
|
8
7
|
import config from '@plone/volto/registry';
|
|
8
|
+
import Controlpanels from './Controlpanels';
|
|
9
9
|
|
|
10
10
|
const mockStore = configureStore();
|
|
11
11
|
|
|
@@ -20,7 +20,30 @@ jest.mock('./VersionOverview', () =>
|
|
|
20
20
|
describe('Controlpanels', () => {
|
|
21
21
|
it('renders a controlpanels component', () => {
|
|
22
22
|
const store = mockStore({
|
|
23
|
-
controlpanels:
|
|
23
|
+
controlpanels: [
|
|
24
|
+
{
|
|
25
|
+
'@id': 'http://localhost:8080/Plone/@controlpanels/date-and-time',
|
|
26
|
+
group: 'General',
|
|
27
|
+
title: 'Date and Time',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
'@id': 'http://localhost:8080/Plone/@controlpanels/lang',
|
|
31
|
+
group: 'General',
|
|
32
|
+
title: 'Language',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
'@id': 'http://localhost:8080/Plone/@controlpanels/editing',
|
|
36
|
+
group: 'Content',
|
|
37
|
+
title: 'Editing',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
'@id': 'http://localhost:8080/Plone/@controlpanels/security',
|
|
41
|
+
group: 'Security',
|
|
42
|
+
title: 'test',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
reduxAsyncConnect: {
|
|
46
|
+
// Mocked in redux async connect as it isn't fetch client-side.
|
|
24
47
|
controlpanels: [
|
|
25
48
|
{
|
|
26
49
|
'@id': 'http://localhost:8080/Plone/@controlpanels/date-and-time',
|
|
@@ -40,10 +63,11 @@ describe('Controlpanels', () => {
|
|
|
40
63
|
{
|
|
41
64
|
'@id': 'http://localhost:8080/Plone/@controlpanels/security',
|
|
42
65
|
group: 'Security',
|
|
43
|
-
title: '
|
|
66
|
+
title: 'test',
|
|
44
67
|
},
|
|
45
68
|
],
|
|
46
69
|
},
|
|
70
|
+
router: { location: '/blog' },
|
|
47
71
|
intl: {
|
|
48
72
|
locale: 'en',
|
|
49
73
|
messages: {},
|
|
@@ -62,9 +86,24 @@ describe('Controlpanels', () => {
|
|
|
62
86
|
|
|
63
87
|
it('renders an additional control panel', () => {
|
|
64
88
|
const store = mockStore({
|
|
65
|
-
controlpanels:
|
|
66
|
-
|
|
89
|
+
controlpanels: [
|
|
90
|
+
{
|
|
91
|
+
'@id': 'http://localhost:8080/Plone/@controlpanels/security',
|
|
92
|
+
group: 'Security',
|
|
93
|
+
title: 'test',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
reduxAsyncConnect: {
|
|
97
|
+
// Mocked in redux async connect as it isn't fetch client-side.
|
|
98
|
+
controlpanels: [
|
|
99
|
+
{
|
|
100
|
+
'@id': 'http://localhost:8080/Plone/@controlpanels/security',
|
|
101
|
+
group: 'Security',
|
|
102
|
+
title: 'test',
|
|
103
|
+
},
|
|
104
|
+
],
|
|
67
105
|
},
|
|
106
|
+
router: { location: '/blog' },
|
|
68
107
|
intl: {
|
|
69
108
|
locale: 'en',
|
|
70
109
|
messages: {},
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { uniqBy } from 'lodash';
|
|
3
|
+
import { FormattedMessage } from 'react-intl';
|
|
4
|
+
import { useSelector, useDispatch } from 'react-redux';
|
|
5
|
+
import { Divider, Segment, Table } from 'semantic-ui-react';
|
|
6
|
+
import { queryRelations } from '@plone/volto/actions';
|
|
7
|
+
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
8
|
+
import { UniversalLink } from '@plone/volto/components';
|
|
9
|
+
|
|
10
|
+
const BrokenRelations = () => {
|
|
11
|
+
const dispatch = useDispatch();
|
|
12
|
+
const brokenRelationStats = useSelector(
|
|
13
|
+
(state) => state.relations?.stats?.broken || {},
|
|
14
|
+
);
|
|
15
|
+
const brokenRelations = useSelector(
|
|
16
|
+
(state) => state.relations?.subrequests?.broken?.relations,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
dispatch(queryRelations(null, true, 'broken'));
|
|
21
|
+
}, [dispatch]);
|
|
22
|
+
|
|
23
|
+
return brokenRelations && Object.keys(brokenRelations).length > 0 ? (
|
|
24
|
+
<>
|
|
25
|
+
<Divider section hidden />
|
|
26
|
+
<Segment>
|
|
27
|
+
<h3>
|
|
28
|
+
<FormattedMessage
|
|
29
|
+
id="Broken relations"
|
|
30
|
+
defaultMessage="Broken relations"
|
|
31
|
+
/>
|
|
32
|
+
</h3>
|
|
33
|
+
{Object.keys(brokenRelations).map((relationname) => (
|
|
34
|
+
<div key={relationname}>
|
|
35
|
+
<Divider section hidden />
|
|
36
|
+
<h4>
|
|
37
|
+
{brokenRelationStats[relationname]} broken <i>{relationname}</i>{' '}
|
|
38
|
+
relations
|
|
39
|
+
</h4>
|
|
40
|
+
<Table>
|
|
41
|
+
<Table.Body>
|
|
42
|
+
{uniqBy(brokenRelations[relationname].items, function (el) {
|
|
43
|
+
return el[0];
|
|
44
|
+
}).map((el) => (
|
|
45
|
+
<Table.Row key={el[0]}>
|
|
46
|
+
<Table.Cell>
|
|
47
|
+
<UniversalLink
|
|
48
|
+
href={`${flattenToAppURL(el[0])}/edit`}
|
|
49
|
+
openLinkInNewTab={true}
|
|
50
|
+
>
|
|
51
|
+
{flattenToAppURL(el[0])}
|
|
52
|
+
</UniversalLink>
|
|
53
|
+
</Table.Cell>
|
|
54
|
+
<Table.Cell>{el[1]}</Table.Cell>
|
|
55
|
+
</Table.Row>
|
|
56
|
+
))}
|
|
57
|
+
</Table.Body>
|
|
58
|
+
</Table>
|
|
59
|
+
</div>
|
|
60
|
+
))}
|
|
61
|
+
</Segment>
|
|
62
|
+
</>
|
|
63
|
+
) : null;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default BrokenRelations;
|