-
Notifications
You must be signed in to change notification settings - Fork 46
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
Feature/pagination actions #2108
Feature/pagination actions #2108
Conversation
By default, the MUI TablePagination component only allows for Previous/Next page navigation. Any further customisation must be implemented inside a separate component, which gets passed to the MUI ActionsComponent prop
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.
Thanks Charlie! :)
Source/Plugins/Core/com.equella.core/js/__tests__/tsrc/search/SearchPage.test.tsx
Outdated
Show resolved
Hide resolved
Source/Plugins/Core/com.equella.core/js/__tests__/tsrc/search/SearchPage.test.tsx
Outdated
Show resolved
Hide resolved
Source/Plugins/Core/com.equella.core/js/__tests__/tsrc/search/SearchPage.test.tsx
Show resolved
Hide resolved
Source/Plugins/Core/com.equella.core/js/__tests__/tsrc/search/SearchPage.test.tsx
Show resolved
Hide resolved
Source/Plugins/Core/com.equella.core/js/__tests__/tsrc/search/SearchPage.test.tsx
Show resolved
Hide resolved
Source/Plugins/Core/com.equella.core/js/__tests__/tsrc/search/SearchPage.test.tsx
Show resolved
Hide resolved
Source/Plugins/Core/com.equella.core/js/tsrc/search/components/SearchPagination.tsx
Outdated
Show resolved
Hide resolved
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.
Just some tweaks as per discussion and comments.
Source/Plugins/Core/com.equella.core/js/__mocks__/getSearchResult.js
Outdated
Show resolved
Hide resolved
Source/Plugins/Core/com.equella.core/js/__mocks__/getSearchResult.js
Outdated
Show resolved
Hide resolved
Source/Plugins/Core/com.equella.core/js/tsrc/search/components/SearchPagination.tsx
Outdated
Show resolved
Hide resolved
Source/Plugins/Core/com.equella.core/js/tsrc/search/components/SearchPagination.tsx
Outdated
Show resolved
Hide resolved
Source/Plugins/Core/com.equella.core/js/__tests__/tsrc/search/SearchPage.test.tsx
Outdated
Show resolved
Hide resolved
Source/Plugins/Core/com.equella.core/js/__tests__/tsrc/search/SearchPage.test.tsx
Show resolved
Hide resolved
… reliable autotests, as well as giving oEQ admins more flexibility in custom ui styling
Source/Plugins/Core/com.equella.core/js/tsrc/search/components/SearchPagination.tsx
Show resolved
Hide resolved
The Search page test is getting more and more test cases and mock data in. Almost all of tests are reliant on |
* Generate mock search results using lodash * Use ids for pagination button selectors
…ppy/Charliequella into feature/pagination-actions
Yes. I think this test needs an overhaul in general. But in the interests of time we should revisit this in the future |
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.
Looks good 👍. I've highlighted a slight simplification but it will do the equivalent of what you did before so feel free to ignore.
Also I'm noting we talked about the issues with tests - that file will be rewritten in another ticket.
Source/Plugins/Core/com.equella.core/js/__tests__/tsrc/search/SearchPage.test.tsx
Outdated
Show resolved
Hide resolved
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.
Good stuff dude! Love the new test.
Coupla quick tweaks and then you should be done. 👍
Source/Plugins/Core/com.equella.core/js/__tests__/tsrc/search/SearchPage.test.tsx
Outdated
Show resolved
Hide resolved
… being hardcoded to 30
…ing purposes. And use it inside SearchPage and SearchPagination tests Origianlly I tried exporting the function from the SearchPagination test. But eslint enforces the jest/no-export rule, so it had to go inside its own ts file
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 pretty well there, but in order or priority:
- Need JSDoc on your new utility function;
- Sorry about previous advice, looks like you've enough controls/elements here that you want an interface for your
paginatorControls
; and - Should get the mocked data right.
Source/Plugins/Core/com.equella.core/js/__tests__/tsrc/components/SearchPaginationTestHelper.ts
Outdated
Show resolved
Hide resolved
…ppy/Charliequella into feature/pagination-actions
Checklist
Description of change
#1306
This PR adds in additional Paging options to the mui TablePagination component, allowing for navigating to the first and last page of search results