decap-cms-core 3.14.0 → 3.15.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 +18 -18
- package/dist/decap-cms-core.js.map +1 -1
- package/dist/esm/bootstrap.js +2 -2
- package/dist/esm/components/App/App.js +6 -6
- package/dist/esm/components/Collection/Collection.js +7 -7
- package/dist/esm/components/Collection/CollectionControls.js +1 -1
- package/dist/esm/components/Collection/CollectionTop.js +8 -8
- package/dist/esm/components/Collection/ControlButton.js +2 -2
- package/dist/esm/components/Collection/Entries/Entries.js +2 -2
- package/dist/esm/components/Collection/Sidebar.js +6 -6
- package/dist/esm/components/MediaLibrary/MediaLibraryButtons.js +48 -9
- package/dist/esm/components/MediaLibrary/MediaLibraryCard.js +7 -9
- package/dist/esm/components/MediaLibrary/MediaLibraryCardGrid.js +5 -5
- package/dist/esm/components/MediaLibrary/MediaLibraryHeader.js +15 -3
- package/dist/esm/components/MediaLibrary/MediaLibraryModal.js +4 -1
- package/dist/esm/components/MediaLibrary/MediaLibrarySearch.js +6 -6
- package/dist/esm/components/MediaLibrary/MediaLibraryTop.js +14 -24
- package/dist/esm/components/UI/ErrorBoundary.js +2 -2
- package/dist/esm/components/UI/Modal.js +11 -4
- package/dist/esm/components/Workflow/Workflow.js +5 -5
- package/dist/esm/components/Workflow/WorkflowCard.js +14 -14
- package/dist/esm/components/Workflow/WorkflowList.js +18 -42
- package/dist/esm/constants/configSchema.js +1 -2
- package/dist/esm/reducers/entries.js +9 -7
- package/dist/esm/reducers/entryDraft.js +3 -4
- package/dist/esm/reducers/mediaLibrary.js +2 -3
- package/dist/esm/reducers/notifications.js +1 -2
- package/index.d.ts +2 -2
- package/package.json +7 -8
- package/src/actions/__tests__/editorialWorkflow.spec.js +1 -3
- package/src/components/App/App.js +0 -1
- package/src/components/Collection/Collection.js +10 -3
- package/src/components/Collection/CollectionControls.js +4 -3
- package/src/components/Collection/CollectionTop.js +3 -2
- package/src/components/Collection/ControlButton.js +1 -0
- package/src/components/Collection/Entries/Entries.js +1 -0
- package/src/components/Collection/Sidebar.js +8 -7
- package/src/components/Collection/__tests__/__snapshots__/Collection.spec.js.snap +76 -12
- package/src/components/Collection/__tests__/__snapshots__/Sidebar.spec.js.snap +76 -16
- package/src/components/MediaLibrary/MediaLibraryButtons.js +39 -7
- package/src/components/MediaLibrary/MediaLibraryCard.js +1 -3
- package/src/components/MediaLibrary/MediaLibraryCardGrid.js +2 -2
- package/src/components/MediaLibrary/MediaLibraryHeader.js +32 -17
- package/src/components/MediaLibrary/MediaLibraryModal.js +8 -4
- package/src/components/MediaLibrary/MediaLibrarySearch.js +3 -1
- package/src/components/MediaLibrary/MediaLibraryTop.js +19 -1
- package/src/components/MediaLibrary/__tests__/__snapshots__/MediaLibraryCard.spec.js.snap +6 -6
- package/src/components/UI/Modal.js +10 -3
- package/src/components/Workflow/Workflow.js +7 -1
- package/src/components/Workflow/WorkflowCard.js +52 -14
- package/src/components/Workflow/WorkflowList.js +50 -31
- package/src/constants/configSchema.js +1 -2
- package/src/reducers/__tests__/entryDraft.spec.js +1 -1
- package/src/reducers/__tests__/mediaLibrary.spec.js +0 -1
- package/src/reducers/entries.ts +9 -7
- package/src/reducers/entryDraft.js +3 -4
- package/src/reducers/mediaLibrary.ts +2 -3
- package/src/reducers/notifications.ts +1 -2
- package/src/types/redux.ts +3 -3
package/src/reducers/entries.ts
CHANGED
|
@@ -474,14 +474,16 @@ function getGroup(entry: EntryMap, selectedGroup: GroupMap) {
|
|
|
474
474
|
if (selectedGroup.has('pattern')) {
|
|
475
475
|
const pattern = selectedGroup.get('pattern');
|
|
476
476
|
let value = '';
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
477
|
+
if (pattern !== undefined) {
|
|
478
|
+
try {
|
|
479
|
+
const regex = new RegExp(pattern);
|
|
480
|
+
const matched = dataAsString.match(regex);
|
|
481
|
+
if (matched) {
|
|
482
|
+
value = matched[0];
|
|
483
|
+
}
|
|
484
|
+
} catch (e) {
|
|
485
|
+
console.warn(`Invalid view group pattern '${pattern}' for field '${field}'`, e);
|
|
482
486
|
}
|
|
483
|
-
} catch (e) {
|
|
484
|
-
console.warn(`Invalid view group pattern '${pattern}' for field '${field}'`, e);
|
|
485
487
|
}
|
|
486
488
|
return {
|
|
487
489
|
id: `${label}${value}`,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Map, List, fromJS } from 'immutable';
|
|
2
|
-
import { v4 as uuid } from 'uuid';
|
|
3
2
|
import get from 'lodash/get';
|
|
4
3
|
import { join, basename } from 'path';
|
|
5
4
|
|
|
@@ -53,7 +52,7 @@ function entryDraftReducer(state = Map(), action) {
|
|
|
53
52
|
state.set('fieldsMetaData', Map());
|
|
54
53
|
state.set('fieldsErrors', Map());
|
|
55
54
|
state.set('hasChanged', false);
|
|
56
|
-
state.set('key',
|
|
55
|
+
state.set('key', crypto.randomUUID());
|
|
57
56
|
});
|
|
58
57
|
case DRAFT_CREATE_EMPTY:
|
|
59
58
|
// New Entry
|
|
@@ -63,7 +62,7 @@ function entryDraftReducer(state = Map(), action) {
|
|
|
63
62
|
state.set('fieldsMetaData', Map());
|
|
64
63
|
state.set('fieldsErrors', Map());
|
|
65
64
|
state.set('hasChanged', false);
|
|
66
|
-
state.set('key',
|
|
65
|
+
state.set('key', crypto.randomUUID());
|
|
67
66
|
});
|
|
68
67
|
case DRAFT_CREATE_FROM_LOCAL_BACKUP:
|
|
69
68
|
// Local Backup
|
|
@@ -76,7 +75,7 @@ function entryDraftReducer(state = Map(), action) {
|
|
|
76
75
|
state.set('fieldsMetaData', Map());
|
|
77
76
|
state.set('fieldsErrors', Map());
|
|
78
77
|
state.set('hasChanged', true);
|
|
79
|
-
state.set('key',
|
|
78
|
+
state.set('key', crypto.randomUUID());
|
|
80
79
|
});
|
|
81
80
|
case DRAFT_CREATE_DUPLICATE_FROM_ENTRY:
|
|
82
81
|
// Duplicate Entry
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Map, List } from 'immutable';
|
|
2
|
-
import { v4 as uuid } from 'uuid';
|
|
3
2
|
import { dirname } from 'path';
|
|
4
3
|
|
|
5
4
|
import {
|
|
@@ -150,7 +149,7 @@ function mediaLibrary(state = Map(defaultState), action: MediaLibraryAction) {
|
|
|
150
149
|
return state;
|
|
151
150
|
}
|
|
152
151
|
|
|
153
|
-
const filesWithKeys = files.map(file => ({ ...file, key:
|
|
152
|
+
const filesWithKeys = files.map(file => ({ ...file, key: crypto.randomUUID() }));
|
|
154
153
|
return state.withMutations(map => {
|
|
155
154
|
map.set('isLoading', false);
|
|
156
155
|
map.set('isPaginating', false);
|
|
@@ -186,7 +185,7 @@ function mediaLibrary(state = Map(defaultState), action: MediaLibraryAction) {
|
|
|
186
185
|
return state;
|
|
187
186
|
}
|
|
188
187
|
return state.withMutations(map => {
|
|
189
|
-
const fileWithKey = { ...file, key:
|
|
188
|
+
const fileWithKey = { ...file, key: crypto.randomUUID() };
|
|
190
189
|
const files = map.get('files') as MediaFile[];
|
|
191
190
|
const updatedFiles = [fileWithKey, ...files];
|
|
192
191
|
map.set('files', updatedFiles);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { produce } from 'immer';
|
|
2
|
-
import { v4 as uuid } from 'uuid';
|
|
3
2
|
|
|
4
3
|
import {
|
|
5
4
|
NOTIFICATION_SEND,
|
|
@@ -41,7 +40,7 @@ const notifications = produce((state: NotificationsState, action: NotificationsA
|
|
|
41
40
|
state.notifications = [
|
|
42
41
|
...state.notifications,
|
|
43
42
|
{
|
|
44
|
-
id:
|
|
43
|
+
id: crypto.randomUUID(),
|
|
45
44
|
...(action.payload as NotificationPayload),
|
|
46
45
|
},
|
|
47
46
|
];
|
package/src/types/redux.ts
CHANGED
|
@@ -72,7 +72,7 @@ export interface CmsFieldBase {
|
|
|
72
72
|
label?: string;
|
|
73
73
|
required?: boolean;
|
|
74
74
|
hint?: string;
|
|
75
|
-
pattern?: [string, string];
|
|
75
|
+
pattern?: [string | RegExp, string];
|
|
76
76
|
i18n?: boolean | 'translate' | 'duplicate' | 'none';
|
|
77
77
|
media_folder?: string;
|
|
78
78
|
public_folder?: string;
|
|
@@ -315,14 +315,14 @@ export interface CmsCollectionFile {
|
|
|
315
315
|
export interface ViewFilter {
|
|
316
316
|
label: string;
|
|
317
317
|
field: string;
|
|
318
|
-
pattern: string;
|
|
318
|
+
pattern: string | boolean;
|
|
319
319
|
id: string;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
export interface ViewGroup {
|
|
323
323
|
label: string;
|
|
324
324
|
field: string;
|
|
325
|
-
pattern
|
|
325
|
+
pattern?: string;
|
|
326
326
|
id: string;
|
|
327
327
|
}
|
|
328
328
|
|