-
Notifications
You must be signed in to change notification settings - Fork 262
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
Conversation
40f3a86
to
77a6834
Compare
@@ -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'), |
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.
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 |
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.
We should probably keep 10 as the default value, otherwise it would change for everybody.
f543f7a
to
98123dd
Compare
f844037
to
eb779e5
Compare
eb779e5
to
60a7859
Compare
61166e0
to
f997d8a
Compare
@@ -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), |
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.
Add a separator between the pathname and the stateUrlParam. Like -
.
See xoa-support#3020
Check list
Fixes #007
orSee xoa-support#42
)CHANGELOG.unreleased.md
:${name} v${new version}
)cron/parse.spec.js
)xo-server
API changes, the corresponding test has been added to/updated onxo-server-test
Process
WiP:
(Work in Progress) if not ready to be mergedFrom the Four Agreements: