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

Add delete modal for project connections #3204

Merged

Conversation

emilys314
Copy link
Contributor

Closes https://issues.redhat.com/browse/RHOAIENG-11557

Description

Fairly straightforward implementation of the delete modal for the new connections page inside a project.

image

How Has This Been Tested?

To test: if there are existing data connections on a project, you can delete those. otherwise you have to add new secrets from openshift console for that project

Has been tested locally

Test Impact

Cypress test added

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress This PR is in WIP state label Sep 12, 2024
Copy link
Contributor

openshift-ci bot commented Sep 12, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 3 lines in your changes missing coverage. Please review.

Project coverage is 85.32%. Comparing base (06e065b) to head (56dce7f).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...eens/detail/connections/ConnectionsDeleteModal.tsx 82.35% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3204      +/-   ##
==========================================
+ Coverage   85.29%   85.32%   +0.02%     
==========================================
  Files        1266     1268       +2     
  Lines       27800    27865      +65     
  Branches     7400     7414      +14     
==========================================
+ Hits        23712    23775      +63     
- Misses       4088     4090       +2     
Files with missing lines Coverage Δ
...ntend/src/pages/projects/ProjectDetailsContext.tsx 93.84% <100.00%> (+0.19%) ⬆️
...cts/screens/detail/connections/ConnectionsList.tsx 100.00% <100.00%> (ø)
...ts/screens/detail/connections/ConnectionsTable.tsx 100.00% <100.00%> (ø)
...eens/detail/connections/ConnectionsDeleteModal.tsx 82.35% <82.35%> (ø)

... and 20 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06e065b...56dce7f. Read the comment docs.

@emilys314 emilys314 marked this pull request as ready for review September 13, 2024 01:26
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress This PR is in WIP state label Sep 13, 2024
Comment on lines 8 to 10
onClose: () => void;
onDelete: () => Promise<K8sStatus>;
refresh: () => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of having a refresh prop, I prefer onClose: (deleted: boolean) => void; and have the consumer of the modal handle whatever it needs to on close.

}}
deleting={isDeleting}
error={error}
deleteName={deleteConnection.metadata.annotations['openshift.io/display-name'] ?? ''}
Copy link
Contributor

Choose a reason for hiding this comment

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

use getDisplayNameFromK8sResource to get the name and store it in a variable for reuse.

@@ -17,6 +17,7 @@ const ConnectionsDescription =
const ConnectionsList: React.FC = () => {
const {
connections: { data: connections, loaded, error },
refreshAllProjectData: refresh,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's find a way to not refresh all projects data.

Comment on lines 44 to 47
<>
The <b>{getDisplayNameFromK8sResource(deleteConnection)}</b> connection will be deleted, and
its dependent resources will stop working.
</>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: unnecessary fragment

@christianvogt
Copy link
Contributor

/lgtm
/approve

Copy link
Contributor

openshift-ci bot commented Sep 13, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, jeff-phillips-18

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-merge-bot openshift-merge-bot bot merged commit 353a156 into opendatahub-io:main Sep 13, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants