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

Stop making unnecessary calls in Project Summary page #4729

Merged
merged 3 commits into from Nov 21, 2023

Conversation

magicznyleszek
Copy link
Member

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes

Description

Avoid making unnecessary calls for project with no submissions. Also don't show a "Not found" error for expected 404 response from API for the graph.

Notes

Things changed here:

  • SubmissionsCountGraph component is making a call to counts API, a 404 will be returned when there are no counts for given period. We were unnecessarily displaying error notification for this
  • Similarly FormSummaryProjectInfo is making a call to submissions API to display information about latest submission. We were unnecessarily making call knowing there are no submissions

@magicznyleszek magicznyleszek marked this pull request as ready for review November 16, 2023 17:59
Copy link
Contributor

@noliveleger noliveleger left a comment

Choose a reason for hiding this comment

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

LGTM

@noliveleger noliveleger merged commit 8519cd8 into beta Nov 21, 2023
4 checks passed
@noliveleger noliveleger deleted the fix-project-summary-calls branch November 21, 2023 21:28
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

2 participants