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

✨ View files task attachments #1954

Merged
merged 3 commits into from
Jun 20, 2024
Merged

Conversation

rszwajko
Copy link
Collaborator

@rszwajko rszwajko commented Jun 11, 2024

Resolves: #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"

Copy link

codecov bot commented Jun 11, 2024

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 ⚠️
client/src/app/api/rest.ts 21.42% 11 Missing ⚠️
Additional details and impacted files
@@            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 Coverage Δ
client 42.65% <23.33%> (+3.45%) ⬆️
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.

@rszwajko rszwajko force-pushed the viewAttachments branch 2 times, most recently from 91c8671 to 124c843 Compare June 11, 2024 17:47
@rszwajko rszwajko changed the title ✨ View attachments ✨ View files task attachments Jun 11, 2024
@rszwajko
Copy link
Collaborator Author

rszwajko commented Jun 11, 2024

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 rszwajko marked this pull request as ready for review June 11, 2024 17:58
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

UX changes:

  • The attachment select drop down background should be white instead of the default transparent --- or maybe the page's content background color white (the other pages do this, see the comment on AnalysisDetails.tsx)

  • When a file has a known file type (e.g. settings.yaml), select that file type for display by default instead of the "Text" one

Looks really good. I have a few comments.

@sjd78 sjd78 added this to the v0.5.0 milestone Jun 14, 2024
Resolves: konveyor#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<Task> for working with the object
   b) getTaskByIdAndFormat() returning Promise<string> 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"

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
@rszwajko
Copy link
Collaborator Author

@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
Copy link
Member

@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
Copy link
Collaborator Author

@JustinXHale

would the default view be the Log View?

yes

@rromannissen
Copy link

LGTM!

Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

Looks great!

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 the ability to individually view all files attached to a task on the Analysis details view
4 participants