impaktapps-ui-builder 0.0.101-alpha.58 → 0.0.101-alpha.60

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.101-alpha.58",
3
+ "version": "0.0.101-alpha.60",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -154,28 +154,37 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
154
154
  schema.properties.RemoveItemButton.disabled = false;
155
155
  }
156
156
 
157
- const currentConfig = JSON.parse(sessionStorage.getItem("pageFormdata"));
157
+ const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
158
158
  const path = store.searchParams?.get("path");
159
+ const id = store.searchParams?.get("id")
159
160
 
160
- const pathArrayAll = path.split(".");
161
+ let pathArray = [];
161
162
 
162
- const breadPathArray = pathArrayAll.reduce((currPath, elem, i)=>{
163
- if(i === 0){
164
- currPath = elem;
165
- }
166
- else{
167
- currPath = currPath + "." + elem
168
- }
169
- const currObj = _.get(currentConfig, currPath)
170
- console.log("currObj>>",currObj, "index>>", i)
171
- },currentConfig)
172
-
173
- // const lastDotIndex = path.lastIndexOf('.')
174
- // const currPath = path.slice(lastDotIndex+1)
163
+ if (path) {
164
+ // let urlRoutes: string = config.name;
165
+ const pathArrayAll = path.split(".");
166
+ const arr: any = []
167
+ pathArrayAll.map((e: string, i: number) => {
168
+ if (i === 0) {
169
+ arr.push(e)
170
+ return;
171
+ }
172
+ arr.push(`${arr[i - 1]}.${e}`)
173
+ })
174
+
175
+
176
+ arr.map((e) => {
177
+ const data = _.get(config, e)
178
+ pathArray.push({
179
+ label: data?.name || data?.eventType || "NewComponent",
180
+ path: `/Component?path=${e}&id=${id}`
181
+ });
182
+ })
183
+ }
175
184
 
176
- // const currObj = _.get(currentConfig, currPath)
185
+ console.log("pathArray>>",pathArray)
177
186
 
178
- // schema.properties.pageName.path.push({label: currObj?.config?.main?.label || "undefined", path: path})
187
+ schema.properties.pageName.path = pathArray
179
188
  return schema;
180
189
  },
181
190
  okHandler: () => okHandler(store),