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

Create separate provider for the context #1050

Conversation

TimothyAsirJeyasing
Copy link
Contributor

Create separate provider for the context and pass its descendants as a children
#672

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 20, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: TimothyAsirJeyasing
Once this PR has been reviewed and has the lgtm label, please assign sanjalkatiyar for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@TimothyAsirJeyasing
Copy link
Contributor Author

@SanjalKatiyar Please review

activeItem,
setActiveItem,
}),
[activeItemsUID, setActiveItemsUID, activeItem, setActiveItem]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please resolve these dependency warnings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

Choose a reason for hiding this comment

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

please do not resolve comments unless it is fixed... I can still see the same warnings...

@TimothyAsirJeyasing TimothyAsirJeyasing force-pushed the create-seperate-provider-for-context branch from 831ebe1 to 710ab54 Compare October 3, 2023 07:19
@bipuladh
Copy link
Contributor

bipuladh commented Oct 3, 2023

build tests are failing

@openshift-merge-robot
Copy link
Contributor

@TimothyAsirJeyasing: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/odf-console-e2e-aws 710ab54 link true /test odf-console-e2e-aws

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@TimothyAsirJeyasing
Copy link
Contributor Author

/retest

@TimothyAsirJeyasing TimothyAsirJeyasing force-pushed the create-seperate-provider-for-context branch from 710ab54 to 4b944ef Compare October 9, 2023 08:35
@@ -531,24 +531,53 @@ const Topology: React.FC = () => {

const zones = memoizedNodes.map(getTopologyDomain);

const TopologyDataContextProvider: React.FC<{ children: React.ReactNode }> =
Copy link
Collaborator

@SanjalKatiyar SanjalKatiyar Oct 9, 2023

Choose a reason for hiding this comment

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

why are you creating nested FCs ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

create sperate provider...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you please give some more light

Copy link
Collaborator

Choose a reason for hiding this comment

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

do not create a FC inside another FC...

);
};

const TopologySearchContextProvider: React.FC<{ children: React.ReactNode }> =
Copy link
Collaborator

Choose a reason for hiding this comment

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

create sperate provider... do not do nesting of FCs...

@SanjalKatiyar
Copy link
Collaborator

is this PR tested ?
please add SS for both MCO and ODF pages where we have made changes...

@TimothyAsirJeyasing TimothyAsirJeyasing force-pushed the create-seperate-provider-for-context branch from 4b944ef to d5d30db Compare October 25, 2023 08:29
@TimothyAsirJeyasing
Copy link
Contributor Author

Screenshot from 2023-10-25 13-13-47
Screenshot from 2023-10-25 13-56-25

Comment on lines 5 to 19
export const combineComponents = (...components: React.FC[]): React.FC => {
return components.reduce(
(AccumulatedComponents, CurrentComponent) => {
return ({ children }: React.ComponentProps<React.FC>): JSX.Element => {
return (
<AccumulatedComponents>
<CurrentComponent>{children}</CurrentComponent>
</AccumulatedComponents>
);
};
},
({ children }) => <>{children}</>
);
};

Copy link
Collaborator

Choose a reason for hiding this comment

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

no need for this...


const providers = [CSVStatusesContextProvider, DRResourcesContextProvider];

const AppContextProvider = combineComponents(...providers);
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need for this right now...

Comment on lines -168 to -169
// ToDo(Sanjal): combime multiple Context together to make it scalable
// refer: https://javascript.plainenglish.io/how-to-combine-context-providers-for-cleaner-react-code-9ed24f20225e
Copy link
Collaborator

Choose a reason for hiding this comment

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

add this comment back...

@TimothyAsirJeyasing TimothyAsirJeyasing force-pushed the create-seperate-provider-for-context branch from d5d30db to 6a1e820 Compare November 7, 2023 06:58
@TimothyAsirJeyasing
Copy link
Contributor Author

@SanjalKatiyar Please review

@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@TimothyAsirJeyasing
Copy link
Contributor Author

After encountering many changes and merge conflicts, I am closing this and I will be sending a separate pull request.

/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants