-
Notifications
You must be signed in to change notification settings - Fork 613
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
[WIP] CONSOLE-3568: Expose DeleteModal component in console-dynamic-plugin-sdk #12785
Conversation
@jhadvig: This pull request references CONSOLE-3568 which is a valid jira issue. 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/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhadvig 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 |
@jhadvig: The following tests 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/test-infra repository. I understand the commands that are listed here. |
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.
Should we expose the modal or the action itself? It would be good to expose the action so that callers don't need to manage display of the modal and we can change the implementation later if we want, although that probably means we need to expose at least some components from kebab.tsx.
import { ResourceDeleteModalProps } from '../../../extensions/console-types'; | ||
import { k8sDeleteResource } from '../../../utils/k8s/k8s-resource'; | ||
|
||
const ResourceDeleteModal = (props: ResourceDeleteModalProps) => { |
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.
Did we copy the code here? It would be better to avoid duplicate code.
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.
No the code has been written as for minimal valiable component. The original delete modal component is DeleteModal
, this one since its just for a single resource deletion I've names ResourceDeleteModal
.
Is it possible to have this support the propagation policy feature (i.e. non-cascading delete) of the internal delete dialog? I'm working on a plugin for OpenShift GitOps and deleting the dependent objects can be catastrophic for customers so supporting this option would be greatly appreciated. Addionally from a visual perspective it looks odd that the internal dialog has this option but the plugin one would not. |
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. |
Also does the history.push need to be optional, i.e. if I call this from a kebob menu in a list of resources I don't think the history push is desirable for delete? |
@jhadvig: This pull request references CONSOLE-3568 which is a valid jira issue. 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/test-infra repository. |
@jhadvig, can you provide insight as to why the decision was made to have the new modal only handle a single resource? |
Agreed. Will make the history.push only occur if on the resource details page like the existing modal does. |
This PR is being replaced with #12974. |
Exposing a minimal version of the
DeleteModal
as aResourceDeleteModa
so it does not conflict with original component. This new component only handles a single resource and is not as robust as the originalDeleteModal
.Action items:
ResourceDeleteModal
/assign @vojtechszocs @TheRealJon