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

[UI] Add Virtualise List for Volume Table #2938

Merged
merged 14 commits into from
Jan 8, 2021

Conversation

ChengYanJin
Copy link
Contributor

@ChengYanJin ChengYanJin commented Nov 20, 2020

Component: ui, tables

Context:
With the use case of thousands of volumes, the table would meet performance issues when rendering them at once.
So instead of doing this, we just render a small subset of rows at a give time.

Summary:
Introduce react-window and react-virtualized-auto-sizer to realize the virtualize row.
Adapt the interaction test

UI change:
Replace the "Unknown" text in the table with a hyphen icon to reduce the noise that less important information brings.

Acceptance criteria:
image
If we open the developer tool => Elements, we should see just a few of the <tr/> at the beginning, when we scroll down on the list, we can see the update of the list.
image


Closes: #2931

@bert-e
Copy link
Contributor

bert-e commented Nov 20, 2020

Hello chengyanjin,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Nov 20, 2020

Branches have diverged

This pull request's source branch improvement/add-virtualise-list-for-tables has diverged from
development/2.6 by more than 50 commits.

To avoid any integration risks, please re-synchronize them using one of the
following solutions:

  • Merge origin/development/2.6 into improvement/add-virtualise-list-for-tables
  • Rebase improvement/add-virtualise-list-for-tables onto origin/development/2.6

Note: If you choose to rebase, you may have to ask me to rebuild
integration branches using the reset command.

@ChengYanJin ChengYanJin force-pushed the improvement/add-virtualise-list-for-tables branch 2 times, most recently from 09fd05f to 66f38c0 Compare November 20, 2020 10:23
@bert-e
Copy link
Contributor

bert-e commented Nov 20, 2020

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

@bert-e
Copy link
Contributor

bert-e commented Nov 20, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@ChengYanJin ChengYanJin force-pushed the improvement/add-virtualise-list-for-tables branch from 66f38c0 to 2ee989f Compare November 20, 2020 10:25
@bert-e
Copy link
Contributor

bert-e commented Nov 20, 2020

History mismatch

Merge commit #d8a6d63191aa0fd356244edda4009768c8f5f684 on the integration branch
w/2.7/improvement/add-virtualise-list-for-tables is merging a branch which is neither the current
branch improvement/add-virtualise-list-for-tables nor the development branch
development/2.7.

