@webiny/app-headless-cms 5.40.5 → 5.40.6-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.
Files changed (67) hide show
  1. package/HeadlessCMS.js +2 -1
  2. package/HeadlessCMS.js.map +1 -1
  3. package/admin/components/ContentEntryForm/ContentEntryForm.d.ts +6 -11
  4. package/admin/components/ContentEntryForm/ContentEntryForm.js +5 -6
  5. package/admin/components/ContentEntryForm/ContentEntryForm.js.map +1 -1
  6. package/admin/components/ContentEntryForm/ContentEntryFormPreview.js +6 -1
  7. package/admin/components/ContentEntryForm/ContentEntryFormPreview.js.map +1 -1
  8. package/admin/components/ContentEntryForm/ContentEntryFormProvider.d.ts +7 -2
  9. package/admin/components/ContentEntryForm/ContentEntryFormProvider.js +8 -42
  10. package/admin/components/ContentEntryForm/ContentEntryFormProvider.js.map +1 -1
  11. package/admin/components/ContentEntryForm/Header/DeleteEntry/DeleteEntry.js +1 -1
  12. package/admin/components/ContentEntryForm/Header/DeleteEntry/DeleteEntry.js.map +1 -1
  13. package/admin/components/ContentEntryForm/SingletonHeader/SaveAction.d.ts +2 -0
  14. package/admin/components/ContentEntryForm/SingletonHeader/SaveAction.js +24 -0
  15. package/admin/components/ContentEntryForm/SingletonHeader/SaveAction.js.map +1 -0
  16. package/admin/components/ContentEntryForm/SingletonHeader/SingletonHeader.d.ts +5 -0
  17. package/admin/components/ContentEntryForm/SingletonHeader/SingletonHeader.js +65 -0
  18. package/admin/components/ContentEntryForm/SingletonHeader/SingletonHeader.js.map +1 -0
  19. package/admin/components/ContentEntryForm/SingletonHeader/index.d.ts +1 -0
  20. package/admin/components/ContentEntryForm/SingletonHeader/index.js +18 -0
  21. package/admin/components/ContentEntryForm/SingletonHeader/index.js.map +1 -0
  22. package/admin/components/Decorators/ShowConfirmationOnDeleteRevision/EntryRevisionDeletedSnackbarMessage.d.ts +8 -0
  23. package/admin/components/Decorators/ShowConfirmationOnDeleteRevision/EntryRevisionDeletedSnackbarMessage.js +18 -0
  24. package/admin/components/Decorators/ShowConfirmationOnDeleteRevision/EntryRevisionDeletedSnackbarMessage.js.map +1 -0
  25. package/admin/components/Decorators/ShowConfirmationOnDeleteRevision.d.ts +2 -0
  26. package/admin/components/Decorators/ShowConfirmationOnDeleteRevision.js +106 -0
  27. package/admin/components/Decorators/ShowConfirmationOnDeleteRevision.js.map +1 -0
  28. package/admin/contexts/Cms/index.d.ts +27 -5
  29. package/admin/contexts/Cms/index.js +136 -38
  30. package/admin/contexts/Cms/index.js.map +1 -1
  31. package/admin/hooks/usePersistEntry.d.ts +12 -0
  32. package/admin/hooks/usePersistEntry.js +48 -0
  33. package/admin/hooks/usePersistEntry.js.map +1 -0
  34. package/admin/plugins/fieldRenderers/ref/components/NewReferencedEntryDialog.js +11 -6
  35. package/admin/plugins/fieldRenderers/ref/components/NewReferencedEntryDialog.js.map +1 -1
  36. package/admin/plugins/fields/ref.js +7 -1
  37. package/admin/plugins/fields/ref.js.map +1 -1
  38. package/admin/views/contentEntries/ContentEntriesModule.js +2 -1
  39. package/admin/views/contentEntries/ContentEntriesModule.js.map +1 -1
  40. package/admin/views/contentEntries/ContentEntry/ContentEntryContext.d.ts +8 -0
  41. package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js +51 -22
  42. package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js.map +1 -1
  43. package/admin/views/contentEntries/ContentEntry/RevisionsList/PublishEntryRevisionListItem.js +1 -1
  44. package/admin/views/contentEntries/ContentEntry/RevisionsList/PublishEntryRevisionListItem.js.map +1 -1
  45. package/admin/views/contentEntries/ContentEntry/RevisionsList/RevisionListItem.js +6 -6
  46. package/admin/views/contentEntries/ContentEntry/RevisionsList/RevisionListItem.js.map +1 -1
  47. package/admin/views/contentEntries/ContentEntry/RevisionsList/useRevision.js +28 -22
  48. package/admin/views/contentEntries/ContentEntry/RevisionsList/useRevision.js.map +1 -1
  49. package/admin/views/contentEntries/ContentEntry/SingletonContentEntry.d.ts +8 -0
  50. package/admin/views/contentEntries/ContentEntry/SingletonContentEntry.js +66 -0
  51. package/admin/views/contentEntries/ContentEntry/SingletonContentEntry.js.map +1 -0
  52. package/admin/views/contentEntries/ContentEntry/SingletonContentEntryContext.d.ts +20 -0
  53. package/admin/views/contentEntries/ContentEntry/SingletonContentEntryContext.js +75 -0
  54. package/admin/views/contentEntries/ContentEntry/SingletonContentEntryContext.js.map +1 -0
  55. package/admin/views/contentEntries/ContentEntry.js +11 -4
  56. package/admin/views/contentEntries/ContentEntry.js.map +1 -1
  57. package/admin/views/contentEntries/SingletonContentEntryModule.d.ts +2 -0
  58. package/admin/views/contentEntries/SingletonContentEntryModule.js +33 -0
  59. package/admin/views/contentEntries/SingletonContentEntryModule.js.map +1 -0
  60. package/admin/views/contentEntries/hooks/useSingletonContentEntry.d.ts +8 -0
  61. package/admin/views/contentEntries/hooks/useSingletonContentEntry.js +18 -0
  62. package/admin/views/contentEntries/hooks/useSingletonContentEntry.js.map +1 -0
  63. package/admin/views/contentModels/ContentModelsDataList.js +13 -4
  64. package/admin/views/contentModels/ContentModelsDataList.js.map +1 -1
  65. package/admin/views/contentModels/NewContentModelDialog.js +58 -21
  66. package/admin/views/contentModels/NewContentModelDialog.js.map +1 -1
  67. package/package.json +28 -28
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
11
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
13
  var _react = _interopRequireWildcard(require("react"));
