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

Table view for Virtual Machines screen #1600

Merged
merged 6 commits into from
Sep 28, 2022
Merged

Conversation

rszwajko
Copy link
Member

@rszwajko rszwajko commented Jun 9, 2022

Depends on #1592 The commit from #1592 this PR was dependent on has been cherry-picked to this PR.

This PR adds possibility to switch between card view and table view on the Virtual Machines screen. The card view remains the default but it's possible to change it (the change is persisted on the server as an user profile property).

Note that this PR is only about presentation layer: the underlying logic remains the same.
In particular:

  1. both views present the same information to the user (no extra columns in table view)
  2. data is lazy loaded using infinite scroller (no explicit paging)
  3. actions are per VM/pool (no multiple selection/bulk operations)

@rszwajko rszwajko requested review from sjd78 and sgratch June 9, 2022 12:12
@ovirt-infra
Copy link

All tests passed

@rszwajko
Copy link
Member Author

rszwajko commented Jun 9, 2022

Overwiew

image

Filtering/sorting

image

Small screen

image

@ovirt-infra
Copy link

All tests passed

@ovirt-infra
Copy link

All tests passed

@rszwajko
Copy link
Member Author

/ost

@rszwajko rszwajko closed this Jun 15, 2022
@rszwajko rszwajko reopened this Jun 15, 2022
@ovirt-infra
Copy link

All tests passed

Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

Only 1 things is bugging me really...and it is how the table is wired in to VmCardList

src/components/VmsList/style.css Show resolved Hide resolved
src/components/VmsList/VmCardList.js Outdated Show resolved Hide resolved
@ovirt-infra
Copy link

All tests passed

@rszwajko
Copy link
Member Author

@sjd78 @sgratch
Note that this PR depends on #1592 0 - in particular it uses common filtering and sorting components.

@rszwajko rszwajko requested a review from sjd78 July 14, 2022 09:58
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

LGTM

@ovirt-infra
Copy link

All tests passed

@sjd78
Copy link
Member

sjd78 commented Jul 20, 2022

@sjd78 @sgratch Note that this PR depends on #1592 0 - in particular it uses common filtering and sorting components.

@sgratch, @rszwajko -- I cherry-picked the necessary commit from 1592 to this PR. This PR is now standalone complete.

Copy link
Member

@sgratch sgratch left a comment

Choose a reason for hiding this comment

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

@rszwajko
Few comments/enhancements to consider:

  1. IMHO both card/table view buttons on VMs dashboard dialog worth adding tooltips to easily differentiate between them:
    image

  2. Resetting the user's account settings via the account settings dialog reset this view option back to cards view. This is not an obvious expected behavior and even though it's not a destructive action, it is still worth adding a property/indication to the account settings dialog, as done for all other reset-able options.

  3. When resizing the dialog by zooming in, the filter search text field is dismissed. This is reproduced regardless to this fix but now the chance is higher since less space is left. It's not obvious that the search text filed is hidden by the funnel button so maybe worth at least adding a tooltip:
    Default zoom:
    image

    Zoom in:
    image

  4. Pool and Pool vms rows look exactly the same at the table view (same layout except the status new option) while on cards view there is a bit different layout (2 status fields instead of one) and it's more easy to distinguish between them. Maybe worth adding a tag to distinguish

  5. The number of entities displayed on vms dashboard, as part of the filter results, includes a question mark which seems like a bug. E.g.: "23 of ? Results"

    image

@rszwajko
Copy link
Member Author

rszwajko commented Aug 1, 2022

@sgratch

Few comments/enhancements to consider:

  1. IMHO both card/table view buttons on VMs dashboard dialog worth adding tooltips to easily differentiate between them:

The icons look self-explanatory to me but I'll check how tooltips will behave in this scenario. Note that the design guidlines and the examples don't use the tooltips.

  1. Resetting the user's account settings via the account settings dialog reset this view option back to cards view. This is not an obvious expected behavior and even though it's not a destructive action, it is still worth adding a property/indication to the account settings dialog, as done for all other reset-able options.

