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

feat(ui): list dependent resources in delete popup #18116

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

agaudreault
Copy link
Member

@agaudreault agaudreault commented May 7, 2024

When deleting a resource in the UI, the default option slected will delete the dependent resources. It can be easily missed by a user to delete a resource with all its dependents by mistake. For instance, if someone wants to clean up an old replicaSet that does not have pods anymore, and inadvertently selects the current replicaset, the UI popup will be very similar.

Adding the list of direct dependents reduce the risk of human error.

image image image image image

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Copy link

codecov bot commented May 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 45.13%. Comparing base (f87897c) to head (9e52b89).
Report is 162 commits behind head on master.

❗ Current head 9e52b89 differs from pull request most recent head b2e17a8. Consider uploading reports for the commit b2e17a8 to get more accurate results

Files Patch % Lines
cmd/argocd/commands/app_resources.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18116      +/-   ##
==========================================
- Coverage   49.73%   45.13%   -4.60%     
==========================================
  Files         274      352      +78     
  Lines       48948    57437    +8489     
==========================================
+ Hits        24343    25925    +1582     
- Misses      22230    28774    +6544     
- Partials     2375     2738     +363     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@todaywasawesome
Copy link
Contributor

@agaudreault what happens when there are so many dependent resources that the window goes beyond the bottom of the screen? We might need a limit in the display to keep from the window getting broken. I glanced through the code and didn't see one.

@todaywasawesome
Copy link
Contributor

Also I love this idea :D

@crenshaw-dev
Copy link
Collaborator

@todaywasawesome I had the same thought, found it in the 2nd screenshot

image

@agaudreault
Copy link
Member Author

@todaywasawesome The maximum number of items is 5. I made sure it is not possible to have an item only for "and 1 more". The code might not be the sexiest, I did my best but I am not too familiar with the Typescript syntax 😅

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
@agaudreault agaudreault marked this pull request as ready for review May 9, 2024 15:51
@agaudreault agaudreault requested a review from a team as a code owner May 9, 2024 15:51
@ashutosh16
Copy link
Contributor

LGTM!
Screenshot 2024-05-09 at 12 21 05
Screenshot 2024-05-09 at 12 20 43

@@ -360,6 +376,29 @@ export const deletePopup = async (
review the change first.
</p>

{(childResources || []).length > 0 ? (
<p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Use <span> instead of <p>
error in the console
Screenshot 2024-05-09 at 12 13 03

Copy link
Member Author

Choose a reason for hiding this comment

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

I have to use <p> to get the correct css. This will require another PR in https://github.com/argoproj/argo-ui ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need another PR in argo-ui?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

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

I might suggest making the "and X more" un-collapsible so that a user can get the full list if they wanted to.

Otherwise def a good feature!

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
@agaudreault agaudreault requested a review from a team as a code owner May 13, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants