@griddo/ax 11.3.3 → 11.4.0-rc.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.4.0-rc.0",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -226,5 +226,5 @@
|
|
|
226
226
|
"publishConfig": {
|
|
227
227
|
"access": "public"
|
|
228
228
|
},
|
|
229
|
-
"gitHead": "
|
|
229
|
+
"gitHead": "43df7813b2ed2410a268df8267638e4a503958a0"
|
|
230
230
|
}
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
Tag,
|
|
19
19
|
Tooltip,
|
|
20
20
|
CategoryCell,
|
|
21
|
+
ErrorToast,
|
|
21
22
|
} from "@ax/components";
|
|
22
23
|
import { pageEditorActions } from "@ax/containers/PageEditor";
|
|
23
24
|
import { appActions } from "@ax/containers/App";
|
|
@@ -265,13 +266,14 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
265
266
|
return languages;
|
|
266
267
|
};
|
|
267
268
|
|
|
268
|
-
const handleDuplicatePage = () => {
|
|
269
|
+
const handleDuplicatePage = async () => {
|
|
269
270
|
setTemplateInstanceError({ error: false, templateName: "" });
|
|
270
271
|
if (isDuplicable) {
|
|
271
|
-
duplicatePage(page.id, modalState)
|
|
272
|
+
const isDuplicated = await duplicatePage(page.id, modalState);
|
|
273
|
+
if (isDuplicated) {
|
|
272
274
|
toggleModal();
|
|
273
275
|
setRoute("pages/editor");
|
|
274
|
-
}
|
|
276
|
+
}
|
|
275
277
|
} else {
|
|
276
278
|
toggleModal();
|
|
277
279
|
setModalState({ title: "", slug: "" });
|
|
@@ -279,12 +281,17 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
279
281
|
}
|
|
280
282
|
};
|
|
281
283
|
|
|
284
|
+
const handleCloseDuplicate = () => {
|
|
285
|
+
toggleModal();
|
|
286
|
+
setModalState({ title: "", slug: "" });
|
|
287
|
+
};
|
|
288
|
+
|
|
282
289
|
const mainModalAction = {
|
|
283
290
|
title: "Duplicate",
|
|
284
291
|
onClick: handleDuplicatePage,
|
|
285
292
|
disabled: !modalState.title.trim() || !modalState.slug.trim(),
|
|
286
293
|
};
|
|
287
|
-
const secondaryModalAction = { title: "Cancel", onClick:
|
|
294
|
+
const secondaryModalAction = { title: "Cancel", onClick: handleCloseDuplicate };
|
|
288
295
|
|
|
289
296
|
const currentLanguages = getCurrentPageLanguages();
|
|
290
297
|
|
|
@@ -571,12 +578,13 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
571
578
|
/>
|
|
572
579
|
<Modal
|
|
573
580
|
isOpen={isOpen}
|
|
574
|
-
hide={
|
|
581
|
+
hide={handleCloseDuplicate}
|
|
575
582
|
title="Duplicate page"
|
|
576
583
|
secondaryAction={secondaryModalAction}
|
|
577
584
|
mainAction={mainModalAction}
|
|
578
585
|
size="M"
|
|
579
586
|
>
|
|
587
|
+
<ErrorToast />
|
|
580
588
|
{isOpen ? (
|
|
581
589
|
<S.ModalContent>
|
|
582
590
|
<FieldsBehavior
|