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

🐛 Set filenames for task details downloads #2031

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

sjd78
Copy link
Member

@sjd78 sjd78 commented Jul 25, 2024

Resolves: #2030

On the Analysis details / Task details page, the log viewer allows downloading of the file being displayed. Set a filename that matches the attachment name when doing the download.

File names used:

  • Base log view -> "log-${taskId}"
  • Merged log view -> "log-merged-${taskId}"
  • Task attachment -> attachment name

Due to the way the CodeEditor PF5 component implements the download action, only file extensions of known file types can be used. Any log or attachment files will have file extensions of .yaml or .json or .txt depending on the detected file type. File type detection is only using attachment name file extensions currently, and only differentiates between yaml and json with a default to plain text. For example, given an attachment name, the download file name will be:

  • git.output -> git.output.txt
  • addon.log -> addon.log.txt
  • settings.yaml -> settings.yaml
  • data.json -> data.json

@sjd78 sjd78 requested a review from jortel July 25, 2024 14:27
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.15%. Comparing base (b654645) to head (5c9bced).
Report is 202 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2031      +/-   ##
==========================================
+ Coverage   39.20%   42.15%   +2.95%     
==========================================
  Files         146      171      +25     
  Lines        4857     5503     +646     
  Branches     1164     1353     +189     
==========================================
+ Hits         1904     2320     +416     
- Misses       2939     3068     +129     
- Partials       14      115     +101     
Flag Coverage Δ
client 42.15% <ø> (+2.95%) ⬆️
server ?

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

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

On the Analysis details / Task details page, the log
viewer allows downloading of the file being displayed.
Set a filename that matches the attachment name when
doing the download.

File names used:
  - Base log view -> "log-${taskId}"
  - Merged log view -> "log-merged-${taskId}"
  - Task attachment -> attachment name

Due to the way the `CodeEditor` PF5 component implements
the download action, only file extensions of known file
types can be used.  Any log or attachment files will have
file extensions of `.yaml` or `.json` or `.txt` depending
on the detected file type.  File type detection is only
using attachment name file extensions currently, and only
differentiates between yaml and json with a default to plain
text.  For example, given an attachment name, the download
file name will be:
  - `git.output` -> `git.output.txt`
  - `addon.log` -> `addon.log.txt`
  - `settings.yaml` -> `settings.yaml`
  - `data.json` -> `data.json`

Signed-off-by: Scott J Dickerson <[email protected]>
@sjd78 sjd78 force-pushed the task-details-download-filename branch from 681aee9 to 5c9bced Compare July 25, 2024 15:11
@sjd78 sjd78 added this to the v0.5.0 milestone Jul 25, 2024
@sjd78 sjd78 merged commit 04c244e into konveyor:main Jul 25, 2024
12 checks passed
@sjd78 sjd78 deleted the task-details-download-filename branch July 25, 2024 16:22
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.

[BUG] Task attached file download does not preserve name.
2 participants