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

feat(editors): add form/input reset to Composite Editor modal & fix touched value #267

Merged
merged 13 commits into from
Feb 25, 2021

Conversation

ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented Feb 20, 2021

  • provide 2 optional ways to reset each input value(s) and/or the entire form
  • also add isValueTouched to every editor to fix some problem detected in the Composite Editor form, if user type something and deletes it, it wasn't showing the orange outline (but it should) and it was still applying empty value to all rows in the grid which was unexpected by the user, the new isValueTouched is now used to show the orange outline instead of the isValueChanged which serves a different purpose

TODOs

  • add unit tests
  • add more Cypress E2E tests
    • possibly add singleSelect or multipleSelect editor to Composite Editor to test isValueTouched in E2E test
    • add "Reset Form" button with Cypress tests as well

- on a Mass Update modal, whenever an input is touched, it will apply that empty value to all the items in the grid (for example if user types "123" and deletes it, now it becomes "" empty string which is what will be applied).
- in some cases, applying empty string is what we might want but in other cases the user might just want to reset to the original value (on a Mass Update form, the original value would be blank) without having that value changed in the "formValues" object, this is what this PR does, it allows to reset the value while also exclude it from the "formValues" object.
- provide 2 optional way to reset each input value(s) and/or the entire form
- also add `isValueTouched` to every editor to fix some problem detected in the Composite Editor form, if user type something and deletes it, it wasn't showing the orange outline (but it should) and it was still applying empty value to all rows in the grid which was unexpected by the user, the new `isValueTouched` is now used to show the orange outline instead of the `isValueChanged` which serves a different purpose
@ghiscoding ghiscoding changed the title feat(editors): add form/input reset to Composite Editor modal & fix touched value WIP - feat(editors): add form/input reset to Composite Editor modal & fix touched value Feb 20, 2021
@codecov
Copy link

codecov bot commented Feb 20, 2021

Codecov Report

Merging #267 (e34ab91) into master (20564a3) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            master      #267    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          209       209            
  Lines        12119     12357   +238     
  Branches      4170      4230    +60     
==========================================
+ Hits         12119     12357   +238     
Impacted Files Coverage Δ
packages/common/src/constants.ts 100.00% <ø> (ø)
packages/common/src/services/shared.service.ts 100.00% <ø> (ø)
packages/common/src/aggregators/maxAggregator.ts 100.00% <100.00%> (ø)
packages/common/src/aggregators/minAggregator.ts 100.00% <100.00%> (ø)
packages/common/src/editors/autoCompleteEditor.ts 100.00% <100.00%> (ø)
packages/common/src/editors/checkboxEditor.ts 100.00% <100.00%> (ø)
packages/common/src/editors/dateEditor.ts 100.00% <100.00%> (ø)
packages/common/src/editors/dualInputEditor.ts 100.00% <100.00%> (ø)
packages/common/src/editors/floatEditor.ts 100.00% <100.00%> (ø)
packages/common/src/editors/integerEditor.ts 100.00% <100.00%> (ø)
... and 40 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20564a3...e34ab91. Read the comment docs.

@ghiscoding ghiscoding changed the title WIP - feat(editors): add form/input reset to Composite Editor modal & fix touched value feat(editors): add form/input reset to Composite Editor modal & fix touched value Feb 25, 2021
@ghiscoding ghiscoding merged commit 09eaad7 into master Feb 25, 2021
@ghiscoding ghiscoding deleted the feat/composite-reset-button branch February 25, 2021 00:12
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.

1 participant