Skip to content

OCPBUGS-49709: Add useOverlay hook to dynamic plugin SDK and deprecate useModal hook #14707

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kyoto
Copy link
Member

@kyoto kyoto commented Jan 31, 2025

No description provided.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 31, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 31, 2025

@kyoto: This pull request references OLS-1330 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.19.0" version, but no target version was set.

In response to this:

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 31, 2025
@openshift-ci openshift-ci bot requested review from rawagner and spadgett January 31, 2025 12:18
@openshift-ci openshift-ci bot added component/sdk Related to console-plugin-sdk approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 31, 2025
@kyoto kyoto changed the title [WIP] OLS-1330: Add the ability to launch multiple modals with useModal hook [WIP] OCPBUGS-49709: Add the ability to launch multiple modals with useModal hook Jan 31, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jan 31, 2025
@openshift-ci-robot
Copy link
Contributor

@kyoto: This pull request references Jira Issue OCPBUGS-49709, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.19.0) matches configured target version for branch (4.19.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from yapei January 31, 2025 12:36

return (
<ModalContext.Provider value={{ launchModal, closeModal }}>
{isOpen && !!Component && <Component {...componentProps} closeModal={closeModal} />}
{_.map(componentsMap, (c, id) => (
<c.Component {...c.props} key={id} closeModal={closeModal} />
Copy link
Contributor

Choose a reason for hiding this comment

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

I think close modal needs the id:

Suggested change
<c.Component {...c.props} key={id} closeModal={closeModal} />
<c.Component {...c.props} key={id} closeModal={(e) => closeModal(e,id)} />

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @jgbernalp! I refactored a bit based on your suggestion.

@kyoto kyoto force-pushed the ModalProvider-multiple-modals branch 2 times, most recently from 5242806 to 83d020f Compare January 31, 2025 13:53
@spadgett
Copy link
Member

spadgett commented Feb 3, 2025

/assign @vojtechszocs
/assign @TheRealJon

@kyoto kyoto force-pushed the ModalProvider-multiple-modals branch from 83d020f to 17195c3 Compare March 11, 2025 02:31
@openshift-ci openshift-ci bot added component/core Related to console core functionality plugin-api-changed Categorizes a PR as containing plugin API changes labels Mar 11, 2025
@kyoto kyoto changed the title [WIP] OCPBUGS-49709: Add the ability to launch multiple modals with useModal hook [WIP] OCPBUGS-49709: Add useOverlay hook to dynamic plugin SDK and deprecate useModal hook Mar 11, 2025
@jgbernalp
Copy link
Contributor

/test e2e-gcp-console

@kyoto
Copy link
Member Author

kyoto commented Mar 11, 2025

/cherrypick release-4.18

@openshift-cherrypick-robot

@kyoto: once the present PR merges, I will cherry-pick it on top of release-4.18 in a new PR and assign it to you.

In response to this:

/cherrypick release-4.18

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-sigs/prow repository.

@kyoto
Copy link
Member Author

kyoto commented Mar 11, 2025

/cherrypick release-4.17

@openshift-cherrypick-robot

@kyoto: once the present PR merges, I will cherry-pick it on top of release-4.17 in a new PR and assign it to you.

In response to this:

/cherrypick release-4.17

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-sigs/prow repository.

@kyoto
Copy link
Member Author

kyoto commented Mar 11, 2025

/test e2e-gcp-console

@kyoto
Copy link
Member Author

kyoto commented Mar 11, 2025

@vojtechszocs @TheRealJon Could one of you please review?

@kyoto
Copy link
Member Author

kyoto commented Mar 12, 2025

/retest

@kyoto kyoto changed the title [WIP] OCPBUGS-49709: Add useOverlay hook to dynamic plugin SDK and deprecate useModal hook OCPBUGS-49709: Add useOverlay hook to dynamic plugin SDK and deprecate useModal hook Mar 13, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 13, 2025
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

Thanks @kyoto 👍


### Summary

A hook to launch Modals.
A hook to launch Overlays.
Copy link
Member

@spadgett spadgett Mar 14, 2025

Choose a reason for hiding this comment

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

I know the useModal description and others are terse, but I'd like to try to add more detail to these going forward and eventually fix existing API docs. Let's add more description here. Some questions that come to mind:

  1. What is an overlay?
  2. How do I position an overlay?
  3. How do I close an overlay?
  4. Can I launch multiple overlays?
  5. Can I make an overlay modal?
  6. What props if any can the component I pass in take?
  7. What PF or SDK components can I use with overlays?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @spadgett! I expanded the API docs with your suggestions. Could you please take another look?


## `useModal`

### Summary [DEPRECATED]
Copy link
Member

Choose a reason for hiding this comment

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

@opayne1 FYI, we're deprecating a hook from the console plugin API. We should look at release noting this. Let us know what we need to do.

@kyoto kyoto force-pushed the ModalProvider-multiple-modals branch from 17195c3 to 12d18c6 Compare April 8, 2025 13:43
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

@kyoto Thank you, I really appreciate the doc updates. API looks good 👍

I'll let @vojtechszocs give the final lgtm.

/approved
/label plugin-api-approved

@openshift-ci openshift-ci bot added the plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer label Apr 8, 2025
Copy link
Contributor

openshift-ci bot commented Apr 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kyoto, spadgett

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

The pull request process is described 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

@kyoto kyoto force-pushed the ModalProvider-multiple-modals branch from 12d18c6 to 143f213 Compare April 8, 2025 14:12
@kyoto
Copy link
Member Author

kyoto commented Apr 9, 2025

/retest

1 similar comment
@kyoto
Copy link
Member Author

kyoto commented Apr 9, 2025

/retest

Copy link
Contributor

openshift-ci bot commented Apr 9, 2025

@kyoto: 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/okd-scos-e2e-aws-ovn 143f213 link false /test okd-scos-e2e-aws-ovn

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-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/sdk Related to console-plugin-sdk jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer plugin-api-changed Categorizes a PR as containing plugin API changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants