nasa / earthdata-download

Download your Earth science data with only one click
https://nasa.github.io/earthdata-download/
Other
22 stars 6 forks source link

EDD-41: As a download app user, I want to be notified of a new download starting. #25

Closed daniel-zamora closed 1 year ago

daniel-zamora commented 1 year ago

Overview

What is the feature?

Notification when a new download is started when not on Downloads page.

What is the Solution?

I added a toast notification that fires when the onInitializeDownload listener in Layout receives and event and the currentPage is not downloads. I also adjusted the preload.ts file listener setup to call removeAllListeners instead of removeListener, as we were running into issues receiving the message properly due to orphaned listeners.

What areas of the application does this impact?

Layout.jsx, Settings.jsx and FileDownloads.jsx

Testing

Reproduction steps

  1. Start a download
  2. Navigate to fileDownloads page
  3. Start another download
  4. View toast notification

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #25 (43068bd) into main (12f9215) will decrease coverage by 0.09%. The diff coverage is 76.19%.

:exclamation: Current head 43068bd differs from pull request most recent head db52e4d. Consider uploading reports for the commit db52e4d to get more accurate results

@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
- Coverage   92.36%   92.28%   -0.09%     
==========================================
  Files          96       96              
  Lines        1807     1801       -6     
  Branches      402      404       +2     
==========================================
- Hits         1669     1662       -7     
- Misses        138      139       +1     
Files Changed Coverage Δ
src/app/pages/FileDownloads/FileDownloads.jsx 95.65% <ø> (+1.42%) :arrow_up:
src/app/components/Layout/Layout.jsx 56.70% <44.44%> (-2.19%) :arrow_down:
src/app/dialogs/Settings/Settings.jsx 100.00% <100.00%> (+5.26%) :arrow_up:
src/main/eventHandlers/chooseDownloadLocation.ts 100.00% <100.00%> (ø)
src/main/preload.ts 100.00% <100.00%> (ø)
src/main/utils/setupEventListeners.ts 97.72% <100.00%> (ø)