From b113552f312a87d933e17c1ffaca4fbd4707e94e Mon Sep 17 00:00:00 2001 From: Pawel Kowalczyk Date: Tue, 17 Jul 2018 11:28:22 +0200 Subject: [PATCH] duplicatedName flag renamed on isUniqName Feature #13781 Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk --- src/utils/dialog-validator.tsx | 6 +++--- .../dialog-create/dialog-project-create.tsx | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/utils/dialog-validator.tsx b/src/utils/dialog-validator.tsx index 848acec1b1..b264f963d0 100644 --- a/src/utils/dialog-validator.tsx +++ b/src/utils/dialog-validator.tsx @@ -10,7 +10,7 @@ type ValidatorProps = { onChange: (isValid: boolean | string) => void; render: (hasError: boolean) => React.ReactElement; isRequired: boolean; - duplicatedName?: string; + isUniqName?: boolean; }; interface ValidatorState { @@ -41,14 +41,14 @@ class Validator extends React.Component> { } render() { - const { classes, isRequired, value, duplicatedName } = this.props; + const { classes, isRequired, value, isUniqName } = this.props; const { isLengthValid } = this.state; return ( {this.props.render(!isLengthValid && (isRequired || (!isRequired && value.length > 0)))} {!isLengthValid ? This field should have max 255 characters. : null} - {duplicatedName ? Project with this name already exists : null} + {isUniqName ? Project with this name already exists : null} ); } diff --git a/src/views-components/dialog-create/dialog-project-create.tsx b/src/views-components/dialog-create/dialog-project-create.tsx index efaa02e84b..0388e05bb8 100644 --- a/src/views-components/dialog-create/dialog-project-create.tsx +++ b/src/views-components/dialog-create/dialog-project-create.tsx @@ -25,7 +25,7 @@ interface DialogState { description: string; isNameValid: boolean; isDescriptionValid: boolean; - duplicatedName: string; + isUniqName: boolean; } class DialogProjectCreate extends React.Component> { @@ -34,19 +34,19 @@ class DialogProjectCreate extends React.Component this.isNameValid(e)} isRequired={true} - duplicatedName={duplicatedName} + isUniqName={isUniqName} render={hasError => this.handleProjectName(e)} label="Project name" - error={hasError || !!duplicatedName} + error={hasError || isUniqName} fullWidth />} />