summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/configurationApp/src
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/odlux/apps/configurationApp/src')
-rw-r--r--sdnr/wt/odlux/apps/configurationApp/src/components/uiElementNumber.tsx4
-rw-r--r--sdnr/wt/odlux/apps/configurationApp/src/components/uiElementSelection.tsx6
-rw-r--r--sdnr/wt/odlux/apps/configurationApp/src/models/yang.ts1
-rw-r--r--sdnr/wt/odlux/apps/configurationApp/src/yang/yangParser.ts17
4 files changed, 22 insertions, 6 deletions
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementNumber.tsx b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementNumber.tsx
index c4816686a..76c11f6e5 100644
--- a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementNumber.tsx
+++ b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementNumber.tsx
@@ -23,7 +23,7 @@ import { BaseProps } from "./baseProps";
import { IfWhenTextInput } from "./ifWhenTextInput";
import { checkRange } from "./verifyer";
-type numberInputProps = BaseProps<number>;
+type numberInputProps = BaseProps<any>;
export const UiElementNumber = (props: numberInputProps) => {
@@ -49,7 +49,7 @@ export const UiElementNumber = (props: numberInputProps) => {
setError(true);
setHelperText("Input is not a number.");
}
- props.onChange(num);
+ props.onChange(data);
}
return (
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementSelection.tsx b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementSelection.tsx
index 7ca9ae36b..fdf803419 100644
--- a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementSelection.tsx
+++ b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementSelection.tsx
@@ -28,8 +28,8 @@ export const UiElementSelection = (props: selectionProps) => {
const element = props.value as ViewElementSelection;
let error = "";
- const value = String(props.inputValue).toLowerCase();
- if (element.mandatory && !!value) {
+ const value = String(props.inputValue);
+ if (element.mandatory && Boolean(!value)) {
error = "Error";
}
@@ -42,7 +42,7 @@ export const UiElementSelection = (props: selectionProps) => {
onChange={(e) => { props.onChange(e.target.value as string) }}
readOnly={props.readOnly}
disabled={props.disabled}
- value={value.toString().toLowerCase()}
+ value={value.toString()}
aria-label={element.label+'-selection'}
inputProps={{
name: element.id,
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 74e346e86..e8e636f9b 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