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

[WIP] CONSOLE-3568: Expose DeleteModal component in console-dynamic-plugin-sdk #12785

Closed
wants to merge 1 commit into from

Conversation

jhadvig
Copy link
Member

@jhadvig jhadvig commented Apr 27, 2023

Exposing a minimal version of the DeleteModal as a ResourceDeleteModa so it does not conflict with original component. This new component only handles a single resource and is not as robust as the original DeleteModal.

Action items:

  • Expose the DeleteModal component in our console-dynamic-plugin-sdk as a ResourceDeleteModal
  • Decouple the functionality console internal codebase.
  • Use the new ResourceDeleteModal in parts of the code base where it would make delete action over a single resource
  • Review the new component's API before merge
  • Add TS docs the migrated DeleteModal component

/assign @vojtechszocs @TheRealJon

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

openshift-ci-robot commented Apr 27, 2023

@jhadvig: This pull request references CONSOLE-3568 which is a valid jira issue.

In response to this:

Exposing a minimal version of the DeleteModal as a ResourceDeleteModa so it does not conflict with original component. This new component only handles a single resource and is not as robust as the original DeleteModal.

Action items:

  • Expose the DeleteModal component in our console-dynamic-plugin-sdk as a ResourceDeleteModal
  • Decouple the functionality console internal codebase.
  • Use the original new ResourceDeleteModal in parts of the code base where it would make delete action over a single resrouce
  • Review the new component's API before merge
  • Add TS docs the migrated DeleteModal component

/assign @vojtechszocs @TheRealJon

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.

@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 Apr 27, 2023
@openshift-ci openshift-ci bot added the component/sdk Related to console-plugin-sdk label Apr 27, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 27, 2023

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 27, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 27, 2023

@jhadvig: The following tests 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/images 387ddd8 link true /test images
ci/prow/analyze 387ddd8 link true /test analyze
ci/prow/backend 387ddd8 link true /test backend
ci/prow/e2e-gcp-console 387ddd8 link true /test e2e-gcp-console
ci/prow/frontend 387ddd8 link true /test frontend

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.

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.

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) => {
Copy link
Member

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.

Copy link
Member Author

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.

@gnunn1
Copy link

gnunn1 commented Jun 25, 2023

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.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 25, 2023
@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.

@gnunn1
Copy link

gnunn1 commented Jun 27, 2023

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?

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jul 5, 2023

@jhadvig: This pull request references CONSOLE-3568 which is a valid jira issue.

In response to this:

Exposing a minimal version of the DeleteModal as a ResourceDeleteModa so it does not conflict with original component. This new component only handles a single resource and is not as robust as the original DeleteModal.

Action items:

  • Expose the DeleteModal component in our console-dynamic-plugin-sdk as a ResourceDeleteModal
  • Decouple the functionality console internal codebase.
  • Use the new ResourceDeleteModal in parts of the code base where it would make delete action over a single resource
  • Review the new component's API before merge
  • Add TS docs the migrated DeleteModal component

/assign @vojtechszocs @TheRealJon

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.

@rhamilto
Copy link
Member

rhamilto commented Jul 6, 2023

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.

@jhadvig, can you provide insight as to why the decision was made to have the new modal only handle a single resource?

@rhamilto
Copy link
Member

rhamilto commented Jul 6, 2023

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?

Agreed. Will make the history.push only occur if on the resource details page like the existing modal does.

@rhamilto
Copy link
Member

rhamilto commented Jul 6, 2023

This PR is being replaced with #12974.

@rhamilto rhamilto closed this Jul 6, 2023
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/sdk Related to console-plugin-sdk do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants