-
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/home): allow to change the number of items per page #4708
Conversation
dc790c0
to
c08d790
Compare
pathname, | ||
query: { ...query, n: nItems }, | ||
}) | ||
} |
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 think it would be interesting to save this in cookies.
c2f9750
to
d2e36ef
Compare
@@ -5,6 +5,7 @@ import ActionButton from 'action-button' | |||
import Button from 'button' | |||
import CenterPanel from 'center-panel' | |||
import classNames from 'classnames' | |||
import cookies from 'cookies-js' |
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.
Is it sorted?
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.
Yes.
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.
That's weird because if it's case sensitive, then CenterPanel
and Component
should be grouped and if it isn't, then cookies
should be after Component
.
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.
It's my fault. it's not sorted.
To avoid unrelated changes, I will import it after Component
.
48e5bdb
to
f8a1c63
Compare
b12cc56
to
49a60b2
Compare
@@ -5,6 +5,7 @@ import ActionButton from 'action-button' | |||
import Button from 'button' | |||
import CenterPanel from 'center-panel' | |||
import classNames from 'classnames' | |||
import cookies from 'cookies-js' |
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.
That's weird because if it's case sensitive, then CenterPanel
and Component
should be grouped and if it isn't, then cookies
should be after Component
.
@@ -1154,6 +1182,7 @@ export default class Home extends Component { | |||
isPoolAdmin, | |||
noResourceSets, | |||
} = this.props | |||
const nItemsPerPage = this._getnItemsPerPage() |
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.
Inline.
@@ -979,7 +997,7 @@ export default class Home extends Component { | |||
})} | |||
</span> | |||
</Col> | |||
<Col mediumSize={8} className='text-xs-right hidden-sm-down'> | |||
<Col mediumSize={6} className='text-xs-right hidden-sm-down'> |
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.
Can you check if all the sizes work fine with all the widths? If not, we can take some space from the 1st column, I think.
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.
Should we keep the issue open since it mentions adding a user preference for this?
@@ -517,6 +519,18 @@ export default class Home extends Component { | |||
identity, | |||
]) | |||
|
|||
_getNItemsPerPage = () => | |||
+defined( | |||
this.state.homeItemsPerPage, |
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.
Why do you need to also store it in the state? Can't we only rely on the cookies?
@@ -683,7 +697,7 @@ export default class Home extends Component { | |||
_getVisibleItems = createPager( | |||
this._getFilteredItems, | |||
() => this._getPage(), | |||
ITEMS_PER_PAGE | |||
() => this._getNItemsPerPage() |
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._getNItemsPerPage
888b737
to
a6f8e1b
Compare
Yes. |
fcd7f25
to
0f24491
Compare
See #4535
Screenshots
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: