@webiny/app-headless-cms 6.5.1-beta.0 → 6.5.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-headless-cms",
|
|
3
|
-
"version": "6.5.1
|
|
3
|
+
"version": "6.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -28,30 +28,30 @@
|
|
|
28
28
|
"@fortawesome/react-fontawesome": "3.5.0",
|
|
29
29
|
"@lexical/utils": "0.52.0",
|
|
30
30
|
"@types/react": "18.3.31",
|
|
31
|
-
"@webiny/admin-ui": "6.5.1
|
|
32
|
-
"@webiny/app": "6.5.1
|
|
33
|
-
"@webiny/app-aco": "6.5.1
|
|
34
|
-
"@webiny/app-admin": "6.5.1
|
|
35
|
-
"@webiny/app-graphql-playground": "6.5.1
|
|
36
|
-
"@webiny/app-headless-cms-common": "6.5.1
|
|
37
|
-
"@webiny/cms-sdk": "6.5.1
|
|
31
|
+
"@webiny/admin-ui": "6.5.1",
|
|
32
|
+
"@webiny/app": "6.5.1",
|
|
33
|
+
"@webiny/app-aco": "6.5.1",
|
|
34
|
+
"@webiny/app-admin": "6.5.1",
|
|
35
|
+
"@webiny/app-graphql-playground": "6.5.1",
|
|
36
|
+
"@webiny/app-headless-cms-common": "6.5.1",
|
|
37
|
+
"@webiny/cms-sdk": "6.5.1",
|
|
38
38
|
"@webiny/di": "1.1.0",
|
|
39
|
-
"@webiny/feature": "6.5.1
|
|
40
|
-
"@webiny/form": "6.5.1
|
|
41
|
-
"@webiny/frontend-settings": "6.5.1
|
|
42
|
-
"@webiny/icons": "6.5.1
|
|
43
|
-
"@webiny/lexical-editor": "6.5.1
|
|
44
|
-
"@webiny/lexical-nodes": "6.5.1
|
|
45
|
-
"@webiny/plugins": "6.5.1
|
|
46
|
-
"@webiny/react-composition": "6.5.1
|
|
47
|
-
"@webiny/react-properties": "6.5.1
|
|
48
|
-
"@webiny/utils": "6.5.1
|
|
49
|
-
"@webiny/validation": "6.5.1
|
|
39
|
+
"@webiny/feature": "6.5.1",
|
|
40
|
+
"@webiny/form": "6.5.1",
|
|
41
|
+
"@webiny/frontend-settings": "6.5.1",
|
|
42
|
+
"@webiny/icons": "6.5.1",
|
|
43
|
+
"@webiny/lexical-editor": "6.5.1",
|
|
44
|
+
"@webiny/lexical-nodes": "6.5.1",
|
|
45
|
+
"@webiny/plugins": "6.5.1",
|
|
46
|
+
"@webiny/react-composition": "6.5.1",
|
|
47
|
+
"@webiny/react-properties": "6.5.1",
|
|
48
|
+
"@webiny/utils": "6.5.1",
|
|
49
|
+
"@webiny/validation": "6.5.1",
|
|
50
50
|
"dot-prop-immutable": "2.1.1",
|
|
51
51
|
"graphql": "16.14.2",
|
|
52
52
|
"graphql-tag": "2.12.7",
|
|
53
53
|
"lodash": "4.18.1",
|
|
54
|
-
"mobx": "7.
|
|
54
|
+
"mobx": "7.1.1",
|
|
55
55
|
"mobx-react-lite": "5.1.0",
|
|
56
56
|
"react": "18.3.1",
|
|
57
57
|
"react-dnd": "16.0.1",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"zod": "4.6.7"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@webiny/build-tools": "6.5.1
|
|
66
|
+
"@webiny/build-tools": "6.5.1",
|
|
67
67
|
"rimraf": "6.1.3",
|
|
68
68
|
"typescript": "7.0.2",
|
|
69
69
|
"vitest": "5.0.5"
|
|
@@ -8,18 +8,21 @@ const SaveAndPublishButton = observer(()=>{
|
|
|
8
8
|
const { ButtonPrimary } = ContentEntryEditorConfig.Actions.ButtonAction.useButtons();
|
|
9
9
|
const { canEdit, canPublish } = usePermission();
|
|
10
10
|
if (!presenter.vm.canPublish || "unpublished" === presenter.vm.status && !presenter.vm.isDirty || presenter.vm.entry && !canEdit(presenter.vm.entry, "cms.contentEntry") || !canPublish("cms.contentEntry")) return null;
|
|
11
|
+
const canSave = presenter.vm.canSave;
|
|
11
12
|
const saveAndPublish = async ()=>{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
if (canSave) {
|
|
14
|
+
const saved = await presenter.saveRevision({
|
|
15
|
+
skipValidation: false
|
|
16
|
+
});
|
|
17
|
+
if (!saved) return;
|
|
18
|
+
}
|
|
16
19
|
await presenter.publishRevision();
|
|
17
20
|
};
|
|
18
21
|
return /*#__PURE__*/ react.createElement(ButtonPrimary, {
|
|
19
22
|
onAction: saveAndPublish,
|
|
20
23
|
disabled: null !== presenter.vm.loading,
|
|
21
24
|
"data-testid": "cms-content-save-publish-content-button"
|
|
22
|
-
}, "Save & Publish");
|
|
25
|
+
}, canSave ? "Save & Publish" : "Publish");
|
|
23
26
|
});
|
|
24
27
|
export { SaveAndPublishButton };
|
|
25
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/contentEntries/views/actions/SaveAndPublishButton.js","sources":["../../../../../src/presentation/contentEntries/views/actions/SaveAndPublishButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ContentEntryEditorConfig } from \"~/admin/config/contentEntries/index.js\";\nimport { usePermission } from \"~/admin/hooks/usePermission.js\";\nimport { useContentEntryFormPresenter } from \"~/presentation/contentEntries/form/useContentEntryFormPresenter.js\";\n\nexport const SaveAndPublishButton = observer(() => {\n const presenter = useContentEntryFormPresenter();\n const { ButtonPrimary } = ContentEntryEditorConfig.Actions.ButtonAction.useButtons();\n const { canEdit, canPublish } = usePermission();\n\n if (\n !presenter.vm.canPublish ||\n (presenter.vm.status === \"unpublished\" && !presenter.vm.isDirty) ||\n (presenter.vm.entry && !canEdit(presenter.vm.entry, \"cms.contentEntry\")) ||\n !canPublish(\"cms.contentEntry\")\n ) {\n return null;\n }\n\n const saveAndPublish = async () => {\n const saved = await presenter.saveRevision({ skipValidation: false });\n
|
|
1
|
+
{"version":3,"file":"presentation/contentEntries/views/actions/SaveAndPublishButton.js","sources":["../../../../../src/presentation/contentEntries/views/actions/SaveAndPublishButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ContentEntryEditorConfig } from \"~/admin/config/contentEntries/index.js\";\nimport { usePermission } from \"~/admin/hooks/usePermission.js\";\nimport { useContentEntryFormPresenter } from \"~/presentation/contentEntries/form/useContentEntryFormPresenter.js\";\n\nexport const SaveAndPublishButton = observer(() => {\n const presenter = useContentEntryFormPresenter();\n const { ButtonPrimary } = ContentEntryEditorConfig.Actions.ButtonAction.useButtons();\n const { canEdit, canPublish } = usePermission();\n\n if (\n !presenter.vm.canPublish ||\n (presenter.vm.status === \"unpublished\" && !presenter.vm.isDirty) ||\n (presenter.vm.entry && !canEdit(presenter.vm.entry, \"cms.contentEntry\")) ||\n !canPublish(\"cms.contentEntry\")\n ) {\n return null;\n }\n\n // A workflow locks an approved entry, so there is nothing to save and it can only be published.\n const canSave = presenter.vm.canSave;\n\n const saveAndPublish = async () => {\n if (canSave) {\n const saved = await presenter.saveRevision({ skipValidation: false });\n if (!saved) {\n return;\n }\n }\n await presenter.publishRevision();\n };\n\n return (\n <ButtonPrimary\n onAction={saveAndPublish}\n disabled={presenter.vm.loading !== null}\n data-testid=\"cms-content-save-publish-content-button\"\n >\n {canSave ? \"Save & Publish\" : \"Publish\"}\n </ButtonPrimary>\n );\n});\n"],"names":["SaveAndPublishButton","observer","presenter","useContentEntryFormPresenter","ButtonPrimary","ContentEntryEditorConfig","canEdit","canPublish","usePermission","canSave","saveAndPublish","saved"],"mappings":";;;;;AAMO,MAAMA,uBAAuBC,SAAS;IACzC,MAAMC,YAAYC;IAClB,MAAM,EAAEC,aAAa,EAAE,GAAGC,yBAAyB,OAAO,CAAC,YAAY,CAAC,UAAU;IAClF,MAAM,EAAEC,OAAO,EAAEC,UAAU,EAAE,GAAGC;IAEhC,IACI,CAACN,UAAU,EAAE,CAAC,UAAU,IACvBA,AAAwB,kBAAxBA,UAAU,EAAE,CAAC,MAAM,IAAsB,CAACA,UAAU,EAAE,CAAC,OAAO,IAC9DA,UAAU,EAAE,CAAC,KAAK,IAAI,CAACI,QAAQJ,UAAU,EAAE,CAAC,KAAK,EAAE,uBACpD,CAACK,WAAW,qBAEZ,OAAO;IAIX,MAAME,UAAUP,UAAU,EAAE,CAAC,OAAO;IAEpC,MAAMQ,iBAAiB;QACnB,IAAID,SAAS;YACT,MAAME,QAAQ,MAAMT,UAAU,YAAY,CAAC;gBAAE,gBAAgB;YAAM;YACnE,IAAI,CAACS,OACD;QAER;QACA,MAAMT,UAAU,eAAe;IACnC;IAEA,OAAO,WAAP,GACI,oBAACE,eAAAA;QACG,UAAUM;QACV,UAAUR,AAAyB,SAAzBA,UAAU,EAAE,CAAC,OAAO;QAC9B,eAAY;OAEXO,UAAU,mBAAmB;AAG1C"}
|