-
Notifications
You must be signed in to change notification settings - Fork 153
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
Projects list view: expand workbenches column to a table #3207
base: main
Are you sure you want to change the base?
Projects list view: expand workbenches column to a table #3207
Conversation
@jeff-phillips-18: GitHub didn't allow me to request PR reviews from the following users: tobiastal. Note that only opendatahub-io members and repo collaborators can review this PR, and authors cannot review their own PRs. 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-sigs/prow repository. |
998f741
to
db5d2ec
Compare
/retest |
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.
These changes are looking good @jeff-phillips-18 . Tested in the UI against the mocks. Left a comment below.
@@ -0,0 +1,13 @@ | |||
import { createIcon } from '@patternfly/react-icons/dist/esm/createIcon'; | |||
|
|||
const NotebookIcon = createIcon({ |
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.
According to the mocks, it looks like this icon should be solid. Wondering if we can update the svg path here? WDYT @jeff-phillips-18
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.
@jenny-s51 You're looking at the old mocks, In the updatedmocks (which are ready for dev), we're using the outlined icon, just like Jeff added.
One small difference is that the icon appears slightly smaller than it should be (compared to the mocks).
@jeff-phillips-18 Could you take a look at this?
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.
The size in the table is based on the font size (14px) while the mocks show 16px. I have updated the code to set the icons size to 16px. Screen shot above has been updated.
f2e8d01
to
edc6b62
Compare
LGTM |
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.
LGTM, retested locally and compared against updated mocks. Icon size update looks good.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jenny-s51 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Does the stopped state have a pause icon? It's not paused... there is no data persistence in memory |
@tobiastal Mocks show a |
edc6b62
to
1999b53
Compare
New changes are detected. LGTM label has been removed. |
a9c48bd
to
430e3a4
Compare
<Tr isExpanded={!!expandColumn}> | ||
<Td | ||
dataLabel="workbenches" | ||
colSpan={4} | ||
style={{ | ||
borderTopWidth: 1, | ||
borderTopStyle: 'solid', | ||
borderTopColor: 'var(--pf-v5-global--BorderColor--100)', | ||
}} | ||
> | ||
<ProjectTableRowNotebookTable obj={project} /> | ||
</Td> | ||
</Tr> |
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.
This row is rendered by PF no matter if it's expanded or not.
This is causing extra network requests to be made.
Add conditional rendering.
{ | ||
isDisabled: isStarting || isStopping, | ||
title: 'Edit workbench', | ||
onClick: () => { | ||
navigate( | ||
`/projects/${project.metadata.name}/spawner/${notebookState.notebook.metadata.name}`, | ||
); | ||
}, | ||
}, |
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.
If I cancel out of editing the workbench, I don't end up back at the project list view.
If I press the browser back button, I end up on the project list view however I am on the wrong page or the expanded section is no longer open.
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.
Updated the spawner paged to navigate back on a cancel
icon: <InProgressIcon style={{ animation: rotate }} />, | ||
}; | ||
} | ||
if (isStopping) { | ||
return { | ||
label: 'Stopping', | ||
color: 'grey', | ||
icon: <SyncAltIcon style={{ animation: rotate }} />, |
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.
We use these icons in several places.
PF doesn't have a means to spin icons? If not then, make then reusable components with their custom animation so we can update those other locations at a later date.
frontend/src/api/k8s/notebooks.ts
Outdated
@@ -206,7 +206,7 @@ export const getStopPatch = (): Patch => ({ | |||
value: getStopPatchDataString(), | |||
}); | |||
|
|||
export const getNotebooks = (namespace: string): Promise<NotebookKind[]> => | |||
export const getNotebooks = (namespace?: string): Promise<NotebookKind[]> => |
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.
Why this change?
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.
oops... reverted
<DeleteNotebookModal | ||
notebook={notebookToDelete} | ||
onClose={(deleted) => { | ||
if (deleted) { | ||
refresh(); | ||
} | ||
setNotebookToDelete(undefined); | ||
}} | ||
/> |
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.
Modals should be conditionally rendered.
); | ||
return ( | ||
<Tr style={{ border: 'none' }} data-testid="project-notebooks-table-row"> | ||
<Td dataLabel="workbenchName" style={{ paddingLeft: 'var(--pf-v5-global--spacer--sm)' }}> |
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.
430e3a4
to
8587d6b
Compare
Closes RHOAIENG-10494
Description
Update the projects list view from having nested subcolumns to show workbenches to using an expandable column to show an expanded view with a table listing the workbenches for the project.
How Has This Been Tested?
On a system with multiple projects, navigate to the Data Science Projects page.
Notice that workbenches are now indicated as an icon (wrench) and a count.
Click on the icon/count for a project with existing workbenches.
See the row expand to show a table of the workbenches belonging to the project.
Manually tested
Test Impact
Updated the e2e tests
Screen shot
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
/cc @tobiastal