decap-cms-core 3.6.2 → 3.7.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/dist/decap-cms-core.js +26 -26
- package/dist/decap-cms-core.js.LICENSE.txt +22 -4
- package/dist/decap-cms-core.js.map +1 -1
- package/dist/esm/actions/config.js +57 -49
- package/dist/esm/actions/editorialWorkflow.js +4 -4
- package/dist/esm/actions/entries.js +8 -14
- package/dist/esm/actions/mediaLibrary.js +6 -11
- package/dist/esm/actions/search.js +2 -2
- package/dist/esm/actions/status.js +2 -8
- package/dist/esm/backend.js +70 -79
- package/dist/esm/bootstrap.js +2 -2
- package/dist/esm/components/App/App.js +28 -34
- package/dist/esm/components/App/Header.js +32 -39
- package/dist/esm/components/Collection/Collection.js +45 -48
- package/dist/esm/components/Collection/CollectionSearch.js +76 -81
- package/dist/esm/components/Collection/CollectionTop.js +1 -2
- package/dist/esm/components/Collection/Entries/Entries.js +2 -4
- package/dist/esm/components/Collection/Entries/EntriesCollection.js +25 -29
- package/dist/esm/components/Collection/Entries/EntriesSearch.js +34 -38
- package/dist/esm/components/Collection/Entries/EntryCard.js +8 -13
- package/dist/esm/components/Collection/Entries/EntryListing.js +72 -76
- package/dist/esm/components/Collection/FilterControl.js +1 -1
- package/dist/esm/components/Collection/GroupControl.js +1 -1
- package/dist/esm/components/Collection/NestedCollection.js +50 -53
- package/dist/esm/components/Collection/Sidebar.js +35 -38
- package/dist/esm/components/Collection/SortControl.js +3 -3
- package/dist/esm/components/Collection/ViewStyleControl.js +1 -2
- package/dist/esm/components/Editor/Editor.js +197 -201
- package/dist/esm/components/Editor/EditorControlPane/EditorControl.js +79 -87
- package/dist/esm/components/Editor/EditorControlPane/EditorControlPane.js +75 -86
- package/dist/esm/components/Editor/EditorControlPane/Widget.js +226 -228
- package/dist/esm/components/Editor/EditorInterface.js +69 -80
- package/dist/esm/components/Editor/EditorPreviewPane/EditorPreview.js +1 -2
- package/dist/esm/components/Editor/EditorPreviewPane/EditorPreviewContent.js +20 -28
- package/dist/esm/components/Editor/EditorPreviewPane/EditorPreviewPane.js +163 -161
- package/dist/esm/components/Editor/EditorPreviewPane/PreviewHOC.js +4 -8
- package/dist/esm/components/Editor/EditorToolbar.js +335 -347
- package/dist/esm/components/Editor/withWorkflow.js +5 -6
- package/dist/esm/components/MediaLibrary/MediaLibrary.js +304 -294
- package/dist/esm/components/MediaLibrary/MediaLibraryButtons.js +40 -46
- package/dist/esm/components/MediaLibrary/MediaLibraryCard.js +1 -2
- package/dist/esm/components/MediaLibrary/MediaLibraryCardGrid.js +8 -13
- package/dist/esm/components/MediaLibrary/MediaLibraryModal.js +3 -3
- package/dist/esm/components/MediaLibrary/MediaLibrarySearch.js +1 -2
- package/dist/esm/components/MediaLibrary/MediaLibraryTop.js +3 -6
- package/dist/esm/components/UI/DragDrop.js +15 -23
- package/dist/esm/components/UI/ErrorBoundary.js +23 -25
- package/dist/esm/components/UI/Modal.js +10 -12
- package/dist/esm/components/UI/Notifications.js +4 -8
- package/dist/esm/components/UI/SettingsDropdown.js +4 -8
- package/dist/esm/components/Workflow/Workflow.js +19 -20
- package/dist/esm/components/Workflow/WorkflowCard.js +2 -4
- package/dist/esm/components/Workflow/WorkflowList.js +105 -113
- package/dist/esm/constants/configSchema.js +18 -16
- package/dist/esm/formats/formats.js +11 -12
- package/dist/esm/formats/frontmatter.js +17 -21
- package/dist/esm/formats/yaml.js +2 -6
- package/dist/esm/index.js +3 -7
- package/dist/esm/integrations/providers/algolia/implementation.js +12 -14
- package/dist/esm/integrations/providers/assetStore/implementation.js +10 -12
- package/dist/esm/lib/formatters.js +13 -17
- package/dist/esm/lib/i18n.js +35 -33
- package/dist/esm/lib/phrases.js +2 -2
- package/dist/esm/lib/registry.js +35 -35
- package/dist/esm/lib/serializeEntryValues.js +3 -3
- package/dist/esm/lib/stega.js +142 -0
- package/dist/esm/lib/urlHelper.js +16 -18
- package/dist/esm/mediaLibrary.js +3 -4
- package/dist/esm/reducers/collections.js +26 -42
- package/dist/esm/reducers/combinedReducer.js +3 -6
- package/dist/esm/reducers/config.js +3 -7
- package/dist/esm/reducers/editorialWorkflow.js +5 -9
- package/dist/esm/reducers/entries.js +33 -35
- package/dist/esm/reducers/entryDraft.js +2 -2
- package/dist/esm/reducers/integrations.js +8 -14
- package/dist/esm/reducers/mediaLibrary.js +18 -20
- package/dist/esm/reducers/notifications.js +4 -8
- package/dist/esm/types/immutable.js +7 -1
- package/dist/esm/valueObjects/AssetProxy.js +1 -9
- package/dist/esm/valueObjects/EditorComponent.js +18 -25
- package/dist/esm/valueObjects/Entry.js +2 -2
- package/index.d.ts +2 -0
- package/package.json +8 -11
- package/src/actions/__tests__/config.spec.js +3 -3
- package/src/actions/config.ts +3 -1
- package/src/actions/editorialWorkflow.ts +1 -1
- package/src/actions/entries.ts +1 -1
- package/src/actions/search.ts +1 -1
- package/src/backend.ts +8 -1
- package/src/components/App/App.js +5 -0
- package/src/components/App/Header.js +3 -0
- package/src/components/Collection/Collection.js +5 -0
- package/src/components/Collection/CollectionSearch.js +5 -0
- package/src/components/Collection/Entries/EntriesCollection.js +4 -1
- package/src/components/Collection/Entries/EntriesSearch.js +4 -1
- package/src/components/Collection/Entries/EntryListing.js +5 -0
- package/src/components/Collection/Entries/__tests__/__snapshots__/EntriesCollection.spec.js.snap +0 -4
- package/src/components/Collection/NestedCollection.js +6 -1
- package/src/components/Collection/Sidebar.js +5 -0
- package/src/components/Editor/Editor.js +4 -1
- package/src/components/Editor/EditorControlPane/EditorControl.js +7 -1
- package/src/components/Editor/EditorControlPane/Widget.js +5 -0
- package/src/components/Editor/EditorPreviewPane/EditorPreviewPane.js +1 -1
- package/src/components/Editor/EditorToolbar.js +6 -3
- package/src/components/Editor/__tests__/Editor.spec.js +3 -4
- package/src/components/Editor/__tests__/__snapshots__/Editor.spec.js.snap +5 -5
- package/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap +708 -393
- package/src/components/MediaLibrary/MediaLibrary.js +5 -1
- package/src/components/MediaLibrary/MediaLibraryModal.js +1 -1
- package/src/components/UI/ErrorBoundary.js +6 -1
- package/src/components/UI/Modal.js +3 -0
- package/src/components/Workflow/Workflow.js +3 -0
- package/src/components/Workflow/WorkflowList.js +5 -0
- package/src/constants/__tests__/configSchema.spec.js +1 -1
- package/src/formats/formats.ts +1 -1
- package/src/integrations/providers/algolia/implementation.js +2 -2
- package/src/integrations/providers/assetStore/implementation.js +2 -1
- package/src/lib/formatters.ts +4 -1
- package/src/lib/i18n.ts +3 -1
- package/src/lib/phrases.js +1 -1
- package/src/lib/serializeEntryValues.js +1 -1
- package/src/lib/stega.ts +145 -0
- package/src/lib/urlHelper.ts +4 -1
- package/src/mediaLibrary.ts +1 -1
- package/src/reducers/collections.ts +2 -1
- package/src/reducers/editorialWorkflow.ts +1 -1
- package/src/reducers/entries.ts +6 -1
- package/src/reducers/entryDraft.js +1 -1
- package/src/types/immutable.ts +10 -0
- package/src/types/redux.ts +2 -0
- package/src/valueObjects/EditorComponent.js +1 -1
- package/src/valueObjects/Entry.ts +1 -1
package/src/backend.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import attempt from 'lodash/attempt';
|
|
2
|
+
import flatten from 'lodash/flatten';
|
|
3
|
+
import isError from 'lodash/isError';
|
|
4
|
+
import uniq from 'lodash/uniq';
|
|
5
|
+
import trim from 'lodash/trim';
|
|
6
|
+
import sortBy from 'lodash/sortBy';
|
|
7
|
+
import get from 'lodash/get';
|
|
8
|
+
import set from 'lodash/set';
|
|
2
9
|
import { List, fromJS, Set } from 'immutable';
|
|
3
10
|
import * as fuzzy from 'fuzzy';
|
|
4
11
|
import {
|
|
@@ -86,6 +86,11 @@ class App extends React.Component {
|
|
|
86
86
|
t: PropTypes.func.isRequired,
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
+
componentDidMount() {
|
|
90
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
91
|
+
PropTypes.checkPropTypes(App.propTypes, this.props, 'prop', 'App');
|
|
92
|
+
}
|
|
93
|
+
|
|
89
94
|
configError(config) {
|
|
90
95
|
const t = this.props.t;
|
|
91
96
|
return (
|
|
@@ -131,6 +131,9 @@ class Header extends React.Component {
|
|
|
131
131
|
intervalId;
|
|
132
132
|
|
|
133
133
|
componentDidMount() {
|
|
134
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
135
|
+
PropTypes.checkPropTypes(Header.propTypes, this.props, 'prop', 'Header');
|
|
136
|
+
|
|
134
137
|
this.intervalId = setInterval(() => {
|
|
135
138
|
this.props.checkBackendStatus();
|
|
136
139
|
}, 5 * 60 * 1000);
|
|
@@ -55,6 +55,11 @@ export class Collection extends React.Component {
|
|
|
55
55
|
onSortClick: PropTypes.func.isRequired,
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
+
componentDidMount() {
|
|
59
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
60
|
+
PropTypes.checkPropTypes(Collection.propTypes, this.props, 'prop', 'Collection');
|
|
61
|
+
}
|
|
62
|
+
|
|
58
63
|
renderEntriesCollection = () => {
|
|
59
64
|
const { collection, filterTerm, viewStyle } = this.props;
|
|
60
65
|
return (
|
|
@@ -102,6 +102,11 @@ class CollectionSearch extends React.Component {
|
|
|
102
102
|
selectedCollectionIdx: this.getSelectedSelectionBasedOnProps(),
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
+
componentDidMount() {
|
|
106
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
107
|
+
PropTypes.checkPropTypes(CollectionSearch.propTypes, this.props, 'prop', 'CollectionSearch');
|
|
108
|
+
}
|
|
109
|
+
|
|
105
110
|
componentDidUpdate(prevProps) {
|
|
106
111
|
if (prevProps.collection !== this.props.collection) {
|
|
107
112
|
const selectedCollectionIdx = this.getSelectedSelectionBasedOnProps();
|
|
@@ -4,7 +4,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
4
4
|
import { connect } from 'react-redux';
|
|
5
5
|
import styled from '@emotion/styled';
|
|
6
6
|
import { translate } from 'react-polyglot';
|
|
7
|
-
import
|
|
7
|
+
import partial from 'lodash/partial';
|
|
8
8
|
import { Cursor } from 'decap-cms-lib-util';
|
|
9
9
|
import { colors } from 'decap-cms-ui-default';
|
|
10
10
|
|
|
@@ -73,6 +73,9 @@ export class EntriesCollection extends React.Component {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
componentDidMount() {
|
|
76
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
77
|
+
PropTypes.checkPropTypes(EntriesCollection.propTypes, this.props, 'prop', 'EntriesCollection');
|
|
78
|
+
|
|
76
79
|
const { collection, entriesLoaded, loadEntries } = this.props;
|
|
77
80
|
if (collection && !entriesLoaded) {
|
|
78
81
|
loadEntries(collection);
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
4
4
|
import { connect } from 'react-redux';
|
|
5
|
-
import
|
|
5
|
+
import isEqual from 'lodash/isEqual';
|
|
6
6
|
import { Cursor } from 'decap-cms-lib-util';
|
|
7
7
|
|
|
8
8
|
import { selectSearchedEntries } from '../../../reducers';
|
|
@@ -25,6 +25,9 @@ class EntriesSearch extends React.Component {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
componentDidMount() {
|
|
28
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
29
|
+
PropTypes.checkPropTypes(EntriesSearch.propTypes, this.props, 'prop', 'EntriesSearch');
|
|
30
|
+
|
|
28
31
|
const { searchTerm, searchEntries, collectionNames } = this.props;
|
|
29
32
|
searchEntries(searchTerm, collectionNames);
|
|
30
33
|
}
|
|
@@ -27,6 +27,11 @@ export default class EntryListing extends React.Component {
|
|
|
27
27
|
page: PropTypes.number,
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
componentDidMount() {
|
|
31
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
32
|
+
PropTypes.checkPropTypes(EntryListing.propTypes, this.props, 'prop', 'EntryListing');
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
hasMore = () => {
|
|
31
36
|
const hasMore = this.props.cursor?.actions?.has('append_next');
|
|
32
37
|
return hasMore;
|
package/src/components/Collection/Entries/__tests__/__snapshots__/EntriesCollection.spec.js.snap
CHANGED
|
@@ -7,7 +7,6 @@ exports[`EntriesCollection should render connected component 1`] = `
|
|
|
7
7
|
collections="Map { \\"name\\": \\"pages\\", \\"label\\": \\"Pages\\", \\"folder\\": \\"src/pages\\" }"
|
|
8
8
|
cursor="[object Object]"
|
|
9
9
|
entries="List [ Map { \\"slug\\": \\"index\\", \\"path\\": \\"src/pages/index.md\\", \\"data\\": Map { \\"title\\": \\"Root\\" } }, Map { \\"slug\\": \\"dir1/index\\", \\"path\\": \\"src/pages/dir1/index.md\\", \\"data\\": Map { \\"title\\": \\"File 1\\" } }, Map { \\"slug\\": \\"dir2/index\\", \\"path\\": \\"src/pages/dir2/index.md\\", \\"data\\": Map { \\"title\\": \\"File 2\\" } } ]"
|
|
10
|
-
isfetching="false"
|
|
11
10
|
/>
|
|
12
11
|
</DocumentFragment>
|
|
13
12
|
`;
|
|
@@ -19,7 +18,6 @@ exports[`EntriesCollection should render show only immediate children for nested
|
|
|
19
18
|
collections="Map { \\"name\\": \\"pages\\", \\"label\\": \\"Pages\\", \\"folder\\": \\"src/pages\\", \\"nested\\": Map { \\"depth\\": 10, \\"subfolders\\": false } }"
|
|
20
19
|
cursor="[object Object]"
|
|
21
20
|
entries="List [ Map { \\"slug\\": \\"index\\", \\"path\\": \\"src/pages/index.md\\", \\"data\\": Map { \\"title\\": \\"Root\\" } } ]"
|
|
22
|
-
isfetching="false"
|
|
23
21
|
/>
|
|
24
22
|
</DocumentFragment>
|
|
25
23
|
`;
|
|
@@ -31,7 +29,6 @@ exports[`EntriesCollection should render with applied filter term for nested col
|
|
|
31
29
|
collections="Map { \\"name\\": \\"pages\\", \\"label\\": \\"Pages\\", \\"folder\\": \\"src/pages\\", \\"nested\\": Map { \\"depth\\": 10, \\"subfolders\\": false } }"
|
|
32
30
|
cursor="[object Object]"
|
|
33
31
|
entries="List [ Map { \\"slug\\": \\"dir3/dir4/index\\", \\"path\\": \\"src/pages/dir3/dir4/index.md\\", \\"data\\": Map { \\"title\\": \\"File 4\\" } } ]"
|
|
34
|
-
isfetching="false"
|
|
35
32
|
/>
|
|
36
33
|
</DocumentFragment>
|
|
37
34
|
`;
|
|
@@ -43,7 +40,6 @@ exports[`EntriesCollection should render with entries 1`] = `
|
|
|
43
40
|
collections="Map { \\"name\\": \\"pages\\", \\"label\\": \\"Pages\\", \\"folder\\": \\"src/pages\\" }"
|
|
44
41
|
cursor="[object Object]"
|
|
45
42
|
entries="List [ Map { \\"slug\\": \\"index\\" } ]"
|
|
46
|
-
isfetching="false"
|
|
47
43
|
/>
|
|
48
44
|
</DocumentFragment>
|
|
49
45
|
`;
|
|
@@ -9,7 +9,7 @@ import { stringTemplate } from 'decap-cms-lib-widgets';
|
|
|
9
9
|
import { Icon, colors, components } from 'decap-cms-ui-default';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
12
|
-
import
|
|
12
|
+
import sortBy from 'lodash/sortBy';
|
|
13
13
|
|
|
14
14
|
import { selectEntries } from '../../reducers/entries';
|
|
15
15
|
import { selectEntryCollectionTitle } from '../../reducers/collections';
|
|
@@ -263,6 +263,11 @@ export class NestedCollection extends React.Component {
|
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
componentDidMount() {
|
|
267
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
268
|
+
PropTypes.checkPropTypes(NestedCollection.propTypes, this.props, 'prop', 'NestedCollection');
|
|
269
|
+
}
|
|
270
|
+
|
|
266
271
|
componentDidUpdate(prevProps) {
|
|
267
272
|
const { collection, entries, filterTerm } = this.props;
|
|
268
273
|
if (
|
|
@@ -77,6 +77,11 @@ export class Sidebar extends React.Component {
|
|
|
77
77
|
t: PropTypes.func.isRequired,
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
+
componentDidMount() {
|
|
81
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
82
|
+
PropTypes.checkPropTypes(Sidebar.propTypes, this.props, 'prop', 'Sidebar');
|
|
83
|
+
}
|
|
84
|
+
|
|
80
85
|
renderLink = (collection, filterTerm) => {
|
|
81
86
|
const collectionName = collection.get('name');
|
|
82
87
|
if (collection.has('nested')) {
|
|
@@ -4,7 +4,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
4
4
|
import { connect } from 'react-redux';
|
|
5
5
|
import { Loader } from 'decap-cms-ui-default';
|
|
6
6
|
import { translate } from 'react-polyglot';
|
|
7
|
-
import
|
|
7
|
+
import debounce from 'lodash/debounce';
|
|
8
8
|
|
|
9
9
|
import { history, navigateToCollection, navigateToNewEntry } from '../../routing/history';
|
|
10
10
|
import { logoutUser } from '../../actions/auth';
|
|
@@ -82,6 +82,9 @@ export class Editor extends React.Component {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
componentDidMount() {
|
|
85
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
86
|
+
PropTypes.checkPropTypes(Editor.propTypes, this.props, 'prop', 'Editor');
|
|
87
|
+
|
|
85
88
|
const {
|
|
86
89
|
newEntry,
|
|
87
90
|
collection,
|
|
@@ -5,7 +5,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
5
5
|
import { translate } from 'react-polyglot';
|
|
6
6
|
import { ClassNames, Global, css as coreCss } from '@emotion/react';
|
|
7
7
|
import styled from '@emotion/styled';
|
|
8
|
-
import
|
|
8
|
+
import partial from 'lodash/partial';
|
|
9
|
+
import uniqueId from 'lodash/uniqueId';
|
|
9
10
|
import { connect } from 'react-redux';
|
|
10
11
|
import { FieldLabel, colors, transitions, lengths, borders } from 'decap-cms-ui-default';
|
|
11
12
|
import ReactMarkdown from 'react-markdown';
|
|
@@ -170,6 +171,11 @@ class EditorControl extends React.Component {
|
|
|
170
171
|
|
|
171
172
|
uniqueFieldId = uniqueId(`${this.props.field.get('name')}-field-`);
|
|
172
173
|
|
|
174
|
+
componentDidMount() {
|
|
175
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
176
|
+
PropTypes.checkPropTypes(EditorControl.propTypes, this.props, 'prop', 'EditorControl');
|
|
177
|
+
}
|
|
178
|
+
|
|
173
179
|
isAncestorOfFieldError = () => {
|
|
174
180
|
const { fieldsErrors } = this.props;
|
|
175
181
|
|
|
@@ -75,6 +75,11 @@ export default class Widget extends Component {
|
|
|
75
75
|
isParentListCollapsed: PropTypes.bool,
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
+
componentDidMount() {
|
|
79
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
80
|
+
PropTypes.checkPropTypes(Widget.propTypes, this.props, 'prop', 'Widget');
|
|
81
|
+
}
|
|
82
|
+
|
|
78
83
|
shouldComponentUpdate(nextProps) {
|
|
79
84
|
/**
|
|
80
85
|
* Avoid unnecessary rerenders while loading assets.
|
|
@@ -6,8 +6,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
6
6
|
import Frame, { FrameContextConsumer } from 'react-frame-component';
|
|
7
7
|
import { lengths } from 'decap-cms-ui-default';
|
|
8
8
|
import { connect } from 'react-redux';
|
|
9
|
-
import { encodeEntry } from 'decap-cms-lib-util/src/stega';
|
|
10
9
|
|
|
10
|
+
import { encodeEntry } from '../../../lib/stega';
|
|
11
11
|
import {
|
|
12
12
|
resolveWidget,
|
|
13
13
|
getPreviewTemplate,
|
|
@@ -280,6 +280,9 @@ export class EditorToolbar extends React.Component {
|
|
|
280
280
|
};
|
|
281
281
|
|
|
282
282
|
componentDidMount() {
|
|
283
|
+
// Manually validate PropTypes - React 19 breaking change
|
|
284
|
+
PropTypes.checkPropTypes(EditorToolbar.propTypes, this.props, 'prop', 'EditorToolbar');
|
|
285
|
+
|
|
283
286
|
const { isNewEntry, loadDeployPreview } = this.props;
|
|
284
287
|
if (!isNewEntry) {
|
|
285
288
|
loadDeployPreview({ maxAttempts: 3 });
|
|
@@ -450,7 +453,7 @@ export class EditorToolbar extends React.Component {
|
|
|
450
453
|
return canPublish || canCreate ? (
|
|
451
454
|
<ToolbarDropdown
|
|
452
455
|
dropdownTopOverlap="40px"
|
|
453
|
-
dropdownWidth="
|
|
456
|
+
dropdownWidth="max-content"
|
|
454
457
|
key="td-publish-create"
|
|
455
458
|
renderButton={() => (
|
|
456
459
|
<PublishedToolbarButton>
|
|
@@ -486,7 +489,7 @@ export class EditorToolbar extends React.Component {
|
|
|
486
489
|
return canCreate ? (
|
|
487
490
|
<ToolbarDropdown
|
|
488
491
|
dropdownTopOverlap="40px"
|
|
489
|
-
dropdownWidth="
|
|
492
|
+
dropdownWidth="max-content"
|
|
490
493
|
renderButton={() => (
|
|
491
494
|
<PublishedToolbarButton>{t('editor.editorToolbar.published')}</PublishedToolbarButton>
|
|
492
495
|
)}
|
|
@@ -511,7 +514,7 @@ export class EditorToolbar extends React.Component {
|
|
|
511
514
|
<div>
|
|
512
515
|
<ToolbarDropdown
|
|
513
516
|
dropdownTopOverlap="40px"
|
|
514
|
-
dropdownWidth="
|
|
517
|
+
dropdownWidth="max-content"
|
|
515
518
|
renderButton={() => (
|
|
516
519
|
<PublishButton>
|
|
517
520
|
{isPersisting
|
|
@@ -65,10 +65,9 @@ describe('Editor', () => {
|
|
|
65
65
|
expect(asFragment()).toMatchSnapshot();
|
|
66
66
|
expect(console.error).toHaveBeenCalledTimes(1);
|
|
67
67
|
expect(console.error).toHaveBeenCalledWith(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
expect.anything(),
|
|
68
|
+
expect.stringContaining(
|
|
69
|
+
'Warning: Failed prop type: Required prop `entryDraft` was not specified in `Editor`.',
|
|
70
|
+
),
|
|
72
71
|
);
|
|
73
72
|
});
|
|
74
73
|
|
|
@@ -7,8 +7,8 @@ exports[`Editor should render editor interface when entry is not fetching 1`] =
|
|
|
7
7
|
deploypreview="Map {}"
|
|
8
8
|
entry="Map { \\"slug\\": \\"slug\\" }"
|
|
9
9
|
fields="List []"
|
|
10
|
-
isnewentry="
|
|
11
|
-
showdelete="
|
|
10
|
+
isnewentry=""
|
|
11
|
+
showdelete=""
|
|
12
12
|
user="Map {}"
|
|
13
13
|
/>
|
|
14
14
|
</DocumentFragment>
|
|
@@ -17,7 +17,7 @@ exports[`Editor should render editor interface when entry is not fetching 1`] =
|
|
|
17
17
|
exports[`Editor should render loader when entry is fetching 1`] = `
|
|
18
18
|
<DocumentFragment>
|
|
19
19
|
<mock-loader
|
|
20
|
-
active="
|
|
20
|
+
active=""
|
|
21
21
|
>
|
|
22
22
|
editor.editor.loadingEntry
|
|
23
23
|
</mock-loader>
|
|
@@ -27,7 +27,7 @@ exports[`Editor should render loader when entry is fetching 1`] = `
|
|
|
27
27
|
exports[`Editor should render loader when entryDraft entry is undefined 1`] = `
|
|
28
28
|
<DocumentFragment>
|
|
29
29
|
<mock-loader
|
|
30
|
-
active="
|
|
30
|
+
active=""
|
|
31
31
|
>
|
|
32
32
|
editor.editor.loadingEntry
|
|
33
33
|
</mock-loader>
|
|
@@ -37,7 +37,7 @@ exports[`Editor should render loader when entryDraft entry is undefined 1`] = `
|
|
|
37
37
|
exports[`Editor should render loader when entryDraft is null 1`] = `
|
|
38
38
|
<DocumentFragment>
|
|
39
39
|
<mock-loader
|
|
40
|
-
active="
|
|
40
|
+
active=""
|
|
41
41
|
>
|
|
42
42
|
editor.editor.loadingEntry
|
|
43
43
|
</mock-loader>
|