AFAIK we don't list the properties that will be removed during the reset operation.

  1. When resizing the dialog by zooming in, the filter search text field is dismissed. This is reproduced regardless to this fix but now the chance is higher since less space is left. It's not obvious that the search text filed is hidden by the funnel button so maybe worth at least adding a tooltip:

According to PF4 design guidelines the primary use case here is the mobile browser where "on hover" support is poor.

  1. Pool and Pool vms rows look exactly the same at the table view (same layout except the status new option) while on cards view there is a bit different layout (2 status fields instead of one) and it's more easy to distinguish between them. Maybe worth adding a tag to distinguish

The data is the same in both views - only the layout is different. Of course we can add some extra tag but then it should be visible also on the card view. It would be also nice to filter based on such tag. I would rather create a follow-up PR to track this.

5. The number of entities displayed on vms dashboard, as part of the filter results, includes a question mark which seems like a bug. E.g.: "`23 of ? Results`"

This is a feature :)

Visualise that the total number of VMs/Pools is unknown by displaying
a question mark as the total result count i.e. "10 of ? Results" 

rszwajko added a commit to rszwajko/forklift-console-plugin that referenced this pull request Aug 31, 2022
rszwajko added a commit to rszwajko/forklift-console-plugin that referenced this pull request Aug 31, 2022
Changes:
1. display all providers in ons table
2. provide attribute-value filter implementation with:
  a) free text filter
  b) enum based filter

Reference-Url: oVirt/ovirt-web-ui#1600
Reference-Url: oVirt/ovirt-web-ui#1592
Reference-Url: https://www.patternfly.org/v4/guidelines/filters#attribute-value-filter
rszwajko added a commit to rszwajko/forklift-console-plugin that referenced this pull request Sep 6, 2022
Functional changes:
1. display all providers in one table
2. use only 'Ready' condition to describe the state of the provider

Components created:
1. primary filters component for displaying few (1-3) most important
   filters. The filters are grouped but displayed independently.
2. attribute-value filter implementation for grouping all other filters
   in a space efficient way
3. default filter types:
  a) free text filter
  - substring search based on multiple terms
  - search terms confirmed by 'Enter' key
  b) enum based filter
  - exact match based on checkboxes selected
4. generic table component providing sorting capabilities

Reference-Url: oVirt/ovirt-web-ui#1600
Reference-Url: oVirt/ovirt-web-ui#1592
Reference-Url: https://www.patternfly.org/v4/guidelines/filters#attribute-value-filter
Before, filtering and sorting was tied to VM entities. After this patch
the generic filter/sort component can be reused for other entities.

Filter component changes:
1. create a new type of filter - a date filter
2. generalize name filter to text based filter - as before only one
   filter of this type is supported per filter toolbar
3. extract enum based filter as SelectFilter

Sort component changes:
1. refactor SortFields from constant to parameter
2. drop unused isNumeric flag - natural sort order is used for all
   types of input
Persist chosen view mode as server side user property
"vmPortal.viewForVirtualMachines".

Visualise that the total number of VMs/Pools is unknown by displaying
a question mark as the total result count i.e. "10 of ? Results"
@ovirt-infra
Copy link

All tests passed

@rszwajko
Copy link
Member Author

@sgratch @sjd78
Added 3 commits on top of already reviewed code:

  1. Add tooltips to toolbar filter and card/table view toggle
  2. Use 'many' to describe indeterminate number of results. This wording is recommended by PF4 for paging - see https://www.patternfly.org/v4/components/pagination/design-guidelines#indeterminate-pagination
  3. Base filter selection on already selected filters - the existing code worked (somehow) but after refactoring it's deterministic

@rszwajko
Copy link
Member Author

Screenshots

image

image

image

image

rszwajko added a commit to rszwajko/forklift-console-plugin that referenced this pull request Sep 12, 2022
Functional changes:
1. display all providers in one table
2. use only 'Ready' condition to describe the state of the provider

