-
Notifications
You must be signed in to change notification settings - Fork 631
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
base: main
Are you sure you want to change the base?
Conversation
@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. |
@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
Requesting review from QA contact: 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. |
|
||
return ( | ||
<ModalContext.Provider value={{ launchModal, closeModal }}> | ||
{isOpen && !!Component && <Component {...componentProps} closeModal={closeModal} />} | ||
{_.map(componentsMap, (c, id) => ( | ||
<c.Component {...c.props} key={id} closeModal={closeModal} /> |
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 think close modal needs the id:
<c.Component {...c.props} key={id} closeModal={closeModal} /> | |
<c.Component {...c.props} key={id} closeModal={(e) => closeModal(e,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.
Thanks @jgbernalp! I refactored a bit based on your suggestion.
5242806
to
83d020f
Compare
/assign @vojtechszocs |
83d020f
to
17195c3
Compare
/test e2e-gcp-console |
/cherrypick release-4.18 |
@kyoto: once the present PR merges, I will cherry-pick it on top of 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 kubernetes-sigs/prow repository. |
/cherrypick release-4.17 |
@kyoto: once the present PR merges, I will cherry-pick it on top of 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 kubernetes-sigs/prow repository. |
/test e2e-gcp-console |
@vojtechszocs @TheRealJon Could one of you please review? |
/retest |
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.
Thanks @kyoto 👍
|
||
### Summary | ||
|
||
A hook to launch Modals. | ||
A hook to launch Overlays. |
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 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:
- What is an overlay?
- How do I position an overlay?
- How do I close an overlay?
- Can I launch multiple overlays?
- Can I make an overlay modal?
- What props if any can the component I pass in take?
- What PF or SDK components can I use with overlays?
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.
Thanks @spadgett! I expanded the API docs with your suggestions. Could you please take another look?
|
||
## `useModal` | ||
|
||
### Summary [DEPRECATED] |
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.
@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.
17195c3
to
12d18c6
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.
@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
[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 |
12d18c6
to
143f213
Compare
/retest |
1 similar comment
/retest |
@kyoto: The following test failed, say
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. |
No description provided.