konveyor / tackle2-ui

Tackle (2nd generation) UI component.
Apache License 2.0
6 stars 29 forks source link

:sparkles: View files task attachments #1954

Closed rszwajko closed 1 week ago

rszwajko commented 3 weeks ago

Resolves: https://github.com/konveyor/tackle2-ui/issues/1929

Functional changes:

  1. document to be viewed is selected from the list (first action above the editor) or via URL
  2. display language toggle based on languages supported by the document. For attachments the list consists of plain text and optionally a second language discovered based on file extension (YAML or JSON).
  3. replace "merged" checkbox with an option in the select

Related refactorings:

  1. split getTaskById() query into specialized queries: a) getTaskById() returning Promise for working with the object b) getTaskByIdAndFormat() returning Promise for displaying the task as a formatted text
  2. configure AnalysisDetails component to respond to 2 routes: existing details route and newly added /applications/:applicationId/analysis-details/:taskId/attachments/:attachmentId
  3. persist merge mode in the URL as search param "merged"
codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 23.33333% with 23 lines in your changes missing coverage. Please review.

Project coverage is 42.65%. Comparing base (b654645) to head (618aa39). Report is 167 commits behind head on main.

Files Patch % Lines
client/src/app/queries/tasks.ts 25.00% 12 Missing :warning:
client/src/app/api/rest.ts 21.42% 11 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1954 +/- ## ========================================== + Coverage 39.20% 42.65% +3.45% ========================================== Files 146 166 +20 Lines 4857 5284 +427 Branches 1164 1269 +105 ========================================== + Hits 1904 2254 +350 - Misses 2939 3014 +75 - Partials 14 16 +2 ``` | [Flag](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1954/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | Coverage Δ | | |---|---|---| | [client](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1954/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | `42.65% <23.33%> (+3.45%)` | :arrow_up: | | [server](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1954/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor#carryforward-flags-in-the-pull-request-comment) to find out more.

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

rszwajko commented 3 weeks ago

Analysis details with default option pre-selected

image

Typical task attachment (text only)

image

YAML attachment (discovery based on extension)

image

Merged view (persisted in the URL with search param)

image

rszwajko commented 2 weeks ago

@jortel @JustinXHale @rromannissen Please take a look at screenshots above. The version currently under review has some differences compared to the enhancement - most notably handling the "merged" view has changed. I've put all options in one place. Let me know if you would prefer a checkbox as before.

JustinXHale commented 2 weeks ago

@jortel @JustinXHale @rromannissen Please take a look at screenshots above. The version currently under review has some differences compared to the enhancement - most notably handling the "merged" view has changed. I've put all options in one place. Let me know if you would prefer a checkbox as before.

would the default view be the Log View? I dont have any objections.

rszwajko commented 2 weeks ago

@JustinXHale

would the default view be the Log View?

yes

rromannissen commented 2 weeks ago

LGTM!