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(ws): Add popup to Workspace data vol column in workspaces table #160

Merged

Conversation

ElayAharoni
Copy link

Fixes: #149

added popup with the worspace data vol info, that will show when hovering on the data vol column field.

please inform me if anything needs to be changes in matter of functionality or styling.

added a picture of the change:

image

Copy link

@paulovmr paulovmr left a comment

Choose a reason for hiding this comment

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

Hi @ElayAharoni , thanks for the PR! For this task, I asked @jenny-s51 from UX to give her input on the best component to use to show those data volumes. One thing that would need to change, is that we need to show not only the first but all elements from the workspace.podTemplate.volumes.data array, so there might be a need for an alternative component than the Popover.

@ElayAharoni
Copy link
Author

Hi Paulo, thanks for your comment.

I think that if we need to show larger data than what is shown right now, then maybe it will be better not to show it when hovering on the field.
But to show it when clicking on the helpIcon that next to it, and then we can open a dialog or other component with all the relevant data.

Please let me know what you think about it.

@paulovmr
Copy link

Hi @jenny-s51 , here is the PR about the data volumes column.

@jenny-s51
Copy link

jenny-s51 commented Dec 17, 2024

Hi @paulovmr , thank you for tagging me! I see #150 is a similar ticket as well.

Per our recent conversation this morning we agreed that the expandable table variant is an effective approach and component to use for these cases - since we want to show additional data for multiple columns in this table view, using the PF expandable table variant offers more flexibility and provides a visual cue to the user that there is more data within the table view. WDYT @ElayAharoni ?

@ElayAharoni
Copy link
Author

ElayAharoni commented Dec 17, 2024

I think it will be the best approach, as it is a solution for all the columns that need to show additional data.
And it is also the way it is implemented in the ODH.

Do you want me to implement it in my pr and then all the other relevant PR's will be based on mine?
@paulovmr , @jenny-s51

@jenny-s51
Copy link

Yes, that sounds like a good plan, @ElayAharoni.

@ElayAharoni ElayAharoni force-pushed the Workspace-Data-Vol-column branch from a909536 to dd73111 Compare December 18, 2024 09:27
@ElayAharoni
Copy link
Author

ElayAharoni commented Dec 18, 2024

hi @paulovmr , @jenny-s51.
i have made the changes, to show the data via expendable table row.
attached screenshot for reference:

image

@ElayAharoni ElayAharoni force-pushed the Workspace-Data-Vol-column branch from dd73111 to fdaa028 Compare December 18, 2024 09:47
@paulovmr
Copy link

IMO the idea of adding a expandable row would eliminate the need for a normal column for that field, since the expandable part would be presented as a separate row that adds more information, and not an extension to the columns, like seen in here. @jenny-s51 do you agree?

Copy link

@jenny-s51 jenny-s51 left a comment

Choose a reason for hiding this comment

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

This is a good callout @paulovmr - if we are showing additional data for multiple columns, the data should be presented within the span of the column it is associated with.

Here is a good example of how this is currently done in the RHOAI Dashboard, for example the "Container size" column has Limits and Memory within the same column span (see NotebookTableRow.tsx).
Screenshot 2024-12-18 at 5 22 17 PM

We also want to make sure to wrap the content of each child row cell in ExpandableRowContent to apply the correct styles. @ElayAharoni

@ElayAharoni ElayAharoni force-pushed the Workspace-Data-Vol-column branch from fdaa028 to 0164324 Compare December 19, 2024 11:07
@ElayAharoni
Copy link
Author

hi @jenny-s51 @paulovmr.
i have made the requested fixes.
attached new snapshot:
image

@ElayAharoni ElayAharoni force-pushed the Workspace-Data-Vol-column branch from 0164324 to c81c44e Compare December 22, 2024 08:43
@ElayAharoni
Copy link
Author

hi @paulovmr , @jenny-s51.
after the discussions we had this is the current fix.
please review when you have time.
attached latest snapshot:
image

