diff options
author | 2022-11-30 19:58:16 +0000 | |
---|---|---|
committer | 2022-11-30 19:58:16 +0000 | |
commit | 5e74a6239015385876ff347f85eaac3240c7b845 (patch) | |
tree | a04d738f97222cced0ed659ee586466259194fcf /sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts | |
parent | afb0ef315e3bae380f474cd8605c7c0afa8ba5a0 (diff) | |
parent | d7a30e99b9e5d9a8ec4679955b1d278d81c0e112 (diff) |
Merge "SDNR UI don't process list which has more than one key"
Diffstat (limited to 'sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts')
-rw-r--r-- | sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts b/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts index 2846dba06..37583787f 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts @@ -374,11 +374,12 @@ export const updateViewActionAsyncCreator = (vPath: string) => async (dispatch: } extractList = true; } else { - // normal case - dataPath += `/${property}${key ? `=${key.replace(/\//ig, "%2F")}` : ""}`; - + // normal case // in case of the root element the required namespace will be added later, // while extracting the data + + dataPath += `/${property}${key ? `=${key.replace(/\%2C/g, ",").replace(/\//ig, "%2F")}` : ""}`; + dataMember = namespace === defaultNS ? viewElement.label : `${namespace}:${viewElement.label}`; @@ -518,8 +519,10 @@ export const updateDataActionAsyncCreator = (vPath: string, data: any) => async dispatch(new SetCollectingSelectionData(false)); throw new Error("No key for list [" + property + "]"); } else if (vPath.endsWith("[]") && pathParts.length - 1 === ind) { - // handle new element - key = viewElement.key && String(data[viewElement.key]) || ""; + // handle new element with any number of arguments + let keyList = viewElement.key?.split(" "); + let dataPathParam = keyList?.map(id => data[id]).join(","); + key = viewElement.key && String(dataPathParam) || ""; isNew = key; if (!key) { dispatch(new SetCollectingSelectionData(false)); |