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

Checks selection from wanda #976

Merged
merged 16 commits into from
Nov 29, 2022
Merged

Checks selection from wanda #976

merged 16 commits into from
Nov 29, 2022

Conversation

arbulu89
Copy link
Contributor

@arbulu89 arbulu89 commented Nov 10, 2022

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 restructure

How was this tested?

Tests added

@arbulu89 arbulu89 added the enhancement New feature or request label Nov 10, 2022
@arbulu89 arbulu89 force-pushed the checks-selection-from-wanda branch from d305245 to 868cf90 Compare November 25, 2022 13:22
@arbulu89 arbulu89 marked this pull request as ready for review November 25, 2022 13:26
@arbulu89 arbulu89 force-pushed the checks-selection-from-wanda branch 2 times, most recently from dca1bca to 781c316 Compare November 28, 2022 14:05
Copy link
Member

@nelsonkopliku nelsonkopliku left a 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.

assets/js/state/actions/cluster.js Outdated Show resolved Hide resolved
assets/js/components/ChecksCatalog/ChecksCatalogNew.jsx Outdated Show resolved Hide resolved
Copy link
Contributor

@dottorblaster dottorblaster left a 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

assets/js/components/ChecksCatalog/ChecksCatalogNew.jsx Outdated Show resolved Hide resolved
assets/js/components/ChecksCatalog/ChecksCatalogNew.jsx Outdated Show resolved Hide resolved
Comment on lines 12 to 14
allSelected,
someSelected,
noneSelected,
Copy link
Contributor

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.

Copy link
Contributor Author

@arbulu89 arbulu89 Nov 29, 2022

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

assets/js/components/ClusterDetails/ChecksSelectionNew.jsx Outdated Show resolved Hide resolved
...check,
selected: isSelected(check.id),
}));
const allSelected = checks.every((check) => isSelected(check.id));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const allSelected = checks.every((check) => isSelected(check.id));
const allSelected = checks.every(({ id }) => isSelected(id));

assets/js/components/ClusterDetails/ChecksSelectionNew.jsx Outdated Show resolved Hide resolved
@arbulu89 arbulu89 force-pushed the checks-selection-from-wanda branch from 2fa0f97 to ab30f8e Compare November 29, 2022 13:41
Copy link
Contributor

@dottorblaster dottorblaster left a 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

Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

Good to go.

@arbulu89 arbulu89 merged commit 2ac5985 into main Nov 29, 2022
@arbulu89 arbulu89 deleted the checks-selection-from-wanda branch November 29, 2022 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants