From 05ef023752abdb4f1e072332496dc7c6eaff8965 Mon Sep 17 00:00:00 2001 From: herbert Date: Sat, 1 Feb 2020 16:00:00 +0100 Subject: SDN-R add updated odlux Updates all odlux framework and app components. Issue-ID: SDNC-1032 Signed-off-by: herbert Change-Id: I13c520489fd40d05b7fd5215f5941af6238e9cae --- .../src/models/networkElementConnection.ts | 18 ++++++ .../apps/configurationApp/src/models/uiModels.ts | 68 +++++++++++++++++++--- .../odlux/apps/configurationApp/src/models/yang.ts | 20 ++++++- 3 files changed, 98 insertions(+), 8 deletions(-) (limited to 'sdnr/wt/odlux/apps/configurationApp/src/models') diff --git a/sdnr/wt/odlux/apps/configurationApp/src/models/networkElementConnection.ts b/sdnr/wt/odlux/apps/configurationApp/src/models/networkElementConnection.ts index 2575500a3..88f70181c 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/models/networkElementConnection.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/models/networkElementConnection.ts @@ -1,3 +1,21 @@ +/** + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt odlux + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ + export type NetworkElementConnection = { id?: string; nodeId: string; diff --git a/sdnr/wt/odlux/apps/configurationApp/src/models/uiModels.ts b/sdnr/wt/odlux/apps/configurationApp/src/models/uiModels.ts index 441d1281d..7b41c3845 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/models/uiModels.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/models/uiModels.ts @@ -1,3 +1,21 @@ +/** + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt odlux + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ + export type ViewElementBase = { "id": string; "label": string; @@ -15,7 +33,7 @@ export type ViewElementBase = { // https://tools.ietf.org/html/rfc7950#section-9.8 export type ViewElementBinary = ViewElementBase & { "uiType": "binary"; - "length"?: number; // number of octets + "length"?: Expression; // number of octets } // https://tools.ietf.org/html/rfc7950#section-9.7.4 @@ -29,16 +47,17 @@ export type ViewElementBits = ViewElementBase & { // https://tools.ietf.org/html/rfc7950#section-9 export type ViewElementString = ViewElementBase & { "uiType": "string"; - "pattern"?: string[]; - "length"?: string; + "pattern"?: Expression; + "length"?: Expression; "invertMatch"?: true; } // https://tools.ietf.org/html/rfc7950#section-9.3 export type ViewElementNumber = ViewElementBase & { "uiType": "number"; - "min"?: number; - "max"?: number; + "min": number; + "max": number; + "range"?: Expression; "units"?: string; "format"?: string; "fDigits"?: number; @@ -85,6 +104,16 @@ export type ViewElementReference = ViewElementBase & { "ref": (currentPath: string) => ViewElement | null; } +export type ViewElementUnion = ViewElementBase & { + "uiType": "union"; + "elements": ViewElement[]; +} + +export type ViewElementChoise = ViewElementBase & { + "uiType": "choise"; + "cases": { [name: string]: { id: string, label: string, description?: string, elements: { [name: string]: ViewElement } } }; +} + export type ViewElement = | ViewElementBits | ViewElementBinary @@ -94,14 +123,16 @@ export type ViewElement = | ViewElementObject | ViewElementList | ViewElementSelection - | ViewElementReference; + | ViewElementReference + | ViewElementUnion + | ViewElementChoise; export const isViewElementString = (viewElement: ViewElement): viewElement is ViewElementString => { return viewElement && viewElement.uiType === "string"; } export const isViewElementNumber = (viewElement: ViewElement): viewElement is ViewElementNumber => { - return viewElement && viewElement.uiType === "number" ; + return viewElement && viewElement.uiType === "number"; } export const isViewElementBoolean = (viewElement: ViewElement): viewElement is ViewElementBoolean => { @@ -128,6 +159,15 @@ export const isViewElementReference = (viewElement: ViewElement): viewElement is return viewElement && viewElement.uiType === "reference"; } +export const isViewElementUnion = (viewElement: ViewElement): viewElement is ViewElementUnion => { + return viewElement && viewElement.uiType === "union"; +} + +export const isViewElementChoise = (viewElement: ViewElement): viewElement is ViewElementChoise => { + return viewElement && viewElement.uiType === "choise"; +} + + export type ViewSpecification = { "id": string; "name": string; @@ -140,3 +180,17 @@ export type ViewSpecification = { "elements": { [name: string]: ViewElement }; readonly "canEdit": boolean; } + +export type YangRange = { + min: number, + max: number, +} + +export type Expression = + | T + | Operator; + +export type Operator = { + operation: "AND" | "OR"; + arguments: Expression[]; +} \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/configurationApp/src/models/yang.ts b/sdnr/wt/odlux/apps/configurationApp/src/models/yang.ts index 57edf803f..11eb44d92 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/models/yang.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/models/yang.ts @@ -1,3 +1,21 @@ +/** + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt odlux + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ + import { ViewElement, ViewSpecification } from "./uiModels"; export type Token = { @@ -33,7 +51,7 @@ export type Module = { namespace?: string; prefix?: string; identities: { [name: string]: Identity }; - revisions: { [version: string]: Revision } ; + revisions: { [version: string]: Revision }; imports: { [prefix: string]: string }; features: { [feature: string]: { description?: string } }; typedefs: { [type: string]: ViewElement }; -- cgit 1.2.3-korg