From 040ec967ff4b6bdf92e7d24ec6d3ac75002a3f4b Mon Sep 17 00:00:00 2001 From: herbert Date: Fri, 6 Mar 2020 19:17:25 +0100 Subject: Fix behavior of config app behavior for list without key of config app Issue-ID: SDNC-1111 Signed-off-by: herbert Change-Id: I7984efc9d2101ff9480e8361cd34a31c61c81b79 (cherry picked from commit 10972f1312606d3184dcd1dba882cd2219878277) --- sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sdnr/wt/odlux/apps/configurationApp/src/yang') diff --git a/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts b/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts index 5322e1f6f..27859f7b6 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts @@ -650,12 +650,14 @@ export class YangParser { const lists = this.extractNodes(statement, "list"); if (lists && lists.length > 0) { subViews.push(...lists.reduce((acc, cur) => { + let elmConfig = config; if (!cur.arg) { throw new Error(`Module: [${context.name}]${currentPath}. Found list without name.`); } const key = this.extractValue(cur, "key") || undefined; - if (config && !key) { - throw new Error(`Module: [${context.name}]${currentPath}. Found configurable list without key.`); + if (elmConfig && !key) { + console.error(new Error(`Module: [${context.name}]${currentPath}. Found configurable list without key.`)); + elmConfig = false; } const [currentView, subViews] = this.extractSubViews(cur, currentId, context, `${currentPath}/${context.name}:${cur.arg}`); elements.push({ @@ -665,7 +667,7 @@ export class YangParser { uiType: "object", viewId: currentView.id, key: key, - config: config + config: elmConfig }); acc.push(currentView, ...subViews); return acc; -- cgit 1.2.3-korg