-
Notifications
You must be signed in to change notification settings - Fork 62
fix(inlineinput): float value validation for user input #2816
fix(inlineinput): float value validation for user input #2816
Conversation
Ike Plugins (test-keeper)Thank you @abhinandan13jan for this contribution! It seems that this PR already contains some added or changed tests. Good job! Your plugin configuration is stored in the file. |
Hey @abhinandan13jan! It seems you tried to trigger |
@abhinandan13jan Your image is available in the registry. Run |
Added test cases |
@abhinandan13jan please add a reference to the issue that you are fixing. |
[test] |
@abhinandan13jan Your image is available in the registry. Run |
@abhinandan13jan please use "semantic release" syntax for the git commit messages. You can find it in the README.(or google it) |
@abhinandan13jan Your image is available in the registry. Run |
@abhinandan13jan Your image is available in the registry. Run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I press enter or click the blue check button with an invalid value in textarea
, focus is lost from the input.
validateValue(value) { | ||
if (this.type === 'integer') { | ||
return /^\d+$/.test(value); | ||
} | ||
if (this.type === 'float') { | ||
return /^-?\d*(\.\d+)?$/.test(value); | ||
return this.isFloat(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abhinandan13jan This method is still failing because value
is of type string
. value
needs to be parsed first for this to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sahil143 I was trying not to alter any preexisting functionalities. Now, I've added a .focus() method for the validation failure case. Can you please check again if it looks ok now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshuawilson I've updated using sematic release format
[test] |
Looks good to me. Thanks, @abhinandan13jan. |
@abhinandan13jan Your image is available in the registry. Run |
@abhinandan13jan Your image is available in the registry. Run |
Note: If there are pending changes to the PR, prefix the PR title with "WIP" and add the label "DO NOT MERGE"
Mandatory
Validate float type input field value
Fixes #4047
[2] Effort field populates incorrect value openshiftio/openshift.io#4047
test case included
Optional
Is the documentation Included?
Are the Release Notes included?