[ARVADOS-WORKBENCH2] updated: 1.1.4-361-g47e97dc
Git user
git at public.curoverse.com
Mon Jul 23 08:41:26 EDT 2018
Summary of changes:
src/utils/dialog-validator.tsx | 74 ------------------------------------------
1 file changed, 74 deletions(-)
delete mode 100644 src/utils/dialog-validator.tsx
via 47e97dc4b88c85dc8599ce65c79baec6ec574ff6 (commit)
from 757caa452374ab9e46d2b80c6c4b8aa10df5cd02 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 47e97dc4b88c85dc8599ce65c79baec6ec574ff6
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Mon Jul 23 14:41:16 2018 +0200
deleted unnecessary file
Feature #13781
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --git a/src/utils/dialog-validator.tsx b/src/utils/dialog-validator.tsx
deleted file mode 100644
index 9697a86..0000000
--- a/src/utils/dialog-validator.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import * as React from 'react';
-import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
-
-type CssRules = "formInputError";
-
-const styles: StyleRulesCallback<CssRules> = theme => ({
- formInputError: {
- color: "#ff0000",
- marginLeft: "5px",
- fontSize: "11px",
- }
-});
-
-type ValidatorProps = {
- value: string,
- onChange: (isValid: boolean | string) => void;
- render: (hasError: boolean) => React.ReactElement<any>;
- isRequired: boolean;
-};
-
-interface ValidatorState {
- isPatternValid: boolean;
- isLengthValid: boolean;
-}
-
-const nameRegEx = /^[a-zA-Z0-9-_ ]+$/;
-const maxInputLength = 60;
-
-export const Validator = withStyles(styles)(
- class extends React.Component<ValidatorProps & WithStyles<CssRules>> {
- state: ValidatorState = {
- isPatternValid: true,
- isLengthValid: true
- };
-
- componentWillReceiveProps(nextProps: ValidatorProps) {
- const { value } = nextProps;
-
- if (this.props.value !== value) {
- this.setState({
- isPatternValid: value.match(nameRegEx),
- isLengthValid: value.length < maxInputLength
- }, () => this.onChange());
- }
- }
-
- onChange() {
- const { value, onChange, isRequired } = this.props;
- const { isPatternValid, isLengthValid } = this.state;
- const isValid = value && isPatternValid && isLengthValid && (isRequired || (!isRequired && value.length > 0));
-
- onChange(isValid);
- }
-
- render() {
- const { classes, isRequired, value } = this.props;
- const { isPatternValid, isLengthValid } = this.state;
-
- return (
- <span>
- {this.props.render(!(isPatternValid && isLengthValid) && (isRequired || (!isRequired && value.length > 0)))}
- {!isPatternValid && (isRequired || (!isRequired && value.length > 0)) ?
- <span className={classes.formInputError}>This field allow only alphanumeric characters, dashes, spaces and underscores.<br/></span> : null}
- {!isLengthValid ?
- <span className={classes.formInputError}>This field should have max 60 characters.</span> : null}
- </span>
- );
- }
- }
-);
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list