Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBW-97 Add 'required' option for string inputs #227

Merged
merged 1 commit into from
Jan 17, 2019
Merged

Conversation

TimAle
Copy link
Member

@TimAle TimAle commented Jan 17, 2019

  • Use nullable: false in select/select_table for the same purposes

@TimAle TimAle force-pushed the HBW-97 branch 2 times, most recently from f97a5c7 to 5f6a8f9 Compare January 17, 2019 08:46
@sugarfree1 sugarfree1 self-requested a review January 17, 2019 11:52
@sugarfree1 sugarfree1 self-assigned this Jan 17, 2019
},

isValid () {
return this.props.params.nullable ? true : this.isFilled();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return this.props.params.nullable || this.isFilled();

},

isValid () {
return this.props.params.nullable ? true : this.isFilled();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.props.params.nullable || this.isFilled();

@@ -185,11 +192,26 @@ modulejs.define('HBWFormString', ['React', 'jQuery'], (React, jQuery) => {
},

isValid () {
return (this.state.value || '').search(new RegExp(this.props.params.regex)) >= 0;
const requiredOK = this.props.params.required ? this.isFilled() : true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!this.props.params.required || this.isFilled()

@@ -185,11 +192,26 @@ modulejs.define('HBWFormString', ['React', 'jQuery'], (React, jQuery) => {
},

isValid () {
return (this.state.value || '').search(new RegExp(this.props.params.regex)) >= 0;
const requiredOK = this.props.params.required ? this.isFilled() : true;
const regexOK = this.props.params.regex ? this.regexMatched() : true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you know...

* Use `nullable: false` in select/select_table for the same purposes
@hydra-billing-robot hydra-billing-robot merged commit de21556 into master Jan 17, 2019
@hydra-billing-robot hydra-billing-robot deleted the HBW-97 branch January 17, 2019 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants