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

Kt 2021 11 pagination #3973

Merged
merged 3 commits into from
Nov 22, 2021
Merged

Kt 2021 11 pagination #3973

merged 3 commits into from
Nov 22, 2021

Conversation

khamui
Copy link
Contributor

@khamui khamui commented Nov 17, 2021

Some notes, that might help to understand what was intended :)
This react pagination should behave like the old one (rather than what is in the current design)
I am not sure if i utilized the pagination django part correctly, any suggestions appreciated.

You might expect it a bit different, but:
page_size = 0 won't show all, but 0 --> edge case (we should use rather a large number)

Copy link
Contributor

@sabinammm sabinammm left a comment

Choose a reason for hiding this comment

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

nice!!

Copy link
Contributor

@fuzzylogic2000 fuzzylogic2000 left a comment

Choose a reason for hiding this comment

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

It looks good and works well! (And I think for testing and for now it would be good, to keep the firts state of the template?)

meinberlin/apps/budgeting/api.py Outdated Show resolved Hide resolved
meinberlin/apps/budgeting/assets/Pagination.jsx Outdated Show resolved Hide resolved
meinberlin/config/settings/base.py Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Nov 18, 2021

Coverage report

Total coverage

Status Category Percentage Covered / Total
🔴 Statements 1.48% 18/1220
🔴 Branches 0.85% 6/702
🔴 Functions 2.25% 9/400
🔴 Lines 3.09% 108/3493

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Show new covered files 🌑

Coverage of new files

Status Filename Statements Branches Functions Lines
🟢 meinberlin/apps/budgeting/assets/Pagination.jsx 100% 100% 100% 100%

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Show files with reduced coverage 🔻

Reduced coverage

Status Filename Statements Branches Functions Lines
🔴 meinberlin/apps/budgeting/assets/BudgetingProposalList.jsx 0% 0% (-100% 🔻) 0% 0%

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Report generated by 🧪jest coverage report action from 6139057

@fuzzylogic2000 fuzzylogic2000 self-assigned this Nov 22, 2021
Copy link
Contributor

@fuzzylogic2000 fuzzylogic2000 left a comment

Choose a reason for hiding this comment

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

Yeah, I like that all the logic is in the API now. But I think, that can be done with less code by using what the paginator already gives you.
https://www.django-rest-framework.org/api-guide/pagination/#custom-pagination-styles

meinberlin/apps/budgeting/api.py Outdated Show resolved Hide resolved
return Response({
'status': True,
'results': data,
'meta': {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here: do you need all of that? Could you use the stuff you have?

meinberlin/apps/budgeting/api.py Outdated Show resolved Hide resolved
meinberlin/apps/budgeting/api.py Outdated Show resolved Hide resolved
meinberlin/apps/budgeting/api.py Outdated Show resolved Hide resolved
meinberlin/apps/budgeting/api.py Outdated Show resolved Hide resolved
meinberlin/apps/budgeting/api.py Outdated Show resolved Hide resolved
@fuzzylogic2000 fuzzylogic2000 removed their assignment Nov 22, 2021
Kha added 2 commits November 22, 2021 10:16
…settings.py

creating better response structur from backend
changing page_size to be set on backend only
Copy link
Contributor

@fuzzylogic2000 fuzzylogic2000 left a comment

Choose a reason for hiding this comment

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

Nice!

@fuzzylogic2000 fuzzylogic2000 merged commit a43dbde into main Nov 22, 2021
@fuzzylogic2000 fuzzylogic2000 deleted the kt-2021-11-pagination branch November 22, 2021 12:35
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.

None yet

3 participants