impaktapps-ui-builder 0.0.963-copyElement.1018 → 0.0.963-copyElement.1020
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.
|
@@ -8441,7 +8441,7 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
8441
8441
|
}
|
|
8442
8442
|
},
|
|
8443
8443
|
elementPathHandler: function(parentPath, rowId, elementType) {
|
|
8444
|
-
if (elementType === "
|
|
8444
|
+
if (elementType === "Component") {
|
|
8445
8445
|
return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
|
|
8446
8446
|
}
|
|
8447
8447
|
return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
|
|
@@ -8455,7 +8455,7 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
8455
8455
|
const parentPathOfCopiedComponent = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
8456
8456
|
const copiedElementPath = this.elementPathHandler(parentPathOfCopiedComponent, rowId, elementType);
|
|
8457
8457
|
const formData = getFormdataFromSessionStorage(copiedElementPath);
|
|
8458
|
-
const elementHeading = elementType === "
|
|
8458
|
+
const elementHeading = elementType === "Component" ? `Copied Element: ${formData.name}` : `Copied Event: ${formData.eventType} `;
|
|
8459
8459
|
uiSchema.elements[2].elements[1].config.main.heading = elementHeading;
|
|
8460
8460
|
sessionStorage.setItem("copiedConfig", JSON.stringify(formData));
|
|
8461
8461
|
store2.setSchema(schema2);
|
|
@@ -8472,15 +8472,15 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
8472
8472
|
}
|
|
8473
8473
|
const pastedElementParentPath = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
8474
8474
|
const formData = getFormdataFromSessionStorage(pastedElementParentPath);
|
|
8475
|
-
const insertElementIndex = elementType === "
|
|
8475
|
+
const insertElementIndex = elementType === "Component" ? formData.elements.length : formData.events.length;
|
|
8476
8476
|
const pastedElementPath = this.elementPathHandler(pastedElementParentPath, insertElementIndex, elementType);
|
|
8477
8477
|
const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
|
|
8478
|
-
if (copiedConfig.Handler && elementType === "
|
|
8478
|
+
if (copiedConfig.Handler && elementType === "Component") {
|
|
8479
8479
|
store2.setNotify({
|
|
8480
8480
|
FailMessage: "The pasted content is invalid; the event cannot be integrated into the component section.",
|
|
8481
8481
|
Fail: true
|
|
8482
8482
|
});
|
|
8483
|
-
} else if (copiedConfig.elements && elementType === "
|
|
8483
|
+
} else if (copiedConfig.elements && elementType === "Event") {
|
|
8484
8484
|
store2.setNotify({
|
|
8485
8485
|
FailMessage: "The pasted content is invalid; the component cannot be integrated into the event section.",
|
|
8486
8486
|
Fail: true
|