Components created:
1. primary filters component for displaying few (1-3) most important
   filters. The filters are grouped but displayed independently.
2. attribute-value filter implementation for grouping all other filters
   in a space efficient way
3. default filter types:
  a) free text filter
  - substring search based on multiple terms
  - search terms confirmed by 'Enter' key
  b) enum based filter
  - exact match based on checkboxes selected
4. generic table component providing sorting capabilities

Reference-Url: oVirt/ovirt-web-ui#1600
Reference-Url: oVirt/ovirt-web-ui#1592
Reference-Url: https://www.patternfly.org/v4/guidelines/filters#attribute-value-filter
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

LGTM

@sjd78 sjd78 requested a review from sgratch September 14, 2022 16:27
@sjd78
Copy link
Member

sjd78 commented Sep 19, 2022

/ost

rszwajko added a commit to rszwajko/forklift-console-plugin that referenced this pull request Sep 20, 2022
Functional changes:
1. display all providers in one table
2. use only 'Ready' condition to describe the state of the provider

Components created:
1. primary filters component for displaying few (1-3) most important
   filters. The filters are grouped but displayed independently.
2. attribute-value filter implementation for grouping all other filters
   in a space efficient way
3. default filter types:
  a) free text filter
  - substring search based on multiple terms
  - search terms confirmed by 'Enter' key
  b) enum based filter
  - exact match based on checkboxes selected
4. generic table component providing sorting capabilities

Reference-Url: oVirt/ovirt-web-ui#1600
Reference-Url: oVirt/ovirt-web-ui#1592
Reference-Url: https://www.patternfly.org/v4/guidelines/filters#attribute-value-filter
@rszwajko
Copy link
Member Author

/ost

rszwajko added a commit to rszwajko/forklift-console-plugin that referenced this pull request Sep 23, 2022
Functional changes:
1. display all providers in one table
2. use only 'Ready' condition to describe the state of the provider

Components created:
1. primary filters component for displaying few (1-3) most important
   filters. The filters are grouped but displayed independently.
2. attribute-value filter implementation for grouping all other filters
   in a space efficient way
3. default filter types:
  a) free text filter
  - substring search based on multiple terms
  - search terms confirmed by 'Enter' key
  b) enum based filter
  - exact match based on checkboxes selected
4. generic table component providing sorting capabilities

Reference-Url: oVirt/ovirt-web-ui#1600
Reference-Url: oVirt/ovirt-web-ui#1592
Reference-Url: https://www.patternfly.org/v4/guidelines/filters#attribute-value-filter
Copy link
Member

@sgratch sgratch left a comment

Choose a reason for hiding this comment

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

All looks good, agree with your comments above, except one comment which I'm not sure about:

AFAIK we don't list the properties that will be removed during the reset operation.

It's true that the list of properties is not displayed during reset operation but it's strange that the user can change his current view from cards->table and then approach the "account settings" dialog and see that the "reset settings" option is enabled without knowing why. For all other reset-able options he can see the current chosen values as part of the account settings dialog itself.

A suggestion might be to add a read only view mode field as part of "advanced options" tab within the "account settings" dialog.

A followup issue was opened to handle this: #1632

Copy link
Member

@sgratch sgratch left a comment

Choose a reason for hiding this comment

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

This looks ok except a followup issue that will be handled separately for the reset options handling.

@sgratch sgratch merged commit aa6f3da into oVirt:master Sep 28, 2022
rszwajko added a commit to rszwajko/forklift-console-plugin that referenced this pull request Oct 4, 2022
Functional changes:
1. display all providers in one table
2. use only 'Ready' condition to describe the state of the provider

Components created:
1. primary filters component for displaying few (1-3) most important
   filters. The filters are grouped but displayed independently.
2. attribute-value filter implementation for grouping all other filters
   in a space efficient way
3. default filter types:
  a) free text filter
  - substring search based on multiple terms
  - search terms confirmed by 'Enter' key
  b) enum based filter
  - exact match based on checkboxes selected
4. generic table component providing sorting capabilities