@@ -22,6 +23,7 @@ var _i18n = require("@webiny/app/i18n");
22
23
  var _Button = require("@webiny/ui/Button");
23
24
  var UID = _interopRequireWildcard(require("@webiny/ui/Dialog"));
24
25
  var _Grid = require("@webiny/ui/Grid");
26
+ var _appHeadlessCmsCommon = require("@webiny/app-headless-cms-common");
25
27
  var _cache = require("./cache");
26
28
  var GQL = _interopRequireWildcard(require("../../viewsGraphql"));
27
29
  var _Dialog2 = require("../../components/Dialog");
@@ -29,7 +31,8 @@ var _apiNameValidator = require("./helpers/apiNameValidator");
29
31
  var _nameValidator = require("./helpers/nameValidator");
30
32
  var _Checkbox = require("@webiny/ui/Checkbox");
31
33
  var _IconPicker = require("../../components/IconPicker");
32
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;
34
+ var _Switch = require("@webiny/ui/Switch");
35
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17;
33
36
  var t = _i18n.i18n.ns("app-headless-cms/admin/views/content-models/new-content-model-dialog");
34
37
  var NewContentModelDialog = function NewContentModelDialog(_ref) {
35
38
  var open = _ref.open,
@@ -104,32 +107,55 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
104
107
  client: client,
105
108
  models: models
106
109
  }), [client, models]);
107
- var group = contentModelGroups.length > 0 ? contentModelGroups[0].value : null;
108
- var _onSubmit = async function onSubmit(data) {
110
+ var group = (0, _react.useMemo)(function () {
111
+ if (!contentModelGroups.length) {
112
+ return undefined;
113
+ }
114
+ return contentModelGroups[0]?.value;
115
+ }, [contentModelGroups]);
116
+ var _onSubmit = (0, _react.useCallback)(async function (data) {
109
117
  setLoading(true);
118
+ /**
119
+ * We need to make sure that tags are always an array.
120
+ * At the moment there is no tags on the CmsModelData type.
121
+ * If it is added at some point, the @ts-expect-error should be removed - it will cause TS error.
122
+ */
123
+ // @ts-expect-error
124
+ var tags = Array.isArray(data.tags) ? data.tags : [];
125
+ /**
126
+ * If a model is a singleton, we add a special tag to it.
127
+ * + we need to put the pluralApiName to something that is not used.
128
+ */
129
+ if (data.singleton) {
130
+ tags.push(_appHeadlessCmsCommon.CMS_MODEL_SINGLETON_TAG);
131
+ data.pluralApiName = "".concat(data.singularApiName, "Unused");
132
+ }
133
+ delete data.singleton;
110
134
  await createContentModel({
111
135
  variables: {
112
- data: data
136
+ data: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
137
+ tags: tags
138
+ })
113
139
  }
114
140
  });
115
- };
141
+ }, [loading, createContentModel]);
116
142
  return /*#__PURE__*/_react.default.createElement(_Dialog2.Dialog, {
117
143
  open: open,
118
144
  onClose: onClose,
119
145
  "data-testid": "cms-new-content-model-modal"
120
146
  }, open && /*#__PURE__*/_react.default.createElement(_form.Form, {
121
147
  data: {
122
- group: group
148
+ group: group,
149
+ singleton: false
123
150
  },
124
151
  onSubmit: function onSubmit(data) {
125
- /**
126
- * We are positive that data is CmsModelData.
127
- */
152
+ console.log("submitting", data);
128
153
  _onSubmit(data);
129
154
  }
130
155
  }, function (_ref3) {
131
156
  var Bind = _ref3.Bind,
132
- submit = _ref3.submit;
157
+ submit = _ref3.submit,
158
+ data = _ref3.data;
133
159
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, loading && /*#__PURE__*/_react.default.createElement(_Progress.CircularProgress, {
134
160
  label: "Creating content model..."
135
161
  }), /*#__PURE__*/_react.default.createElement(UID.DialogTitle, null, t(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["New Content Model"])))), /*#__PURE__*/_react.default.createElement(UID.DialogContent, null, /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
@@ -152,12 +178,22 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
152
178
  "data-testid": "cms.newcontentmodeldialog.singularApiName"
153
179
  }))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
