aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorProjit Roy <projitr@aarnanetworks.com>2022-11-05 03:58:28 +0530
committerDan Timoney <dtimoney@att.com>2022-11-12 20:36:57 +0000
commitb766452d12ce382b699bffe37aebe840276f5735 (patch)
tree6ea75b26a3ad7ee828f25479af9dd9ede5b59308
parent2e9b8d54ea0db08912ce58eb400936df09cfe8b0 (diff)
SDNR UI module not showing under some parent module issue fix
Issue-ID: CCSDK-3788 Signed-off-by: Projit Roy <projitr@aarnanetworks.com> Change-Id: I350a6341687a756ba0faa33e3848316826a1ff1b
-rw-r--r--sdnr/wt/odlux/apps/configurationApp/src/models/yang.ts1
-rw-r--r--sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts17
2 files changed, 17 insertions, 1 deletions
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/models/yang.ts b/sdnr/wt/odlux/apps/configurationApp/src/models/yang.ts
index 10f538c2e..79704ae34 100644
--- a/sdnr/wt/odlux/apps/configurationApp/src/models/yang.ts
+++ b/sdnr/wt/odlux/apps/configurationApp/src/models/yang.ts
@@ -67,4 +67,5 @@ export type Module = {
groupings: { [group: string]: ViewSpecification };
views: { [view: string]: ViewSpecification };
elements: { [view: string]: ViewElement };
+ executionOrder?: number;
} \ No newline at end of file
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts b/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts
index 965935a5c..ee874c80a 100644
--- a/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts
+++ b/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts
@@ -467,8 +467,23 @@ export class YangParser {
}
});
+ /**
+ * This is to fix the issue for sequential execution of modules based on their child and parent relationship
+ * We are sorting the module object based on their augment status
+ */
+ Object.keys(this.modules)
+ .map(elem => {
+ if(this.modules[elem].augments && Object.keys(this.modules[elem].augments).length > 0) {
+ const {augments, ...rest} = this.modules[elem];
+ const partsOfKeys = Object.keys(augments).map((key) => (key.split("/").length - 1))
+ this.modules[elem].executionOrder= Math.max(...partsOfKeys)
+ } else {
+ this.modules[elem].executionOrder=0;
+ }
+ })
+
// process all augmentations / sort by namespace changes to ensure proper order
- Object.keys(this.modules).forEach(modKey => {
+ Object.keys(this.modules).sort((a, b) => this.modules[a].executionOrder! - this.modules[b].executionOrder!).forEach(modKey => {
const module = this.modules[modKey];
const augmentKeysWithCounter = Object.keys(module.augments).map((key) => {
const pathParts = splitVPath(key, /(?:(?:([^\/\:]+):)?([^\/]+))/g); // 1 = opt: namespace / 2 = property