diff --git a/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/components/ConfigEditor/StringEditor.tsx b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/components/ConfigEditor/StringEditor.tsx index 9f21f77..e48038d 100644 --- a/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/components/ConfigEditor/StringEditor.tsx +++ b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/components/ConfigEditor/StringEditor.tsx @@ -5,6 +5,7 @@ import * as React from "react"; import { Input } from "reactstrap"; +import { EntryUnitType } from "../../models/EntryUnitType"; import { InputEditorBasePropModel } from "./InputEditorBase"; import SelectionEditorBase from "./SelectionEditorBase"; @@ -14,7 +15,7 @@ export default class StringEditor extends SelectionEditorBase { } private preRenderInput(): React.ReactNode { - return () => this.onValueChange(e, this.props.Entry)} placeholder={"Please enter a string ..."} disabled={this.props.Entry.Value.IsReadOnly || this.props.IsReadOnly} diff --git a/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryUnitType.ts b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryUnitType.ts new file mode 100644 index 0000000..555634b --- /dev/null +++ b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryUnitType.ts @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2020, Phoenix Contact GmbH & Co. KG + * Licensed under the Apache License, Version 2.0 +*/ +export enum EntryUnitType { + None, + Password, + File, + Directory +} diff --git a/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryValidation.ts b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryValidation.ts index 1379e9e..6913e11 100644 --- a/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryValidation.ts +++ b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryValidation.ts @@ -2,6 +2,7 @@ * Copyright (c) 2020, Phoenix Contact GmbH & Co. KG * Licensed under the Apache License, Version 2.0 */ +import { EntryUnitType } from "./EntryUnitType"; export default class EntryValidation { public Minimum: number; @@ -9,4 +10,8 @@ export default class EntryValidation { public Regex: string; public IsRequired: boolean; public IsPassword: boolean; + + public static IsItPassword(UntiType: EntryUnitType): boolean { + return UntiType === EntryUnitType.Password; + } } diff --git a/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryValue.ts b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryValue.ts index 0a3571a..5529e62 100644 --- a/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryValue.ts +++ b/src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryValue.ts @@ -3,10 +3,12 @@ * Licensed under the Apache License, Version 2.0 */ +import { EntryUnitType } from "./EntryUnitType"; import { EntryValueType } from "./EntryValueType"; export default class EntryValue { public Type: EntryValueType; + public UnitType: EntryUnitType; public Current: string; public Default: string; public Possible: string[];