nasa / earthdata-search

Earthdata Search is a web application developed by NASA EOSDIS to enable data discovery, search, comparison, visualization, and access across EOSDIS' Earth Science data holdings.
https://search.earthdata.nasa.gov
Other
743 stars 221 forks source link

EDSC-4079: error status code check change #1803

Closed daniel-zamora closed 1 week ago

daniel-zamora commented 2 weeks ago

Overview

What is the feature?

When a user is unauthorized, either because they are not logged in or otherwise, and they select granule filters and attempt to downloaded, upon redirect to the project page then subsequent redirect to EDL then again back to the project, the filters they had selected can be dropped.

What is the Solution?

Refactored the granule download button to send the user to a login page directly when they are trying to download granules while not logged in, instead of relying on failed subsequent calls on the project page that required authentication.

What areas of the application does this impact?

Granule download button.

Testing

Reproduction steps

In any environment,

  1. Select some granules from download while not logged in.
  2. Press the download button to progress to the project page.
  3. Once redirected to EDL login, enter in credentials and submit (to be redirected back)
  4. Verify your granule filters are intact(or that they are not there if fix is not in).

Checklist

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.23%. Comparing base (06affc5) to head (9dca02f). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1803 +/- ## ========================================== - Coverage 93.37% 93.23% -0.15% ========================================== Files 764 765 +1 Lines 18441 18451 +10 Branches 4763 4764 +1 ========================================== - Hits 17220 17203 -17 - Misses 1137 1163 +26 - Partials 84 85 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

daniel-zamora commented 2 weeks ago

@eudoroolivares2016 I tried using the button component in this way early in development on this solution and found it failed to save the state properly, directing to the project page. It was long enough ago that I do not remember the specifics. It may have been something else causing that.