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

Fix total count in show page navigation bar when total count = 1 #6405

Closed
lucasbordeau opened this issue Jul 25, 2024 · 7 comments · Fixed by #6462
Closed

Fix total count in show page navigation bar when total count = 1 #6405

lucasbordeau opened this issue Jul 25, 2024 · 7 comments · Fixed by #6462
Assignees

Comments

@lucasbordeau
Copy link
Contributor

Bug Description

Total count is displayed as 0 if it is 1.

image

Expected behavior

Total count should be 1 if total count is 1.

Technical inputs

See related issue : #6325

@ehconitin
Copy link
Contributor

@lucasbordeau can I work on it?

@ehconitin
Copy link
Contributor

Hi @lucasbordeau,
I tried to reproduce the bug you mentioned but was unable to do so. Could you please provide more specific details or steps to replicate the issue? This would greatly help me in understanding and resolving the problem.

@charlesBochet
Copy link
Member

Updating the logic to:
// Todo: the totalCount is broken on backend (likely because of pg_graphql)
// Here are the current behavior, if the query does not return any result, totalCount is 0
// If the query returns a result, totalCount is the total number of records
const totalCount =
totalCountBefore === 0
? totalCountAfter === 0
? 1
: totalCountAfter
: totalCountBefore;

We need to fix the BE, but this fix will do it in the FE

@prateekj117
Copy link
Contributor

@charlesBochet Can i take this up? I can replicate this.
Screenshot 2024-07-30 at 8 14 58 PM

@Bonapara
Copy link
Member

Bonapara commented Jul 30, 2024

@ehconitin sure you can have a try! But it's a Backend issue, so might be hard to tackle

@prateekj117
Copy link
Contributor

@Bonapara @ehconitin Sorry! I already made an MR for this. I was able to reproduce it so I just went ahead and solved it. Sorry for the inconvenience!

@ehconitin
Copy link
Contributor

Its okay @prateekj117
Let me know if you need any help.

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in 🎯 Roadmap & Sprints Jul 30, 2024
charlesBochet pushed a commit that referenced this issue Jul 31, 2024
Fixes #6405

We need to take into account both the totalCount of **before cursor**
results and **after cursor** results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants