impaktapps-ui-builder 0.0.963-copyElement.1008 → 0.0.963-copyElement.1010

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.
@@ -8450,18 +8450,26 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
8450
8450
  PasteComponent: function(paramStore = store2, setPage = this.setPage) {
8451
8451
  var _a;
8452
8452
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
8453
+ dynamicData2.path.split(".")[1];
8453
8454
  const formData = getFormdataFromSessionStorage(path);
8454
8455
  const insertComponentPath = formData.elements.length;
8455
- const finalPath = `${path}.elements[${insertComponentPath}]`;
8456
+ const finalPath = path ? `${path}.elements[${insertComponentPath}]` : `elements[${insertComponentPath}]`;
8456
8457
  const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
8457
- saveFormdataInSessionStorage(copiedData, finalPath);
8458
- sessionStorage.removeItem("copiedConfig");
8459
- setPage();
8458
+ if (copiedData.Handler) {
8459
+ store2.setNotify({
8460
+ FailMessage: "Pasting element not Valid",
8461
+ Fail: true
8462
+ });
8463
+ } else {
8464
+ saveFormdataInSessionStorage(copiedData, finalPath);
8465
+ setPage();
8466
+ }
8460
8467
  },
8461
8468
  RemoveItemButton: function(paramStore = store2) {
8462
8469
  const schema2 = lodash.exports.cloneDeep(paramStore.schema);
8463
8470
  const uiSchema = lodash.exports.cloneDeep(paramStore.uiSchema);
8464
8471
  schema2.properties.RemoveItemButton.disabled = true;
8472
+ sessionStorage.removeItem("copiedConfig");
8465
8473
  store2.setSchema(schema2);
8466
8474
  store2.setUiSchema(uiSchema);
8467
8475
  },