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

Add download_file API #648

Merged
merged 1 commit into from
May 6, 2023
Merged

Add download_file API #648

merged 1 commit into from
May 6, 2023

Conversation

jmthomas
Copy link
Member

@jmthomas jmthomas commented May 2, 2023

closes #645

@jmthomas jmthomas requested a review from ryanmelt May 2, 2023 16:50
@codecov
Copy link

codecov bot commented May 2, 2023

Codecov Report

Patch coverage: 20.00% and project coverage change: -0.02 ⚠️

Comparison is base (a999438) 74.48% compared to head (7263c6a) 74.46%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #648      +/-   ##
==========================================
- Coverage   74.48%   74.46%   -0.02%     
==========================================
  Files         462      462              
  Lines       28670    28680      +10     
  Branches      588      588              
==========================================
+ Hits        21355    21357       +2     
- Misses       7221     7229       +8     
  Partials       94       94              
Flag Coverage Δ
ruby-api 51.40% <14.28%> (-0.08%) ⬇️
ruby-backend 78.55% <33.33%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...riptrunner/src/tools/ScriptRunner/ScriptRunner.vue 69.63% <ø> (ø)
openc3/lib/openc3/script/storage.rb 14.11% <0.00%> (-0.35%) ⬇️
...mos-script-runner-api/app/models/running_script.rb 19.81% <14.28%> (-0.05%) ⬇️
openc3/lib/openc3/utilities/store_autoload.rb 83.16% <100.00%> (+0.16%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.setAttribute('download', data.filename)
link.click()
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to remove the element after clicking on it? Seems like this would leave an anchor on the page?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe but this is how it's done everywhere else, lol. I'll check ...

Copy link
Member Author

Choose a reason for hiding this comment

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

According to this they will be garbage collected. We don't actually insert the new element in the DOM so nothing actually shows up and they're all just local variables.

@jmthomas jmthomas merged commit 2d2eedd into main May 6, 2023
@jmthomas jmthomas deleted the download_file branch May 6, 2023 17:26
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.

Add download_file to Script Runner
2 participants