diff options
author | Projit Roy <projitr@aarnanetworks.com> | 2022-11-10 02:55:17 +0530 |
---|---|---|
committer | Projit Roy <projitr@aarnanetworks.com> | 2022-11-21 19:02:53 +0000 |
commit | d7a30e99b9e5d9a8ec4679955b1d278d81c0e112 (patch) | |
tree | 41f4e46130abd9bc44cf7ecccb89f205e764d17d /sdnr/wt/odlux/apps/configurationApp/src/views | |
parent | 9b0742cc4b23a75492b76f9bfd7615e054014aef (diff) |
SDNR UI don't process list which has more than one key
Issue-ID: CCSDK-3799
Signed-off-by: Projit Roy <projitr@aarnanetworks.com>
Change-Id: I79a0a028b0ff7b31740e3b83012b77e97843c806
Diffstat (limited to 'sdnr/wt/odlux/apps/configurationApp/src/views')
-rw-r--r-- | sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx b/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx index 12815a517..0e2ddb395 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx @@ -628,8 +628,15 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp e.stopPropagation(); e.preventDefault(); confirm({ title: "Do you really want to delete this element ?", description: "This action is permanent!", confirmationButtonProps: { color: "secondary" }, cancellationButtonProps: { color:"inherit" } }) - .then(() => removeElement(`${this.props.vPath}[${props.rowData[listKeyProperty]}]`)) - .then(props.onReload); + .then(() => { + let keyId = ""; + if (listKeyProperty && listKeyProperty.split(" ").length > 1) { + keyId += listKeyProperty.split(" ").map(id => props.rowData[id]).join(","); + } else { + keyId = props.rowData[listKeyProperty]; + } + return removeElement(`${this.props.vPath}[${keyId}]`) + }).then(props.onReload); }} size="large"> <RemoveIcon /> @@ -667,7 +674,13 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp }]) } onHandleClick={(ev, row) => { ev.preventDefault(); - listKeyProperty && navigate(`[${encodeURIComponent(row[listKeyProperty])}]`); // Do not navigate without key. + let keyId = "" + if (listKeyProperty && listKeyProperty.split(" ").length > 1) { + keyId += listKeyProperty.split(" ").map(id => row[id]).join(","); + } else { + keyId = row[listKeyProperty]; + } + listKeyProperty && navigate(`[${encodeURIComponent(keyId)}]`); // Do not navigate without key. }} ></SelectElementTable> ); } @@ -776,7 +789,7 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp onClick={(ev: React.MouseEvent<HTMLElement>) => { ev.preventDefault(); this.props.history.push(keyPath); - }}>{`[${key}]`}</Link> || null + }}>{`[${key && key.replace(/\%2C/g, ",")}]`}</Link> || null } </span> ); |