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

Remove connection settings when using wanda #1094

Merged
merged 4 commits into from
Jan 11, 2023

Conversation

nelsonkopliku
Copy link
Member

@nelsonkopliku nelsonkopliku commented Jan 9, 2023

Description

This keeps only the checks selection when in Wanda context.
As a proposal, page title has also been changed from Cluster Settings for <cluster-name> to Checks Selection for <cluster-name>.

image

How was this tested?

Added a test case in ChecksSelectionNew.test.jsx

@nelsonkopliku nelsonkopliku added the enhancement New feature or request label Jan 9, 2023
@nelsonkopliku nelsonkopliku self-assigned this Jan 9, 2023
@nelsonkopliku nelsonkopliku force-pushed the remove-connection-settings-when-using-wanda branch from 73fe7ac to 528aa33 Compare January 9, 2023 11:50
@nelsonkopliku nelsonkopliku marked this pull request as ready for review January 9, 2023 11:58
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

I'm a bit lost with the changes.
If the intention is to use the ChecksSelectionNew directly when we go to the settings i wouldn't touch the ClusterSettings code, I would directly render the selection page in the trento.jsx file:

<Route
  path="clusters_new/:clusterID/settings"
  element={<CheckSelectionNew />}
 />

We can even think of changing the path from settings to something else.
The setting component looks like it will be removed soon, so I wouldn't do changes there if possible

assets/js/components/ClusterDetails/ClusterSettings.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.

I totally agree with the approach @arbulu89 is suggesting, do see any potential issue in that?

@nelsonkopliku nelsonkopliku force-pushed the remove-connection-settings-when-using-wanda branch 2 times, most recently from 421d57e to 9b47f03 Compare January 9, 2023 17:44
@nelsonkopliku
Copy link
Member Author

Alright, I followed the suggestion with the only difference that instead of binding directly CheckSelectionNew to the route, I added an intermediate container Component ClusterSettingsNew for consistency with what we have now (yes we can rethink the structure there) and to keep testing simple.

How does this work?

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.

Much better now! I'm sure the strangling of the old part will be much easier 😅

Some more stuff to take care off then we are ok I think 👍

@nelsonkopliku nelsonkopliku force-pushed the remove-connection-settings-when-using-wanda branch 6 times, most recently from d9fa63d to bbf250e Compare January 10, 2023 18:31
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Great job! Thanks @nelsonkopliku

@nelsonkopliku nelsonkopliku force-pushed the remove-connection-settings-when-using-wanda branch from bbf250e to f1ec611 Compare January 11, 2023 08:21
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.

One more change then we are ok to merge 👍

Comment on lines 53 to 58
export const withExtendedDefaultState = (component, additionalState = {}) =>
withState(component, {
...defaultInitialState,
...additionalState,
});

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather export defaultInitialState and then compose it using withState inside the test

Copy link
Member Author

Choose a reason for hiding this comment

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

Initially I started like that and then it looked natural following the same with... pattern, to keep the same level of encapsulation for defaultInitialState, composability and to reduce a bit the boiler of merging the default state with a piece of extra state when needed.
However since you prefer that, I changed as per the suggestion so we can proceed.

@nelsonkopliku nelsonkopliku force-pushed the remove-connection-settings-when-using-wanda branch from f1ec611 to 4223d5a Compare January 11, 2023 08:50
@nelsonkopliku nelsonkopliku merged commit 2c5960c into main Jan 11, 2023
@nelsonkopliku nelsonkopliku deleted the remove-connection-settings-when-using-wanda branch January 11, 2023 09:14
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