@plone/volto 18.0.0-alpha.41 → 18.0.0-alpha.43
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 +114 -0
- package/finalreleasechangelog.py +48 -0
- package/locales/ca/LC_MESSAGES/volto.po +39 -13
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +40 -14
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +39 -13
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +40 -14
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +40 -14
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +40 -14
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +40 -14
- package/locales/fr.json +1 -1
- package/locales/hi/LC_MESSAGES/volto.po +40 -14
- package/locales/hi.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +40 -14
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +39 -13
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +39 -13
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +39 -13
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +40 -14
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +39 -13
- package/locales/ro.json +1 -1
- package/locales/volto.pot +40 -14
- package/locales/zh_CN/LC_MESSAGES/volto.po +40 -14
- package/locales/zh_CN.json +1 -1
- package/package.json +5 -6
- package/razzle.config.js +3 -3
- package/src/components/index.js +0 -1
- package/src/components/manage/Actions/Actions.stories.jsx +138 -0
- package/src/components/manage/Add/Add.jsx +7 -4
- package/src/components/manage/BlockChooser/BlockChooser.jsx +9 -1
- package/src/components/manage/Blocks/Block/BlocksForm.jsx +5 -0
- package/src/components/manage/Blocks/Block/Edit.jsx +24 -8
- package/src/components/manage/Blocks/Block/EditBlockWrapper.jsx +17 -1
- package/src/components/manage/Blocks/Block/Order/Item.jsx +8 -2
- package/src/components/manage/Blocks/Block/Order/Order.jsx +2 -0
- package/src/components/manage/Blocks/Container/Data.jsx +10 -2
- package/src/components/manage/Blocks/Grid/View.jsx +3 -0
- package/src/components/manage/Blocks/Image/ImageSidebar.jsx +10 -2
- package/src/components/manage/Blocks/LeadImage/Edit.jsx +74 -126
- package/src/components/manage/Blocks/Listing/ListingData.jsx +10 -2
- package/src/components/manage/Blocks/Maps/MapsSidebar.jsx +3 -1
- package/src/components/manage/Blocks/Search/SearchBlockEdit.jsx +2 -0
- package/src/components/manage/Blocks/Search/SearchBlockView.jsx +18 -2
- package/src/components/manage/Blocks/Search/components/SortOn.jsx +82 -55
- package/src/components/manage/Blocks/Search/hocs/withSearch.jsx +1 -1
- package/src/components/manage/Blocks/Search/widgets/SelectMetadataField.jsx +107 -176
- package/src/components/manage/Blocks/Teaser/Data.jsx +10 -2
- package/src/components/manage/Blocks/Teaser/DefaultBody.jsx +15 -8
- package/src/components/manage/Blocks/ToC/Edit.jsx +36 -28
- package/src/components/manage/Blocks/Video/Edit.jsx +105 -172
- package/src/components/manage/Blocks/Video/Edit.stories.jsx +57 -0
- package/src/components/manage/Blocks/Video/VideoSidebar.jsx +3 -1
- package/src/components/manage/Contents/Contents.jsx +4 -1
- package/src/components/manage/Contents/ContentsBreadcrumbs.stories.jsx +46 -0
- package/src/components/manage/Contents/ContentsPropertiesModal.jsx +85 -52
- package/src/components/manage/Contents/ContentsUploadModal.jsx +230 -323
- package/src/components/manage/Contents/ContentsUploadModal.stories.jsx +56 -0
- package/src/components/manage/Controlpanels/AddonsControlpanel.jsx +323 -441
- package/src/components/manage/Controlpanels/Aliases.jsx +452 -580
- package/src/components/manage/Controlpanels/Aliases.stories.jsx +74 -0
- package/src/components/manage/Controlpanels/ContentTypeSchema.jsx +1 -0
- package/src/components/manage/Controlpanels/Controlpanel.jsx +41 -2
- package/src/components/manage/Controlpanels/Controlpanel.test.jsx +55 -24
- package/src/components/manage/Controlpanels/DatabaseInformation.jsx +162 -229
- package/src/components/manage/Controlpanels/Groups/RenderGroups.jsx +74 -122
- package/src/components/manage/Controlpanels/UndoControlpanel.jsx +3 -3
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipListing.jsx +28 -12
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx +12 -4
- package/src/components/manage/Display/Display.jsx +92 -148
- package/src/components/manage/Display/Display.stories.jsx +46 -0
- package/src/components/manage/Edit/Edit.jsx +2 -4
- package/src/components/manage/Form/Form.jsx +85 -20
- package/src/components/manage/Form/InlineForm.jsx +2 -4
- package/src/components/manage/Form/ModalForm.jsx +1 -1
- package/src/components/manage/History/History.jsx +1 -1
- package/src/components/manage/Pluggable/Pluggable.test.js +1 -1
- package/src/components/manage/Preferences/ChangePassword.jsx +94 -172
- package/src/components/manage/Preferences/ChangePassword.stories.jsx +41 -0
- package/src/components/manage/Preferences/PersonalInformation.jsx +50 -115
- package/src/components/manage/Preferences/PersonalPreferences.jsx +46 -100
- package/src/components/manage/Preferences/PersonalPreferences.stories.jsx +48 -0
- package/src/components/manage/Toolbar/More.jsx +308 -399
- package/src/components/manage/Toolbar/Toolbar.jsx +1 -1
- package/src/components/manage/Widgets/ArrayWidget.jsx +2 -2
- package/src/components/manage/Widgets/DatetimeWidget.jsx +121 -175
- package/src/components/manage/Widgets/ImageWidget.jsx +6 -5
- package/src/components/manage/Widgets/RecurrenceWidget/EndField.jsx +7 -1
- package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +80 -31
- package/src/components/manage/Widgets/ReferenceWidget.jsx +134 -210
- package/src/components/theme/Register/Register.jsx +70 -142
- package/src/components/theme/Register/Register.stories.jsx +49 -0
- package/src/components/theme/Search/Search.jsx +13 -5
- package/src/components/theme/Tags/Tags.jsx +19 -10
- package/src/components/theme/Tags/Tags.test.jsx +9 -11
- package/src/components/theme/View/AlbumView.jsx +122 -167
- package/src/components/theme/View/LinkView.jsx +4 -0
- package/src/components/theme/View/LinkView.test.jsx +2 -0
- package/src/components/theme/View/View.jsx +0 -13
- package/src/components/theme/View/View.test.jsx +0 -3
- package/src/config/ControlPanels.js +49 -43
- package/src/config/Widgets.jsx +1 -1
- package/src/config/config.test.js +1 -0
- package/src/config/index.js +23 -2
- package/src/config/slots.js +12 -0
- package/src/config/validation.ts +155 -0
- package/src/helpers/Blocks/Blocks.js +12 -7
- package/src/helpers/Blocks/Blocks.test.js +15 -0
- package/src/helpers/Blocks/cloneBlocks.ts +1 -1
- package/src/helpers/Extensions/withBlockExtensions.jsx +1 -1
- package/src/helpers/FormValidation/FormValidation.jsx +128 -172
- package/src/helpers/FormValidation/FormValidation.test.js +836 -8
- package/src/helpers/FormValidation/validators.ts +203 -0
- package/src/helpers/MessageLabels/MessageLabels.js +28 -0
- package/src/helpers/Url/Url.test.js +19 -6
- package/src/helpers/Url/urlRegex.js +1 -1
- package/src/helpers/User/User.js +1 -1
- package/src/helpers/index.js +2 -0
- package/src/hooks/client/useClient.js +1 -1
- package/src/middleware/api.js +4 -2
- package/src/middleware/index.js +1 -0
- package/src/middleware/userSessionReset.js +46 -0
- package/src/store.js +2 -0
- package/test-setup-config.jsx +10 -0
- package/theme/themes/default/modules/embed.variables +1 -1
- package/theme/themes/pastanaga/collections/form.overrides +34 -0
- package/theme/themes/pastanaga/extras/blocks.less +6 -0
- package/theme/themes/pastanaga/extras/sidebar.less +4 -0
- package/theme/themes/pastanaga/extras/toolbar.less +10 -3
- package/tsconfig.declarations.json +3 -2
- package/types/components/index.d.ts +0 -1
- package/types/components/manage/Actions/Actions.stories.d.ts +8 -0
- package/types/components/manage/Blocks/Block/Order/Order.d.ts +2 -1
- package/types/components/manage/Blocks/LeadImage/Edit.d.ts +14 -5
- package/types/components/manage/Blocks/Search/widgets/SelectMetadataField.d.ts +0 -5
- package/types/components/manage/Blocks/ToC/Edit.d.ts +1 -6
- package/types/components/manage/Blocks/Video/Edit.d.ts +1 -1
- package/types/components/manage/Blocks/Video/Edit.stories.d.ts +8 -0
- package/types/components/manage/Contents/ContentsBreadcrumbs.stories.d.ts +8 -0
- package/types/components/manage/Contents/ContentsUploadModal.d.ts +14 -2
- package/types/components/manage/Contents/ContentsUploadModal.stories.d.ts +8 -0
- package/types/components/manage/Contents/index.d.ts +1 -1
- package/types/components/manage/Controlpanels/AddonsControlpanel.d.ts +2 -2
- package/types/components/manage/Controlpanels/Aliases.d.ts +2 -2
- package/types/components/manage/Controlpanels/Aliases.stories.d.ts +8 -0
- package/types/components/manage/Controlpanels/DatabaseInformation.d.ts +2 -2
- package/types/components/manage/Controlpanels/Groups/RenderGroups.d.ts +10 -5
- package/types/components/manage/Controlpanels/index.d.ts +4 -4
- package/types/components/manage/Display/Display.stories.d.ts +8 -0
- package/types/components/manage/Preferences/ChangePassword.d.ts +2 -2
- package/types/components/manage/Preferences/ChangePassword.stories.d.ts +8 -0
- package/types/components/manage/Preferences/PersonalInformation.d.ts +7 -2
- package/types/components/manage/Preferences/PersonalPreferences.d.ts +5 -1
- package/types/components/manage/Preferences/PersonalPreferences.stories.d.ts +8 -0
- package/types/components/manage/Toolbar/More.d.ts +8 -5
- package/types/components/manage/Widgets/DatetimeWidget.d.ts +0 -85
- package/types/components/manage/Widgets/DatetimeWidget.stories.d.ts +0 -1
- package/types/components/manage/Widgets/ReferenceWidget.d.ts +27 -2
- package/types/components/manage/Widgets/index.d.ts +1 -1
- package/types/components/theme/Register/Register.d.ts +2 -2
- package/types/components/theme/Register/Register.stories.d.ts +9 -0
- package/types/components/theme/Tags/Tags.d.ts +15 -7
- package/types/components/theme/View/AlbumView.d.ts +3 -17
- package/types/config/ControlPanels.d.ts +8 -0
- package/types/config/RichTextEditor/ToHTML.d.ts +1 -1
- package/types/config/Widgets.d.ts +3 -3
- package/types/config/slots.d.ts +21 -0
- package/types/config/validation.d.ts +3 -0
- package/types/helpers/Blocks/Blocks.d.ts +6 -0
- package/types/helpers/Extensions/withBlockExtensions.d.ts +1 -1
- package/types/helpers/FormValidation/FormValidation.d.ts +2 -0
- package/types/helpers/FormValidation/validators.d.ts +29 -0
- package/types/helpers/MessageLabels/MessageLabels.d.ts +36 -0
- package/types/helpers/User/User.d.ts +1 -1
- package/types/helpers/index.d.ts +2 -2
- package/types/middleware/index.d.ts +1 -0
- package/types/middleware/userSessionReset.d.ts +5 -0
- package/src/components/theme/SocialSharing/SocialSharing.jsx +0 -48
- package/src/components/theme/SocialSharing/SocialSharing.test.jsx +0 -14
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { Link } from 'react-router-dom';
|
|
11
|
-
import { getBaseUrl, getParentUrl, Helmet } from '@plone/volto/helpers';
|
|
1
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
+
import { Link, useHistory, useLocation } from 'react-router-dom';
|
|
4
|
+
import {
|
|
5
|
+
getBaseUrl,
|
|
6
|
+
getParentUrl,
|
|
7
|
+
Helmet,
|
|
8
|
+
usePrevious,
|
|
9
|
+
} from '@plone/volto/helpers';
|
|
12
10
|
import { removeAliases, addAliases, getAliases } from '@plone/volto/actions';
|
|
13
11
|
import { createPortal } from 'react-dom';
|
|
14
12
|
import {
|
|
@@ -25,9 +23,10 @@ import {
|
|
|
25
23
|
Pagination,
|
|
26
24
|
Menu,
|
|
27
25
|
} from 'semantic-ui-react';
|
|
28
|
-
import { FormattedMessage, defineMessages,
|
|
29
|
-
import
|
|
26
|
+
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
|
27
|
+
import DatetimeWidget from '@plone/volto/components/manage/Widgets/DatetimeWidget';
|
|
30
28
|
import { Icon, Toolbar } from '@plone/volto/components';
|
|
29
|
+
import { useClient } from '@plone/volto/hooks';
|
|
31
30
|
|
|
32
31
|
import backSVG from '@plone/volto/icons/back.svg';
|
|
33
32
|
import { map } from 'lodash';
|
|
@@ -61,627 +60,500 @@ const filterChoices = [
|
|
|
61
60
|
|
|
62
61
|
const itemsPerPageChoices = [10, 25, 50, 'All'];
|
|
63
62
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Property types.
|
|
72
|
-
* @property {Object} propTypes Property types.
|
|
73
|
-
* @static
|
|
74
|
-
*/
|
|
75
|
-
static propTypes = {
|
|
76
|
-
addAliases: PropTypes.func.isRequired,
|
|
77
|
-
getAliases: PropTypes.func.isRequired,
|
|
78
|
-
removeAliases: PropTypes.func.isRequired,
|
|
79
|
-
};
|
|
63
|
+
const Aliases = (props) => {
|
|
64
|
+
const title = props;
|
|
65
|
+
const intl = useIntl();
|
|
66
|
+
const dispatch = useDispatch();
|
|
67
|
+
const { pathname } = useLocation();
|
|
68
|
+
const history = useHistory();
|
|
80
69
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
isAltUrlCorrect: false,
|
|
95
|
-
targetUrlPath: '',
|
|
96
|
-
isTargetUrlCorrect: false,
|
|
97
|
-
aliasesToRemove: [],
|
|
98
|
-
errorMessageAdd: '',
|
|
99
|
-
filterQuery: '',
|
|
100
|
-
aliases: [],
|
|
101
|
-
activePage: 1,
|
|
102
|
-
pages: '',
|
|
103
|
-
itemsPerPage: 10,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
70
|
+
const aliases = useSelector((state) => state.aliases);
|
|
71
|
+
const [filterType, setFilterType] = useState(filterChoices[0]);
|
|
72
|
+
const [createdBefore, setCreatedBefore] = useState(null);
|
|
73
|
+
const [altUrlPath, setAltUrlPath] = useState('');
|
|
74
|
+
const [isAltUrlCorrect, setIsAltUrlCorrect] = useState(false);
|
|
75
|
+
const [targetUrlPath, setTargetUrlPath] = useState('');
|
|
76
|
+
const [aliasesToRemove, setAliasesToRemove] = useState([]);
|
|
77
|
+
const [errorMessageAdd, setErrorMessageAdd] = useState('');
|
|
78
|
+
const [filterQuery, setFilterQuery] = useState('');
|
|
79
|
+
const [activePage, setActivePage] = useState(1);
|
|
80
|
+
const [pages, setPages] = useState('');
|
|
81
|
+
const [itemsPerPage, setItemsPerPage] = useState(10);
|
|
82
|
+
const isClient = useClient();
|
|
106
83
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.setState({ isClient: true });
|
|
115
|
-
this.props.getAliases(getBaseUrl(this.props.pathname), {
|
|
116
|
-
query: filterQuery,
|
|
117
|
-
manual: filterType.value,
|
|
118
|
-
datetime: createdBefore,
|
|
119
|
-
batchSize: itemsPerPage,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
84
|
+
const prevaliasesitemstotal = usePrevious(aliases.items_total);
|
|
85
|
+
const previtemsPerPage = usePrevious(itemsPerPage);
|
|
86
|
+
const prevactivePage = usePrevious(activePage);
|
|
87
|
+
const prevalturlpath = usePrevious(altUrlPath);
|
|
88
|
+
const prevtargetUrlPath = usePrevious(targetUrlPath);
|
|
89
|
+
const prevaliasesaddloading = usePrevious(aliases.add.loading);
|
|
90
|
+
const prevaliasesremoveloading = usePrevious(aliases.remove.loading);
|
|
122
91
|
|
|
123
|
-
|
|
124
|
-
* Component did mount
|
|
125
|
-
* @method componentDidUpdate
|
|
126
|
-
* @returns {undefined}
|
|
127
|
-
*/
|
|
128
|
-
componentDidUpdate(prevProps, prevState) {
|
|
129
|
-
const { filterQuery, filterType, createdBefore, itemsPerPage } = this.state;
|
|
92
|
+
useEffect(() => {
|
|
130
93
|
if (
|
|
131
|
-
|
|
132
|
-
|
|
94
|
+
prevaliasesitemstotal !== aliases.items_total ||
|
|
95
|
+
previtemsPerPage !== itemsPerPage
|
|
133
96
|
) {
|
|
134
|
-
const pages = Math.ceil(
|
|
135
|
-
this.props.aliases.items_total / this.state.itemsPerPage,
|
|
136
|
-
);
|
|
97
|
+
const pages = Math.ceil(aliases.items_total / itemsPerPage);
|
|
137
98
|
|
|
138
99
|
if (pages === 0 || isNaN(pages)) {
|
|
139
|
-
|
|
100
|
+
setPages('');
|
|
140
101
|
} else {
|
|
141
|
-
|
|
102
|
+
setPages(pages);
|
|
142
103
|
}
|
|
143
104
|
}
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
if (prevState.altUrlPath !== this.state.altUrlPath) {
|
|
157
|
-
if (this.state.altUrlPath.charAt(0) === '/') {
|
|
158
|
-
this.setState({ isAltUrlCorrect: true });
|
|
159
|
-
} else {
|
|
160
|
-
this.setState({ isAltUrlCorrect: false });
|
|
161
|
-
}
|
|
105
|
+
if (prevactivePage !== activePage || previtemsPerPage !== itemsPerPage) {
|
|
106
|
+
dispatch(
|
|
107
|
+
getAliases(getBaseUrl(pathname), {
|
|
108
|
+
query: filterQuery,
|
|
109
|
+
manual: filterType.value,
|
|
110
|
+
datetime: createdBefore,
|
|
111
|
+
batchSize: itemsPerPage === 'All' ? 999999999999 : itemsPerPage,
|
|
112
|
+
batchStart: (activePage - 1) * itemsPerPage,
|
|
113
|
+
}),
|
|
114
|
+
);
|
|
162
115
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
this.setState({ isTargetUrlCorrect: true });
|
|
116
|
+
if (prevalturlpath !== altUrlPath) {
|
|
117
|
+
if (altUrlPath.charAt(0) === '/') {
|
|
118
|
+
setIsAltUrlCorrect(true);
|
|
167
119
|
} else {
|
|
168
|
-
|
|
120
|
+
setIsAltUrlCorrect(false);
|
|
169
121
|
}
|
|
170
122
|
}
|
|
171
|
-
}
|
|
123
|
+
}, [
|
|
124
|
+
itemsPerPage,
|
|
125
|
+
pathname,
|
|
126
|
+
prevaliasesitemstotal,
|
|
127
|
+
aliases.items_total,
|
|
128
|
+
previtemsPerPage,
|
|
129
|
+
prevactivePage,
|
|
130
|
+
activePage,
|
|
131
|
+
prevalturlpath,
|
|
132
|
+
altUrlPath,
|
|
133
|
+
prevtargetUrlPath,
|
|
134
|
+
targetUrlPath,
|
|
135
|
+
dispatch,
|
|
136
|
+
filterQuery,
|
|
137
|
+
filterType.value,
|
|
138
|
+
createdBefore,
|
|
139
|
+
]);
|
|
172
140
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
* @returns {undefined}
|
|
178
|
-
*/
|
|
179
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
180
|
-
if (this.props.aliases.add.loading && !nextProps.aliases.add.loaded) {
|
|
181
|
-
if (nextProps.aliases.add.error) {
|
|
182
|
-
this.setState({
|
|
183
|
-
errorMessageAdd: nextProps.aliases.add.error.response.body.message,
|
|
184
|
-
});
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
if (prevaliasesaddloading && !aliases.add.loaded) {
|
|
143
|
+
if (aliases.add.error) {
|
|
144
|
+
setErrorMessageAdd(aliases.add.error.response.body.message);
|
|
185
145
|
}
|
|
186
146
|
}
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
});
|
|
147
|
+
if (prevaliasesaddloading && aliases.add.loaded) {
|
|
148
|
+
dispatch(
|
|
149
|
+
getAliases(getBaseUrl(pathname), {
|
|
150
|
+
query: filterQuery,
|
|
151
|
+
manual: filterType.value,
|
|
152
|
+
datetime: createdBefore,
|
|
153
|
+
batchSize: itemsPerPage,
|
|
154
|
+
}),
|
|
155
|
+
);
|
|
197
156
|
toast.success(
|
|
198
157
|
<Toast
|
|
199
158
|
success
|
|
200
|
-
title={
|
|
201
|
-
content={
|
|
159
|
+
title={intl.formatMessage(messages.success)}
|
|
160
|
+
content={intl.formatMessage(messages.successAdd)}
|
|
202
161
|
/>,
|
|
203
162
|
);
|
|
204
|
-
if (!
|
|
205
|
-
|
|
206
|
-
errorMessageAdd: '',
|
|
207
|
-
});
|
|
163
|
+
if (!aliases.add.error) {
|
|
164
|
+
setErrorMessageAdd('');
|
|
208
165
|
}
|
|
209
166
|
}
|
|
210
|
-
if (
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
});
|
|
167
|
+
if (prevaliasesremoveloading && aliases.remove.loaded) {
|
|
168
|
+
dispatch(
|
|
169
|
+
getAliases(getBaseUrl(pathname), {
|
|
170
|
+
query: filterQuery,
|
|
171
|
+
manual: filterType.value,
|
|
172
|
+
datetime: createdBefore,
|
|
173
|
+
batchSize: itemsPerPage,
|
|
174
|
+
}),
|
|
175
|
+
);
|
|
220
176
|
}
|
|
221
|
-
}
|
|
177
|
+
}, [
|
|
178
|
+
prevaliasesaddloading,
|
|
179
|
+
aliases.add.loaded,
|
|
180
|
+
aliases.add.error,
|
|
181
|
+
aliases.remove.loaded,
|
|
182
|
+
prevaliasesremoveloading,
|
|
183
|
+
dispatch,
|
|
184
|
+
pathname,
|
|
185
|
+
filterQuery,
|
|
186
|
+
filterType.value,
|
|
187
|
+
createdBefore,
|
|
188
|
+
itemsPerPage,
|
|
189
|
+
intl,
|
|
190
|
+
]);
|
|
222
191
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
* @returns {undefined}
|
|
227
|
-
*/
|
|
228
|
-
onCancel() {
|
|
229
|
-
this.props.history.push(getParentUrl(this.props.pathname));
|
|
230
|
-
}
|
|
192
|
+
const onCancel = () => {
|
|
193
|
+
history.push(getParentUrl(pathname));
|
|
194
|
+
};
|
|
231
195
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
* @returns {undefined}
|
|
236
|
-
*/
|
|
237
|
-
handleSelectFilterType(type) {
|
|
238
|
-
this.setState({ filterType: type });
|
|
239
|
-
}
|
|
196
|
+
const handleSelectFilterType = (type) => {
|
|
197
|
+
setFilterType(type);
|
|
198
|
+
};
|
|
240
199
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
* @returns {undefined}
|
|
245
|
-
*/
|
|
246
|
-
handleFilterQueryChange(query) {
|
|
247
|
-
this.setState({ filterQuery: query });
|
|
248
|
-
}
|
|
200
|
+
const handleFilterQueryChange = (query) => {
|
|
201
|
+
setFilterQuery(query);
|
|
202
|
+
};
|
|
249
203
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
* @returns {undefined}
|
|
254
|
-
*/
|
|
255
|
-
handleCreateDate(date) {
|
|
256
|
-
this.setState({ createdBefore: date });
|
|
257
|
-
}
|
|
204
|
+
const handleCreateDate = (date) => {
|
|
205
|
+
setCreatedBefore(date);
|
|
206
|
+
};
|
|
258
207
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
datetime: createdBefore,
|
|
270
|
-
batchSize: itemsPerPage,
|
|
271
|
-
});
|
|
272
|
-
}
|
|
208
|
+
const handleSubmitFilter = () => {
|
|
209
|
+
dispatch(
|
|
210
|
+
getAliases(getBaseUrl(pathname), {
|
|
211
|
+
query: filterQuery,
|
|
212
|
+
manual: filterType.value,
|
|
213
|
+
datetime: createdBefore,
|
|
214
|
+
batchSize: itemsPerPage,
|
|
215
|
+
}),
|
|
216
|
+
);
|
|
217
|
+
};
|
|
273
218
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
* @returns {undefined}
|
|
278
|
-
*/
|
|
279
|
-
handleAltUrlChange(url) {
|
|
280
|
-
this.setState({ altUrlPath: url });
|
|
281
|
-
}
|
|
219
|
+
const handleAltUrlChange = (url) => {
|
|
220
|
+
setAltUrlPath(url);
|
|
221
|
+
};
|
|
282
222
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
* @returns {undefined}
|
|
287
|
-
*/
|
|
288
|
-
handleTargetUrlChange(url) {
|
|
289
|
-
this.setState({ targetUrlPath: url });
|
|
290
|
-
}
|
|
223
|
+
const handleTargetUrlChange = (url) => {
|
|
224
|
+
setTargetUrlPath(url);
|
|
225
|
+
};
|
|
291
226
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
});
|
|
307
|
-
this.setState({ altUrlPath: '', targetUrlPath: '' });
|
|
227
|
+
const handleSubmitAlias = useCallback(() => {
|
|
228
|
+
if (isAltUrlCorrect) {
|
|
229
|
+
dispatch(
|
|
230
|
+
addAliases('', {
|
|
231
|
+
items: [
|
|
232
|
+
{
|
|
233
|
+
path: altUrlPath,
|
|
234
|
+
'redirect-to': targetUrlPath,
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
}),
|
|
238
|
+
);
|
|
239
|
+
setAltUrlPath('');
|
|
240
|
+
setTargetUrlPath('');
|
|
308
241
|
}
|
|
309
|
-
}
|
|
242
|
+
}, [isAltUrlCorrect, altUrlPath, targetUrlPath, dispatch]);
|
|
310
243
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
*/
|
|
316
|
-
handleCheckAlias(alias) {
|
|
317
|
-
const aliases = this.state.aliasesToRemove;
|
|
318
|
-
if (aliases.includes(alias)) {
|
|
319
|
-
const index = aliases.indexOf(alias);
|
|
244
|
+
const handleCheckAlias = (alias) => {
|
|
245
|
+
const aliasess = [...aliasesToRemove];
|
|
246
|
+
if (aliasess.includes(alias)) {
|
|
247
|
+
const index = aliasess.indexOf(alias);
|
|
320
248
|
if (index > -1) {
|
|
321
|
-
let newAliasesArr =
|
|
249
|
+
let newAliasesArr = aliasess;
|
|
322
250
|
newAliasesArr.splice(index, 1);
|
|
323
|
-
|
|
251
|
+
setAliasesToRemove(newAliasesArr);
|
|
324
252
|
}
|
|
325
253
|
} else {
|
|
326
|
-
|
|
327
|
-
aliasesToRemove: [...this.state.aliasesToRemove, alias],
|
|
328
|
-
});
|
|
254
|
+
setAliasesToRemove([...aliasesToRemove, alias]);
|
|
329
255
|
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
* Remove aliases handler
|
|
334
|
-
* @method handleRemoveAliases
|
|
335
|
-
* @returns {undefined}
|
|
336
|
-
*/
|
|
337
|
-
handleRemoveAliases = () => {
|
|
338
|
-
const items = this.state.aliasesToRemove.map((a) => {
|
|
256
|
+
};
|
|
257
|
+
const handleRemoveAliases = () => {
|
|
258
|
+
const items = aliasesToRemove.map((a) => {
|
|
339
259
|
return {
|
|
340
260
|
path: a,
|
|
341
261
|
};
|
|
342
262
|
});
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
263
|
+
|
|
264
|
+
dispatch(
|
|
265
|
+
removeAliases('', {
|
|
266
|
+
items,
|
|
267
|
+
}),
|
|
268
|
+
);
|
|
269
|
+
setAliasesToRemove([]);
|
|
347
270
|
};
|
|
348
271
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
* @returns {undefined}
|
|
353
|
-
*/
|
|
354
|
-
handlePageChange(e, { activePage }) {
|
|
355
|
-
this.setState({ activePage });
|
|
356
|
-
}
|
|
272
|
+
const handlePageChange = (e, { activePage }) => {
|
|
273
|
+
setActivePage(activePage);
|
|
274
|
+
};
|
|
357
275
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
*/
|
|
363
|
-
handleItemsPerPage(e, { value }) {
|
|
364
|
-
this.setState({ itemsPerPage: value, activePage: 1 });
|
|
365
|
-
}
|
|
276
|
+
const handleItemsPerPage = (e, { value }) => {
|
|
277
|
+
setItemsPerPage(value);
|
|
278
|
+
setActivePage(1);
|
|
279
|
+
};
|
|
366
280
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
this.state.altUrlPath !== '' && (
|
|
410
|
-
<p style={{ color: 'red' }}>
|
|
411
|
-
<FormattedMessage
|
|
412
|
-
id="Alternative url path must start with a slash."
|
|
413
|
-
defaultMessage="Alternative url path must start with a slash."
|
|
414
|
-
/>
|
|
415
|
-
</p>
|
|
416
|
-
)}
|
|
417
|
-
</Form.Field>
|
|
418
|
-
<Header size="medium">
|
|
419
|
-
<FormattedMessage
|
|
420
|
-
id="Target Path (Required)"
|
|
421
|
-
defaultMessage="Target Path (Required)"
|
|
422
|
-
/>
|
|
423
|
-
</Header>
|
|
424
|
-
<p className="help">
|
|
425
|
-
<FormattedMessage
|
|
426
|
-
id="Enter the absolute path of the target. The path must start with '/'. Target must exist or be an existing alternative url path to the target."
|
|
427
|
-
defaultMessage="Enter the absolute path of the target. The path must start with '/'. Target must exist or be an existing alternative url path to the target."
|
|
428
|
-
/>
|
|
429
|
-
</p>
|
|
430
|
-
<Form.Field>
|
|
431
|
-
<Input
|
|
432
|
-
id="target-url-input"
|
|
433
|
-
name="target-url-path"
|
|
434
|
-
placeholder="/example"
|
|
435
|
-
value={this.state.targetUrlPath}
|
|
436
|
-
onChange={(e) =>
|
|
437
|
-
this.handleTargetUrlChange(e.target.value)
|
|
438
|
-
}
|
|
439
|
-
/>
|
|
440
|
-
{!this.state.isTargetUrlCorrect &&
|
|
441
|
-
this.state.targetUrlPath !== '' && (
|
|
442
|
-
<p style={{ color: 'red' }}>
|
|
443
|
-
<FormattedMessage
|
|
444
|
-
id="Target url path must start with a slash."
|
|
445
|
-
defaultMessage="Target url path must start with a slash."
|
|
446
|
-
/>
|
|
447
|
-
</p>
|
|
448
|
-
)}
|
|
449
|
-
</Form.Field>
|
|
450
|
-
<Button
|
|
451
|
-
id="submit-alias"
|
|
452
|
-
primary
|
|
453
|
-
onClick={() => this.handleSubmitAlias()}
|
|
454
|
-
disabled={
|
|
455
|
-
!this.state.isAltUrlCorrect ||
|
|
456
|
-
!this.state.isTargetUrlCorrect ||
|
|
457
|
-
this.state.altUrlPath === '' ||
|
|
458
|
-
this.state.targetUrlPath === ''
|
|
459
|
-
}
|
|
460
|
-
>
|
|
461
|
-
<FormattedMessage id="Add" defaultMessage="Add" />
|
|
462
|
-
</Button>
|
|
463
|
-
{this.state.errorMessageAdd && (
|
|
464
|
-
<Message color="red">
|
|
465
|
-
<Message.Header>
|
|
466
|
-
<FormattedMessage
|
|
467
|
-
id="ErrorHeader"
|
|
468
|
-
defaultMessage="Error"
|
|
469
|
-
/>
|
|
470
|
-
</Message.Header>
|
|
471
|
-
<p>{this.state.errorMessageAdd}</p>
|
|
472
|
-
</Message>
|
|
281
|
+
return (
|
|
282
|
+
<div id="page-aliases">
|
|
283
|
+
<Helmet title={intl.formatMessage(messages.aliases)} />
|
|
284
|
+
<Container>
|
|
285
|
+
<article id="content">
|
|
286
|
+
<Segment.Group raised>
|
|
287
|
+
<Segment className="primary">
|
|
288
|
+
<FormattedMessage
|
|
289
|
+
id="URL Management"
|
|
290
|
+
defaultMessage="URL Management"
|
|
291
|
+
values={{ title: <q>{title}</q> }}
|
|
292
|
+
/>
|
|
293
|
+
</Segment>
|
|
294
|
+
<Form>
|
|
295
|
+
<Segment>
|
|
296
|
+
<Header size="medium">
|
|
297
|
+
<FormattedMessage
|
|
298
|
+
id="Alternative url path (Required)"
|
|
299
|
+
defaultMessage="Alternative url path (Required)"
|
|
300
|
+
/>
|
|
301
|
+
</Header>
|
|
302
|
+
<p className="help">
|
|
303
|
+
<FormattedMessage
|
|
304
|
+
id="Enter the absolute path where the alternative url should exist. The path must start with '/'. Only urls that result in a 404 not found page will result in a redirect occurring."
|
|
305
|
+
defaultMessage="Enter the absolute path where the alternative url should exist. The path must start with '/'. Only urls that result in a 404 not found page will result in a redirect occurring."
|
|
306
|
+
/>
|
|
307
|
+
</p>
|
|
308
|
+
<Form.Field>
|
|
309
|
+
<Input
|
|
310
|
+
id="alternative-url-input"
|
|
311
|
+
name="alternative-url-path"
|
|
312
|
+
placeholder="/example"
|
|
313
|
+
value={altUrlPath}
|
|
314
|
+
onChange={(e) => handleAltUrlChange(e.target.value)}
|
|
315
|
+
/>
|
|
316
|
+
{!isAltUrlCorrect && altUrlPath !== '' && (
|
|
317
|
+
<p style={{ color: 'red' }}>
|
|
318
|
+
<FormattedMessage
|
|
319
|
+
id="Alternative url path must start with a slash."
|
|
320
|
+
defaultMessage="Alternative url path must start with a slash."
|
|
321
|
+
/>
|
|
322
|
+
</p>
|
|
473
323
|
)}
|
|
474
|
-
</
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
324
|
+
</Form.Field>
|
|
325
|
+
<Header size="medium">
|
|
326
|
+
<FormattedMessage
|
|
327
|
+
id="Target Path (Required)"
|
|
328
|
+
defaultMessage="Target Path (Required)"
|
|
329
|
+
/>
|
|
330
|
+
</Header>
|
|
331
|
+
<p className="help">
|
|
332
|
+
<FormattedMessage
|
|
333
|
+
id="Enter the absolute path of the target. Target must exist or be an existing alternative url path to the target."
|
|
334
|
+
defaultMessage="Enter the absolute path of the target. Target must exist or be an existing alternative url path to the target."
|
|
335
|
+
/>
|
|
336
|
+
</p>
|
|
337
|
+
<Form.Field>
|
|
338
|
+
<Input
|
|
339
|
+
id="target-url-input"
|
|
340
|
+
name="target-url-path"
|
|
341
|
+
placeholder="/example"
|
|
342
|
+
value={targetUrlPath}
|
|
343
|
+
onChange={(e) => handleTargetUrlChange(e.target.value)}
|
|
344
|
+
/>
|
|
345
|
+
</Form.Field>
|
|
346
|
+
<Button
|
|
347
|
+
id="submit-alias"
|
|
348
|
+
primary
|
|
349
|
+
onClick={() => handleSubmitAlias()}
|
|
350
|
+
disabled={
|
|
351
|
+
!isAltUrlCorrect ||
|
|
352
|
+
altUrlPath === '' ||
|
|
353
|
+
targetUrlPath === ''
|
|
354
|
+
}
|
|
355
|
+
>
|
|
356
|
+
<FormattedMessage id="Add" defaultMessage="Add" />
|
|
357
|
+
</Button>
|
|
358
|
+
{errorMessageAdd && (
|
|
359
|
+
<Message color="red">
|
|
360
|
+
<Message.Header>
|
|
361
|
+
<FormattedMessage
|
|
362
|
+
id="ErrorHeader"
|
|
363
|
+
defaultMessage="Error"
|
|
514
364
|
/>
|
|
515
|
-
</
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
365
|
+
</Message.Header>
|
|
366
|
+
<p>{errorMessageAdd}</p>
|
|
367
|
+
</Message>
|
|
368
|
+
)}
|
|
369
|
+
</Segment>
|
|
370
|
+
</Form>
|
|
371
|
+
<Form>
|
|
372
|
+
<Segment className="primary">
|
|
373
|
+
<Header size="medium">
|
|
374
|
+
<FormattedMessage
|
|
375
|
+
id="All existing alternative urls for this site"
|
|
376
|
+
defaultMessage="All existing alternative urls for this site"
|
|
377
|
+
/>
|
|
378
|
+
</Header>
|
|
379
|
+
<Header size="small">
|
|
380
|
+
<FormattedMessage
|
|
381
|
+
id="Filter by prefix"
|
|
382
|
+
defaultMessage="Filter by prefix"
|
|
383
|
+
/>
|
|
384
|
+
</Header>
|
|
385
|
+
<Form.Field>
|
|
386
|
+
<Input
|
|
387
|
+
name="filter"
|
|
388
|
+
placeholder="/example"
|
|
389
|
+
value={filterQuery}
|
|
390
|
+
onChange={(e) => handleFilterQueryChange(e.target.value)}
|
|
391
|
+
/>
|
|
392
|
+
</Form.Field>
|
|
393
|
+
<Header size="small">
|
|
394
|
+
<FormattedMessage
|
|
395
|
+
id="Manually or automatically added?"
|
|
396
|
+
defaultMessage="Manually or automatically added?"
|
|
397
|
+
/>
|
|
398
|
+
</Header>
|
|
399
|
+
{filterChoices.map((o, i) => (
|
|
400
|
+
<Form.Field key={i}>
|
|
401
|
+
<Radio
|
|
402
|
+
label={o.label}
|
|
403
|
+
name="radioGroup"
|
|
404
|
+
value={o.value}
|
|
405
|
+
checked={filterType === o}
|
|
406
|
+
onChange={() => handleSelectFilterType(o)}
|
|
526
407
|
/>
|
|
527
408
|
</Form.Field>
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
<Table>
|
|
539
|
-
<Table.Body>
|
|
540
|
-
<Table.Row>
|
|
541
|
-
<Table.HeaderCell>
|
|
542
|
-
<FormattedMessage
|
|
543
|
-
id="Select"
|
|
544
|
-
defaultMessage="Select"
|
|
545
|
-
/>
|
|
546
|
-
</Table.HeaderCell>
|
|
547
|
-
<Table.HeaderCell>
|
|
548
|
-
<FormattedMessage id="Alias" defaultMessage="Alias" />
|
|
549
|
-
</Table.HeaderCell>
|
|
550
|
-
<Table.HeaderCell>
|
|
551
|
-
<FormattedMessage
|
|
552
|
-
id="Target"
|
|
553
|
-
defaultMessage="Target"
|
|
554
|
-
/>
|
|
555
|
-
</Table.HeaderCell>
|
|
556
|
-
<Table.HeaderCell>
|
|
557
|
-
<FormattedMessage id="Date" defaultMessage="Date" />
|
|
558
|
-
</Table.HeaderCell>
|
|
559
|
-
<Table.HeaderCell>
|
|
560
|
-
<FormattedMessage
|
|
561
|
-
id="Manual"
|
|
562
|
-
defaultMessage="Manual"
|
|
563
|
-
/>
|
|
564
|
-
</Table.HeaderCell>
|
|
565
|
-
</Table.Row>
|
|
566
|
-
{this.props.aliases.items.length > 0 &&
|
|
567
|
-
this.props.aliases.items.map((alias, i) => (
|
|
568
|
-
<Table.Row key={i}>
|
|
569
|
-
<Table.Cell>
|
|
570
|
-
<Checkbox
|
|
571
|
-
onChange={(e, { value }) =>
|
|
572
|
-
this.handleCheckAlias(value)
|
|
573
|
-
}
|
|
574
|
-
checked={this.state.aliasesToRemove.includes(
|
|
575
|
-
alias.path,
|
|
576
|
-
)}
|
|
577
|
-
value={alias.path}
|
|
578
|
-
/>
|
|
579
|
-
</Table.Cell>
|
|
580
|
-
<Table.Cell>
|
|
581
|
-
<p>{alias.path}</p>
|
|
582
|
-
</Table.Cell>
|
|
583
|
-
<Table.Cell>
|
|
584
|
-
<p>{alias['redirect-to']}</p>
|
|
585
|
-
</Table.Cell>
|
|
586
|
-
<Table.Cell>
|
|
587
|
-
<p>{alias.datetime}</p>
|
|
588
|
-
</Table.Cell>
|
|
589
|
-
<Table.Cell>
|
|
590
|
-
<p>{`${alias.manual}`}</p>
|
|
591
|
-
</Table.Cell>
|
|
592
|
-
</Table.Row>
|
|
593
|
-
))}
|
|
594
|
-
</Table.Body>
|
|
595
|
-
</Table>
|
|
596
|
-
<div
|
|
597
|
-
style={{
|
|
598
|
-
display: 'flex',
|
|
599
|
-
flexWrap: 'wrap',
|
|
600
|
-
alignItems: 'center',
|
|
601
|
-
marginBottom: '20px',
|
|
409
|
+
))}
|
|
410
|
+
<Form.Field>
|
|
411
|
+
<DatetimeWidget
|
|
412
|
+
id="created-before-date"
|
|
413
|
+
title={'Created before'}
|
|
414
|
+
dateOnly={true}
|
|
415
|
+
value={createdBefore}
|
|
416
|
+
onChange={(id, value) => {
|
|
417
|
+
handleCreateDate(value);
|
|
602
418
|
}}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
419
|
+
/>
|
|
420
|
+
</Form.Field>
|
|
421
|
+
<Button onClick={() => handleSubmitFilter()} primary>
|
|
422
|
+
Filter
|
|
423
|
+
</Button>
|
|
424
|
+
<Header size="small">
|
|
425
|
+
<FormattedMessage
|
|
426
|
+
id="Alternative url path → target url path (date and time of creation, manually created yes/no)"
|
|
427
|
+
defaultMessage="Alternative url path → target url path (date and time of creation, manually created yes/no)"
|
|
428
|
+
/>
|
|
429
|
+
</Header>
|
|
430
|
+
|
|
431
|
+
<Table>
|
|
432
|
+
<Table.Body>
|
|
433
|
+
<Table.Row>
|
|
434
|
+
<Table.HeaderCell>
|
|
435
|
+
<FormattedMessage id="Select" defaultMessage="Select" />
|
|
436
|
+
</Table.HeaderCell>
|
|
437
|
+
<Table.HeaderCell>
|
|
438
|
+
<FormattedMessage id="Alias" defaultMessage="Alias" />
|
|
439
|
+
</Table.HeaderCell>
|
|
440
|
+
<Table.HeaderCell>
|
|
441
|
+
<FormattedMessage id="Target" defaultMessage="Target" />
|
|
442
|
+
</Table.HeaderCell>
|
|
443
|
+
<Table.HeaderCell>
|
|
444
|
+
<FormattedMessage id="Date" defaultMessage="Date" />
|
|
445
|
+
</Table.HeaderCell>
|
|
446
|
+
<Table.HeaderCell>
|
|
447
|
+
<FormattedMessage id="Manual" defaultMessage="Manual" />
|
|
448
|
+
</Table.HeaderCell>
|
|
449
|
+
</Table.Row>
|
|
450
|
+
{aliases.items.length > 0 &&
|
|
451
|
+
aliases.items.map((alias, i) => (
|
|
452
|
+
<Table.Row key={i}>
|
|
453
|
+
<Table.Cell>
|
|
454
|
+
<Checkbox
|
|
455
|
+
onChange={(e, { value }) =>
|
|
456
|
+
handleCheckAlias(value)
|
|
457
|
+
}
|
|
458
|
+
checked={aliasesToRemove.includes(alias.path)}
|
|
459
|
+
value={alias.path}
|
|
460
|
+
/>
|
|
461
|
+
</Table.Cell>
|
|
462
|
+
<Table.Cell>
|
|
463
|
+
<p>{alias.path}</p>
|
|
464
|
+
</Table.Cell>
|
|
465
|
+
<Table.Cell>
|
|
466
|
+
<p>{alias['redirect-to']}</p>
|
|
467
|
+
</Table.Cell>
|
|
468
|
+
<Table.Cell>
|
|
469
|
+
<p>{alias.datetime}</p>
|
|
470
|
+
</Table.Cell>
|
|
471
|
+
<Table.Cell>
|
|
472
|
+
<p>{`${alias.manual}`}</p>
|
|
473
|
+
</Table.Cell>
|
|
474
|
+
</Table.Row>
|
|
637
475
|
))}
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
476
|
+
</Table.Body>
|
|
477
|
+
</Table>
|
|
478
|
+
<div
|
|
479
|
+
style={{
|
|
480
|
+
display: 'flex',
|
|
481
|
+
flexWrap: 'wrap',
|
|
482
|
+
alignItems: 'center',
|
|
483
|
+
marginBottom: '20px',
|
|
484
|
+
}}
|
|
485
|
+
>
|
|
486
|
+
{pages && (
|
|
487
|
+
<Pagination
|
|
488
|
+
boundaryRange={0}
|
|
489
|
+
activePage={activePage}
|
|
490
|
+
ellipsisItem={null}
|
|
491
|
+
firstItem={null}
|
|
492
|
+
lastItem={null}
|
|
493
|
+
siblingRange={1}
|
|
494
|
+
totalPages={pages}
|
|
495
|
+
onPageChange={(e, o) => handlePageChange(e, o)}
|
|
648
496
|
/>
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
497
|
+
)}
|
|
498
|
+
<Menu.Menu
|
|
499
|
+
position="right"
|
|
500
|
+
style={{ display: 'flex', marginLeft: 'auto' }}
|
|
501
|
+
>
|
|
502
|
+
<Menu.Item style={{ color: 'grey' }}>
|
|
503
|
+
<FormattedMessage id="Show" defaultMessage="Show" />:
|
|
504
|
+
</Menu.Item>
|
|
505
|
+
{map(itemsPerPageChoices, (size) => (
|
|
506
|
+
<Menu.Item
|
|
507
|
+
style={{
|
|
508
|
+
padding: '0 0.4em',
|
|
509
|
+
margin: '0em 0.357em',
|
|
510
|
+
cursor: 'pointer',
|
|
511
|
+
}}
|
|
512
|
+
key={size}
|
|
513
|
+
value={size}
|
|
514
|
+
active={size === itemsPerPage}
|
|
515
|
+
onClick={(e, o) => handleItemsPerPage(e, o)}
|
|
516
|
+
>
|
|
517
|
+
{size}
|
|
518
|
+
</Menu.Item>
|
|
519
|
+
))}
|
|
520
|
+
</Menu.Menu>
|
|
521
|
+
</div>
|
|
522
|
+
<Button
|
|
523
|
+
disabled={aliasesToRemove.length === 0}
|
|
524
|
+
onClick={handleRemoveAliases}
|
|
525
|
+
primary
|
|
526
|
+
>
|
|
527
|
+
<FormattedMessage
|
|
528
|
+
id="Remove selected"
|
|
529
|
+
defaultMessage="Remove selected"
|
|
667
530
|
/>
|
|
668
|
-
</
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
</
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
531
|
+
</Button>
|
|
532
|
+
</Segment>
|
|
533
|
+
</Form>
|
|
534
|
+
</Segment.Group>
|
|
535
|
+
</article>
|
|
536
|
+
</Container>
|
|
537
|
+
{isClient &&
|
|
538
|
+
createPortal(
|
|
539
|
+
<Toolbar
|
|
540
|
+
pathname={pathname}
|
|
541
|
+
hideDefaultViewButtons
|
|
542
|
+
inner={
|
|
543
|
+
<Link className="item" to="#" onClick={() => onCancel()}>
|
|
544
|
+
<Icon
|
|
545
|
+
name={backSVG}
|
|
546
|
+
className="contents circled"
|
|
547
|
+
size="30px"
|
|
548
|
+
title={intl.formatMessage(messages.back)}
|
|
549
|
+
/>
|
|
550
|
+
</Link>
|
|
551
|
+
}
|
|
552
|
+
/>,
|
|
553
|
+
document.getElementById('toolbar'),
|
|
554
|
+
)}
|
|
555
|
+
</div>
|
|
556
|
+
);
|
|
557
|
+
};
|
|
677
558
|
|
|
678
|
-
export default
|
|
679
|
-
injectIntl,
|
|
680
|
-
connect(
|
|
681
|
-
(state, props) => ({
|
|
682
|
-
aliases: state.aliases,
|
|
683
|
-
pathname: props.location.pathname,
|
|
684
|
-
}),
|
|
685
|
-
{ addAliases, getAliases, removeAliases },
|
|
686
|
-
),
|
|
687
|
-
)(Aliases);
|
|
559
|
+
export default Aliases;
|