@plone/volto 16.26.1 → 16.28.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/.changelog.draft +5 -5
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +17 -0
- package/README.md +3 -19
- package/locales/ca/LC_MESSAGES/volto.po +94 -30
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +94 -30
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +95 -31
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +94 -30
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +94 -30
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +94 -30
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +94 -30
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +94 -30
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +94 -30
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +94 -30
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +94 -30
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +94 -30
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +94 -30
- package/locales/ro.json +1 -1
- package/locales/volto.pot +95 -31
- package/locales/zh_CN/LC_MESSAGES/volto.po +94 -30
- package/locales/zh_CN.json +1 -1
- package/package.json +1 -1
- package/packages/volto-slate/package.json +1 -1
- package/src/actions/index.js +7 -0
- package/src/actions/relations/rebuild.js +25 -0
- package/src/actions/relations/relations.js +103 -0
- package/src/actions/relations/relations.test.js +15 -0
- package/src/components/index.js +1 -0
- package/src/components/manage/Contents/Contents.jsx +320 -110
- package/src/components/manage/LinksToItem/LinksToItem.jsx +185 -0
- package/src/components/manage/LinksToItem/LinksToItem.test.jsx +97 -0
- package/src/components/manage/Toolbar/More.jsx +15 -0
- package/src/components/theme/ContentMetadataTags/ContentMetadataTags.jsx +37 -6
- package/src/config/NonContentRoutes.jsx +1 -0
- package/src/config/index.js +2 -0
- package/src/constants/ActionTypes.js +5 -0
- package/src/reducers/index.js +2 -0
- package/src/reducers/relations/relations.js +201 -0
- package/src/routes.js +9 -0
- package/theme/themes/pastanaga/extras/contents.less +4 -0
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +0 -541
- package/.yarn/releases/yarn-3.6.3.cjs +0 -874
- package/packages/volto-slate/build/messages/src/blocks/Table/TableBlockEdit.json +0 -90
- package/packages/volto-slate/build/messages/src/blocks/Text/DefaultTextBlockEditor.json +0 -6
- package/packages/volto-slate/build/messages/src/blocks/Text/DetachedTextBlockEditor.json +0 -6
- package/packages/volto-slate/build/messages/src/blocks/Text/SlashMenu.json +0 -6
- package/packages/volto-slate/build/messages/src/editor/plugins/AdvancedLink/index.json +0 -10
- package/packages/volto-slate/build/messages/src/editor/plugins/Link/index.json +0 -10
- package/packages/volto-slate/build/messages/src/editor/plugins/Table/index.json +0 -30
- package/packages/volto-slate/build/messages/src/elementEditor/messages.json +0 -10
- package/packages/volto-slate/build/messages/src/widgets/HtmlSlateWidget.json +0 -6
- package/packages/volto-slate/build/messages/src/widgets/RichTextWidgetView.json +0 -6
- package/share/man/man1/ttx.1 +0 -225
- package/styles/Microsoft/AMPM.yml +0 -9
- package/styles/Microsoft/Accessibility.yml +0 -25
- package/styles/Microsoft/Acronyms.yml +0 -64
- package/styles/Microsoft/Adverbs.yml +0 -270
- package/styles/Microsoft/Auto.yml +0 -11
- package/styles/Microsoft/Avoid.yml +0 -14
- package/styles/Microsoft/ComplexWords.yml +0 -120
- package/styles/Microsoft/Contractions.yml +0 -50
- package/styles/Microsoft/Dashes.yml +0 -13
- package/styles/Microsoft/DateFormat.yml +0 -8
- package/styles/Microsoft/DateNumbers.yml +0 -40
- package/styles/Microsoft/DateOrder.yml +0 -8
- package/styles/Microsoft/Ellipses.yml +0 -9
- package/styles/Microsoft/FirstPerson.yml +0 -16
- package/styles/Microsoft/Foreign.yml +0 -13
- package/styles/Microsoft/Gender.yml +0 -8
- package/styles/Microsoft/GenderBias.yml +0 -44
- package/styles/Microsoft/GeneralURL.yml +0 -11
- package/styles/Microsoft/HeadingAcronyms.yml +0 -7
- package/styles/Microsoft/HeadingColons.yml +0 -8
- package/styles/Microsoft/HeadingPunctuation.yml +0 -13
- package/styles/Microsoft/Headings.yml +0 -28
- package/styles/Microsoft/Hyphens.yml +0 -14
- package/styles/Microsoft/Negative.yml +0 -13
- package/styles/Microsoft/Ordinal.yml +0 -13
- package/styles/Microsoft/OxfordComma.yml +0 -8
- package/styles/Microsoft/Passive.yml +0 -183
- package/styles/Microsoft/Percentages.yml +0 -7
- package/styles/Microsoft/Quotes.yml +0 -7
- package/styles/Microsoft/RangeFormat.yml +0 -13
- package/styles/Microsoft/RangeTime.yml +0 -13
- package/styles/Microsoft/Ranges.yml +0 -7
- package/styles/Microsoft/Semicolon.yml +0 -8
- package/styles/Microsoft/SentenceLength.yml +0 -7
- package/styles/Microsoft/Spacing.yml +0 -8
- package/styles/Microsoft/Suspended.yml +0 -7
- package/styles/Microsoft/Terms.yml +0 -41
- package/styles/Microsoft/URLFormat.yml +0 -10
- package/styles/Microsoft/Units.yml +0 -16
- package/styles/Microsoft/Vocab.yml +0 -25
- package/styles/Microsoft/We.yml +0 -11
- package/styles/Microsoft/Wordiness.yml +0 -122
- package/styles/Microsoft/meta.json +0 -4
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderer from 'react-test-renderer';
|
|
3
|
+
import { Provider } from 'react-intl-redux';
|
|
4
|
+
import configureMockStore from 'redux-mock-store';
|
|
5
|
+
import thunk from 'redux-thunk';
|
|
6
|
+
|
|
7
|
+
import LinksToItem from './LinksToItem';
|
|
8
|
+
|
|
9
|
+
const middlewares = [thunk];
|
|
10
|
+
const mockStore = configureMockStore(middlewares);
|
|
11
|
+
|
|
12
|
+
jest.mock('react-portal', () => ({
|
|
13
|
+
Portal: jest.fn(() => <div id="Portal" />),
|
|
14
|
+
}));
|
|
15
|
+
jest.mock('../Toolbar/More', () => jest.fn(() => <div className="More" />));
|
|
16
|
+
|
|
17
|
+
describe('LinksToItem', () => {
|
|
18
|
+
it('renders "links and references" view', () => {
|
|
19
|
+
const store = mockStore({
|
|
20
|
+
relations: {
|
|
21
|
+
subrequests: {
|
|
22
|
+
'/page-1': {
|
|
23
|
+
data: {
|
|
24
|
+
isReferencing: {
|
|
25
|
+
items: [
|
|
26
|
+
{
|
|
27
|
+
source: {
|
|
28
|
+
'@id': 'http://localhost:3000/page-basil',
|
|
29
|
+
'@type': 'Document',
|
|
30
|
+
UID: 'SOMEUID008',
|
|
31
|
+
description: '',
|
|
32
|
+
review_state: 'published',
|
|
33
|
+
title: 'Basil',
|
|
34
|
+
type_title: 'Document',
|
|
35
|
+
},
|
|
36
|
+
target: {
|
|
37
|
+
'@id': 'http://localhost:3000/page-tomato',
|
|
38
|
+
'@type': 'Document',
|
|
39
|
+
UID: 'SOMEUID007',
|
|
40
|
+
description: '',
|
|
41
|
+
review_state: 'published',
|
|
42
|
+
title: 'Tomato',
|
|
43
|
+
type_title: 'Document',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
items_total: 1,
|
|
48
|
+
},
|
|
49
|
+
relatedItems: {
|
|
50
|
+
items: [
|
|
51
|
+
{
|
|
52
|
+
source: {
|
|
53
|
+
'@id': 'http://localhost:3000/page-cucumber',
|
|
54
|
+
'@type': 'Document',
|
|
55
|
+
UID: 'SOMEUID008',
|
|
56
|
+
description: '',
|
|
57
|
+
review_state: 'published',
|
|
58
|
+
title: 'Cucumber',
|
|
59
|
+
type_title: 'Document',
|
|
60
|
+
},
|
|
61
|
+
target: {
|
|
62
|
+
'@id': 'http://localhost:3000/page-tomato',
|
|
63
|
+
'@type': 'Document',
|
|
64
|
+
UID: 'SOMEUID007',
|
|
65
|
+
description: '',
|
|
66
|
+
review_state: 'published',
|
|
67
|
+
title: 'Tomato',
|
|
68
|
+
type_title: 'Document',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
items_total: 1,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
content: {
|
|
79
|
+
data: {
|
|
80
|
+
UID: 'SOMEUID007',
|
|
81
|
+
title: 'page #1',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
intl: {
|
|
85
|
+
locale: 'en',
|
|
86
|
+
messages: {},
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
const component = renderer.create(
|
|
90
|
+
<Provider store={store}>
|
|
91
|
+
<LinksToItem location={{ pathname: '/page-1/links-to-item' }} />
|
|
92
|
+
</Provider>,
|
|
93
|
+
);
|
|
94
|
+
const json = component.toJSON();
|
|
95
|
+
expect(json).toMatchSnapshot();
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -53,6 +53,10 @@ const messages = defineMessages({
|
|
|
53
53
|
id: 'URL Management',
|
|
54
54
|
defaultMessage: 'URL Management',
|
|
55
55
|
},
|
|
56
|
+
linkstoitem: {
|
|
57
|
+
id: 'Links and references',
|
|
58
|
+
defaultMessage: 'Links and references',
|
|
59
|
+
},
|
|
56
60
|
ManageTranslations: {
|
|
57
61
|
id: 'Manage Translations',
|
|
58
62
|
defaultMessage: 'Manage Translations',
|
|
@@ -227,6 +231,7 @@ class More extends Component {
|
|
|
227
231
|
const aliasesAction = find(this.props.actions.object_buttons, {
|
|
228
232
|
id: 'redirection',
|
|
229
233
|
});
|
|
234
|
+
|
|
230
235
|
const { content, intl } = this.props;
|
|
231
236
|
|
|
232
237
|
const dateOptions = {
|
|
@@ -317,6 +322,16 @@ class More extends Component {
|
|
|
317
322
|
</li>
|
|
318
323
|
)}
|
|
319
324
|
</Plug>
|
|
325
|
+
{path !== '' && !config.settings.excludeLinksAndReferencesMenuItem && (
|
|
326
|
+
<Plug pluggable="toolbar-more-menu-list" id="linkstoitems">
|
|
327
|
+
<li>
|
|
328
|
+
<Link to={`${path}/links-to-item`}>
|
|
329
|
+
{this.props.intl.formatMessage(messages.linkstoitem)}
|
|
330
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
331
|
+
</Link>
|
|
332
|
+
</li>
|
|
333
|
+
</Plug>
|
|
334
|
+
)}
|
|
320
335
|
<Plug pluggable="toolbar-more-menu-list" id="rules">
|
|
321
336
|
{rulesAction && (
|
|
322
337
|
<li>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { toPublicURL, Helmet } from '@plone/volto/helpers';
|
|
3
2
|
import config from '@plone/volto/registry';
|
|
4
3
|
|
|
@@ -16,8 +15,21 @@ const ContentMetadataTags = (props) => {
|
|
|
16
15
|
|
|
17
16
|
const getContentImageInfo = () => {
|
|
18
17
|
const { contentMetadataTagsImageField } = config.settings;
|
|
19
|
-
const
|
|
18
|
+
const image_field = props.content[contentMetadataTagsImageField];
|
|
19
|
+
const preview_image = props.content.preview_image;
|
|
20
|
+
const preview_image_link = props.content.preview_image_link;
|
|
20
21
|
const { opengraph_image } = props.content;
|
|
22
|
+
let image = undefined;
|
|
23
|
+
|
|
24
|
+
if (opengraph_image !== undefined && opengraph_image) {
|
|
25
|
+
image = opengraph_image;
|
|
26
|
+
} else if (preview_image_link !== undefined && preview_image_link) {
|
|
27
|
+
image = preview_image_link[contentMetadataTagsImageField];
|
|
28
|
+
} else if (preview_image !== undefined && preview_image) {
|
|
29
|
+
image = preview_image;
|
|
30
|
+
} else if (image_field !== undefined && image_field) {
|
|
31
|
+
image = image_field;
|
|
32
|
+
}
|
|
21
33
|
|
|
22
34
|
const contentImageInfo = {
|
|
23
35
|
contentHasImage: false,
|
|
@@ -25,10 +37,7 @@ const ContentMetadataTags = (props) => {
|
|
|
25
37
|
height: null,
|
|
26
38
|
width: null,
|
|
27
39
|
};
|
|
28
|
-
contentImageInfo.contentHasImage =
|
|
29
|
-
opengraph_image?.scales?.large?.download ||
|
|
30
|
-
image?.scales?.large?.download ||
|
|
31
|
-
false;
|
|
40
|
+
contentImageInfo.contentHasImage = image?.scales?.large?.download || false;
|
|
32
41
|
|
|
33
42
|
if (contentImageInfo.contentHasImage && opengraph_image?.scales?.large) {
|
|
34
43
|
contentImageInfo.url = opengraph_image.scales.large.download;
|
|
@@ -54,6 +63,7 @@ const ContentMetadataTags = (props) => {
|
|
|
54
63
|
property="og:title"
|
|
55
64
|
content={opengraph_title || seo_title || title}
|
|
56
65
|
/>
|
|
66
|
+
<meta property="og:type" content={'website'} />
|
|
57
67
|
<meta
|
|
58
68
|
property="og:url"
|
|
59
69
|
content={seo_canonical_url || toPublicURL(props.content['@id'])}
|
|
@@ -65,6 +75,12 @@ const ContentMetadataTags = (props) => {
|
|
|
65
75
|
content={toPublicURL(contentImageInfo.url)}
|
|
66
76
|
/>
|
|
67
77
|
)}
|
|
78
|
+
{contentImageInfo.contentHasImage && (
|
|
79
|
+
<meta
|
|
80
|
+
property="twitter:image"
|
|
81
|
+
content={toPublicURL(contentImageInfo.url)}
|
|
82
|
+
/>
|
|
83
|
+
)}
|
|
68
84
|
{contentImageInfo.contentHasImage && (
|
|
69
85
|
<meta property="og:image:width" content={contentImageInfo.width} />
|
|
70
86
|
)}
|
|
@@ -78,6 +94,21 @@ const ContentMetadataTags = (props) => {
|
|
|
78
94
|
/>
|
|
79
95
|
)}
|
|
80
96
|
<meta name="twitter:card" content="summary_large_image" />
|
|
97
|
+
<meta
|
|
98
|
+
property="twitter:url"
|
|
99
|
+
content={seo_canonical_url || toPublicURL(props.content['@id'])}
|
|
100
|
+
/>
|
|
101
|
+
{/* TODO: Improve SEO backend metadata providers by adding the twitter handler */}
|
|
102
|
+
{/* <meta property="twitter:site" content={'@my_twitter_handler'} /> */}
|
|
103
|
+
<meta
|
|
104
|
+
property="twitter:title"
|
|
105
|
+
content={opengraph_title || seo_title || title}
|
|
106
|
+
/>
|
|
107
|
+
<meta
|
|
108
|
+
property="twitter:description"
|
|
109
|
+
content={seo_description || description}
|
|
110
|
+
/>
|
|
111
|
+
<meta property="twitter:domain" content={config.settings.publicURL} />
|
|
81
112
|
</Helmet>
|
|
82
113
|
</>
|
|
83
114
|
);
|
package/src/config/index.js
CHANGED
|
@@ -183,6 +183,8 @@ let config = {
|
|
|
183
183
|
hashLinkSmoothScroll: false,
|
|
184
184
|
styleClassNameExtenders,
|
|
185
185
|
querystringSearchGet: false,
|
|
186
|
+
blockSettingsTabFieldsetsInitialStateOpen: true,
|
|
187
|
+
excludeLinksAndReferencesMenuItem: true,
|
|
186
188
|
},
|
|
187
189
|
experimental: {
|
|
188
190
|
addBlockButton: {
|
|
@@ -36,6 +36,11 @@ export const GET_NAVIGATION = 'GET_NAVIGATION';
|
|
|
36
36
|
export const GET_PRINCIPALS = 'GET_PRINCIPALS';
|
|
37
37
|
export const GET_QUERYSTRING = 'GET_QUERYSTRING';
|
|
38
38
|
export const GET_QUERYSTRING_RESULTS = 'GET_QUERYSTRING_RESULTS';
|
|
39
|
+
export const CREATE_RELATIONS = 'CREATE_RELATIONS';
|
|
40
|
+
export const DELETE_RELATIONS = 'DELETE_RELATIONS';
|
|
41
|
+
export const LIST_RELATIONS = 'LIST_RELATIONS';
|
|
42
|
+
export const STATS_RELATIONS = 'STATS_RELATIONS';
|
|
43
|
+
export const REBUILD_RELATIONS = 'REBUILD_RELATIONS';
|
|
39
44
|
export const GET_SCHEMA = 'GET_SCHEMA';
|
|
40
45
|
export const POST_SCHEMA = 'POST_SCHEMA';
|
|
41
46
|
export const PUT_SCHEMA = 'PUT_SCHEMA';
|
package/src/reducers/index.js
CHANGED
|
@@ -25,6 +25,7 @@ import messages from '@plone/volto/reducers/messages/messages';
|
|
|
25
25
|
import navigation from '@plone/volto/reducers/navigation/navigation';
|
|
26
26
|
import querystring from '@plone/volto/reducers/querystring/querystring';
|
|
27
27
|
import querystringsearch from '@plone/volto/reducers/querystringsearch/querystringsearch';
|
|
28
|
+
import relations from '@plone/volto/reducers/relations/relations';
|
|
28
29
|
import roles from '@plone/volto/reducers/roles/roles';
|
|
29
30
|
import rules from '@plone/volto/reducers/rules/rules';
|
|
30
31
|
import controlpanelrule from '@plone/volto/reducers/controlPanelRule/controlPanelRule';
|
|
@@ -80,6 +81,7 @@ const reducers = {
|
|
|
80
81
|
navigation,
|
|
81
82
|
querystring,
|
|
82
83
|
querystringsearch,
|
|
84
|
+
relations,
|
|
83
85
|
roles,
|
|
84
86
|
rules,
|
|
85
87
|
controlpanelrule,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relations reducer.
|
|
3
|
+
* @module reducers/relations/relations
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
CREATE_RELATIONS,
|
|
8
|
+
DELETE_RELATIONS,
|
|
9
|
+
LIST_RELATIONS,
|
|
10
|
+
STATS_RELATIONS,
|
|
11
|
+
REBUILD_RELATIONS,
|
|
12
|
+
} from '@plone/volto/constants/ActionTypes';
|
|
13
|
+
|
|
14
|
+
const initialState = {
|
|
15
|
+
relations: {
|
|
16
|
+
error: null,
|
|
17
|
+
loaded: false,
|
|
18
|
+
loading: false,
|
|
19
|
+
data: null,
|
|
20
|
+
},
|
|
21
|
+
stats: {
|
|
22
|
+
error: null,
|
|
23
|
+
loaded: false,
|
|
24
|
+
loading: false,
|
|
25
|
+
data: null,
|
|
26
|
+
},
|
|
27
|
+
create: {
|
|
28
|
+
error: null,
|
|
29
|
+
loaded: false,
|
|
30
|
+
loading: false,
|
|
31
|
+
},
|
|
32
|
+
delete: {
|
|
33
|
+
error: null,
|
|
34
|
+
loaded: false,
|
|
35
|
+
loading: false,
|
|
36
|
+
},
|
|
37
|
+
rebuild: {
|
|
38
|
+
error: null,
|
|
39
|
+
loaded: false,
|
|
40
|
+
loading: false,
|
|
41
|
+
},
|
|
42
|
+
subrequests: {},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Get request key
|
|
47
|
+
* @function getRequestKey
|
|
48
|
+
* @param {string} actionType Action type.
|
|
49
|
+
* @returns {string} Request key.
|
|
50
|
+
*/
|
|
51
|
+
function getRequestKey(actionType) {
|
|
52
|
+
return actionType.split('_')[0].toLowerCase();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Relations reducer.
|
|
57
|
+
* @function relations
|
|
58
|
+
* @param {Object} state Current state.
|
|
59
|
+
* @param {Object} action Action to be handled.
|
|
60
|
+
* @returns {Object} New state.
|
|
61
|
+
*/
|
|
62
|
+
export default function relations(state = initialState, action = {}) {
|
|
63
|
+
switch (action.type) {
|
|
64
|
+
case `${LIST_RELATIONS}_PENDING`:
|
|
65
|
+
return action.subrequest
|
|
66
|
+
? {
|
|
67
|
+
...state,
|
|
68
|
+
subrequests: {
|
|
69
|
+
...state.subrequests,
|
|
70
|
+
[action.subrequest]: {
|
|
71
|
+
data: null,
|
|
72
|
+
loaded: false,
|
|
73
|
+
loading: true,
|
|
74
|
+
error: null,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
: {
|
|
79
|
+
...state,
|
|
80
|
+
relations: {
|
|
81
|
+
data: null,
|
|
82
|
+
loading: true,
|
|
83
|
+
loaded: false,
|
|
84
|
+
error: null,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
case `${LIST_RELATIONS}_SUCCESS`:
|
|
88
|
+
return action.subrequest
|
|
89
|
+
? {
|
|
90
|
+
...state,
|
|
91
|
+
subrequests: {
|
|
92
|
+
...state.subrequests,
|
|
93
|
+
[action.subrequest]: {
|
|
94
|
+
data: action.result.relations,
|
|
95
|
+
loading: false,
|
|
96
|
+
loaded: true,
|
|
97
|
+
error: null,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
: {
|
|
102
|
+
...state,
|
|
103
|
+
relations: {
|
|
104
|
+
data: action.result.relations,
|
|
105
|
+
loading: false,
|
|
106
|
+
loaded: true,
|
|
107
|
+
error: null,
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
case `${LIST_RELATIONS}_FAIL`:
|
|
111
|
+
return action.subrequest
|
|
112
|
+
? {
|
|
113
|
+
...state,
|
|
114
|
+
subrequests: {
|
|
115
|
+
...state.subrequests,
|
|
116
|
+
[action.subrequest]: {
|
|
117
|
+
data: null,
|
|
118
|
+
loading: false,
|
|
119
|
+
loaded: false,
|
|
120
|
+
error: action.error,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
}
|
|
124
|
+
: {
|
|
125
|
+
...state,
|
|
126
|
+
relations: {
|
|
127
|
+
data: null,
|
|
128
|
+
loading: false,
|
|
129
|
+
loaded: false,
|
|
130
|
+
error: action.error,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
case `${STATS_RELATIONS}_PENDING`:
|
|
135
|
+
return {
|
|
136
|
+
...state,
|
|
137
|
+
[getRequestKey(action.type)]: {
|
|
138
|
+
loading: true,
|
|
139
|
+
loaded: false,
|
|
140
|
+
error: null,
|
|
141
|
+
data: null,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
case `${STATS_RELATIONS}_SUCCESS`:
|
|
145
|
+
return {
|
|
146
|
+
...state,
|
|
147
|
+
[getRequestKey(action.type)]: {
|
|
148
|
+
loading: false,
|
|
149
|
+
loaded: true,
|
|
150
|
+
error: null,
|
|
151
|
+
data: action.result,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
case `${STATS_RELATIONS}_FAIL`:
|
|
155
|
+
return {
|
|
156
|
+
...state,
|
|
157
|
+
[getRequestKey(action.type)]: {
|
|
158
|
+
loading: false,
|
|
159
|
+
loaded: false,
|
|
160
|
+
error: action.error,
|
|
161
|
+
data: null,
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
case `${CREATE_RELATIONS}_PENDING`:
|
|
166
|
+
case `${DELETE_RELATIONS}_PENDING`:
|
|
167
|
+
case `${REBUILD_RELATIONS}_PENDING`:
|
|
168
|
+
return {
|
|
169
|
+
...state,
|
|
170
|
+
[getRequestKey(action.type)]: {
|
|
171
|
+
loading: true,
|
|
172
|
+
loaded: false,
|
|
173
|
+
error: null,
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
case `${CREATE_RELATIONS}_SUCCESS`:
|
|
177
|
+
case `${DELETE_RELATIONS}_SUCCESS`:
|
|
178
|
+
case `${REBUILD_RELATIONS}_SUCCESS`:
|
|
179
|
+
return {
|
|
180
|
+
...state,
|
|
181
|
+
[getRequestKey(action.type)]: {
|
|
182
|
+
loading: false,
|
|
183
|
+
loaded: true,
|
|
184
|
+
error: null,
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
case `${CREATE_RELATIONS}_FAIL`:
|
|
188
|
+
case `${DELETE_RELATIONS}_FAIL`:
|
|
189
|
+
case `${REBUILD_RELATIONS}_FAIL`:
|
|
190
|
+
return {
|
|
191
|
+
...state,
|
|
192
|
+
[getRequestKey(action.type)]: {
|
|
193
|
+
loading: false,
|
|
194
|
+
loaded: false,
|
|
195
|
+
error: action.error,
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
default:
|
|
199
|
+
return state;
|
|
200
|
+
}
|
|
201
|
+
}
|
package/src/routes.js
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
Diff,
|
|
24
24
|
Edit,
|
|
25
25
|
History,
|
|
26
|
+
LinksToItem,
|
|
26
27
|
Login,
|
|
27
28
|
Logout,
|
|
28
29
|
ManageTranslations,
|
|
@@ -280,6 +281,14 @@ export const defaultRoutes = [
|
|
|
280
281
|
path: '/**/manage-translations',
|
|
281
282
|
component: ManageTranslations,
|
|
282
283
|
},
|
|
284
|
+
{
|
|
285
|
+
path: '/links-to-item',
|
|
286
|
+
component: LinksToItem,
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
path: '/**/links-to-item',
|
|
290
|
+
component: LinksToItem,
|
|
291
|
+
},
|
|
283
292
|
{
|
|
284
293
|
path: '/register',
|
|
285
294
|
component: Register,
|