impaktapps-ui-builder 0.0.963-copyElement.1019 → 0.0.963-copyElement.1021

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.1019",
3
+ "version": "0.0.963-copyElement.1021",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -185,9 +185,10 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
185
185
 
186
186
  // Paste_Event // Paste_Component //Copy_Event //Copy_Component
187
187
  // elements.0.Copy_Component
188
- const path = dynamicData.path.split('.')[2];
189
- const actionType = path.split('_')[0];
190
- const elementType = path.split('_')[1];
188
+ // Paste_Component.Paste_Component
189
+ const path = dynamicData.path.split('.').pop();
190
+ const actionType = path?.split('_')[0];
191
+ const elementType = path?.split('_')[1];
191
192
 
192
193
  if(actionType === "Copy"){
193
194
  this.CopyElement(paramStore, elementType);
@@ -198,7 +199,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
198
199
 
199
200
 
200
201
  elementPathHandler: function(parentPath: string, rowId, elementType: string){
201
- if(elementType === "component"){
202
+ if(elementType === "Component"){
202
203
  return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
203
204
  }
204
205
  return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
@@ -215,7 +216,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
215
216
  const copiedElementPath = this.elementPathHandler(parentPathOfCopiedComponent, rowId, elementType);
216
217
 
217
218
  const formData = getFormdataFromSessionStorage(copiedElementPath);
218
- const elementHeading = elementType === "component" ? `Copied Element: ${formData.name}` : `Copied Event: ${formData.eventType} `;
219
+ const elementHeading = elementType === "Component" ? `Copied Element: ${formData.name}` : `Copied Event: ${formData.eventType} `;
219
220
  uiSchema.elements[2].elements[1].config.main.heading = elementHeading;
220
221
  sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
221
222
  store.setSchema(schema);