154
180
  span: 12
181
+ }, /*#__PURE__*/_react.default.createElement(Bind, {
182
+ name: "singleton",
183
+ defaultValue: false
184
+ }, /*#__PURE__*/_react.default.createElement(_Switch.Switch, {
185
+ description: t(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["Create a model that can hold only one entry. Cannot be changed later."]))),
186
+ label: t(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["Single entry model"]))),
187
+ "data-testid": "cms.newcontentmodeldialog.singleton"
188
+ }))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
189
+ span: 12
155
190
  }, /*#__PURE__*/_react.default.createElement(Bind, {
156
191
  name: "pluralApiName",
157
- validators: [_validation.validation.create("required,maxLength:100"), apiNameValidator]
192
+ validators: data.singleton ? [] : [_validation.validation.create("required,maxLength:100"), apiNameValidator]
158
193
  }, /*#__PURE__*/_react.default.createElement(_Input.Input, {
159
- label: t(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["Plural API Name"]))),
160
- description: t(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["The plural API name of the content model. For example: AuthorCategories."]))),
194
+ disabled: data.singleton,
195
+ label: t(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["Plural API Name"]))),
196
+ description: t(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["The plural API name of the content model. For example: AuthorCategories."]))),
161
197
  "data-testid": "cms.newcontentmodeldialog.pluralApiName"
162
198
  }))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
163
199
  span: 12
@@ -165,8 +201,8 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
165
201
  name: "group",
166
202
  validators: _validation.validation.create("required")
167
203
  }, /*#__PURE__*/_react.default.createElement(_Select.Select, {
168
- description: t(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["Choose a content model group"]))),
169
- label: t(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["Content model group"]))),
204
+ description: t(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["Choose a content model group"]))),
205
+ label: t(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["Content model group"]))),
170
206
  options: contentModelGroups,
171
207
  "data-testid": "cms.newcontentmodeldialog.selectgroup"
172
208
  }))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
@@ -174,8 +210,8 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
174
210
  }, /*#__PURE__*/_react.default.createElement(Bind, {
175
211
  name: "icon"
176
212
  }, /*#__PURE__*/_react.default.createElement(_IconPicker.IconPicker, {
177
- label: t(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["Icon"]))),
178
- description: t(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["Choose an icon to represent the model."])))
213
+ label: t(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["Icon"]))),
214
+ description: t(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["Choose an icon to represent the model."])))
179
215
  }))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
180
216
  span: 12
181
217
  }, /*#__PURE__*/_react.default.createElement(Bind, {
@@ -185,7 +221,7 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
185
221
  rows: 4,
186
222
  maxLength: 200,
187
223
  characterCount: true,
188
- label: t(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["Description"]))),
224
+ label: t(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["Description"]))),
189
225
  "data-testid": "cms.newcontentmodeldialog.description"
190
226
  }));
191
227
  })), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
@@ -194,14 +230,15 @@ var NewContentModelDialog = function NewContentModelDialog(_ref) {
194
230
  name: "defaultFields",
195
231
  defaultValue: true
196
232
  }, /*#__PURE__*/_react.default.createElement(_Checkbox.Checkbox, {
197
- description: t(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["Create model with default title (text), description (long text) and image (file) fields"]))),
198
- label: t(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["Create model with default fields"]))),
233
+ description: t(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["Create model with default title (text), description (long text) and image (file) fields"]))),
234
+ label: t(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["Create model with default fields"]))),
199
235
  "data-testid": "cms.newcontentmodeldialog.defaultfields"
200
236
  }))))), /*#__PURE__*/_react.default.createElement(UID.DialogActions, null, /*#__PURE__*/_react.default.createElement(_Button.ButtonPrimary, {
201
237
  onClick: function onClick(ev) {
238
+ console.log("submitting click", data);
202
239
  submit(ev);
203
240
  }
204
- }, "+ ", t(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["Create Model"]))))));
241
+ }, "+ ", t(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["Create Model"]))))));
205
242
  }));
206
243
  };
