Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -14,7 +15,7 @@ export default class StringEditor extends SelectionEditorBase {
}

private preRenderInput(): React.ReactNode {
return (<Input type={this.props.Entry.Validation.IsPassword ? "password" : "text"}
return (<Input type={this.props.Entry.Value.UnitType === EntryUnitType.Password ? "password" : "text"}
onChange={(e: React.FormEvent<HTMLInputElement>) => this.onValueChange(e, this.props.Entry)}
placeholder={"Please enter a string ..."}
disabled={this.props.Entry.Value.IsReadOnly || this.props.IsReadOnly}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
* 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;
public Maximum: number;
public Regex: string;
public IsRequired: boolean;
public IsPassword: boolean;

public static IsItPassword(UntiType: EntryUnitType): boolean {
return UntiType === EntryUnitType.Password;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
Loading