Skip to content

Commit 773a73c

Browse files
Merge pull request #45 from PHOENIXCONTACT/fix/PasswordField
fixed the Password field on screen.
2 parents 97cbd8d + 637f1a7 commit 773a73c

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

src/Moryx.Runtime.Maintenance.Web.UI/src/modules/components/ConfigEditor/StringEditor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import * as React from "react";
77
import { Input } from "reactstrap";
8+
import { EntryUnitType } from "../../models/EntryUnitType";
89
import { InputEditorBasePropModel } from "./InputEditorBase";
910
import SelectionEditorBase from "./SelectionEditorBase";
1011

@@ -14,7 +15,7 @@ export default class StringEditor extends SelectionEditorBase {
1415
}
1516

1617
private preRenderInput(): React.ReactNode {
17-
return (<Input type={this.props.Entry.Validation.IsPassword ? "password" : "text"}
18+
return (<Input type={this.props.Entry.Value.UnitType === EntryUnitType.Password ? "password" : "text"}
1819
onChange={(e: React.FormEvent<HTMLInputElement>) => this.onValueChange(e, this.props.Entry)}
1920
placeholder={"Please enter a string ..."}
2021
disabled={this.props.Entry.Value.IsReadOnly || this.props.IsReadOnly}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (c) 2020, Phoenix Contact GmbH & Co. KG
3+
* Licensed under the Apache License, Version 2.0
4+
*/
5+
export enum EntryUnitType {
6+
None,
7+
Password,
8+
File,
9+
Directory
10+
}

src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryValidation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
* Copyright (c) 2020, Phoenix Contact GmbH & Co. KG
33
* Licensed under the Apache License, Version 2.0
44
*/
5+
import { EntryUnitType } from "./EntryUnitType";
56

67
export default class EntryValidation {
78
public Minimum: number;
89
public Maximum: number;
910
public Regex: string;
1011
public IsRequired: boolean;
1112
public IsPassword: boolean;
13+
14+
public static IsItPassword(UntiType: EntryUnitType): boolean {
15+
return UntiType === EntryUnitType.Password;
16+
}
1217
}

src/Moryx.Runtime.Maintenance.Web.UI/src/modules/models/EntryValue.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
* Licensed under the Apache License, Version 2.0
44
*/
55

6+
import { EntryUnitType } from "./EntryUnitType";
67
import { EntryValueType } from "./EntryValueType";
78

89
export default class EntryValue {
910
public Type: EntryValueType;
11+
public UnitType: EntryUnitType;
1012
public Current: string;
1113
public Default: string;
1214
public Possible: string[];

0 commit comments

Comments
 (0)