207
244
  var _default = exports.default = NewContentModelDialog;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactRouter","_form","_Input","_Select","_useSnackbar2","_Progress","_validation","_hooks","_i18n","_Button","UID","_Grid","_cache","GQL","_Dialog2","_apiNameValidator","_nameValidator","_Checkbox","_IconPicker","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","_templateObject13","_templateObject14","_templateObject15","t","i18n","ns","NewContentModelDialog","_ref","open","onClose","_React$useState","React","useState","_React$useState2","_slicedToArray2","default","loading","setLoading","_useSnackbar","useSnackbar","showSnackbar","_useRouter","useRouter","history","client","useApolloClient","_useMutation","useMutation","CREATE_CONTENT_MODEL","onCompleted","data","_data$createContentMo","createContentModel","model","error","message","push","modelId","update","cache","_ref2","_data$createContentMo2","addModelToListCache","addModelToGroupCache","_useMutation2","listMenuGroupsQuery","useQuery","LIST_MENU_CONTENT_GROUPS_MODELS","skip","groups","useMemo","listContentModelGroups","contentModelGroups","map","item","value","id","label","name","models","reduce","collection","group","apply","_toConsumableArray2","contentModels","nameValidator","useCallback","createNameValidator","apiNameValidator","createApiNameValidator","length","onSubmit","variables","createElement","Dialog","Form","_ref3","Bind","submit","Fragment","CircularProgress","DialogTitle","_taggedTemplateLiteral2","DialogContent","Grid","Cell","span","validators","validation","create","Input","description","Select","options","IconPicker","props","Object","assign","rows","maxLength","characterCount","defaultValue","Checkbox","DialogActions","ButtonPrimary","onClick","ev","_default","exports"],"sources":["NewContentModelDialog.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { useRouter } from \"@webiny/react-router\";\nimport { Form } from \"@webiny/form\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Select } from \"@webiny/ui/Select\";\nimport { useSnackbar } from \"@webiny/app-admin/hooks/useSnackbar\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { validation } from \"@webiny/validation\";\nimport { useQuery, useMutation, useApolloClient } from \"../../hooks\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport * as UID from \"@webiny/ui/Dialog\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { addModelToGroupCache, addModelToListCache } from \"./cache\";\nimport * as GQL from \"../../viewsGraphql\";\nimport {\n CreateCmsModelMutationResponse,\n CreateCmsModelMutationVariables,\n ListMenuCmsGroupsQueryResponse\n} from \"../../viewsGraphql\";\nimport { CmsModel } from \"~/types\";\nimport { CmsGroupOption } from \"./types\";\nimport { Dialog } from \"~/admin/components/Dialog\";\nimport { createApiNameValidator } from \"~/admin/views/contentModels/helpers/apiNameValidator\";\nimport { createNameValidator } from \"~/admin/views/contentModels/helpers/nameValidator\";\nimport { Checkbox } from \"@webiny/ui/Checkbox\";\nimport { IconPicker } from \"~/admin/components/IconPicker\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/views/content-models/new-content-model-dialog\");\n\nexport interface NewContentModelDialogProps {\n open: boolean;\n onClose: UID.DialogOnClose;\n}\n\ninterface CmsModelData {\n name: string;\n description: string;\n group: string;\n}\n\nconst NewContentModelDialog = ({ open, onClose }: NewContentModelDialogProps) => {\n const [loading, setLoading] = React.useState(false);\n const { showSnackbar } = useSnackbar();\n const { history } = useRouter();\n const client = useApolloClient();\n\n const [createContentModel] = useMutation<\n CreateCmsModelMutationResponse,\n CreateCmsModelMutationVariables\n >(GQL.CREATE_CONTENT_MODEL, {\n onCompleted(data) {\n setLoading(false);\n\n if (!data) {\n showSnackbar(\"Missing data on Create Content Model Mutation Response.\");\n return;\n }\n\n const { data: model, error } = data.createContentModel;\n\n if (error) {\n setLoading(false);\n showSnackbar(error.message);\n return;\n }\n\n history.push(\"/cms/content-models/\" + model.modelId);\n },\n update(cache, { data }) {\n if (!data) {\n return;\n }\n\n const { data: model, error } = data.createContentModel;\n\n if (error) {\n return;\n }\n\n addModelToListCache(cache, model);\n addModelToGroupCache(cache, model);\n }\n });\n\n const listMenuGroupsQuery = useQuery<ListMenuCmsGroupsQueryResponse>(\n GQL.LIST_MENU_CONTENT_GROUPS_MODELS,\n {\n skip: !open\n }\n );\n\n const groups = useMemo(() => {\n return listMenuGroupsQuery.data?.listContentModelGroups?.data || [];\n }, [listMenuGroupsQuery.data]);\n\n const contentModelGroups = useMemo(() => {\n return groups.map((item): CmsGroupOption => {\n return {\n value: item.id,\n label: item.name\n };\n });\n }, [groups]);\n\n const models = useMemo(() => {\n return groups.reduce<CmsModel[]>((collection, group) => {\n collection.push(...group.contentModels);\n return collection;\n }, []);\n }, [groups]);\n\n const nameValidator = useCallback(createNameValidator({ models }), [models]);\n\n const apiNameValidator = useCallback(createApiNameValidator({ client, models }), [\n client,\n models\n ]);\n\n const group = contentModelGroups.length > 0 ? contentModelGroups[0].value : null;\n\n const onSubmit = async (data: CmsModelData) => {\n setLoading(true);\n await createContentModel({\n variables: { data }\n });\n };\n\n return (\n <Dialog open={open} onClose={onClose} data-testid=\"cms-new-content-model-modal\">\n {open && (\n <Form\n data={{ group }}\n onSubmit={data => {\n /**\n * We are positive that data is CmsModelData.\n */\n onSubmit(data as unknown as CmsModelData);\n }}\n >\n {({ Bind, submit }) => (\n <>\n {loading && <CircularProgress label={\"Creating content model...\"} />}\n <UID.DialogTitle>{t`New Content Model`}</UID.DialogTitle>\n <UID.DialogContent>\n <Grid>\n <Cell span={12}>\n <Bind\n name={\"name\"}\n validators={[\n validation.create(\"required,maxLength:100\"),\n nameValidator\n ]}\n >\n <Input\n label={t`Name`}\n description={t`The name of the content model. Use the singular form, e.g. Author Category, not Author Categories.`}\n data-testid=\"cms.newcontentmodeldialog.name\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"singularApiName\"}\n validators={[\n validation.create(\"required,maxLength:100\"),\n apiNameValidator\n ]}\n >\n <Input\n label={t`Singular API Name`}\n description={t`The API name of the content model. For example: AuthorCategory.`}\n data-testid=\"cms.newcontentmodeldialog.singularApiName\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"pluralApiName\"}\n validators={[\n validation.create(\"required,maxLength:100\"),\n apiNameValidator\n ]}\n >\n <Input\n label={t`Plural API Name`}\n description={t`The plural API name of the content model. For example: AuthorCategories.`}\n data-testid=\"cms.newcontentmodeldialog.pluralApiName\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"group\"}\n validators={validation.create(\"required\")}\n >\n <Select\n description={t`Choose a content model group`}\n label={t`Content model group`}\n options={contentModelGroups}\n data-testid=\"cms.newcontentmodeldialog.selectgroup\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name=\"icon\">\n <IconPicker\n label={t`Icon`}\n description={t`Choose an icon to represent the model.`}\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name=\"description\">\n {props => (\n <Input\n {...props}\n rows={4}\n maxLength={200}\n characterCount\n label={t`Description`}\n data-testid=\"cms.newcontentmodeldialog.description\"\n />\n )}\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name={\"defaultFields\"} defaultValue={true}>\n <Checkbox\n description={t`Create model with default title (text), description (long text) and image (file) fields`}\n label={t`Create model with default fields`}\n data-testid=\"cms.newcontentmodeldialog.defaultfields\"\n />\n </Bind>\n </Cell>\n </Grid>\n </UID.DialogContent>\n <UID.DialogActions>\n <ButtonPrimary\n onClick={ev => {\n submit(ev);\n }}\n >\n + {t`Create Model`}\n </ButtonPrimary>\n </UID.DialogActions>\n </>\n )}\n </Form>\n )}\n </Dialog>\n );\n};\n\nexport default NewContentModelDialog;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,GAAA,GAAAZ,uBAAA,CAAAC,OAAA;AACA,IAAAY,KAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,GAAA,GAAAf,uBAAA,CAAAC,OAAA;AAQA,IAAAe,QAAA,GAAAf,OAAA;AACA,IAAAgB,iBAAA,GAAAhB,OAAA;AACA,IAAAiB,cAAA,GAAAjB,OAAA;AACA,IAAAkB,SAAA,GAAAlB,OAAA;AACA,IAAAmB,WAAA,GAAAnB,OAAA;AAA2D,IAAAoB,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,g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AAA,GAEaT,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactRouter","_form","_Input","_Select","_useSnackbar2","_Progress","_validation","_hooks","_i18n","_Button","UID","_Grid","_appHeadlessCmsCommon","_cache","GQL","_Dialog2","_apiNameValidator","_nameValidator","_Checkbox","_IconPicker","_Switch","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","_templateObject13","_templateObject14","_templateObject15","_templateObject16","_templateObject17","t","i18n","ns","NewContentModelDialog","_ref","open","onClose","_React$useState","React","useState","_React$useState2","_slicedToArray2","default","loading","setLoading","_useSnackbar","useSnackbar","showSnackbar","_useRouter","useRouter","history","client","useApolloClient","_useMutation","useMutation","CREATE_CONTENT_MODEL","onCompleted","data","_data$createContentMo","createContentModel","model","error","message","push","modelId","update","cache","_ref2","_data$createContentMo2","addModelToListCache","addModelToGroupCache","_useMutation2","listMenuGroupsQuery","useQuery","LIST_MENU_CONTENT_GROUPS_MODELS","skip","groups","useMemo","listContentModelGroups","contentModelGroups","map","item","value","id","label","name","models","reduce","collection","group","apply","_toConsumableArray2","contentModels","nameValidator","useCallback","createNameValidator","apiNameValidator","createApiNameValidator","length","undefined","onSubmit","tags","Array","isArray","singleton","CMS_MODEL_SINGLETON_TAG","pluralApiName","concat","singularApiName","variables","_objectSpread2","createElement","Dialog","Form","console","log","_ref3","Bind","submit","Fragment","CircularProgress","DialogTitle","_taggedTemplateLiteral2","DialogContent","Grid","Cell","span","validators","validation","create","Input","description","defaultValue","Switch","disabled","Select","options","IconPicker","props","Object","assign","rows","maxLength","characterCount","Checkbox","DialogActions","ButtonPrimary","onClick","ev","_default","exports"],"sources":["NewContentModelDialog.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { useRouter } from \"@webiny/react-router\";\nimport { Form } from \"@webiny/form\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Select } from \"@webiny/ui/Select\";\nimport { useSnackbar } from \"@webiny/app-admin/hooks/useSnackbar\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { validation } from \"@webiny/validation\";\nimport { useApolloClient, useMutation, useQuery } from \"../../hooks\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport * as UID from \"@webiny/ui/Dialog\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { CMS_MODEL_SINGLETON_TAG } from \"@webiny/app-headless-cms-common\";\nimport { addModelToGroupCache, addModelToListCache } from \"./cache\";\nimport * as GQL from \"../../viewsGraphql\";\nimport {\n CreateCmsModelMutationResponse,\n CreateCmsModelMutationVariables,\n ListMenuCmsGroupsQueryResponse\n} from \"../../viewsGraphql\";\nimport { CmsModel } from \"~/types\";\nimport { CmsGroupOption } from \"./types\";\nimport { Dialog } from \"~/admin/components/Dialog\";\nimport { createApiNameValidator } from \"~/admin/views/contentModels/helpers/apiNameValidator\";\nimport { createNameValidator } from \"~/admin/views/contentModels/helpers/nameValidator\";\nimport { Checkbox } from \"@webiny/ui/Checkbox\";\nimport { IconPicker } from \"~/admin/components/IconPicker\";\nimport { Switch } from \"@webiny/ui/Switch\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/views/content-models/new-content-model-dialog\");\n\nexport interface NewContentModelDialogProps {\n open: boolean;\n onClose: UID.DialogOnClose;\n}\n\ninterface CmsModelData {\n name: string;\n description: string;\n group: string;\n singleton?: boolean;\n singularApiName: string;\n pluralApiName: string;\n defaultFields: boolean;\n}\n\nconst NewContentModelDialog = ({ open, onClose }: NewContentModelDialogProps) => {\n const [loading, setLoading] = React.useState(false);\n const { showSnackbar } = useSnackbar();\n const { history } = useRouter();\n const client = useApolloClient();\n\n const [createContentModel] = useMutation<\n CreateCmsModelMutationResponse,\n CreateCmsModelMutationVariables\n >(GQL.CREATE_CONTENT_MODEL, {\n onCompleted(data) {\n setLoading(false);\n\n if (!data) {\n showSnackbar(\"Missing data on Create Content Model Mutation Response.\");\n return;\n }\n\n const { data: model, error } = data.createContentModel;\n\n if (error) {\n setLoading(false);\n showSnackbar(error.message);\n return;\n }\n\n history.push(\"/cms/content-models/\" + model.modelId);\n },\n update(cache, { data }) {\n if (!data) {\n return;\n }\n\n const { data: model, error } = data.createContentModel;\n\n if (error) {\n return;\n }\n\n addModelToListCache(cache, model);\n addModelToGroupCache(cache, model);\n }\n });\n\n const listMenuGroupsQuery = useQuery<ListMenuCmsGroupsQueryResponse>(\n GQL.LIST_MENU_CONTENT_GROUPS_MODELS,\n {\n skip: !open\n }\n );\n\n const groups = useMemo(() => {\n return listMenuGroupsQuery.data?.listContentModelGroups?.data || [];\n }, [listMenuGroupsQuery.data]);\n\n const contentModelGroups = useMemo(() => {\n return groups.map((item): CmsGroupOption => {\n return {\n value: item.id,\n label: item.name\n };\n });\n }, [groups]);\n\n const models = useMemo(() => {\n return groups.reduce<CmsModel[]>((collection, group) => {\n collection.push(...group.contentModels);\n return collection;\n }, []);\n }, [groups]);\n\n const nameValidator = useCallback(createNameValidator({ models }), [models]);\n\n const apiNameValidator = useCallback(createApiNameValidator({ client, models }), [\n client,\n models\n ]);\n\n const group = useMemo<string | undefined>(() => {\n if (!contentModelGroups.length) {\n return undefined;\n }\n return contentModelGroups[0]?.value;\n }, [contentModelGroups]);\n\n const onSubmit = useCallback(\n async (data: CmsModelData) => {\n setLoading(true);\n /**\n * We need to make sure that tags are always an array.\n * At the moment there is no tags on the CmsModelData type.\n * If it is added at some point, the @ts-expect-error should be removed - it will cause TS error.\n */\n // @ts-expect-error\n const tags: string[] = Array.isArray(data.tags) ? data.tags : [];\n /**\n * If a model is a singleton, we add a special tag to it.\n * + we need to put the pluralApiName to something that is not used.\n */\n if (data.singleton) {\n tags.push(CMS_MODEL_SINGLETON_TAG);\n data.pluralApiName = `${data.singularApiName}Unused`;\n }\n delete data.singleton;\n await createContentModel({\n variables: {\n data: {\n ...data,\n tags\n }\n }\n });\n },\n [loading, createContentModel]\n );\n\n return (\n <Dialog open={open} onClose={onClose} data-testid=\"cms-new-content-model-modal\">\n {open && (\n <Form<CmsModelData>\n data={{ group, singleton: false }}\n onSubmit={data => {\n console.log(\"submitting\", data);\n onSubmit(data);\n }}\n >\n {({ Bind, submit, data }) => {\n return (\n <>\n {loading && (\n <CircularProgress label={\"Creating content model...\"} />\n )}\n <UID.DialogTitle>{t`New Content Model`}</UID.DialogTitle>\n <UID.DialogContent>\n <Grid>\n <Cell span={12}>\n <Bind\n name={\"name\"}\n validators={[\n validation.create(\"required,maxLength:100\"),\n nameValidator\n ]}\n >\n <Input\n label={t`Name`}\n description={t`The name of the content model. Use the singular form, e.g. Author Category, not Author Categories.`}\n data-testid=\"cms.newcontentmodeldialog.name\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"singularApiName\"}\n validators={[\n validation.create(\"required,maxLength:100\"),\n apiNameValidator\n ]}\n >\n <Input\n label={t`Singular API Name`}\n description={t`The API name of the content model. For example: AuthorCategory.`}\n data-testid=\"cms.newcontentmodeldialog.singularApiName\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name={\"singleton\"} defaultValue={false}>\n <Switch\n description={t`Create a model that can hold only one entry. Cannot be changed later.`}\n label={t`Single entry model`}\n data-testid=\"cms.newcontentmodeldialog.singleton\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"pluralApiName\"}\n validators={\n data.singleton\n ? []\n : [\n validation.create(\n \"required,maxLength:100\"\n ),\n apiNameValidator\n ]\n }\n >\n <Input\n disabled={data.singleton}\n label={t`Plural API Name`}\n description={t`The plural API name of the content model. For example: AuthorCategories.`}\n data-testid=\"cms.newcontentmodeldialog.pluralApiName\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"group\"}\n validators={validation.create(\"required\")}\n >\n <Select\n description={t`Choose a content model group`}\n label={t`Content model group`}\n options={contentModelGroups}\n data-testid=\"cms.newcontentmodeldialog.selectgroup\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name=\"icon\">\n <IconPicker\n label={t`Icon`}\n description={t`Choose an icon to represent the model.`}\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name=\"description\">\n {props => (\n <Input\n {...props}\n rows={4}\n maxLength={200}\n characterCount\n label={t`Description`}\n data-testid=\"cms.newcontentmodeldialog.description\"\n />\n )}\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name={\"defaultFields\"} defaultValue={true}>\n <Checkbox\n description={t`Create model with default title (text), description (long text) and image (file) fields`}\n label={t`Create model with default fields`}\n data-testid=\"cms.newcontentmodeldialog.defaultfields\"\n />\n </Bind>\n </Cell>\n </Grid>\n </UID.DialogContent>\n <UID.DialogActions>\n <ButtonPrimary\n onClick={ev => {\n console.log(\"submitting click\", data);\n submit(ev);\n }}\n >\n + {t`Create Model`}\n </ButtonPrimary>\n </UID.DialogActions>\n </>\n );\n }}\n </Form>\n )}\n </Dialog>\n );\n};\n\nexport default NewContentModelDialog;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,GAAA,GAAAZ,uBAAA,CAAAC,OAAA;AACA,IAAAY,KAAA,GAAAZ,OAAA;AACA,IAAAa,qBAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,GAAA,GAAAhB,uBAAA,CAAAC,OAAA;AAQA,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OAAA,CAAAqE,aAAA,CAAC7G,GAAG,CAAC+I,aAAa,qBACd5J,MAAA,CAAAqD,OAAA,CAAAqE,aAAA,CAAC9G,OAAA,CAAAiJ,aAAa;MACVC,OAAO,EAAE,SAAAA,QAAAC,EAAE,EAAI;QACXlC,OAAO,CAACC,GAAG,CAAC,kBAAkB,EAAE1D,IAAI,CAAC;QACrC6D,MAAM,CAAC8B,EAAE,CAAC;MACd;IAAE,GACL,IACK,EAACtH,CAAC,CAAAD,iBAAA,KAAAA,iBAAA,OAAA6F,uBAAA,CAAAhF,OAAA,qBACO,CACA,CACrB,CAAC;EAEX,CACE,CAEN,CAAC;AAEjB,CAAC;AAAC,IAAA2G,QAAA,GAAAC,OAAA,CAAA5G,OAAA,GAEaT,qBAAqB","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-headless-cms",
3
- "version": "5.40.5",
3
+ "version": "5.40.6-beta.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,30 +28,30 @@
28
28
  "@material-design-icons/svg": "0.14.13",
29
29
  "@svgr/webpack": "6.5.1",
30
30
  "@types/react": "18.2.79",
31
- "@webiny/app": "5.40.5",
32
- "@webiny/app-aco": "5.40.5",
33
- "@webiny/app-admin": "5.40.5",
34
- "@webiny/app-graphql-playground": "5.40.5",
35
- "@webiny/app-headless-cms-common": "5.40.5",
36
- "@webiny/app-i18n": "5.40.5",
37
- "@webiny/app-plugin-admin-welcome-screen": "5.40.5",
38
- "@webiny/app-security": "5.40.5",
39
- "@webiny/app-tenancy": "5.40.5",
40
- "@webiny/app-trash-bin": "5.40.5",
41
- "@webiny/error": "5.40.5",
42
- "@webiny/feature-flags": "5.40.5",
43
- "@webiny/form": "5.40.5",
44
- "@webiny/lexical-editor": "5.40.5",
45
- "@webiny/lexical-nodes": "5.40.5",
46
- "@webiny/lexical-theme": "5.40.5",
47
- "@webiny/plugins": "5.40.5",
48
- "@webiny/react-composition": "5.40.5",
49
- "@webiny/react-properties": "5.40.5",
50
- "@webiny/react-router": "5.40.5",
51
- "@webiny/theme": "5.40.5",
52
- "@webiny/ui": "5.40.5",
53
- "@webiny/utils": "5.40.5",
54
- "@webiny/validation": "5.40.5",
31
+ "@webiny/app": "5.40.6-beta.0",
32
+ "@webiny/app-aco": "5.40.6-beta.0",
33
+ "@webiny/app-admin": "5.40.6-beta.0",
34
+ "@webiny/app-graphql-playground": "5.40.6-beta.0",
35
+ "@webiny/app-headless-cms-common": "5.40.6-beta.0",
36
+ "@webiny/app-i18n": "5.40.6-beta.0",
37
+ "@webiny/app-plugin-admin-welcome-screen": "5.40.6-beta.0",
38
+ "@webiny/app-security": "5.40.6-beta.0",
39
+ "@webiny/app-tenancy": "5.40.6-beta.0",
40
+ "@webiny/app-trash-bin": "5.40.6-beta.0",
41
+ "@webiny/error": "5.40.6-beta.0",
42
+ "@webiny/feature-flags": "5.40.6-beta.0",
43
+ "@webiny/form": "5.40.6-beta.0",
44
+ "@webiny/lexical-editor": "5.40.6-beta.0",
45
+ "@webiny/lexical-nodes": "5.40.6-beta.0",
46
+ "@webiny/lexical-theme": "5.40.6-beta.0",
47
+ "@webiny/plugins": "5.40.6-beta.0",
48
+ "@webiny/react-composition": "5.40.6-beta.0",
49
+ "@webiny/react-properties": "5.40.6-beta.0",
50
+ "@webiny/react-router": "5.40.6-beta.0",
51
+ "@webiny/theme": "5.40.6-beta.0",
52
+ "@webiny/ui": "5.40.6-beta.0",
53
+ "@webiny/utils": "5.40.6-beta.0",
54
+ "@webiny/validation": "5.40.6-beta.0",
55
55
  "apollo-cache": "1.3.5",
56
56
  "apollo-client": "2.6.10",
57
57
  "apollo-link": "1.2.14",
@@ -85,8 +85,8 @@
85
85
  "@babel/preset-react": "7.24.1",
86
86
  "@babel/preset-typescript": "7.24.1",
87
87
  "@emotion/babel-plugin": "11.11.0",
88
- "@webiny/cli": "5.40.5",
89
- "@webiny/project-utils": "5.40.5",
88
+ "@webiny/cli": "5.40.6-beta.0",
89
+ "@webiny/project-utils": "5.40.6-beta.0",
90
90
  "babel-plugin-module-resolver": "5.0.0",
91
91
  "rimraf": "5.0.5",
92
92
  "ttypescript": "1.5.15",
@@ -115,5 +115,5 @@
115
115
  ]
116
116
  }
117
117
  },
118
- "gitHead": "f67778732392ed88f28da869ddacbf08a98cdec6"
118
+ "gitHead": "c0bf7d9bfe72b0689b29c84506f3168515a78517"
119
119
  }