CUAHSI / CUAHSI/SWOT-Data-Viewer

Fix undefined values in lake CSV filenames

Open Beginner friendly
#219 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
5
Forks
1
Avg merge
1d 1m
Merged PRs (30d)
2

Description

**Describe the bug**
CSV filenames currently use the same naming convention for both rivers and lake data.
`filename = ${featureType}_${riverName}_${reachId}_${startTime}_${endTime}`

This works for river data, but lake features do not have `rivername` or `reachid` fields. As a result, lake downloads can produce filenames such as: `priorlake_undefined_undefined_2023_03_01t00_00_00z_2026_08_11t16_34_28z.csv`

For your reference: Lake support was added after the original river-data implementation, but the filename construction logic was not updated to account for lake-specific fields.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to https://swotviz.cuahsi.io
2. Click on a lake
3. Generate a plot
4. Download the data as a CSV

**Expected behavior**
The filename for lake downloads should be: `____.csv`
The lake name is already included in the downloaded csv. The lake ID is available in the app's metadata table after a lake is selected.

**Screenshots**

Image

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the CSV download flow and locate the filename construction that uses featureType, riverName, reachId, startTime, and endTime. Reproduce a lake download at swotviz.cuahsi.io, then verify the filename uses the lake name and lake ID while river filenames remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.