From 637f1a7649bfc0363a8d931cfa2e2cec105de123 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Tue, 7 Oct 2025 10:11:03 +0200 Subject: [PATCH] fixed the Password field on screen. The Password Attribute is now used from the properties --- .../modules/components/ConfigEditor/StringEditor.tsx | 3 ++- .../src/modules/models/EntryUnitType.ts | 10 ++++++++++ .../src/modules/models/EntryValidation.ts | 5 +++++ .../src/modules/models/EntryValue.ts | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryUnitType.ts 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[];