It is likely due to a rebase of the branch improvement/add-virtualise-list-for-tables and the
merge is not possible until all related w/* branches are deleted or updated.

Please use the reset command to have me reinitialize these branches.

@ChengYanJin ChengYanJin force-pushed the improvement/add-virtualise-list-for-tables branch 5 times, most recently from 328355a to 9163f97 Compare November 24, 2020 19:50
thomasdanan
thomasdanan previously approved these changes Nov 25, 2020
Copy link
Contributor

@thomasdanan thomasdanan left a comment

Choose a reason for hiding this comment

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

works well, just you have to mouse over very precisely on the hyphen to see the tooltip, may be the zone could be enlarged a bit

@ChengYanJin
Copy link
Contributor Author

works well, just you have to mouse over very precisely on the hyphen to see the tooltip, may be the zone could be enlarged a bit

Done! Thanks for the feedback!

thomasdanan
thomasdanan previously approved these changes Dec 9, 2020
@ChengYanJin
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Dec 9, 2020

History mismatch

Merge commit #d8a6d63191aa0fd356244edda4009768c8f5f684 on the integration branch
w/2.7/improvement/add-virtualise-list-for-tables is merging a branch which is neither the current
branch improvement/add-virtualise-list-for-tables nor the development branch
development/2.7.

It is likely due to a rebase of the branch improvement/add-virtualise-list-for-tables and the
merge is not possible until all related w/* branches are deleted or updated.

Please use the reset command to have me reinitialize these branches.

The following options are set: approve

@ChengYanJin
Copy link
Contributor Author

/reset

@bert-e
Copy link
Contributor

bert-e commented Dec 9, 2020

Reset complete

I have successfully deleted this pull request's integration branches.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Dec 9, 2020

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Dec 9, 2020

Build failed

The build for commit did not succeed in branch w/2.7/improvement/add-virtualise-list-for-tables.

The following options are set: approve

@ChengYanJin ChengYanJin force-pushed the improvement/add-virtualise-list-for-tables branch 2 times, most recently from ee34d84 to 734b1a7 Compare December 23, 2020 10:45
@ChengYanJin ChengYanJin changed the base branch from development/2.6 to development/2.7 December 23, 2020 10:45
@bert-e
Copy link
Contributor

bert-e commented Dec 23, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following options are set: approve

@ChengYanJin ChengYanJin force-pushed the improvement/add-virtualise-list-for-tables branch from 734b1a7 to c1fa73b Compare December 23, 2020 17:46
Autosizer automatically adjusts the width and height of a single child.

Refs: #2931

ui/table: Add flex for table row to fully use the space

Refs: #2931
Too many "Unknown" in the table seems extremly noisy and since the
"Unknown" information is rather less important, we should replace it by
an icon with tooltip.

Refs: #2931
- Upgrade the react-table version to get support for react (v17.0.1)
- Introduce react-window and react-virtualized-auto-sizer for the
  virtualize list

Refs: #2931
For non-specified instance URL, such as `/volumes`,
we should automatically choose the first one in the list.

However, since we are not aware currectVolumeName in VolumePage
component, we fall into  update the URL which triger the
VolumePage re-renders. Cause the infinite API calls.

So I move this logic to VolumePageContent which solve the issue.

Refs: #2931
Since <AutoSizer> is a <div/> so it breaks the table layout,
we need to use <div/> for all the HTML tags in table
(thead, tbody, tr, td...) and retrieve the defaullt styles by className.

Refs: #2931
So that the users don't need to hover on the hypen precisely

Refs: #2931
@ChengYanJin ChengYanJin force-pushed the improvement/add-virtualise-list-for-tables branch from c1fa73b to 8f871bc Compare January 6, 2021 10:00
@bert-e
Copy link
Contributor

bert-e commented Jan 6, 2021

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Jan 6, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following options are set: approve

`;

const TableRow = (props) => {
const { row, style, rowClicked, volumeName, theme } = props;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rename rowClicked props to onClick to match standard event names

Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of passing volumeName I would introduce an isSelected prop that reflect in a clearer way if the row is selected or not

Copy link
Contributor

Choose a reason for hiding this comment

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

In order to avoid props drilling of the theme you can rely on styled component which automatically map the theme as part of the props or use useTheme hook that retrieve current theme from styled-component internal context

@@ -151,6 +100,13 @@ const TooltipContent = styled.div`
min-width: 60px;
`;

const UnknownIcon = styled.i`
Copy link
Contributor

Choose a reason for hiding this comment

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

This component is duplicated in table row, please consider exporting it instead if it is necessary

({ index, style }) => {
const row = rows[index];
prepareRow(row);
// Extract the TableRow component outside of Table component
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment can be deleted

{intl.translate('no_volume_found')}
</td>
</HeadRow>
No Volume
Copy link
Contributor

Choose a reason for hiding this comment

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

A translation seems to be missing here, maybe {intl.translate('no_volume_found')}

Since style component can map the theme as part of the props. we don't
need to pass the theme props to the component.

Refs: #2931
@bert-e
Copy link
Contributor

bert-e commented Jan 6, 2021

Build failed

The build for commit did not succeed in branch improvement/add-virtualise-list-for-tables.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Jan 7, 2021

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/2.7

  • ✔️ development/2.8

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Jan 8, 2021

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/2.7

  • ✔️ development/2.8

The following branches have NOT changed:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6

Please check the status of the associated issue None.

Goodbye chengyanjin.

@bert-e bert-e merged commit b87b113 into development/2.7 Jan 8, 2021
@bert-e bert-e deleted the improvement/add-virtualise-list-for-tables branch January 8, 2021 08:33
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.

UI implement Virtualise list for Volume table
5 participants