aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/configurationApp/src/yang
diff options
context:
space:
mode:
authorMichael DÜrre <michael.duerre@highstreet-technologies.com>2021-04-08 07:27:18 +0200
committerMichael DÜrre <michael.duerre@highstreet-technologies.com>2021-04-08 07:27:28 +0200
commit21e4a946cd24b8a03ea577352f0271ebf7669ffa (patch)
tree4227d8566770b75c2c25b67c764038288cacfe3d /sdnr/wt/odlux/apps/configurationApp/src/yang
parenta252be83694ae33260d99d5371ed48c1558aa2e8 (diff)
update odlux for notification change
update due new notification protocol Issue-ID: CCSDK-3253 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com> Change-Id: Iad65459fdc18603cd1ddbd97bb2211308744bd8b
Diffstat (limited to 'sdnr/wt/odlux/apps/configurationApp/src/yang')
-rw-r--r--sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts30
1 files changed, 27 insertions, 3 deletions
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts b/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts
index c5cb8fb4c..2d38976d5 100644
--- a/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts
+++ b/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts
@@ -278,6 +278,7 @@ export class YangParser {
name: "root",
language: "en-US",
canEdit: false,
+ config: true,
parentView: "0",
title: "root",
elements: {},
@@ -544,6 +545,28 @@ export class YangParser {
console.warn(error.message);
}
});
+
+ // resolve readOnly
+ const resolveReadOnly = (view: ViewSpecification, parentConfig: boolean) => {
+
+ // update view config
+ view.config = view.config && parentConfig;
+
+ Object.keys(view.elements).forEach((key) => {
+ const elm = view.elements[key];
+
+ // update element config
+ elm.config = elm.config && view.config;
+
+ // update all sub-elements of objects
+ if (elm.uiType === "object") {
+ resolveReadOnly(this.views[+elm.viewId], elm.config);
+ }
+
+ })
+ }
+
+ const dump = resolveReadOnly(this.views[0], true);
};
private _nextId = 1;
@@ -686,7 +709,7 @@ export class YangParser {
module: context.name || module.name || '',
uiType: "object",
viewId: currentView.id,
- config: config
+ config: currentView.config,
});
acc.push(currentView, ...subViews);
return acc;
@@ -717,7 +740,7 @@ export class YangParser {
uiType: "object",
viewId: currentView.id,
key: key,
- config: elmConfig
+ config: elmConfig && currentView.config,
});
acc.push(currentView, ...subViews);
return acc;
@@ -876,6 +899,7 @@ export class YangParser {
title: statement.arg != null ? statement.arg : undefined,
language: "en-us",
canEdit: false,
+ config: config,
ifFeature: ifFeature,
when: whenCondition,
elements: elements.reduce<{ [name: string]: ViewElement }>((acc, cur) => {
@@ -921,7 +945,7 @@ export class YangParser {
const elm = groupingViewSpec.elements[key];
// a useRef on root level need a namespace
viewSpec.elements[parentId === 0 ? `${module.name}:${key}` : key] = {
- ...groupingViewSpec.elements[key],
+ ...elm,
when: elm.when ? `(${groupingViewSpec.when}) and (${elm.when})` : groupingViewSpec.when,
ifFeature: elm.ifFeature ? `(${groupingViewSpec.ifFeature}) and (${elm.ifFeature})` : groupingViewSpec.ifFeature,
};