-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat(ws): Add popup to Workspace data vol column in workspaces table #160
Conversation
61b14b3
to
a909536
Compare
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.
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
.
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. Please let me know what you think about it. |
Hi @jenny-s51 , here is the PR about the data volumes column. |
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 ? |
I think it will be the best approach, as it is a solution for all the columns that need to show additional data. Do you want me to implement it in my pr and then all the other relevant PR's will be based on mine? |
Yes, that sounds like a good plan, @ElayAharoni. |
a909536
to
dd73111
Compare
hi @paulovmr , @jenny-s51. |
dd73111
to
fdaa028
Compare
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? |
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 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).
We also want to make sure to wrap the content of each child row cell in ExpandableRowContent to apply the correct styles. @ElayAharoni
fdaa028
to
0164324
Compare
hi @jenny-s51 @paulovmr. |
0164324
to
c81c44e
Compare
hi @paulovmr , @jenny-s51. |
bbc1bc3
to
3b67e91
Compare
3b67e91
to
7f3288c
Compare
const workspaceDataVol = workspace.podTemplate.volumes.data; | ||
return ( | ||
<> | ||
<Content component="h3">Data Volumes:</Content> |
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.
@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> |
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.
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 }) => { |
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.
Please consider renaming this component (and also other associated declarations).
export const ExpandedDataVol: React.FC<ExpandedDataVolProps> = ({ workspace }) => { | |
export const DataVolumesList: React.FC<ExpandedDataVolProps> = ({ workspace }) => { |
@paulovmr thanks for your comments i will fix them |
7f3288c
to
d991379
Compare
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.
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 { |
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.
interface ExpandedDataVolProps { | |
interface DataVolumesListProps { |
workspace: Workspace; | ||
} | ||
|
||
export const DataVolumesList: React.FC<ExpandedDataVolProps> = ({ workspace }) => { |
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.
export const DataVolumesList: React.FC<ExpandedDataVolProps> = ({ workspace }) => { | |
export const DataVolumesList: React.FC<DataVolumesListProps> = ({ workspace }) => { |
d991379
to
037519c
Compare
{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> |
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.
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.
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.
yeah you are right, i have fixed and pused for the final time i hope
Signed-off-by: Elay Aharoni (EXT-Nokia) <[email protected]>
037519c
to
8fcab6c
Compare
[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 |
/lgtm |
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: