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(xo-web/SortedTable): allow to change the number of items per page #5355

Merged
merged 7 commits into from
Nov 27, 2020

Conversation

Rajaa-BARHTAOUI
Copy link
Contributor

@Rajaa-BARHTAOUI Rajaa-BARHTAOUI commented Nov 2, 2020

See xoa-support#3020

Check list

Check if done, if not relevant leave unchecked.

  • PR reference the relevant issue (e.g. Fixes #007 or See xoa-support#42)
  • if UI changes, a screenshot has been added to the PR
  • documentation updated
  • CHANGELOG.unreleased.md:
    • enhancement/bug fix entry added
    • list of packages to release updated (${name} v${new version})
  • I have tested added/updated features (and impacted code)

Process

  1. create a PR as soon as possible
  2. mark it as WiP: (Work in Progress) if not ready to be merged
  3. when you want a review, add a reviewer (and only one)
  4. if necessary, update your PR, and re- add a reviewer

From the Four Agreements:

  1. Be impeccable with your word.
  2. Don't take anything personally.
  3. Don't make assumptions.
  4. Always do your best.

@badrAZ badrAZ requested a review from pdonias November 3, 2020 15:32
CHANGELOG.unreleased.md Outdated Show resolved Hide resolved
@@ -343,6 +340,10 @@ class SortedTable extends Component {

const state = (this.state = {
all: false, // whether all items are selected (accross pages)
itemsPerPage: +defined(
cookies.get('sortedTableItemsPerPage'),
Copy link
Member

Choose a reason for hiding this comment

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

Don't you think it would be better to be able to set a different value for each table? Identifying them with their stateUrlParam or another prop, maybe? I don't think someone would necessarily want the same number of items per page in the SR/disks view and in the Health view.

@@ -53,6 +53,11 @@ import parseNdJson from './_parseNdJson'

// ===================================================================

export const DEFAULT_ITEMS_PER_PAGE = 20
Copy link
Member

Choose a reason for hiding this comment

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

We should probably keep 10 as the default value, otherwise it would change for everybody.

@badrAZ badrAZ requested a review from pdonias November 27, 2020 12:01
@@ -306,6 +303,7 @@ class SortedTable extends Component {

const state = (this.state = {
all: false, // whether all items are selected (accross pages)
itemsPerPage: +defined(cookies.get(props.location.pathname + props.stateUrlParam), DEFAULT_ITEMS_PER_PAGE),
Copy link
Member

Choose a reason for hiding this comment

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

Add a separator between the pathname and the stateUrlParam. Like -.

packages/xo-web/src/common/sorted-table/index.js Outdated Show resolved Hide resolved
@pdonias pdonias changed the title feat(xo-web/sortedTable): allow to change the number of items per page feat(xo-web/SortedTable): allow to change the number of items per page Nov 27, 2020
@pdonias pdonias merged commit fbf906d into master Nov 27, 2020
@pdonias pdonias deleted the rajaa-showSrPerPage branch November 27, 2020 13:20
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.

3 participants