@pranaysahith/decap-cms-core 3.9.1
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/README.md +9 -0
- package/dist/@pranaysahith/decap-cms-core.js +52 -0
- package/dist/@pranaysahith/decap-cms-core.js.LICENSE.txt +141 -0
- package/dist/@pranaysahith/decap-cms-core.js.map +1 -0
- package/dist/decap-cms-core.js +47 -0
- package/dist/decap-cms-core.js.LICENSE.txt +116 -0
- package/dist/decap-cms-core.js.map +1 -0
- package/dist/esm/actions/auth.js +97 -0
- package/dist/esm/actions/collections.js +15 -0
- package/dist/esm/actions/config.js +493 -0
- package/dist/esm/actions/deploys.js +79 -0
- package/dist/esm/actions/editorialWorkflow.js +480 -0
- package/dist/esm/actions/entries.js +865 -0
- package/dist/esm/actions/media.js +147 -0
- package/dist/esm/actions/mediaLibrary.js +552 -0
- package/dist/esm/actions/notifications.js +21 -0
- package/dist/esm/actions/search.js +149 -0
- package/dist/esm/actions/status.js +74 -0
- package/dist/esm/actions/waitUntil.js +32 -0
- package/dist/esm/backend.js +1082 -0
- package/dist/esm/bootstrap.js +101 -0
- package/dist/esm/components/App/App.js +289 -0
- package/dist/esm/components/App/Header.js +172 -0
- package/dist/esm/components/App/NotFoundPage.js +19 -0
- package/dist/esm/components/Collection/Collection.js +198 -0
- package/dist/esm/components/Collection/CollectionControls.js +46 -0
- package/dist/esm/components/Collection/CollectionSearch.js +222 -0
- package/dist/esm/components/Collection/CollectionTop.js +68 -0
- package/dist/esm/components/Collection/ControlButton.js +17 -0
- package/dist/esm/components/Collection/Entries/Entries.js +73 -0
- package/dist/esm/components/Collection/Entries/EntriesCollection.js +241 -0
- package/dist/esm/components/Collection/Entries/EntriesSearch.js +113 -0
- package/dist/esm/components/Collection/Entries/EntryCard.js +177 -0
- package/dist/esm/components/Collection/Entries/EntryListing.js +143 -0
- package/dist/esm/components/Collection/FilterControl.js +33 -0
- package/dist/esm/components/Collection/FolderRenameControl.js +403 -0
- package/dist/esm/components/Collection/GroupControl.js +33 -0
- package/dist/esm/components/Collection/NestedCollection.js +308 -0
- package/dist/esm/components/Collection/Sidebar.js +91 -0
- package/dist/esm/components/Collection/SortControl.js +59 -0
- package/dist/esm/components/Collection/ViewStyleControl.js +38 -0
- package/dist/esm/components/Editor/Editor.js +466 -0
- package/dist/esm/components/Editor/EditorControlPane/EditorControl.js +395 -0
- package/dist/esm/components/Editor/EditorControlPane/EditorControlPane.js +254 -0
- package/dist/esm/components/Editor/EditorControlPane/Widget.js +374 -0
- package/dist/esm/components/Editor/EditorInterface.js +386 -0
- package/dist/esm/components/Editor/EditorPreviewPane/EditorPreview.js +47 -0
- package/dist/esm/components/Editor/EditorPreviewPane/EditorPreviewContent.js +66 -0
- package/dist/esm/components/Editor/EditorPreviewPane/EditorPreviewPane.js +288 -0
- package/dist/esm/components/Editor/EditorPreviewPane/PreviewHOC.js +27 -0
- package/dist/esm/components/Editor/EditorToolbar.js +536 -0
- package/dist/esm/components/Editor/EntryPathEditor.js +272 -0
- package/dist/esm/components/Editor/withWorkflow.js +56 -0
- package/dist/esm/components/EditorWidgets/Unknown/UnknownControl.js +18 -0
- package/dist/esm/components/EditorWidgets/Unknown/UnknownPreview.js +20 -0
- package/dist/esm/components/EditorWidgets/index.js +4 -0
- package/dist/esm/components/MediaLibrary/EmptyMessage.js +22 -0
- package/dist/esm/components/MediaLibrary/MediaLibrary.js +446 -0
- package/dist/esm/components/MediaLibrary/MediaLibraryButtons.js +93 -0
- package/dist/esm/components/MediaLibrary/MediaLibraryCard.js +99 -0
- package/dist/esm/components/MediaLibrary/MediaLibraryCardGrid.js +198 -0
- package/dist/esm/components/MediaLibrary/MediaLibraryHeader.js +32 -0
- package/dist/esm/components/MediaLibrary/MediaLibraryModal.js +156 -0
- package/dist/esm/components/MediaLibrary/MediaLibrarySearch.js +51 -0
- package/dist/esm/components/MediaLibrary/MediaLibraryTop.js +123 -0
- package/dist/esm/components/UI/DragDrop.js +67 -0
- package/dist/esm/components/UI/ErrorBoundary.js +173 -0
- package/dist/esm/components/UI/FileUploadButton.js +27 -0
- package/dist/esm/components/UI/Modal.js +104 -0
- package/dist/esm/components/UI/Notifications.js +62 -0
- package/dist/esm/components/UI/SettingsDropdown.js +107 -0
- package/dist/esm/components/UI/index.js +6 -0
- package/dist/esm/components/Workflow/Workflow.js +133 -0
- package/dist/esm/components/Workflow/WorkflowCard.js +128 -0
- package/dist/esm/components/Workflow/WorkflowList.js +204 -0
- package/dist/esm/constants/collectionTypes.js +2 -0
- package/dist/esm/constants/collectionViews.js +2 -0
- package/dist/esm/constants/commitProps.js +2 -0
- package/dist/esm/constants/configSchema.js +644 -0
- package/dist/esm/constants/fieldInference.js +57 -0
- package/dist/esm/constants/publishModes.js +18 -0
- package/dist/esm/constants/validationErrorTypes.js +6 -0
- package/dist/esm/formats/formats.js +83 -0
- package/dist/esm/formats/frontmatter.js +146 -0
- package/dist/esm/formats/helpers.js +12 -0
- package/dist/esm/formats/json.js +8 -0
- package/dist/esm/formats/toml.js +32 -0
- package/dist/esm/formats/yaml.js +51 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/integrations/index.js +28 -0
- package/dist/esm/integrations/providers/algolia/implementation.js +174 -0
- package/dist/esm/integrations/providers/assetStore/implementation.js +165 -0
- package/dist/esm/lib/consoleError.js +3 -0
- package/dist/esm/lib/formatters.js +191 -0
- package/dist/esm/lib/i18n.js +367 -0
- package/dist/esm/lib/phrases.js +6 -0
- package/dist/esm/lib/polyfill.js +8 -0
- package/dist/esm/lib/registry.js +329 -0
- package/dist/esm/lib/serializeEntryValues.js +67 -0
- package/dist/esm/lib/stega.js +142 -0
- package/dist/esm/lib/textHelper.js +9 -0
- package/dist/esm/lib/urlHelper.js +111 -0
- package/dist/esm/mediaLibrary.js +37 -0
- package/dist/esm/reducers/auth.js +27 -0
- package/dist/esm/reducers/collections.js +428 -0
- package/dist/esm/reducers/combinedReducer.js +8 -0
- package/dist/esm/reducers/config.js +29 -0
- package/dist/esm/reducers/cursors.js +31 -0
- package/dist/esm/reducers/deploys.js +45 -0
- package/dist/esm/reducers/editorialWorkflow.js +83 -0
- package/dist/esm/reducers/entries.js +568 -0
- package/dist/esm/reducers/entryDraft.js +212 -0
- package/dist/esm/reducers/globalUI.js +25 -0
- package/dist/esm/reducers/index.js +66 -0
- package/dist/esm/reducers/integrations.js +53 -0
- package/dist/esm/reducers/mediaLibrary.js +252 -0
- package/dist/esm/reducers/medias.js +68 -0
- package/dist/esm/reducers/notifications.js +23 -0
- package/dist/esm/reducers/search.js +92 -0
- package/dist/esm/reducers/status.js +30 -0
- package/dist/esm/redux/index.js +7 -0
- package/dist/esm/redux/middleware/waitUntilAction.js +48 -0
- package/dist/esm/routing/history.js +12 -0
- package/dist/esm/types/diacritics.d.js +0 -0
- package/dist/esm/types/global.d.js +1 -0
- package/dist/esm/types/immutable.js +7 -0
- package/dist/esm/types/redux.js +14 -0
- package/dist/esm/types/tomlify-j0.4.d.js +0 -0
- package/dist/esm/valueObjects/AssetProxy.js +44 -0
- package/dist/esm/valueObjects/EditorComponent.js +34 -0
- package/dist/esm/valueObjects/Entry.js +20 -0
- package/index.d.ts +618 -0
- package/package.json +106 -0
- package/src/__tests__/backend.spec.js +1161 -0
- package/src/actions/__tests__/config.spec.js +1009 -0
- package/src/actions/__tests__/editorialWorkflow.spec.js +216 -0
- package/src/actions/__tests__/entries.spec.js +596 -0
- package/src/actions/__tests__/media.spec.ts +171 -0
- package/src/actions/__tests__/mediaLibrary.spec.js +327 -0
- package/src/actions/__tests__/search.spec.js +209 -0
- package/src/actions/auth.ts +127 -0
- package/src/actions/collections.ts +18 -0
- package/src/actions/config.ts +565 -0
- package/src/actions/deploys.ts +104 -0
- package/src/actions/editorialWorkflow.ts +567 -0
- package/src/actions/entries.ts +1055 -0
- package/src/actions/media.ts +139 -0
- package/src/actions/mediaLibrary.ts +574 -0
- package/src/actions/notifications.ts +36 -0
- package/src/actions/search.ts +221 -0
- package/src/actions/status.ts +99 -0
- package/src/actions/waitUntil.ts +49 -0
- package/src/backend.ts +1400 -0
- package/src/bootstrap.js +104 -0
- package/src/components/App/App.js +286 -0
- package/src/components/App/Header.js +266 -0
- package/src/components/App/NotFoundPage.js +23 -0
- package/src/components/Collection/Collection.js +210 -0
- package/src/components/Collection/CollectionControls.js +58 -0
- package/src/components/Collection/CollectionSearch.js +243 -0
- package/src/components/Collection/CollectionTop.js +81 -0
- package/src/components/Collection/ControlButton.js +27 -0
- package/src/components/Collection/Entries/Entries.js +82 -0
- package/src/components/Collection/Entries/EntriesCollection.js +277 -0
- package/src/components/Collection/Entries/EntriesSearch.js +102 -0
- package/src/components/Collection/Entries/EntryCard.js +246 -0
- package/src/components/Collection/Entries/EntryListing.js +151 -0
- package/src/components/Collection/Entries/__tests__/EntriesCollection.spec.js +163 -0
- package/src/components/Collection/Entries/__tests__/__snapshots__/EntriesCollection.spec.js.snap +46 -0
- package/src/components/Collection/FilterControl.js +39 -0
- package/src/components/Collection/GroupControl.js +39 -0
- package/src/components/Collection/NestedCollection.js +330 -0
- package/src/components/Collection/Sidebar.js +136 -0
- package/src/components/Collection/SortControl.js +68 -0
- package/src/components/Collection/ViewStyleControl.js +50 -0
- package/src/components/Collection/__tests__/Collection.spec.js +75 -0
- package/src/components/Collection/__tests__/NestedCollection.spec.js +445 -0
- package/src/components/Collection/__tests__/Sidebar.spec.js +87 -0
- package/src/components/Collection/__tests__/__snapshots__/Collection.spec.js.snap +144 -0
- package/src/components/Collection/__tests__/__snapshots__/NestedCollection.spec.js.snap +550 -0
- package/src/components/Collection/__tests__/__snapshots__/Sidebar.spec.js.snap +312 -0
- package/src/components/Editor/Editor.js +497 -0
- package/src/components/Editor/EditorControlPane/EditorControl.js +452 -0
- package/src/components/Editor/EditorControlPane/EditorControlPane.js +269 -0
- package/src/components/Editor/EditorControlPane/Widget.js +384 -0
- package/src/components/Editor/EditorInterface.js +444 -0
- package/src/components/Editor/EditorPreviewPane/EditorPreview.js +40 -0
- package/src/components/Editor/EditorPreviewPane/EditorPreviewContent.js +74 -0
- package/src/components/Editor/EditorPreviewPane/EditorPreviewPane.js +333 -0
- package/src/components/Editor/EditorPreviewPane/PreviewHOC.js +33 -0
- package/src/components/Editor/EditorToolbar.js +691 -0
- package/src/components/Editor/__tests__/Editor.spec.js +221 -0
- package/src/components/Editor/__tests__/EditorToolbar.spec.js +120 -0
- package/src/components/Editor/__tests__/__snapshots__/Editor.spec.js.snap +45 -0
- package/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap +4233 -0
- package/src/components/Editor/withWorkflow.js +61 -0
- package/src/components/EditorWidgets/Unknown/UnknownControl.js +17 -0
- package/src/components/EditorWidgets/Unknown/UnknownPreview.js +19 -0
- package/src/components/EditorWidgets/index.js +5 -0
- package/src/components/MediaLibrary/EmptyMessage.js +28 -0
- package/src/components/MediaLibrary/MediaLibrary.js +411 -0
- package/src/components/MediaLibrary/MediaLibraryButtons.js +136 -0
- package/src/components/MediaLibrary/MediaLibraryCard.js +128 -0
- package/src/components/MediaLibrary/MediaLibraryCardGrid.js +199 -0
- package/src/components/MediaLibrary/MediaLibraryHeader.js +48 -0
- package/src/components/MediaLibrary/MediaLibraryModal.js +200 -0
- package/src/components/MediaLibrary/MediaLibrarySearch.js +61 -0
- package/src/components/MediaLibrary/MediaLibraryTop.js +143 -0
- package/src/components/MediaLibrary/__tests__/MediaLibraryButtons.spec.js +45 -0
- package/src/components/MediaLibrary/__tests__/MediaLibraryCard.spec.js +49 -0
- package/src/components/MediaLibrary/__tests__/__snapshots__/MediaLibraryCard.spec.js.snap +264 -0
- package/src/components/UI/DragDrop.js +66 -0
- package/src/components/UI/ErrorBoundary.js +214 -0
- package/src/components/UI/FileUploadButton.js +24 -0
- package/src/components/UI/Modal.js +112 -0
- package/src/components/UI/Notifications.tsx +83 -0
- package/src/components/UI/SettingsDropdown.js +103 -0
- package/src/components/UI/__tests__/ErrorBoundary.spec.js +57 -0
- package/src/components/UI/index.js +6 -0
- package/src/components/Workflow/Workflow.js +169 -0
- package/src/components/Workflow/WorkflowCard.js +177 -0
- package/src/components/Workflow/WorkflowList.js +272 -0
- package/src/constants/__tests__/configSchema.spec.js +611 -0
- package/src/constants/collectionTypes.ts +2 -0
- package/src/constants/collectionViews.js +2 -0
- package/src/constants/commitProps.ts +2 -0
- package/src/constants/configSchema.js +441 -0
- package/src/constants/fieldInference.tsx +78 -0
- package/src/constants/publishModes.ts +22 -0
- package/src/constants/validationErrorTypes.js +6 -0
- package/src/formats/__tests__/formats.spec.js +87 -0
- package/src/formats/__tests__/frontmatter.spec.js +429 -0
- package/src/formats/__tests__/toml.spec.js +9 -0
- package/src/formats/__tests__/yaml.spec.js +162 -0
- package/src/formats/formats.ts +97 -0
- package/src/formats/frontmatter.ts +150 -0
- package/src/formats/helpers.ts +14 -0
- package/src/formats/json.ts +9 -0
- package/src/formats/toml.ts +33 -0
- package/src/formats/yaml.ts +58 -0
- package/src/index.js +8 -0
- package/src/integrations/index.js +35 -0
- package/src/integrations/providers/algolia/implementation.js +176 -0
- package/src/integrations/providers/assetStore/implementation.js +148 -0
- package/src/lib/__tests__/formatters.spec.js +751 -0
- package/src/lib/__tests__/i18n.spec.js +792 -0
- package/src/lib/__tests__/phrases.spec.js +119 -0
- package/src/lib/__tests__/registry.spec.js +261 -0
- package/src/lib/__tests__/serializeEntryValues.spec.js +22 -0
- package/src/lib/__tests__/urlHelper.spec.js +138 -0
- package/src/lib/consoleError.js +7 -0
- package/src/lib/formatters.ts +286 -0
- package/src/lib/i18n.ts +454 -0
- package/src/lib/phrases.js +8 -0
- package/src/lib/polyfill.js +9 -0
- package/src/lib/registry.js +312 -0
- package/src/lib/serializeEntryValues.js +75 -0
- package/src/lib/stega.ts +145 -0
- package/src/lib/textHelper.js +11 -0
- package/src/lib/urlHelper.ts +128 -0
- package/src/mediaLibrary.ts +51 -0
- package/src/reducers/__tests__/auth.spec.ts +38 -0
- package/src/reducers/__tests__/collections.spec.js +610 -0
- package/src/reducers/__tests__/config.spec.js +38 -0
- package/src/reducers/__tests__/entries.spec.js +694 -0
- package/src/reducers/__tests__/entryDraft.spec.js +297 -0
- package/src/reducers/__tests__/globalUI.js +43 -0
- package/src/reducers/__tests__/integrations.spec.ts +76 -0
- package/src/reducers/__tests__/mediaLibrary.spec.js +154 -0
- package/src/reducers/__tests__/medias.spec.ts +49 -0
- package/src/reducers/auth.ts +46 -0
- package/src/reducers/collections.ts +535 -0
- package/src/reducers/combinedReducer.ts +11 -0
- package/src/reducers/config.ts +38 -0
- package/src/reducers/cursors.js +36 -0
- package/src/reducers/deploys.ts +52 -0
- package/src/reducers/editorialWorkflow.ts +163 -0
- package/src/reducers/entries.ts +819 -0
- package/src/reducers/entryDraft.js +260 -0
- package/src/reducers/globalUI.ts +45 -0
- package/src/reducers/index.ts +82 -0
- package/src/reducers/integrations.ts +59 -0
- package/src/reducers/mediaLibrary.ts +296 -0
- package/src/reducers/medias.ts +66 -0
- package/src/reducers/notifications.ts +52 -0
- package/src/reducers/search.ts +111 -0
- package/src/reducers/status.ts +40 -0
- package/src/redux/index.ts +18 -0
- package/src/redux/middleware/waitUntilAction.ts +64 -0
- package/src/routing/__tests__/history.spec.ts +49 -0
- package/src/routing/history.ts +17 -0
- package/src/types/diacritics.d.ts +1 -0
- package/src/types/global.d.ts +8 -0
- package/src/types/immutable.ts +49 -0
- package/src/types/redux.ts +827 -0
- package/src/types/tomlify-j0.4.d.ts +13 -0
- package/src/valueObjects/AssetProxy.ts +48 -0
- package/src/valueObjects/EditorComponent.js +38 -0
- package/src/valueObjects/Entry.ts +63 -0
|
@@ -0,0 +1,644 @@
|
|
|
1
|
+
function _extendableBuiltin(cls) {
|
|
2
|
+
function ExtendableBuiltin() {
|
|
3
|
+
var instance = Reflect.construct(cls, Array.from(arguments));
|
|
4
|
+
Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
|
|
5
|
+
return instance;
|
|
6
|
+
}
|
|
7
|
+
ExtendableBuiltin.prototype = Object.create(cls.prototype, {
|
|
8
|
+
constructor: {
|
|
9
|
+
value: cls,
|
|
10
|
+
enumerable: false,
|
|
11
|
+
writable: true,
|
|
12
|
+
configurable: true
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
if (Object.setPrototypeOf) {
|
|
16
|
+
Object.setPrototypeOf(ExtendableBuiltin, cls);
|
|
17
|
+
} else {
|
|
18
|
+
ExtendableBuiltin.__proto__ = cls;
|
|
19
|
+
}
|
|
20
|
+
return ExtendableBuiltin;
|
|
21
|
+
}
|
|
22
|
+
import AJV from 'ajv';
|
|
23
|
+
import { select, uniqueItemProperties, instanceof as instanceOf, prohibited } from 'ajv-keywords/dist/keywords';
|
|
24
|
+
import ajvErrors from 'ajv-errors';
|
|
25
|
+
import { v4 as uuid } from 'uuid';
|
|
26
|
+
import { frontmatterFormats, extensionFormatters } from '../formats/formats';
|
|
27
|
+
import { getWidgets } from '../lib/registry';
|
|
28
|
+
import { I18N_STRUCTURE, I18N_FIELD } from '../lib/i18n';
|
|
29
|
+
const localeType = {
|
|
30
|
+
type: 'string',
|
|
31
|
+
minLength: 2,
|
|
32
|
+
maxLength: 10,
|
|
33
|
+
pattern: '^[a-zA-Z-_]+$'
|
|
34
|
+
};
|
|
35
|
+
const i18n = {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: {
|
|
38
|
+
structure: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
enum: Object.values(I18N_STRUCTURE)
|
|
41
|
+
},
|
|
42
|
+
locales: {
|
|
43
|
+
type: 'array',
|
|
44
|
+
minItems: 1,
|
|
45
|
+
items: localeType,
|
|
46
|
+
uniqueItems: true
|
|
47
|
+
},
|
|
48
|
+
default_locale: localeType
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const i18nRoot = {
|
|
52
|
+
...i18n,
|
|
53
|
+
required: ['structure', 'locales']
|
|
54
|
+
};
|
|
55
|
+
const i18nCollection = {
|
|
56
|
+
oneOf: [{
|
|
57
|
+
type: 'boolean'
|
|
58
|
+
}, i18n]
|
|
59
|
+
};
|
|
60
|
+
const i18nField = {
|
|
61
|
+
oneOf: [{
|
|
62
|
+
type: 'boolean'
|
|
63
|
+
}, {
|
|
64
|
+
type: 'string',
|
|
65
|
+
enum: Object.values(I18N_FIELD)
|
|
66
|
+
}]
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Config for fields in both file and folder collections.
|
|
71
|
+
*/
|
|
72
|
+
function fieldsConfig() {
|
|
73
|
+
const id = uuid();
|
|
74
|
+
return {
|
|
75
|
+
$id: `fields_${id}`,
|
|
76
|
+
type: 'array',
|
|
77
|
+
minItems: 1,
|
|
78
|
+
items: {
|
|
79
|
+
// ------- Each field: -------
|
|
80
|
+
$id: `field_${id}`,
|
|
81
|
+
type: 'object',
|
|
82
|
+
properties: {
|
|
83
|
+
name: {
|
|
84
|
+
type: 'string'
|
|
85
|
+
},
|
|
86
|
+
label: {
|
|
87
|
+
type: 'string'
|
|
88
|
+
},
|
|
89
|
+
widget: {
|
|
90
|
+
type: 'string'
|
|
91
|
+
},
|
|
92
|
+
required: {
|
|
93
|
+
type: 'boolean'
|
|
94
|
+
},
|
|
95
|
+
i18n: i18nField,
|
|
96
|
+
hint: {
|
|
97
|
+
type: 'string'
|
|
98
|
+
},
|
|
99
|
+
pattern: {
|
|
100
|
+
type: 'array',
|
|
101
|
+
minItems: 2,
|
|
102
|
+
items: [{
|
|
103
|
+
oneOf: [{
|
|
104
|
+
type: 'string'
|
|
105
|
+
}, {
|
|
106
|
+
instanceof: 'RegExp'
|
|
107
|
+
}]
|
|
108
|
+
}, {
|
|
109
|
+
type: 'string'
|
|
110
|
+
}]
|
|
111
|
+
},
|
|
112
|
+
field: {
|
|
113
|
+
$ref: `field_${id}`
|
|
114
|
+
},
|
|
115
|
+
fields: {
|
|
116
|
+
$ref: `fields_${id}`
|
|
117
|
+
},
|
|
118
|
+
types: {
|
|
119
|
+
$ref: `fields_${id}`
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
select: {
|
|
123
|
+
$data: '0/widget'
|
|
124
|
+
},
|
|
125
|
+
selectCases: {
|
|
126
|
+
...getWidgetSchemas()
|
|
127
|
+
},
|
|
128
|
+
required: ['name']
|
|
129
|
+
},
|
|
130
|
+
uniqueItemProperties: ['name']
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const viewFilters = {
|
|
134
|
+
type: 'array',
|
|
135
|
+
minItems: 1,
|
|
136
|
+
items: {
|
|
137
|
+
type: 'object',
|
|
138
|
+
properties: {
|
|
139
|
+
label: {
|
|
140
|
+
type: 'string'
|
|
141
|
+
},
|
|
142
|
+
field: {
|
|
143
|
+
type: 'string'
|
|
144
|
+
},
|
|
145
|
+
pattern: {
|
|
146
|
+
oneOf: [{
|
|
147
|
+
type: 'boolean'
|
|
148
|
+
}, {
|
|
149
|
+
type: 'string'
|
|
150
|
+
}]
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
additionalProperties: false,
|
|
154
|
+
required: ['label', 'field', 'pattern']
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
const viewGroups = {
|
|
158
|
+
type: 'array',
|
|
159
|
+
minItems: 1,
|
|
160
|
+
items: {
|
|
161
|
+
type: 'object',
|
|
162
|
+
properties: {
|
|
163
|
+
label: {
|
|
164
|
+
type: 'string'
|
|
165
|
+
},
|
|
166
|
+
field: {
|
|
167
|
+
type: 'string'
|
|
168
|
+
},
|
|
169
|
+
pattern: {
|
|
170
|
+
type: 'string'
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
additionalProperties: false,
|
|
174
|
+
required: ['label', 'field']
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The schema had to be wrapped in a function to
|
|
180
|
+
* fix a circular dependency problem for WebPack,
|
|
181
|
+
* where the imports get resolved asynchronously.
|
|
182
|
+
*/
|
|
183
|
+
function getConfigSchema() {
|
|
184
|
+
return {
|
|
185
|
+
type: 'object',
|
|
186
|
+
properties: {
|
|
187
|
+
backend: {
|
|
188
|
+
type: 'object',
|
|
189
|
+
properties: {
|
|
190
|
+
name: {
|
|
191
|
+
type: 'string',
|
|
192
|
+
examples: ['test-repo']
|
|
193
|
+
},
|
|
194
|
+
auth_scope: {
|
|
195
|
+
type: 'string',
|
|
196
|
+
examples: ['repo', 'public_repo'],
|
|
197
|
+
enum: ['repo', 'public_repo']
|
|
198
|
+
},
|
|
199
|
+
cms_label_prefix: {
|
|
200
|
+
type: 'string',
|
|
201
|
+
minLength: 1
|
|
202
|
+
},
|
|
203
|
+
open_authoring: {
|
|
204
|
+
type: 'boolean',
|
|
205
|
+
examples: [true]
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
required: ['name']
|
|
209
|
+
},
|
|
210
|
+
local_backend: {
|
|
211
|
+
oneOf: [{
|
|
212
|
+
type: 'boolean'
|
|
213
|
+
}, {
|
|
214
|
+
type: 'object',
|
|
215
|
+
properties: {
|
|
216
|
+
url: {
|
|
217
|
+
type: 'string',
|
|
218
|
+
examples: ['http://localhost:8081/api/v1']
|
|
219
|
+
},
|
|
220
|
+
allowed_hosts: {
|
|
221
|
+
type: 'array',
|
|
222
|
+
items: {
|
|
223
|
+
type: 'string'
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
additionalProperties: false
|
|
228
|
+
}]
|
|
229
|
+
},
|
|
230
|
+
locale: {
|
|
231
|
+
type: 'string',
|
|
232
|
+
examples: ['en', 'fr', 'de']
|
|
233
|
+
},
|
|
234
|
+
i18n: i18nRoot,
|
|
235
|
+
site_url: {
|
|
236
|
+
type: 'string',
|
|
237
|
+
examples: ['https://example.com']
|
|
238
|
+
},
|
|
239
|
+
display_url: {
|
|
240
|
+
type: 'string',
|
|
241
|
+
examples: ['https://example.com']
|
|
242
|
+
},
|
|
243
|
+
logo_url: {
|
|
244
|
+
type: 'string',
|
|
245
|
+
examples: ['https://example.com/images/logo.svg']
|
|
246
|
+
},
|
|
247
|
+
// Deprecated, replaced by `logo.src`
|
|
248
|
+
logo: {
|
|
249
|
+
type: 'object',
|
|
250
|
+
properties: {
|
|
251
|
+
src: {
|
|
252
|
+
type: 'string',
|
|
253
|
+
examples: ['https://example.com/images/logo.svg']
|
|
254
|
+
},
|
|
255
|
+
show_in_header: {
|
|
256
|
+
type: 'boolean'
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
required: ['src']
|
|
260
|
+
},
|
|
261
|
+
show_preview_links: {
|
|
262
|
+
type: 'boolean'
|
|
263
|
+
},
|
|
264
|
+
media_folder: {
|
|
265
|
+
type: 'string',
|
|
266
|
+
examples: ['assets/uploads']
|
|
267
|
+
},
|
|
268
|
+
public_folder: {
|
|
269
|
+
type: 'string',
|
|
270
|
+
examples: ['/uploads']
|
|
271
|
+
},
|
|
272
|
+
media_folder_relative: {
|
|
273
|
+
type: 'boolean'
|
|
274
|
+
},
|
|
275
|
+
media_library: {
|
|
276
|
+
type: 'object',
|
|
277
|
+
properties: {
|
|
278
|
+
name: {
|
|
279
|
+
type: 'string',
|
|
280
|
+
examples: ['uploadcare']
|
|
281
|
+
},
|
|
282
|
+
config: {
|
|
283
|
+
type: 'object'
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
required: ['name']
|
|
287
|
+
},
|
|
288
|
+
publish_mode: {
|
|
289
|
+
type: 'string',
|
|
290
|
+
enum: ['simple', 'editorial_workflow', ''],
|
|
291
|
+
examples: ['editorial_workflow']
|
|
292
|
+
},
|
|
293
|
+
slug: {
|
|
294
|
+
type: 'object',
|
|
295
|
+
properties: {
|
|
296
|
+
encoding: {
|
|
297
|
+
type: 'string',
|
|
298
|
+
enum: ['unicode', 'ascii']
|
|
299
|
+
},
|
|
300
|
+
clean_accents: {
|
|
301
|
+
type: 'boolean'
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
collections: {
|
|
306
|
+
type: 'array',
|
|
307
|
+
minItems: 1,
|
|
308
|
+
items: {
|
|
309
|
+
// ------- Each collection: -------
|
|
310
|
+
type: 'object',
|
|
311
|
+
properties: {
|
|
312
|
+
name: {
|
|
313
|
+
type: 'string'
|
|
314
|
+
},
|
|
315
|
+
label: {
|
|
316
|
+
type: 'string'
|
|
317
|
+
},
|
|
318
|
+
label_singular: {
|
|
319
|
+
type: 'string'
|
|
320
|
+
},
|
|
321
|
+
description: {
|
|
322
|
+
type: 'string'
|
|
323
|
+
},
|
|
324
|
+
folder: {
|
|
325
|
+
type: 'string'
|
|
326
|
+
},
|
|
327
|
+
files: {
|
|
328
|
+
type: 'array',
|
|
329
|
+
items: {
|
|
330
|
+
// ------- Each file: -------
|
|
331
|
+
type: 'object',
|
|
332
|
+
properties: {
|
|
333
|
+
name: {
|
|
334
|
+
type: 'string'
|
|
335
|
+
},
|
|
336
|
+
label: {
|
|
337
|
+
type: 'string'
|
|
338
|
+
},
|
|
339
|
+
label_singular: {
|
|
340
|
+
type: 'string'
|
|
341
|
+
},
|
|
342
|
+
description: {
|
|
343
|
+
type: 'string'
|
|
344
|
+
},
|
|
345
|
+
file: {
|
|
346
|
+
type: 'string'
|
|
347
|
+
},
|
|
348
|
+
preview_path: {
|
|
349
|
+
type: 'string'
|
|
350
|
+
},
|
|
351
|
+
preview_path_date_field: {
|
|
352
|
+
type: 'string'
|
|
353
|
+
},
|
|
354
|
+
fields: fieldsConfig()
|
|
355
|
+
},
|
|
356
|
+
required: ['name', 'label', 'file', 'fields']
|
|
357
|
+
},
|
|
358
|
+
uniqueItemProperties: ['name']
|
|
359
|
+
},
|
|
360
|
+
identifier_field: {
|
|
361
|
+
type: 'string'
|
|
362
|
+
},
|
|
363
|
+
summary: {
|
|
364
|
+
type: 'string'
|
|
365
|
+
},
|
|
366
|
+
slug: {
|
|
367
|
+
type: 'string'
|
|
368
|
+
},
|
|
369
|
+
path: {
|
|
370
|
+
type: 'string'
|
|
371
|
+
},
|
|
372
|
+
preview_path: {
|
|
373
|
+
type: 'string'
|
|
374
|
+
},
|
|
375
|
+
preview_path_date_field: {
|
|
376
|
+
type: 'string'
|
|
377
|
+
},
|
|
378
|
+
create: {
|
|
379
|
+
type: 'boolean'
|
|
380
|
+
},
|
|
381
|
+
publish: {
|
|
382
|
+
type: 'boolean'
|
|
383
|
+
},
|
|
384
|
+
hide: {
|
|
385
|
+
type: 'boolean'
|
|
386
|
+
},
|
|
387
|
+
editor: {
|
|
388
|
+
type: 'object',
|
|
389
|
+
properties: {
|
|
390
|
+
preview: {
|
|
391
|
+
type: 'boolean'
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
format: {
|
|
396
|
+
type: 'string'
|
|
397
|
+
},
|
|
398
|
+
extension: {
|
|
399
|
+
type: 'string'
|
|
400
|
+
},
|
|
401
|
+
frontmatter_delimiter: {
|
|
402
|
+
type: ['string', 'array'],
|
|
403
|
+
minItems: 2,
|
|
404
|
+
maxItems: 2,
|
|
405
|
+
items: {
|
|
406
|
+
type: 'string'
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
fields: fieldsConfig(),
|
|
410
|
+
sortable_fields: {
|
|
411
|
+
type: 'array',
|
|
412
|
+
items: {
|
|
413
|
+
oneOf: [{
|
|
414
|
+
type: 'string'
|
|
415
|
+
}, {
|
|
416
|
+
type: 'object',
|
|
417
|
+
properties: {
|
|
418
|
+
field: {
|
|
419
|
+
type: 'string'
|
|
420
|
+
},
|
|
421
|
+
label: {
|
|
422
|
+
type: 'string'
|
|
423
|
+
},
|
|
424
|
+
default_sort: {
|
|
425
|
+
oneOf: [{
|
|
426
|
+
type: 'boolean'
|
|
427
|
+
}, {
|
|
428
|
+
type: 'string',
|
|
429
|
+
enum: ['asc', 'desc']
|
|
430
|
+
}]
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
required: ['field'],
|
|
434
|
+
additionalProperties: false
|
|
435
|
+
}]
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
sortableFields: {
|
|
439
|
+
type: 'array',
|
|
440
|
+
items: {
|
|
441
|
+
type: 'string'
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
view_filters: viewFilters,
|
|
445
|
+
view_groups: viewGroups,
|
|
446
|
+
nested: {
|
|
447
|
+
type: 'object',
|
|
448
|
+
properties: {
|
|
449
|
+
depth: {
|
|
450
|
+
type: 'number',
|
|
451
|
+
minimum: 1,
|
|
452
|
+
maximum: 1000
|
|
453
|
+
},
|
|
454
|
+
subfolders: {
|
|
455
|
+
type: 'boolean'
|
|
456
|
+
},
|
|
457
|
+
summary: {
|
|
458
|
+
type: 'string'
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
required: ['depth']
|
|
462
|
+
},
|
|
463
|
+
meta: {
|
|
464
|
+
type: 'object',
|
|
465
|
+
properties: {
|
|
466
|
+
path: {
|
|
467
|
+
type: 'object',
|
|
468
|
+
properties: {
|
|
469
|
+
label: {
|
|
470
|
+
type: 'string'
|
|
471
|
+
},
|
|
472
|
+
widget: {
|
|
473
|
+
type: 'string'
|
|
474
|
+
},
|
|
475
|
+
index_file: {
|
|
476
|
+
type: 'string'
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
required: ['label', 'widget']
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
additionalProperties: false,
|
|
483
|
+
minProperties: 1
|
|
484
|
+
},
|
|
485
|
+
i18n: i18nCollection
|
|
486
|
+
},
|
|
487
|
+
required: ['name', 'label'],
|
|
488
|
+
oneOf: [{
|
|
489
|
+
required: ['files']
|
|
490
|
+
}, {
|
|
491
|
+
required: ['folder', 'fields']
|
|
492
|
+
}],
|
|
493
|
+
not: {
|
|
494
|
+
required: ['sortable_fields', 'sortableFields']
|
|
495
|
+
},
|
|
496
|
+
if: {
|
|
497
|
+
required: ['extension']
|
|
498
|
+
},
|
|
499
|
+
then: {
|
|
500
|
+
// Cannot infer format from extension.
|
|
501
|
+
if: {
|
|
502
|
+
properties: {
|
|
503
|
+
extension: {
|
|
504
|
+
enum: Object.keys(extensionFormatters)
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
else: {
|
|
509
|
+
required: ['format']
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
dependencies: {
|
|
513
|
+
frontmatter_delimiter: {
|
|
514
|
+
properties: {
|
|
515
|
+
format: {
|
|
516
|
+
enum: frontmatterFormats
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
required: ['format']
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
uniqueItemProperties: ['name']
|
|
524
|
+
},
|
|
525
|
+
editor: {
|
|
526
|
+
type: 'object',
|
|
527
|
+
properties: {
|
|
528
|
+
preview: {
|
|
529
|
+
type: 'boolean'
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
required: ['backend', 'collections'],
|
|
535
|
+
anyOf: [{
|
|
536
|
+
required: ['media_folder']
|
|
537
|
+
}, {
|
|
538
|
+
required: ['media_library']
|
|
539
|
+
}]
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
function getWidgetSchemas() {
|
|
543
|
+
const schemas = getWidgets().map(widget => ({
|
|
544
|
+
[widget.name]: widget.schema
|
|
545
|
+
}));
|
|
546
|
+
return Object.assign(...schemas);
|
|
547
|
+
}
|
|
548
|
+
class ConfigError extends _extendableBuiltin(Error) {
|
|
549
|
+
constructor(errors, ...args) {
|
|
550
|
+
const message = errors.map(({
|
|
551
|
+
message,
|
|
552
|
+
instancePath
|
|
553
|
+
}) => {
|
|
554
|
+
const dotPath = instancePath.slice(1).split('/').map(seg => seg.match(/^\d+$/) ? `[${seg}]` : `.${seg}`).join('').slice(1);
|
|
555
|
+
return `${dotPath ? `'${dotPath}'` : 'config'} ${message}`;
|
|
556
|
+
}).join('\n');
|
|
557
|
+
super(message, ...args);
|
|
558
|
+
this.errors = errors;
|
|
559
|
+
this.message = message;
|
|
560
|
+
}
|
|
561
|
+
toString() {
|
|
562
|
+
return this.message;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* `validateConfig` is a pure function. It does not mutate
|
|
568
|
+
* the config that is passed in.
|
|
569
|
+
*/
|
|
570
|
+
export function validateConfig(config) {
|
|
571
|
+
const ajv = new AJV({
|
|
572
|
+
allErrors: true,
|
|
573
|
+
$data: true,
|
|
574
|
+
strict: false
|
|
575
|
+
});
|
|
576
|
+
uniqueItemProperties(ajv);
|
|
577
|
+
select(ajv);
|
|
578
|
+
instanceOf(ajv);
|
|
579
|
+
prohibited(ajv);
|
|
580
|
+
ajvErrors(ajv);
|
|
581
|
+
const valid = ajv.validate(getConfigSchema(), config);
|
|
582
|
+
if (!valid) {
|
|
583
|
+
const errors = ajv.errors.map(e => {
|
|
584
|
+
switch (e.keyword) {
|
|
585
|
+
// TODO: remove after https://github.com/ajv-validator/ajv-keywords/pull/123 is merged
|
|
586
|
+
case 'uniqueItemProperties':
|
|
587
|
+
{
|
|
588
|
+
const path = e.instancePath || '';
|
|
589
|
+
let newError = e;
|
|
590
|
+
if (path.endsWith('/fields')) {
|
|
591
|
+
newError = {
|
|
592
|
+
...e,
|
|
593
|
+
message: 'fields names must be unique'
|
|
594
|
+
};
|
|
595
|
+
} else if (path.endsWith('/files')) {
|
|
596
|
+
newError = {
|
|
597
|
+
...e,
|
|
598
|
+
message: 'files names must be unique'
|
|
599
|
+
};
|
|
600
|
+
} else if (path.endsWith('/collections')) {
|
|
601
|
+
newError = {
|
|
602
|
+
...e,
|
|
603
|
+
message: 'collections names must be unique'
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
return newError;
|
|
607
|
+
}
|
|
608
|
+
case 'instanceof':
|
|
609
|
+
{
|
|
610
|
+
const path = e.instancePath || '';
|
|
611
|
+
let newError = e;
|
|
612
|
+
if (/fields\/\d+\/pattern\/\d+/.test(path)) {
|
|
613
|
+
newError = {
|
|
614
|
+
...e,
|
|
615
|
+
message: 'must be a regular expression'
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
return newError;
|
|
619
|
+
}
|
|
620
|
+
default:
|
|
621
|
+
return e;
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
console.error('Config Errors', errors);
|
|
625
|
+
throw new ConfigError(errors);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
// Custom validation: only one sortable field can have default_sort property
|
|
629
|
+
if (config.collections) {
|
|
630
|
+
config.collections.forEach((collection, index) => {
|
|
631
|
+
if (collection.sortable_fields) {
|
|
632
|
+
const defaultFields = collection.sortable_fields.filter(field => typeof field === 'object' && field.default_sort !== undefined);
|
|
633
|
+
if (defaultFields.length > 1) {
|
|
634
|
+
const error = {
|
|
635
|
+
instancePath: `/collections/${index}/sortable_fields`,
|
|
636
|
+
message: 'only one sortable field can have the default_sort property'
|
|
637
|
+
};
|
|
638
|
+
console.error('Config Errors', [error]);
|
|
639
|
+
throw new ConfigError([error]);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
3
|
+
export const IDENTIFIER_FIELDS = ['title', 'path'];
|
|
4
|
+
export const SORTABLE_FIELDS = ['title', 'date', 'author', 'description'];
|
|
5
|
+
export const INFERABLE_FIELDS = {
|
|
6
|
+
title: {
|
|
7
|
+
type: 'string',
|
|
8
|
+
secondaryTypes: [],
|
|
9
|
+
synonyms: ['title', 'name', 'label', 'headline', 'header'],
|
|
10
|
+
defaultPreview: value => ___EmotionJSX("h1", null, value),
|
|
11
|
+
// eslint-disable-line react/display-name
|
|
12
|
+
fallbackToFirstField: true,
|
|
13
|
+
showError: true
|
|
14
|
+
},
|
|
15
|
+
shortTitle: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
secondaryTypes: [],
|
|
18
|
+
synonyms: ['short_title', 'shortTitle', 'short'],
|
|
19
|
+
defaultPreview: value => ___EmotionJSX("h2", null, value),
|
|
20
|
+
// eslint-disable-line react/display-name
|
|
21
|
+
fallbackToFirstField: false,
|
|
22
|
+
showError: false
|
|
23
|
+
},
|
|
24
|
+
author: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
secondaryTypes: [],
|
|
27
|
+
synonyms: ['author', 'name', 'by', 'byline', 'owner'],
|
|
28
|
+
defaultPreview: value => ___EmotionJSX("strong", null, value),
|
|
29
|
+
// eslint-disable-line react/display-name
|
|
30
|
+
fallbackToFirstField: false,
|
|
31
|
+
showError: false
|
|
32
|
+
},
|
|
33
|
+
date: {
|
|
34
|
+
type: 'datetime',
|
|
35
|
+
secondaryTypes: ['date'],
|
|
36
|
+
synonyms: ['date', 'publishDate', 'publish_date'],
|
|
37
|
+
defaultPreview: value => value,
|
|
38
|
+
fallbackToFirstField: false,
|
|
39
|
+
showError: false
|
|
40
|
+
},
|
|
41
|
+
description: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
secondaryTypes: ['text', 'markdown'],
|
|
44
|
+
synonyms: ['shortDescription', 'short_description', 'shortdescription', 'description', 'intro', 'introduction', 'brief', 'content', 'biography', 'bio', 'summary'],
|
|
45
|
+
defaultPreview: value => value,
|
|
46
|
+
fallbackToFirstField: false,
|
|
47
|
+
showError: false
|
|
48
|
+
},
|
|
49
|
+
image: {
|
|
50
|
+
type: 'image',
|
|
51
|
+
secondaryTypes: [],
|
|
52
|
+
synonyms: ['image', 'thumbnail', 'thumb', 'picture', 'avatar', 'photo', 'cover', 'hero', 'logo'],
|
|
53
|
+
defaultPreview: value => value,
|
|
54
|
+
fallbackToFirstField: false,
|
|
55
|
+
showError: false
|
|
56
|
+
}
|
|
57
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Map, OrderedMap } from 'immutable';
|
|
2
|
+
|
|
3
|
+
// Create/edit workflow modes
|
|
4
|
+
export const SIMPLE = 'simple';
|
|
5
|
+
export const EDITORIAL_WORKFLOW = 'editorial_workflow';
|
|
6
|
+
export const Statues = {
|
|
7
|
+
DRAFT: 'draft',
|
|
8
|
+
PENDING_REVIEW: 'pending_review',
|
|
9
|
+
PENDING_PUBLISH: 'pending_publish'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// Available status
|
|
13
|
+
export const status = OrderedMap(Statues);
|
|
14
|
+
export const statusDescriptions = Map({
|
|
15
|
+
[status.get('DRAFT')]: 'Draft',
|
|
16
|
+
[status.get('PENDING_REVIEW')]: 'Waiting for Review',
|
|
17
|
+
[status.get('PENDING_PUBLISH')]: 'Waiting to go live'
|
|
18
|
+
});
|