-
Notifications
You must be signed in to change notification settings - Fork 15
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
Checks selection from wanda #976
Conversation
d305245
to
868cf90
Compare
dca1bca
to
781c316
Compare
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.
Good job!
I could make it work locally and looks going in the right direction.
I left a couple of comments about some doubts and in relation to the connection settings, which we'd need to get rid of when using wanda.
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.
Some things to adjust, then we are good
allSelected, | ||
someSelected, | ||
noneSelected, |
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 overly complicated, you can simplify this providing just a prop or two, like selected
. You can then export some constants like NONE
, ALL
, or SOME
to control this behavior from outside, but the entrypoint would be unique.
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 have ended adding the states into an "enum" (js doesn't have proper enums, so a dictionary does the work, the values of the map don't have any meaning).
Let me know if you like it or not. I can move them to individual constants otherwise
...check, | ||
selected: isSelected(check.id), | ||
})); | ||
const allSelected = checks.every((check) => isSelected(check.id)); |
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.
const allSelected = checks.every((check) => isSelected(check.id)); | |
const allSelected = checks.every(({ id }) => isSelected(id)); |
2fa0f97
to
ab30f8e
Compare
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.
LGTM, a tiny comment but really your call
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.
Good to go.
Description
Replace current checks selection view to use data coming from wanda.
Almost the complete work consists on having the checks selection view components in smaller pieces, beforehand everything was a unique view.
Besides that, I have introduced in the last commit the concept of
actions
in a new folder. There, we can have the actions and their constants defined and reuse the dispatched actions. I think we should do this for all the logical components at some point, at the moment where we do the folder/file restructureHow was this tested?
Tests added