@webiny/app-headless-cms 5.23.0 → 5.24.0-beta.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/admin/components/ContentEntryForm/ContentEntryForm.d.ts +2 -2
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.d.ts +2 -2
- package/admin/components/ContentEntryForm/Fields.d.ts +3 -3
- package/admin/components/ContentEntryForm/Label.d.ts +2 -4
- package/admin/components/ContentEntryForm/RenderFieldElement.d.ts +4 -2
- package/admin/components/ContentEntryForm/functions/createValidators.d.ts +2 -1
- package/admin/components/ContentEntryForm/functions/getValue.d.ts +7 -4
- package/admin/components/ContentEntryForm/functions/getValue.js +5 -4
- package/admin/components/ContentEntryForm/functions/setValue.d.ts +8 -5
- package/admin/components/ContentEntryForm/functions/setValue.js +6 -5
- package/admin/components/ContentEntryForm/useBind.d.ts +8 -4
- package/admin/components/ContentEntryForm/useBind.js +17 -10
- package/admin/components/ContentEntryForm/useContentEntryForm.js +9 -5
- package/admin/components/ContentModelEditor/Context.d.ts +18 -9
- package/admin/components/ContentModelEditor/Context.js +40 -33
- package/admin/components/ContentModelEditor/Editor.d.ts +2 -2
- package/admin/components/ContentModelEditor/FieldsSidebar.d.ts +6 -4
- package/admin/components/ContentModelEditor/FieldsSidebar.js +11 -11
- package/admin/components/ContentModelEditor/Header.d.ts +3 -2
- package/admin/components/ContentModelEditor/Header.js +5 -2
- package/admin/components/DragPreview.d.ts +3 -2
- package/admin/components/DragPreview.js +6 -4
- package/admin/components/Draggable.d.ts +9 -7
- package/admin/components/Draggable.js +4 -3
- package/admin/components/DropZone/Center.d.ts +6 -6
- package/admin/components/DropZone/Center.js +7 -4
- package/admin/components/DropZone/Horizontal.d.ts +7 -5
- package/admin/components/DropZone/Horizontal.js +1 -1
- package/admin/components/DropZone/Vertical.d.ts +4 -4
- package/admin/components/DropZone/Vertical.js +1 -1
- package/admin/components/Droppable.d.ts +22 -13
- package/admin/components/Droppable.js +3 -3
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.d.ts +8 -2
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.js +7 -6
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.d.ts +4 -4
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.d.ts +2 -2
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js +3 -1
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsTab.js +26 -25
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.d.ts +5 -4
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.js +4 -4
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.d.ts +6 -5
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.js +6 -5
- package/admin/components/FieldEditor/EditFieldDialog.d.ts +6 -6
- package/admin/components/FieldEditor/EditFieldDialog.js +10 -10
- package/admin/components/FieldEditor/Field.d.ts +4 -4
- package/admin/components/FieldEditor/FieldEditor.d.ts +2 -2
- package/admin/components/FieldEditor/FieldEditor.js +9 -6
- package/admin/components/FieldEditor/FieldEditorContext.d.ts +65 -20
- package/admin/components/FieldEditor/FieldEditorContext.js +27 -27
- package/admin/components/FieldEditor/Styled.d.ts +2 -2
- package/admin/components/FieldEditor/utils/deleteField.d.ts +5 -7
- package/admin/components/FieldEditor/utils/deleteField.js +6 -6
- package/admin/components/FieldEditor/utils/getFieldPosition.d.ts +6 -5
- package/admin/components/FieldEditor/utils/getFieldPosition.js +3 -3
- package/admin/components/FieldEditor/utils/moveField.d.ts +4 -3
- package/admin/components/FieldEditor/utils/moveField.js +14 -10
- package/admin/components/FieldEditor/utils/moveRow.d.ts +5 -6
- package/admin/constants/statusLabels.d.ts +2 -8
- package/admin/constants/statusLabels.js +3 -2
- package/admin/contexts/Cms/index.d.ts +3 -3
- package/admin/contexts/Cms/index.js +2 -2
- package/admin/elements/ContentGroupMenuElement.js +1 -0
- package/admin/elements/ContentModelMenuElement.js +1 -0
- package/admin/elements/NothingToShowElement.d.ts +1 -1
- package/admin/graphql/contentEntries.d.ts +172 -11
- package/admin/graphql/contentEntries.js +55 -0
- package/admin/graphql/contentModels.d.ts +28 -0
- package/admin/graphql/contentModels.js +13 -2
- package/admin/hooks/useApolloClient.d.ts +2 -1
- package/admin/hooks/useLazyQuery.d.ts +3 -1
- package/admin/hooks/useMutation.d.ts +3 -1
- package/admin/hooks/useMutation.js +1 -1
- package/admin/hooks/usePermission.d.ts +21 -20
- package/admin/hooks/usePermission.js +5 -2
- package/admin/hooks/useQuery.d.ts +4 -1
- package/admin/hooks/useQueryLocale.d.ts +3 -1
- package/admin/menus/CmsMenuLoader.d.ts +1 -1
- package/admin/menus/CmsMenuLoader.js +5 -2
- package/admin/menus/ContentGroupsMenuItems.d.ts +2 -1
- package/admin/menus/ContentGroupsMenuItems.js +4 -6
- package/admin/menus/GlobalSearchPlugins.d.ts +2 -1
- package/admin/menus/GlobalSearchPlugins.js +1 -1
- package/admin/menus/NothingToShowElement.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/BackButton.d.ts +1 -1
- package/admin/plugins/editor/defaultBar/CreateContentButton.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/Divider.d.ts +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.d.ts +4 -4
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/Name/Name.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/Name/Name.js +9 -4
- package/admin/plugins/editor/defaultBar/Name/NameStyled.d.ts +3 -3
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.d.ts +2 -2
- package/admin/plugins/fieldRenderers/Accordion.d.ts +4 -5
- package/admin/plugins/fieldRenderers/Accordion.js +2 -1
- package/admin/plugins/fieldRenderers/DynamicSection.d.ts +5 -4
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.js +1 -0
- package/admin/plugins/fieldRenderers/checkboxes.js +1 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.d.ts +2 -1
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js +3 -3
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.d.ts +2 -1
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js +2 -2
- package/admin/plugins/fieldRenderers/dateTime/Input.d.ts +2 -2
- package/admin/plugins/fieldRenderers/dateTime/Select.d.ts +3 -3
- package/admin/plugins/fieldRenderers/dateTime/Time.d.ts +2 -2
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js +1 -0
- package/admin/plugins/fieldRenderers/dateTime/utils.d.ts +5 -3
- package/admin/plugins/fieldRenderers/file/File.d.ts +2 -2
- package/admin/plugins/fieldRenderers/file/File.js +1 -1
- package/admin/plugins/fieldRenderers/file/fileField.js +1 -0
- package/admin/plugins/fieldRenderers/file/fileFields.js +8 -2
- package/admin/plugins/fieldRenderers/file/utils.d.ts +8 -3
- package/admin/plugins/fieldRenderers/longText/longText.js +1 -0
- package/admin/plugins/fieldRenderers/number/numberInput.js +1 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.d.ts +6 -4
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js +5 -3
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.d.ts +6 -4
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.js +15 -9
- package/admin/plugins/fieldRenderers/ref/components/NewRefEntryFormDialog.d.ts +2 -1
- package/admin/plugins/fieldRenderers/ref/components/NewRefEntryFormDialog.js +3 -2
- package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/components/getOptions.d.ts +15 -1
- package/admin/plugins/fieldRenderers/ref/components/graphql.d.ts +60 -0
- package/admin/plugins/fieldRenderers/ref/components/graphql.js +16 -1
- package/admin/plugins/fieldRenderers/ref/components/renderItem.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/components/useReference.d.ts +4 -4
- package/admin/plugins/fieldRenderers/ref/components/useReferences.d.ts +16 -8
- package/admin/plugins/fieldRenderers/ref/components/useReferences.js +1 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntryDialog.d.ts +2 -4
- package/admin/plugins/fieldRenderers/ref/refInput.js +1 -0
- package/admin/plugins/fieldRenderers/ref/refInputs.js +1 -0
- package/admin/plugins/fieldRenderers/richText/richTextInput.js +1 -0
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js +1 -0
- package/admin/plugins/fieldRenderers/text/textInput.js +1 -0
- package/admin/plugins/fieldValidators/date/createDateInputField.d.ts +2 -1
- package/admin/plugins/fieldValidators/gte.d.ts +2 -2
- package/admin/plugins/fieldValidators/gte.js +3 -2
- package/admin/plugins/fieldValidators/in.d.ts +2 -2
- package/admin/plugins/fieldValidators/in.js +3 -2
- package/admin/plugins/fieldValidators/lte.d.ts +2 -2
- package/admin/plugins/fieldValidators/lte.js +3 -2
- package/admin/plugins/fieldValidators/maxLength.d.ts +2 -2
- package/admin/plugins/fieldValidators/maxLength.js +3 -2
- package/admin/plugins/fieldValidators/minLength.d.ts +2 -2
- package/admin/plugins/fieldValidators/minLength.js +3 -2
- package/admin/plugins/fieldValidators/pattern.d.ts +2 -2
- package/admin/plugins/fieldValidators/pattern.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/email.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/email.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/url.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/url.js +3 -2
- package/admin/plugins/fieldValidators/required.d.ts +2 -2
- package/admin/plugins/fieldValidators/required.js +3 -2
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.d.ts +3 -2
- package/admin/plugins/fields/object/ObjectFields.d.ts +7 -4
- package/admin/plugins/fields/ref.js +2 -1
- package/admin/plugins/icons.js +1 -1
- package/admin/plugins/index.d.ts +1 -1
- package/admin/plugins/install.d.ts +22 -0
- package/admin/plugins/install.js +36 -30
- package/admin/plugins/permissionRenderer/CmsPermissions.d.ts +11 -5
- package/admin/plugins/permissionRenderer/CmsPermissions.js +5 -1
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.d.ts +12 -8
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.d.ts +11 -8
- package/admin/plugins/permissionRenderer/components/ContentModelList.d.ts +8 -6
- package/admin/plugins/permissionRenderer/components/ContentModelList.js +3 -3
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.d.ts +14 -10
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.js +3 -2
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.d.ts +10 -5
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.js +4 -0
- package/admin/plugins/permissionRenderer/components/PermissionSelector.d.ts +11 -26
- package/admin/plugins/permissionRenderer/components/StyledComponents.d.ts +1 -1
- package/admin/plugins/permissionRenderer/components/types.d.ts +16 -0
- package/admin/plugins/permissionRenderer/components/types.js +1 -0
- package/admin/plugins/permissionRenderer/components/useCmsData.d.ts +17 -1
- package/admin/plugins/permissionRenderer/components/useCmsData.js +39 -25
- package/admin/plugins/permissionRenderer/index.d.ts +2 -2
- package/admin/plugins/permissionRenderer/index.js +3 -2
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.d.ts +2 -1
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.js +1 -0
- package/admin/plugins/upgrades/v5.0.0.js +1 -0
- package/admin/plugins/upgrades/v5.19.0.js +1 -0
- package/admin/plugins/upgrades/v5.5.0.js +1 -0
- package/admin/plugins/upgrades/v5.8.0.js +1 -0
- package/admin/plugins/validators/gte.d.ts +2 -2
- package/admin/plugins/validators/gte.js +3 -2
- package/admin/plugins/validators/in.d.ts +2 -2
- package/admin/plugins/validators/in.js +3 -2
- package/admin/plugins/validators/lte.d.ts +2 -2
- package/admin/plugins/validators/lte.js +3 -2
- package/admin/plugins/validators/maxLength.d.ts +2 -2
- package/admin/plugins/validators/maxLength.js +3 -2
- package/admin/plugins/validators/minLength.d.ts +2 -2
- package/admin/plugins/validators/minLength.js +3 -2
- package/admin/plugins/validators/pattern.d.ts +3 -9
- package/admin/plugins/validators/pattern.js +3 -2
- package/admin/plugins/validators/patternPlugins/email.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/email.js +3 -2
- package/admin/plugins/validators/patternPlugins/lowerCase.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/lowerCase.js +3 -2
- package/admin/plugins/validators/patternPlugins/lowerCaseSpace.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/lowerCaseSpace.js +3 -2
- package/admin/plugins/validators/patternPlugins/upperCase.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/upperCase.js +3 -2
- package/admin/plugins/validators/patternPlugins/upperCaseSpace.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/upperCaseSpace.js +3 -2
- package/admin/plugins/validators/patternPlugins/url.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/url.js +3 -2
- package/admin/plugins/validators/required.d.ts +2 -2
- package/admin/plugins/validators/required.js +3 -2
- package/admin/views/contentEntries/ContentEntries.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntries.js +2 -2
- package/admin/views/contentEntries/ContentEntriesContext.d.ts +9 -5
- package/admin/views/contentEntries/ContentEntriesContext.js +1 -1
- package/admin/views/contentEntries/ContentEntriesList.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntriesList.js +11 -1
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.d.ts +1 -4
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js +8 -6
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.d.ts +4 -4
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.js +11 -2
- package/admin/views/contentEntries/ContentEntry/RevisionsList.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/cache.d.ts +9 -7
- package/admin/views/contentEntries/ContentEntry/cache.js +22 -16
- package/admin/views/contentEntries/ContentEntry/header/Header.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/useRevision.d.ts +31 -9
- package/admin/views/contentEntries/ContentEntry/useRevision.js +135 -113
- package/admin/views/contentEntries/ContentEntry.d.ts +1 -2
- package/admin/views/contentEntries/ContentEntry.js +2 -5
- package/admin/views/contentEntries/hooks/useContentEntriesList.d.ts +2 -5
- package/admin/views/contentModelGroups/ContentModelGroups.d.ts +2 -2
- package/admin/views/contentModelGroups/ContentModelGroups.js +2 -2
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.d.ts +4 -4
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js +13 -21
- package/admin/views/contentModelGroups/ContentModelGroupsForm.d.ts +4 -4
- package/admin/views/contentModelGroups/ContentModelGroupsForm.js +49 -32
- package/admin/views/contentModelGroups/DelayedOnChange.d.ts +29 -12
- package/admin/views/contentModelGroups/DelayedOnChange.js +13 -13
- package/admin/views/contentModelGroups/IconPicker.d.ts +3 -2
- package/admin/views/contentModelGroups/IconPicker.js +1 -1
- package/admin/views/contentModelGroups/graphql.d.ts +68 -0
- package/admin/views/contentModelGroups/graphql.js +26 -5
- package/admin/views/contentModels/CloneContentModelDialog.js +6 -5
- package/admin/views/contentModels/ContentModelEditor.d.ts +3 -2
- package/admin/views/contentModels/ContentModelEditor.js +6 -3
- package/admin/views/contentModels/ContentModels.d.ts +2 -2
- package/admin/views/contentModels/ContentModels.js +5 -5
- package/admin/views/contentModels/ContentModelsDataList.d.ts +4 -4
- package/admin/views/contentModels/ContentModelsDataList.js +17 -21
- package/admin/views/contentModels/NewContentModelDialog.d.ts +2 -2
- package/admin/views/contentModels/NewContentModelDialog.js +151 -76
- package/admin/views/contentModels/cache.d.ts +5 -4
- package/admin/views/contentModels/cache.js +9 -9
- package/admin/views/contentModels/types.d.ts +4 -0
- package/admin/views/contentModels/types.js +1 -0
- package/admin/views/utils.d.ts +3 -2
- package/admin/views/utils.js +5 -18
- package/admin/viewsGraphql.d.ts +62 -0
- package/admin/viewsGraphql.js +30 -5
- package/package.json +20 -17
- package/types.d.ts +88 -23
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
1
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
5
5
|
|
|
6
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
6
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
7
7
|
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
9
|
import React, { useCallback } from "react";
|
|
10
|
+
import gql from "graphql-tag";
|
|
10
11
|
import { css } from "emotion";
|
|
11
12
|
import get from "lodash/get";
|
|
12
13
|
import { useRouter } from "@webiny/react-router";
|
|
@@ -16,9 +17,9 @@ import { Select } from "@webiny/ui/Select";
|
|
|
16
17
|
import { useSnackbar } from "@webiny/app-admin/hooks/useSnackbar";
|
|
17
18
|
import { CircularProgress } from "@webiny/ui/Progress";
|
|
18
19
|
import { validation } from "@webiny/validation";
|
|
19
|
-
import { useQuery, useMutation } from "../../hooks";
|
|
20
|
+
import { useQuery, useMutation, useApolloClient } from "../../hooks";
|
|
20
21
|
import { i18n } from "@webiny/app/i18n";
|
|
21
|
-
import {
|
|
22
|
+
import { ButtonPrimary } from "@webiny/ui/Button";
|
|
22
23
|
import * as UID from "@webiny/ui/Dialog";
|
|
23
24
|
import { Grid, Cell } from "@webiny/ui/Grid";
|
|
24
25
|
import { addModelToGroupCache, addModelToListCache } from "./cache";
|
|
@@ -33,12 +34,13 @@ var narrowDialog = /*#__PURE__*/css({
|
|
|
33
34
|
var noPadding = /*#__PURE__*/css({
|
|
34
35
|
padding: "5px !important"
|
|
35
36
|
}, "label:noPadding;");
|
|
36
|
-
|
|
37
37
|
/**
|
|
38
38
|
* This list is to disallow creating models that might interfere with GraphQL schema creation.
|
|
39
39
|
* Add more if required.
|
|
40
40
|
*/
|
|
41
|
+
|
|
41
42
|
var disallowedModelIdEndingList = ["Response", "List", "Meta", "Input", "Sorter"];
|
|
43
|
+
var SCHEMA_TYPES = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query ListSchemaTypes {\n __schema {\n types {\n name\n }\n }\n }\n"])));
|
|
42
44
|
|
|
43
45
|
var NewContentModelDialog = function NewContentModelDialog(_ref) {
|
|
44
46
|
var open = _ref.open,
|
|
@@ -55,6 +57,8 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
|
|
|
55
57
|
var _useRouter = useRouter(),
|
|
56
58
|
history = _useRouter.history;
|
|
57
59
|
|
|
60
|
+
var client = useApolloClient();
|
|
61
|
+
|
|
58
62
|
var _useMutation = useMutation(GQL.CREATE_CONTENT_MODEL, {
|
|
59
63
|
update: function update(cache, _ref2) {
|
|
60
64
|
var data = _ref2.data;
|
|
@@ -64,7 +68,8 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
|
|
|
64
68
|
|
|
65
69
|
if (error) {
|
|
66
70
|
setLoading(false);
|
|
67
|
-
|
|
71
|
+
showSnackbar(error.message);
|
|
72
|
+
return;
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
addModelToListCache(cache, model);
|
|
@@ -75,51 +80,144 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
|
|
|
75
80
|
_useMutation2 = _slicedToArray(_useMutation, 1),
|
|
76
81
|
createContentModel = _useMutation2[0];
|
|
77
82
|
|
|
78
|
-
var
|
|
83
|
+
var listMenuGroupsQuery = useQuery(GQL.LIST_MENU_CONTENT_GROUPS_MODELS, {
|
|
79
84
|
skip: !open
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var contentModelGroups = get(data, "listContentModelGroups.data", []).map(function (item) {
|
|
85
|
+
});
|
|
86
|
+
var contentModelGroups = get(listMenuGroupsQuery, "data.listContentModelGroups.data", []).map(function (item) {
|
|
84
87
|
return {
|
|
85
88
|
value: item.id,
|
|
86
89
|
label: item.name
|
|
87
90
|
};
|
|
88
91
|
});
|
|
89
|
-
var nameValidator = useCallback(function (
|
|
90
|
-
var
|
|
92
|
+
var nameValidator = useCallback( /*#__PURE__*/function () {
|
|
93
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(name) {
|
|
94
|
+
var target, _iterator, _step, ending, re, matched, _yield$client$query, data, types;
|
|
91
95
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
97
|
+
while (1) {
|
|
98
|
+
switch (_context.prev = _context.next) {
|
|
99
|
+
case 0:
|
|
100
|
+
target = (name || "").trim();
|
|
95
101
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
102
|
+
if (target.charAt(0).match(/[a-zA-Z]/)) {
|
|
103
|
+
_context.next = 3;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
throw new Error("Model name can't start with a number.");
|
|
108
|
+
|
|
109
|
+
case 3:
|
|
110
|
+
_iterator = _createForOfIteratorHelper(disallowedModelIdEndingList);
|
|
111
|
+
_context.prev = 4;
|
|
112
|
+
|
|
113
|
+
_iterator.s();
|
|
114
|
+
|
|
115
|
+
case 6:
|
|
116
|
+
if ((_step = _iterator.n()).done) {
|
|
117
|
+
_context.next = 15;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
ending = _step.value;
|
|
122
|
+
re = new RegExp("".concat(ending, "$"), "i");
|
|
123
|
+
matched = target.match(re);
|
|
124
|
+
|
|
125
|
+
if (!(matched === null)) {
|
|
126
|
+
_context.next = 12;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return _context.abrupt("continue", 13);
|
|
131
|
+
|
|
132
|
+
case 12:
|
|
133
|
+
throw new Error("Model must not end with \"".concat(ending, "\"."));
|
|
134
|
+
|
|
135
|
+
case 13:
|
|
136
|
+
_context.next = 6;
|
|
137
|
+
break;
|
|
138
|
+
|
|
139
|
+
case 15:
|
|
140
|
+
_context.next = 20;
|
|
141
|
+
break;
|
|
99
142
|
|
|
100
|
-
|
|
101
|
-
|
|
143
|
+
case 17:
|
|
144
|
+
_context.prev = 17;
|
|
145
|
+
_context.t0 = _context["catch"](4);
|
|
102
146
|
|
|
103
|
-
|
|
104
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
105
|
-
var ending = _step.value;
|
|
106
|
-
var re = new RegExp("".concat(ending, "$"), "i");
|
|
107
|
-
var matched = target.match(re);
|
|
147
|
+
_iterator.e(_context.t0);
|
|
108
148
|
|
|
109
|
-
|
|
110
|
-
|
|
149
|
+
case 20:
|
|
150
|
+
_context.prev = 20;
|
|
151
|
+
|
|
152
|
+
_iterator.f();
|
|
153
|
+
|
|
154
|
+
return _context.finish(20);
|
|
155
|
+
|
|
156
|
+
case 23:
|
|
157
|
+
_context.next = 25;
|
|
158
|
+
return client.query({
|
|
159
|
+
query: SCHEMA_TYPES,
|
|
160
|
+
fetchPolicy: "network-only"
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
case 25:
|
|
164
|
+
_yield$client$query = _context.sent;
|
|
165
|
+
data = _yield$client$query.data;
|
|
166
|
+
types = data.__schema.types.map(function (t) {
|
|
167
|
+
return t.name;
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
if (!types.includes(name)) {
|
|
171
|
+
_context.next = 30;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
throw new Error("\"".concat(name, "\" type already exists in the GraphQL schema. Please pick a different name."));
|
|
176
|
+
|
|
177
|
+
case 30:
|
|
178
|
+
return _context.abrupt("return", true);
|
|
179
|
+
|
|
180
|
+
case 31:
|
|
181
|
+
case "end":
|
|
182
|
+
return _context.stop();
|
|
183
|
+
}
|
|
111
184
|
}
|
|
185
|
+
}, _callee, null, [[4, 17, 20, 23]]);
|
|
186
|
+
}));
|
|
112
187
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
188
|
+
return function (_x) {
|
|
189
|
+
return _ref3.apply(this, arguments);
|
|
190
|
+
};
|
|
191
|
+
}(), [client]);
|
|
192
|
+
var group = (contentModelGroups === null || contentModelGroups === void 0 ? void 0 : contentModelGroups.length) > 0 ? contentModelGroups[0].value : null;
|
|
193
|
+
|
|
194
|
+
var onSubmit = /*#__PURE__*/function () {
|
|
195
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
|
|
196
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
197
|
+
while (1) {
|
|
198
|
+
switch (_context2.prev = _context2.next) {
|
|
199
|
+
case 0:
|
|
200
|
+
setLoading(true);
|
|
201
|
+
_context2.next = 3;
|
|
202
|
+
return createContentModel({
|
|
203
|
+
variables: {
|
|
204
|
+
data: data
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
case 3:
|
|
209
|
+
case "end":
|
|
210
|
+
return _context2.stop();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}, _callee2);
|
|
214
|
+
}));
|
|
215
|
+
|
|
216
|
+
return function onSubmit(_x2) {
|
|
217
|
+
return _ref4.apply(this, arguments);
|
|
218
|
+
};
|
|
219
|
+
}();
|
|
120
220
|
|
|
121
|
-
return true;
|
|
122
|
-
}, undefined);
|
|
123
221
|
return /*#__PURE__*/React.createElement(UID.Dialog, {
|
|
124
222
|
open: open,
|
|
125
223
|
onClose: onClose,
|
|
@@ -127,38 +225,15 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
|
|
|
127
225
|
"data-testid": "cms-new-content-model-modal"
|
|
128
226
|
}, open && /*#__PURE__*/React.createElement(Form, {
|
|
129
227
|
data: {
|
|
130
|
-
group:
|
|
228
|
+
group: group
|
|
131
229
|
},
|
|
132
|
-
onSubmit:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
_context.next = 3;
|
|
140
|
-
return createContentModel({
|
|
141
|
-
variables: {
|
|
142
|
-
data: data
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
case 3:
|
|
147
|
-
case "end":
|
|
148
|
-
return _context.stop();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}, _callee);
|
|
152
|
-
}));
|
|
153
|
-
|
|
154
|
-
return function (_x) {
|
|
155
|
-
return _ref3.apply(this, arguments);
|
|
156
|
-
};
|
|
157
|
-
}()
|
|
158
|
-
}, function (_ref4) {
|
|
159
|
-
var Bind = _ref4.Bind,
|
|
160
|
-
submit = _ref4.submit;
|
|
161
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, loading && /*#__PURE__*/React.createElement(CircularProgress, null), /*#__PURE__*/React.createElement(UID.DialogTitle, null, t(_templateObject || (_templateObject = _taggedTemplateLiteral(["New Content Model"])))), /*#__PURE__*/React.createElement(UID.DialogContent, null, /*#__PURE__*/React.createElement(Grid, {
|
|
230
|
+
onSubmit: onSubmit
|
|
231
|
+
}, function (_ref5) {
|
|
232
|
+
var Bind = _ref5.Bind,
|
|
233
|
+
submit = _ref5.submit;
|
|
234
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, loading && /*#__PURE__*/React.createElement(CircularProgress, {
|
|
235
|
+
label: "Creating content model..."
|
|
236
|
+
}), /*#__PURE__*/React.createElement(UID.DialogTitle, null, t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["New Content Model"])))), /*#__PURE__*/React.createElement(UID.DialogContent, null, /*#__PURE__*/React.createElement(Grid, {
|
|
162
237
|
className: noPadding
|
|
163
238
|
}, /*#__PURE__*/React.createElement(Cell, {
|
|
164
239
|
span: 12
|
|
@@ -166,16 +241,16 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
|
|
|
166
241
|
name: "name",
|
|
167
242
|
validators: [validation.create("required,maxLength:100"), nameValidator]
|
|
168
243
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
169
|
-
label: t(
|
|
170
|
-
description: t(
|
|
244
|
+
label: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Name"]))),
|
|
245
|
+
description: t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["The name of the content model. Use the singular form, e.g. Person, not Persons."])))
|
|
171
246
|
}))), /*#__PURE__*/React.createElement(Cell, {
|
|
172
247
|
span: 12
|
|
173
248
|
}, /*#__PURE__*/React.createElement(Bind, {
|
|
174
249
|
name: "group",
|
|
175
250
|
validators: validation.create("required")
|
|
176
251
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
177
|
-
description: t(
|
|
178
|
-
label: t(
|
|
252
|
+
description: t(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["Choose a content model group"]))),
|
|
253
|
+
label: t(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["Content model group"]))),
|
|
179
254
|
options: contentModelGroups
|
|
180
255
|
}))), /*#__PURE__*/React.createElement(Cell, {
|
|
181
256
|
span: 12
|
|
@@ -186,11 +261,11 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
|
|
|
186
261
|
rows: 4,
|
|
187
262
|
maxLength: 200,
|
|
188
263
|
characterCount: true,
|
|
189
|
-
label: t(
|
|
264
|
+
label: t(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["Description"])))
|
|
190
265
|
}));
|
|
191
|
-
})))), /*#__PURE__*/React.createElement(UID.DialogActions, null, /*#__PURE__*/React.createElement(
|
|
266
|
+
})))), /*#__PURE__*/React.createElement(UID.DialogActions, null, /*#__PURE__*/React.createElement(ButtonPrimary, {
|
|
192
267
|
onClick: submit
|
|
193
|
-
}, "+ ", t(
|
|
268
|
+
}, "+ ", t(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["Create Model"]))))));
|
|
194
269
|
}));
|
|
195
270
|
};
|
|
196
271
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CmsEditorContentModel } from "../../../types";
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
2
|
+
import { DataProxy } from "apollo-cache";
|
|
3
|
+
export declare const addModelToListCache: (cache: DataProxy, model: CmsEditorContentModel) => void;
|
|
4
|
+
export declare const addModelToGroupCache: (cache: DataProxy, model: CmsEditorContentModel) => void;
|
|
5
|
+
export declare const removeModelFromListCache: (cache: DataProxy, model: CmsEditorContentModel) => void;
|
|
6
|
+
export declare const removeModelFromGroupCache: (cache: DataProxy, model: CmsEditorContentModel) => void;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import dotProp from "dot-prop-immutable";
|
|
2
|
-
import
|
|
2
|
+
import { LIST_CONTENT_MODELS, LIST_MENU_CONTENT_GROUPS_MODELS } from "../../viewsGraphql";
|
|
3
3
|
export var addModelToListCache = function addModelToListCache(cache, model) {
|
|
4
4
|
var _cache$readQuery = cache.readQuery({
|
|
5
|
-
query:
|
|
5
|
+
query: LIST_CONTENT_MODELS
|
|
6
6
|
}),
|
|
7
7
|
listContentModels = _cache$readQuery.listContentModels;
|
|
8
8
|
|
|
9
9
|
var newModelIndex = listContentModels.data.length;
|
|
10
10
|
cache.writeQuery({
|
|
11
|
-
query:
|
|
11
|
+
query: LIST_CONTENT_MODELS,
|
|
12
12
|
data: {
|
|
13
13
|
listContentModels: dotProp.set(listContentModels, "data.".concat(newModelIndex), model)
|
|
14
14
|
}
|
|
@@ -16,7 +16,7 @@ export var addModelToListCache = function addModelToListCache(cache, model) {
|
|
|
16
16
|
};
|
|
17
17
|
export var addModelToGroupCache = function addModelToGroupCache(cache, model) {
|
|
18
18
|
var _cache$readQuery2 = cache.readQuery({
|
|
19
|
-
query:
|
|
19
|
+
query: LIST_MENU_CONTENT_GROUPS_MODELS
|
|
20
20
|
}),
|
|
21
21
|
groupsList = _cache$readQuery2.listContentModelGroups;
|
|
22
22
|
|
|
@@ -25,7 +25,7 @@ export var addModelToGroupCache = function addModelToGroupCache(cache, model) {
|
|
|
25
25
|
});
|
|
26
26
|
var newGroupModelIndex = groupsList.data[groupIndex].contentModels.length;
|
|
27
27
|
cache.writeQuery({
|
|
28
|
-
query:
|
|
28
|
+
query: LIST_MENU_CONTENT_GROUPS_MODELS,
|
|
29
29
|
data: {
|
|
30
30
|
listContentModelGroups: dotProp.set(groupsList, "data.".concat(groupIndex, ".contentModels.").concat(newGroupModelIndex), model)
|
|
31
31
|
}
|
|
@@ -33,7 +33,7 @@ export var addModelToGroupCache = function addModelToGroupCache(cache, model) {
|
|
|
33
33
|
};
|
|
34
34
|
export var removeModelFromListCache = function removeModelFromListCache(cache, model) {
|
|
35
35
|
var _cache$readQuery3 = cache.readQuery({
|
|
36
|
-
query:
|
|
36
|
+
query: LIST_CONTENT_MODELS
|
|
37
37
|
}),
|
|
38
38
|
listContentModels = _cache$readQuery3.listContentModels;
|
|
39
39
|
|
|
@@ -41,7 +41,7 @@ export var removeModelFromListCache = function removeModelFromListCache(cache, m
|
|
|
41
41
|
return m.modelId === model.modelId;
|
|
42
42
|
});
|
|
43
43
|
cache.writeQuery({
|
|
44
|
-
query:
|
|
44
|
+
query: LIST_CONTENT_MODELS,
|
|
45
45
|
data: {
|
|
46
46
|
listContentModels: dotProp.delete(listContentModels, "data.".concat(modelIndex))
|
|
47
47
|
}
|
|
@@ -49,7 +49,7 @@ export var removeModelFromListCache = function removeModelFromListCache(cache, m
|
|
|
49
49
|
};
|
|
50
50
|
export var removeModelFromGroupCache = function removeModelFromGroupCache(cache, model) {
|
|
51
51
|
var _cache$readQuery4 = cache.readQuery({
|
|
52
|
-
query:
|
|
52
|
+
query: LIST_MENU_CONTENT_GROUPS_MODELS
|
|
53
53
|
}),
|
|
54
54
|
groupsList = _cache$readQuery4.listContentModelGroups;
|
|
55
55
|
|
|
@@ -60,7 +60,7 @@ export var removeModelFromGroupCache = function removeModelFromGroupCache(cache,
|
|
|
60
60
|
return m.modelId === model.modelId;
|
|
61
61
|
});
|
|
62
62
|
cache.writeQuery({
|
|
63
|
-
query:
|
|
63
|
+
query: LIST_MENU_CONTENT_GROUPS_MODELS,
|
|
64
64
|
data: {
|
|
65
65
|
listContentModelGroups: dotProp.delete(groupsList, "data.".concat(groupIndex, ".contentModels.").concat(modelIndex))
|
|
66
66
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/admin/views/utils.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const deserializeSorters: (data: string) =>
|
|
1
|
+
declare type SortTypes = "asc" | "desc";
|
|
2
|
+
export declare const deserializeSorters: (data: string) => [string, SortTypes];
|
|
3
|
+
export {};
|
package/admin/views/utils.js
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
export var serializeSorters = function serializeSorters(data) {
|
|
4
|
-
if (!data) {
|
|
5
|
-
return data;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
var _Object$entries = Object.entries(data),
|
|
9
|
-
_Object$entries2 = _slicedToArray(_Object$entries, 1),
|
|
10
|
-
_Object$entries2$ = _slicedToArray(_Object$entries2[0], 2),
|
|
11
|
-
key = _Object$entries2$[0],
|
|
12
|
-
value = _Object$entries2$[1];
|
|
13
|
-
|
|
14
|
-
return "".concat(key, ":").concat(value);
|
|
15
|
-
};
|
|
16
2
|
export var deserializeSorters = function deserializeSorters(data) {
|
|
17
3
|
if (typeof data !== "string") {
|
|
18
4
|
return data;
|
|
19
5
|
}
|
|
20
6
|
|
|
21
|
-
var _ref = data.split("
|
|
7
|
+
var _ref = data.split("_"),
|
|
22
8
|
_ref2 = _slicedToArray(_ref, 2),
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
field = _ref2[0],
|
|
10
|
+
orderBy = _ref2[1];
|
|
25
11
|
|
|
26
|
-
|
|
12
|
+
var order = String(orderBy).toLowerCase() === "asc" ? "asc" : "desc";
|
|
13
|
+
return [field, order];
|
|
27
14
|
};
|
package/admin/viewsGraphql.d.ts
CHANGED
|
@@ -1,5 +1,67 @@
|
|
|
1
|
+
import { CmsErrorResponse, CmsGroup, CmsModel } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* ############################
|
|
4
|
+
* List groups with models Query
|
|
5
|
+
* * Fetches data needed for constructing content models list in the main menu.
|
|
6
|
+
*/
|
|
7
|
+
export interface ListMenuCmsGroupsQueryResponse {
|
|
8
|
+
listContentModelGroups: {
|
|
9
|
+
data: CmsGroup[];
|
|
10
|
+
error?: CmsErrorResponse;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
1
13
|
export declare const LIST_MENU_CONTENT_GROUPS_MODELS: import("graphql").DocumentNode;
|
|
14
|
+
/**
|
|
15
|
+
* ############################
|
|
16
|
+
* List Query
|
|
17
|
+
*/
|
|
18
|
+
export interface ListCmsModelsQueryResponse {
|
|
19
|
+
listContentModels: {
|
|
20
|
+
data: CmsModel[];
|
|
21
|
+
error?: CmsErrorResponse;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
2
24
|
export declare const LIST_CONTENT_MODELS: import("graphql").DocumentNode;
|
|
25
|
+
/**
|
|
26
|
+
* ############################
|
|
27
|
+
* Create Mutation
|
|
28
|
+
*/
|
|
29
|
+
export interface CreateCmsModelMutationResponse {
|
|
30
|
+
createContentModel: {
|
|
31
|
+
data: CmsModel;
|
|
32
|
+
error?: CmsErrorResponse;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface CreateCmsModelMutationVariables {
|
|
36
|
+
data: Record<string, any>;
|
|
37
|
+
}
|
|
3
38
|
export declare const CREATE_CONTENT_MODEL: import("graphql").DocumentNode;
|
|
39
|
+
/**
|
|
40
|
+
* ############################
|
|
41
|
+
* Create From Mutation
|
|
42
|
+
*/
|
|
43
|
+
export interface CreateCmsModelFromMutationResponse {
|
|
44
|
+
createContentModelFrom: {
|
|
45
|
+
data: CmsModel;
|
|
46
|
+
error?: CmsErrorResponse;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface CreateCmsModelFromMutationVariables {
|
|
50
|
+
modelId: string;
|
|
51
|
+
data: CmsModel;
|
|
52
|
+
}
|
|
4
53
|
export declare const CREATE_CONTENT_MODEL_FROM: import("graphql").DocumentNode;
|
|
54
|
+
/**
|
|
55
|
+
* ############################
|
|
56
|
+
* Delete Mutation
|
|
57
|
+
*/
|
|
58
|
+
export interface DeleteCmsModelMutationResponse {
|
|
59
|
+
deleteContentModel: {
|
|
60
|
+
data: boolean;
|
|
61
|
+
error?: CmsErrorResponse;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export interface DeleteCmsModelMutationVariables {
|
|
65
|
+
modelId: string;
|
|
66
|
+
}
|
|
5
67
|
export declare const DELETE_CONTENT_MODEL: import("graphql").DocumentNode;
|
package/admin/viewsGraphql.js
CHANGED
|
@@ -4,10 +4,35 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
4
4
|
|
|
5
5
|
import gql from "graphql-tag";
|
|
6
6
|
var ERROR_FIELDS = "\n code\n message\n data\n";
|
|
7
|
-
var BASE_CONTENT_MODEL_FIELDS = "\n description\n modelId\n name\n savedOn\n plugin\n fields {\n id\n }\n group {\n id\n name\n }\n createdBy {\n id\n displayName\n type\n }\n";
|
|
7
|
+
var BASE_CONTENT_MODEL_FIELDS = "\n description\n modelId\n name\n savedOn\n plugin\n fields {\n id\n }\n group {\n id\n name\n }\n createdBy {\n id\n displayName\n type\n }\n";
|
|
8
|
+
/**
|
|
9
|
+
* ############################
|
|
10
|
+
* List groups with models Query
|
|
11
|
+
* * Fetches data needed for constructing content models list in the main menu.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export var LIST_MENU_CONTENT_GROUPS_MODELS = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query CmsListMenuContentGroupsModels {\n listContentModelGroups {\n data {\n id\n name\n icon\n plugin\n contentModels {\n name\n modelId\n plugin\n createdBy {\n id\n displayName\n type\n }\n }\n }\n error {\n ", "\n }\n }\n }\n"])), ERROR_FIELDS);
|
|
15
|
+
/**
|
|
16
|
+
* ############################
|
|
17
|
+
* List Query
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export var LIST_CONTENT_MODELS = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n query CmsListContentModels {\n listContentModels {\n data {\n ", "\n }\n error {\n ", "\n }\n }\n }\n"])), BASE_CONTENT_MODEL_FIELDS, ERROR_FIELDS);
|
|
21
|
+
/**
|
|
22
|
+
* ############################
|
|
23
|
+
* Create Mutation
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export var CREATE_CONTENT_MODEL = gql(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n mutation CmsCreateContentModel($data: CmsContentModelCreateInput!) {\n createContentModel(data: $data) {\n data {\n ", "\n }\n error {\n ", "\n }\n }\n }\n"])), BASE_CONTENT_MODEL_FIELDS, ERROR_FIELDS);
|
|
27
|
+
/**
|
|
28
|
+
* ############################
|
|
29
|
+
* Create From Mutation
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
export var CREATE_CONTENT_MODEL_FROM = gql(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n mutation CmsCreateContentModelFrom($modelId: ID!, $data: CmsContentModelCreateFromInput!) {\n createContentModelFrom(modelId: $modelId, data: $data) {\n data {\n ", "\n }\n error {\n ", "\n }\n }\n }\n"])), BASE_CONTENT_MODEL_FIELDS, ERROR_FIELDS);
|
|
33
|
+
/**
|
|
34
|
+
* ############################
|
|
35
|
+
* Delete Mutation
|
|
36
|
+
*/
|
|
8
37
|
|
|
9
|
-
export var LIST_MENU_CONTENT_GROUPS_MODELS = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query CmsListMenuContentGroupsModels {\n listContentModelGroups {\n data {\n id\n name\n icon\n plugin\n contentModels {\n name\n modelId\n plugin\n createdBy {\n id\n displayName\n type\n }\n }\n }\n }\n }\n"])));
|
|
10
|
-
export var LIST_CONTENT_MODELS = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n query CmsListContentModels {\n listContentModels {\n data {\n ", "\n }\n }\n }\n"])), BASE_CONTENT_MODEL_FIELDS);
|
|
11
|
-
export var CREATE_CONTENT_MODEL = gql(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n mutation CmsCreateContentModel($data: CmsContentModelCreateInput!) {\n createContentModel(data: $data) {\n data {\n ", "\n }\n error {\n message\n data\n }\n }\n }\n"])), BASE_CONTENT_MODEL_FIELDS);
|
|
12
|
-
export var CREATE_CONTENT_MODEL_FROM = gql(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n mutation CmsCreateContentModelFrom($modelId: ID!, $data: CmsContentModelCreateFromInput!) {\n createContentModelFrom(modelId: $modelId, data: $data) {\n data {\n ", "\n }\n error {\n message\n data\n }\n }\n }\n"])), BASE_CONTENT_MODEL_FIELDS);
|
|
13
38
|
export var DELETE_CONTENT_MODEL = gql(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n mutation CmsDeleteContentModel($modelId: ID!) {\n deleteContentModel(modelId: $modelId) {\n data\n error {\n ", "\n }\n }\n }\n"])), ERROR_FIELDS);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-headless-cms",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
],
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
+
"@apollo/react-common": "3.1.4",
|
|
16
17
|
"@apollo/react-hooks": "3.1.5",
|
|
17
18
|
"@babel/runtime": "7.16.7",
|
|
18
19
|
"@emotion/core": "10.3.1",
|
|
19
20
|
"@emotion/styled": "10.3.0",
|
|
21
|
+
"@fortawesome/fontawesome-common-types": "0.2.36",
|
|
20
22
|
"@fortawesome/fontawesome-svg-core": "1.2.36",
|
|
21
23
|
"@fortawesome/free-brands-svg-icons": "5.15.4",
|
|
22
24
|
"@fortawesome/free-regular-svg-icons": "5.15.4",
|
|
@@ -24,19 +26,19 @@
|
|
|
24
26
|
"@fortawesome/react-fontawesome": "0.1.17",
|
|
25
27
|
"@svgr/webpack": "6.2.1",
|
|
26
28
|
"@types/react": "16.14.2",
|
|
27
|
-
"@webiny/app": "5.
|
|
28
|
-
"@webiny/app-admin": "5.
|
|
29
|
-
"@webiny/app-graphql-playground": "5.
|
|
30
|
-
"@webiny/app-i18n": "5.
|
|
31
|
-
"@webiny/app-plugin-admin-welcome-screen": "5.
|
|
32
|
-
"@webiny/app-security": "5.
|
|
33
|
-
"@webiny/error": "5.
|
|
34
|
-
"@webiny/form": "5.
|
|
35
|
-
"@webiny/plugins": "5.
|
|
36
|
-
"@webiny/react-router": "5.
|
|
37
|
-
"@webiny/ui": "5.
|
|
38
|
-
"@webiny/utils": "5.
|
|
39
|
-
"@webiny/validation": "5.
|
|
29
|
+
"@webiny/app": "5.24.0-beta.0",
|
|
30
|
+
"@webiny/app-admin": "5.24.0-beta.0",
|
|
31
|
+
"@webiny/app-graphql-playground": "5.24.0-beta.0",
|
|
32
|
+
"@webiny/app-i18n": "5.24.0-beta.0",
|
|
33
|
+
"@webiny/app-plugin-admin-welcome-screen": "5.24.0-beta.0",
|
|
34
|
+
"@webiny/app-security": "5.24.0-beta.0",
|
|
35
|
+
"@webiny/error": "5.24.0-beta.0",
|
|
36
|
+
"@webiny/form": "5.24.0-beta.0",
|
|
37
|
+
"@webiny/plugins": "5.24.0-beta.0",
|
|
38
|
+
"@webiny/react-router": "5.24.0-beta.0",
|
|
39
|
+
"@webiny/ui": "5.24.0-beta.0",
|
|
40
|
+
"@webiny/utils": "5.24.0-beta.0",
|
|
41
|
+
"@webiny/validation": "5.24.0-beta.0",
|
|
40
42
|
"apollo-cache": "1.3.5",
|
|
41
43
|
"apollo-client": "2.6.10",
|
|
42
44
|
"apollo-link": "1.2.14",
|
|
@@ -52,6 +54,7 @@
|
|
|
52
54
|
"prop-types": "15.8.1",
|
|
53
55
|
"raw.macro": "0.4.2",
|
|
54
56
|
"react": "16.14.0",
|
|
57
|
+
"react-custom-scrollbars": "4.2.1",
|
|
55
58
|
"react-dnd": "11.1.3",
|
|
56
59
|
"react-dnd-html5-backend": "11.1.3",
|
|
57
60
|
"react-dom": "16.14.0",
|
|
@@ -68,8 +71,8 @@
|
|
|
68
71
|
"@babel/preset-env": "^7.16.4",
|
|
69
72
|
"@babel/preset-react": "^7.16.0",
|
|
70
73
|
"@babel/preset-typescript": "^7.16.0",
|
|
71
|
-
"@webiny/cli": "^5.
|
|
72
|
-
"@webiny/project-utils": "^5.
|
|
74
|
+
"@webiny/cli": "^5.24.0-beta.0",
|
|
75
|
+
"@webiny/project-utils": "^5.24.0-beta.0",
|
|
73
76
|
"babel-plugin-emotion": "^9.2.8",
|
|
74
77
|
"babel-plugin-lodash": "^3.3.4",
|
|
75
78
|
"babel-plugin-module-resolver": "^4.1.0",
|
|
@@ -101,5 +104,5 @@
|
|
|
101
104
|
]
|
|
102
105
|
}
|
|
103
106
|
},
|
|
104
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "05b90b92bbaf2ef3adf275d008c4641580cf5f42"
|
|
105
108
|
}
|