Reference-Url: oVirt/ovirt-web-ui#1600
Reference-Url: oVirt/ovirt-web-ui#1592
Reference-Url: https://www.patternfly.org/v4/guidelines/filters#attribute-value-filter

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
rszwajko added a commit to rszwajko/forklift-console-plugin that referenced this pull request Oct 10, 2022
Functional changes:
1. display all providers in one table
2. use only 'Ready' condition to describe the state of the provider

Components created:
1. primary filters component for displaying few (1-3) most important
   filters. The filters are grouped but displayed independently.
2. attribute-value filter implementation for grouping all other filters
   in a space efficient way
3. default filter types:
  a) free text filter
  - substring search based on multiple terms
  - search terms confirmed by 'Enter' key
  b) enum based filter
  - exact match based on checkboxes selected
4. generic table component providing sorting capabilities

Reference-Url: oVirt/ovirt-web-ui#1600
Reference-Url: oVirt/ovirt-web-ui#1592
Reference-Url: https://www.patternfly.org/v4/guidelines/filters#attribute-value-filter

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
rszwajko added a commit to rszwajko/forklift-console-plugin that referenced this pull request Oct 20, 2022
Functional changes:
1. display all providers in one table
2. use only 'Ready' condition to describe the state of the provider

Components created:
1. primary filters component for displaying few (1-3) most important
   filters. The filters are grouped but displayed independently.
2. attribute-value filter implementation for grouping all other filters
   in a space efficient way
3. default filter types:
  a) free text filter
  - substring search based on multiple terms
  - search terms confirmed by 'Enter' key
  b) enum based filter
  - exact match based on checkboxes selected
4. generic table component providing sorting capabilities

Reference-Url: oVirt/ovirt-web-ui#1600
Reference-Url: oVirt/ovirt-web-ui#1592
Reference-Url: https://www.patternfly.org/v4/guidelines/filters#attribute-value-filter

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
rszwajko added a commit to rszwajko/forklift-console-plugin that referenced this pull request Oct 28, 2022
Components created:
1. standard list page component
  a) page skeleton following openshift console layout and practice
  b) generic component parametrized by the entity type
  c) design is view independent and follows the approach used in oVirt
     PR 1600 and 1592. Currently only table view implementation is
     provided.
2. primary filters component
  a) implementation of PatternFly 4 filter group pattern[1] extended to
     support all filters implementing FilterTypeProps interface.
  b) use case: displaying few (1-3) most important filters.
     The filters are grouped but displayed independently.
3. attribute-value filter component
  a) implementation of PatternFly 4 attribute-value filter pattern[2]
  b) use case: grouping all other filters in a space efficient way
  c) supports all filters implementing FilterTypeProps interface.
4. filter components:
  a) free text filter
   - substring search based on multiple terms
   - search terms confirmed by 'Enter' key or by button
  b) enum based filter
   - exact match based on checkboxes selected
5. table view component
  a) parametrized by the entity type
  b) row mapper component is entity-specific which allows complex
     customizations
  c) sorting capabilities (via arrows in the table header)
6. dialog for managing column visibility and order
  a) based on openshift console solution [3] and PatternFly 4 demo[4]
  b) toggle column visibility (except identity columns)
  c) re-order columns using drag and drop

Updated libraries:
1. Downgrade @testing-library/react to ^12.0 since ^13.0 requires
   react >= 18.
2. Bump @openshift/dynamic-plugin-sdk* to 1.0.0

[1] https://www.patternfly.org/v4/guidelines/filters/#filter-group
[2] https://www.patternfly.org/v4/guidelines/filters#attribute-value-filter
[3] https://github.com/openshift/console/blob/release-4.12/frontend/public/components/modals/column-management-modal.tsx
[4] https://www.patternfly.org/v4/components/table/react-demos#column-management-with-draggable

Reference-Url: oVirt/ovirt-web-ui#1600
Reference-Url: oVirt/ovirt-web-ui#1592
Signed-off-by: Radoslaw Szwajkowski <[email protected]>
@isaranova
Copy link

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants