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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.963-copyElement.1008",
3
+ "version": "0.0.963-copyElement.1010",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -212,22 +212,29 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
212
212
  // const schema = cloneDeep(store.schema);
213
213
 
214
214
  const path = store.searchParams?.get("path");
215
+ const rowId = dynamicData.path.split(".")[1];
216
+
215
217
  const formData = getFormdataFromSessionStorage(path)
216
218
  const insertComponentPath = formData.elements.length;
217
- const finalPath = `${path}.elements[${insertComponentPath}]`;
219
+ // const finalPath = `${path}.elements[${insertComponentPath}]`;
220
+
221
+ const finalPath = path ? `${path}.elements[${insertComponentPath}]` : `elements[${insertComponentPath}]`;
222
+
223
+
224
+
225
+
218
226
  const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
219
- // if(!copiedData.type){
220
- // store.setNotify({
221
- // FailMessage: "Pasting element not Valid",
222
- // Fail: true,
223
- // });
224
- // }
225
- // else{
227
+ if(copiedData.Handler){
228
+ store.setNotify({
229
+ FailMessage: "Pasting element not Valid",
230
+ Fail: true,
231
+ });
232
+ }
233
+ else{
226
234
  saveFormdataInSessionStorage(copiedData, finalPath);
227
- sessionStorage.removeItem('copiedConfig');
228
-
235
+ // sessionStorage.removeItem('copiedConfig');
229
236
  setPage();
230
- // }
237
+ }
231
238
  },
232
239
 
233
240
  RemoveItemButton: function(paramStore = store){
@@ -235,6 +242,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
235
242
  const uiSchema = cloneDeep(paramStore.uiSchema);
236
243
  schema.properties.RemoveItemButton.disabled = true;
237
244
  // schema.properties.Paste_Icon.disabled = true;
245
+ sessionStorage.removeItem('copiedConfig');
238
246
 
239
247
  store.setSchema(schema);
240
248
  store.setUiSchema(uiSchema);