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

When no site provided on query string, redirect w/ with valid site specified #35

Merged
merged 4 commits into from
Feb 5, 2024

Conversation

benvinegar
Copy link
Owner

@benvinegar benvinegar commented Feb 4, 2024

This has a couple of benefits:

  • After redirect, doesn't wait for getSitesOrderedByHits to finish before querying data (no blocking before fetching data; faster)
  • Avoids situations where different URLs could generate the same document (better consistency IMO), i.e. we were loading a default site at /dashboard and this would generate the same document as /dashboard?site=default
  • No longer throws when there is no data in the AE dataset (fixes Loading Dashboard with no data fails with "Application Error" #24)
  • Removes unnecessary Promise layer in test code (when mocking responses via fetch.mockResolvedValue)

Copy link

codecov bot commented Feb 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2265b13) 72.38% compared to head (01560b6) 72.51%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   72.38%   72.51%   +0.12%     
==========================================
  Files          18       18              
  Lines        1934     1943       +9     
  Branches      115      119       +4     
==========================================
+ Hits         1400     1409       +9     
  Misses        528      528              
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benvinegar benvinegar merged commit 7f36338 into main Feb 5, 2024
3 checks passed
@benvinegar benvinegar deleted the fix-default-states branch February 5, 2024 03:56
benvinegar added a commit that referenced this pull request Dec 20, 2024
…ecified (#35)

* If no ?site provided, redirect to the most visited site

* Dashboard loader test when site has no corresponding data

* Remove unnecessary promise layer

* Add test when no site data available
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.

Loading Dashboard with no data fails with "Application Error"
1 participant