@ElayAharoni ElayAharoni force-pushed the Workspace-Data-Vol-column branch 2 times, most recently from bbc1bc3 to 3b67e91 Compare January 8, 2025 18:01
@google-oss-prow google-oss-prow bot added size/L and removed size/M labels Jan 8, 2025
@ElayAharoni ElayAharoni force-pushed the Workspace-Data-Vol-column branch from 3b67e91 to 7f3288c Compare January 9, 2025 13:38
const workspaceDataVol = workspace.podTemplate.volumes.data;
return (
<>
<Content component="h3">Data Volumes:</Content>
Copy link

Choose a reason for hiding this comment

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

@ElayAharoni IMO the List component from PatternFly might be a better fit for this kind of information on the UI. Please consider replacing the Content usage for the List component.

<Content component="h3">Data Volumes:</Content>
{workspaceDataVol.map((data, index) => (
<Content key={`data-vol-${index}`} component="blockquote">
<div>
Copy link

Choose a reason for hiding this comment

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

In general, it is best to avoid the usage of plain HTML components in the middle of PatternFly components to avoid breaking future CSS rules.

workspace: Workspace;
}

export const ExpandedDataVol: React.FC<ExpandedDataVolProps> = ({ workspace }) => {
Copy link

Choose a reason for hiding this comment

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

Please consider renaming this component (and also other associated declarations).

Suggested change
export const ExpandedDataVol: React.FC<ExpandedDataVolProps> = ({ workspace }) => {
export const DataVolumesList: React.FC<ExpandedDataVolProps> = ({ workspace }) => {

@ElayAharoni
Copy link
Author

@paulovmr thanks for your comments i will fix them

@ElayAharoni ElayAharoni force-pushed the Workspace-Data-Vol-column branch from 7f3288c to d991379 Compare January 9, 2025 15:01
Copy link

@paulovmr paulovmr left a comment

Choose a reason for hiding this comment

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

Hi @ElayAharoni , left a few minor changes inline. One thing that is important as well is to remove the Data Vol column from the table, now that the information has moved to the expandable row. Also please add the new type WorkspacesColumnNames to the variable columnNames.

import * as React from 'react';
import { Workspace } from '~/shared/types';

interface ExpandedDataVolProps {
Copy link

Choose a reason for hiding this comment

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

Suggested change
interface ExpandedDataVolProps {
interface DataVolumesListProps {

workspace: Workspace;
}

export const DataVolumesList: React.FC<ExpandedDataVolProps> = ({ workspace }) => {
Copy link

Choose a reason for hiding this comment

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

Suggested change
export const DataVolumesList: React.FC<ExpandedDataVolProps> = ({ workspace }) => {
export const DataVolumesList: React.FC<DataVolumesListProps> = ({ workspace }) => {

@ElayAharoni ElayAharoni force-pushed the Workspace-Data-Vol-column branch from d991379 to 037519c Compare January 9, 2025 16:56
{columnNames.cpu}
</Th>
<Th sort={getSortParams(8)} info={{ tooltip: 'Workspace memory usage' }}>
{columnNames.ram}
</Th>
<Th sort={getSortParams(9)}>{columnNames.lastActivity}</Th>
<Th sort={getSortParams(6)}>{columnNames.lastActivity}</Th>
Copy link

@paulovmr paulovmr Jan 9, 2025

Choose a reason for hiding this comment

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

I believe there was an issue with the conflict resolution here, because the lastActivity column is duplicated. Also, because the Data Vol column was removed, it has to also be removed from the sortable rows, and the parameters to the getSortParams should be changed too.

Copy link
Author

Choose a reason for hiding this comment

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

yeah you are right, i have fixed and pused for the final time i hope

Signed-off-by: Elay Aharoni (EXT-Nokia) <[email protected]>
@ElayAharoni ElayAharoni force-pushed the Workspace-Data-Vol-column branch from 037519c to 8fcab6c Compare January 12, 2025 08:58
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ederign, paulovmr

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

@ederign
Copy link
Member

ederign commented Jan 13, 2025

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Jan 13, 2025
@google-oss-prow google-oss-prow bot merged commit 249a456 into kubeflow:notebooks-v2 Jan 13, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

4 participants