From 4bd84bebdaa0c2d82050fbedd1fa8260eb62146d Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Thu, 27 Aug 2020 09:01:53 +0200 Subject: Add link calculation app Add link calculation app to odlux Issue-ID: CCSDK-2562 Signed-off-by: Aijana Schumann Change-Id: Ifc0a5b2a8bb974dfd85d70a9f05990b1f11925a3 Signed-off-by: Aijana Schumann --- .../src/components/uiElementBoolean.tsx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'sdnr/wt/odlux/apps/configurationApp/src/components/uiElementBoolean.tsx') diff --git a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementBoolean.tsx b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementBoolean.tsx index cc141ee35..2fbbf956f 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementBoolean.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementBoolean.tsx @@ -16,29 +16,28 @@ * ============LICENSE_END========================================================================== */ -import { ViewElementBoolean } from "../models/uiModels"; import * as React from "react" import { MenuItem, FormHelperText, Select, FormControl, InputLabel } from "@material-ui/core"; -import { baseProps } from "./baseProps"; -type booleanInputProps = baseProps; +import { ViewElementBoolean } from "../models/uiModels"; +import { BaseProps } from "./baseProps"; + +type BooleanInputProps = BaseProps; -export const UiElementBoolean = (props: booleanInputProps) => { +export const UiElementBoolean = (props: BooleanInputProps) => { const element = props.value as ViewElementBoolean; - let error = ""; const value = String(props.inputValue).toLowerCase(); - if (element.mandatory && value !== "true" && value !== "false") { - error = "Error"; - } + const mandetoryError = element.mandatory && value !== 'true' && value !== 'false'; + return (!props.readOnly || element.id != null ? ( {element.label} - {error} + {mandetoryError ? "Value is mandetory" : ""} ) : null ); -- cgit 1.2.3-korg