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

List connected notebooks for each connection table row #3256

Conversation

jeff-phillips-18
Copy link
Contributor

@jeff-phillips-18 jeff-phillips-18 commented Sep 25, 2024

Towards RHOAIENG-11558

Description

Adds connected notebooks to the connection table rows.
Lists connected notebooks when deleting a connection.

How Has This Been Tested?

Tested manually.
Added test scenarios

Test Impact

Test the connection table to verify the related notebooks show up in each row
Test the delete connection modal to verify the related notebooks are listed.

Screen shots

image

image

image

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.

/cc @simrandhaliw

@christianvogt
Copy link
Contributor

fyi @emilys314

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 51.35135% with 36 lines in your changes missing coverage. Please review.

Project coverage is 84.89%. Comparing base (a0d40fd) to head (033e04d).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
frontend/src/concepts/design/utils.ts 14.81% 23 Missing ⚠️
frontend/src/concepts/design/TypedObjectIcon.tsx 41.17% 10 Missing ⚠️
...eens/detail/connections/ConnectionsDeleteModal.tsx 86.66% 2 Missing ⚠️
.../screens/detail/connections/ConnectedResources.tsx 88.88% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3256      +/-   ##
==========================================
- Coverage   84.96%   84.89%   -0.08%     
==========================================
  Files        1302     1306       +4     
  Lines       29101    29173      +72     
  Branches     7828     7859      +31     
==========================================
+ Hits        24727    24766      +39     
- Misses       4374     4407      +33     
Files with missing lines Coverage Δ
frontend/src/images/icons/ModelsIcon.ts 100.00% <100.00%> (ø)
...pages/projects/notebook/ConnectedNotebookNames.tsx 94.11% <ø> (ø)
.../src/pages/projects/notebook/useNotebooksStates.ts 100.00% <100.00%> (ø)
...src/pages/projects/notebook/useRelatedNotebooks.ts 93.87% <100.00%> (ø)
frontend/src/pages/projects/pvc/DeletePVCModal.tsx 85.18% <ø> (ø)
...cts/screens/detail/connections/ConnectionsList.tsx 100.00% <ø> (ø)
...ts/screens/detail/connections/ConnectionsTable.tsx 100.00% <100.00%> (ø)
...screens/detail/connections/ConnectionsTableRow.tsx 96.15% <ø> (ø)
...jects/screens/detail/connections/ResourceLabel.tsx 100.00% <100.00%> (ø)
...ail/data-connections/DeleteDataConnectionModal.tsx 79.41% <ø> (ø)
... and 9 more

... and 5 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 a0d40fd...033e04d. Read the comment docs.

@@ -35,5 +48,30 @@ describe('ConnectionsTable', () => {
expect(screen.getByText('desc1')).toBeTruthy();
expect(screen.queryByText('s3')).toBeFalsy();
expect(screen.getByText('S3 Buckets')).toBeTruthy();
expect(screen.getByText('S3 Buckets')).toBeTruthy();
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate line added. We can remove line 51

Comment on lines 22 to 24
if (!connectedNotebooks.length) {
return '-';
}

if (!notebooksLoaded) {
return <Spinner size="sm" />;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if the <Spinner /> will ever return? If it's not loaded, the connectedNotbooks will always be [], so it would always return '-' while loading?

So I think these 2 need to be switched around?

key={notebook.metadata.name}
data-testid="connections-delete-notebooks-item"
>
{getDisplayNameFromK8sResource(notebook)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the mocks, I believe we need to append " (Running)" to the display name, if notebook.running === true

@emilys314
Copy link
Contributor

/lgtm

@christianvogt
Copy link
Contributor

/approve

Copy link
Contributor

openshift-ci bot commented Sep 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt

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 947c09b into opendatahub-io:main Sep 27, 2024
8 checks passed
@jeff-phillips-18 jeff-phillips-18 deleted the connected-workbenches branch September 27, 2024 14:25
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