-
Notifications
You must be signed in to change notification settings - Fork 6
Jhork/clear modifier field bug fix #168
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
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #168 +/- ##
===========================================
+ Coverage 94.44% 94.64% +0.19%
===========================================
Files 64 64
Lines 2519 2519
Branches 647 646 -1
===========================================
+ Hits 2379 2384 +5
+ Misses 138 133 -5
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
jgellin-sf
left a comment
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.
👍
|
I attempted to QA and there is a problem. The field value is tied to the condition model. When there is a validation problem the component is re-rendered to show the error, but the condition is not set. So on re-render the field is read from the condition (knock knock; nobody home) and the field input is reset. Here's a video: Screen.Recording.2021-02-04.at.10.14.42.AM.movI think we need to decouple the custom select display value for the field from the condition model. I'll give that a whorl this morning. |
|
I fixed the issue I described with the Screen.Recording.2021-02-04.at.10.36.03.AM.movI think we need to explicitly clear the display values on X click. Back to work. |
|
Ok one more commit |
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.
How do we feel about testing to cover these sort of cases? I think we have the individual parts, clear modifiers, render errors, etc, each with a happy path. Do we want something that combines these conditions? Reset with and without errors.
I'm not sure if the issues we found here should have been caught by tests?
| return field !== this.getFieldName(); | ||
| }); | ||
| return this._currentFieldSelection ? [this._currentFieldSelection] : []; | ||
| } |
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.
This is dead code, I forgot to remove this when we switched to the custom select
|
One more thing: If there was no condition in the model, such as when the user is filling out the first modifier group and makes a field selection but then tries to clear it, Screen.Recording.2021-02-04.at.9.22.25.AM.mov |
| set selectedOptions(selectedOptions: string[]) { | ||
| this._selectedOptions = selectedOptions || []; | ||
| if (selectedOptions && selectedOptions.length) { | ||
| if (selectedOptions) { |
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.
Now that the length is removed, this can be simplified to.
set selectedOptions(selectedOptions: string[]) {
this._selectedOptions = this._value = selectedOptions || [];
}
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.
cool, fixed in the simplify syntax commit.
|
I don't see any tests that actually click the clear modifier group |
| }); | ||
|
|
||
| it.skip('updates inputs when condition model changes', () => { | ||
| it('clears all the values when the X is clicked', () => { |
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.
Do you think it is worth having a similar test but when there is an error state, like in
set error class on invalid operator input
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.
Yes, i'm adding that now. It looks like the error state needs to be cleared as well in this case.
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.
That'll be in a separate PR. QAing this now.
* Jhork: Support for Simple WHERE Expressions (#101) * move rule to css common (#108) * Preventing webview re-rendering when soql statement has not changed (#105) * Revert "Disable WHERE in model (#113)" * Type-aware where (#109) * Fix preview not updating when autosave is off - issue 120 (#125) * Recognize recoverable where errors (#116) * Operator and Criteria Error Tooltips (#122) * Support IN, NOT IN, INCLUDES, EXCLUDE operators (#123) * Add smarter completin on GROUP BY clause and WHERE literals (#126) * Feature/custom select (#148) * Jhork/custom select fields (#111) * Jhork/custom select from (#130) * Jhork/custom select order by (#134) * set the error overlay to be on top of all other form elements (#150) * prepare to publish 0 .0.30 (#151) * Feature/where (#154) * Jhork: Support for Simple WHERE Expressions (#101) * move rule to css common (#108) * Preventing webview re-rendering when soql statement has not changed (#105) * Revert "Disable WHERE in model (#113)" * Type-aware where (#109) * Recognize recoverable where errors (#116) * Operator and Criteria Error Tooltips (#122) * Support IN, NOT IN, INCLUDES, EXCLUDE operators (#123) * Revert "Feature/where (#154)" (#157) * Add support for line comments ( `//` ) at the top of SOQL files (#132) * Jhork/where custom select (#161) * Fix: 'undefined' in SOQL string (#162) * Clear tooltip when object changes, fix empty soql statement error blocker (#165) * Track to force render on condition change - fix rebase conflict (#166) * do not send event when user still adding input' (#169) * Jhork/clear modifier field bug fix (#168) * handle a option selection event (#178) * cler tooltip error when X is clicked (#180) * Jhork/workflow updates (#163) * Bump versions for release (#181) Co-authored-by: Jonny Hork <jhork@salesforce.com> Co-authored-by: dehru <599418+dehru@users.noreply.github.com> Co-authored-by: Dehru Cromer <dehru.cromer@salesforce.com> Co-authored-by: Fernando Dobladez <fernandodobladez@salesforce.com>
What does this PR do?
This PR will address a bug where the field of the last modifier group would not be cleared because the customSelect component would not update the _value with an empty array coming from the model.
I have also refactored a skipped test to work with the customSelect.
What issues does this PR fix or reference?
@W-8847700@