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 option to 'Console output', move 'View as plain text' and 'Copy' buttons to app bar #9169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the copy option really the best thing as being the one that is directly accessible?
So far I never had really the need to copy the logs. But looking at the log in plain text I do from time to time
<l:copyButton ref="out" label="${%Copy}" /> | ||
<l:overflowButton> | ||
<dd:custom> | ||
<a class="jenkins-dropdown__item" href="consoleText" download="${it.displayName}.txt"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really useful to use the displayname here? If I choose a displayname that contains a /
this wouldn't be saveable.
something like
${it.parent.name}-{it.number}.txt
would guarantee a valid filename
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I choose a displayname that contains a
/
this wouldn't be saveable.
Per https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-download
The attribute may have a value; the value, if any, specifies the default filename that the author recommends for use in labeling the resource in a local file system. There are no restrictions on allowed values, but authors are cautioned that most file systems have limitations with regard to what punctuation is supported in filenames, and user agents are likely to adjust filenames accordingly.
Trying this PR and DOM editing in Firefox, I get the file foo_bar_#1.txt
from the attribute value foo/bar/#1.txt
.
(parent.fullName
might still be better though. Unsure whether we should go for display names, there's arguments for and against IMO)
probably OK to have it like proposed. |
It took me a while to understand that the result is visible in freestyle jobs only. Isn't the PR that unifies the console in pipelines and freestyle jobs already merged? I think it is a good idea to move the actions to the app bar. I'm not sure why the copy action is a button (I never use this action, does it copy the whole log or the visible section?), but I very often use the "raw console" link. Maybe we can show the latter as button as well (or only this one). The app bar has a lot of space that is not used yet. Do we have anonymous user statistics about such preferences? |
same for me |
My guess is because it's a recently added action (#8960) that has been previously implemented like this? Copying seems like the least needed use case, and between view raw, and download raw, even seems redundant. (And it only copies the visible section, via JS.) |
Essentially that - I didn't want to undo the existing work, happy to prioritise the order of download/complete log however as I agree. |
ATH passing - jenkinsci/acceptance-test-harness#1563 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a matching PR to Pipeline (probably workflow-job) as well.
Apart from that LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. One minor thing but not blocking
Done - thanks! jenkinsci/workflow-job-plugin#439 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/label ready-for-merge
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.
Thanks!
Before
After
Small MR to add a 'Download' link to the console output, as well as to move the controls to the app bar so that they're grouped. Let me know your thoughts on the updated placement - happy to discuss alternatives.
Testing done
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
@Restricted
or have@since TODO
Javadocs, as appropriate.@Deprecated(since = "TODO")
or@Deprecated(forRemoval = true, since = "TODO")
, if applicable.eval
to ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
@jenkinsci/sig-ux
Before the changes are marked as
ready-for-merge
:Maintainer checklist
upgrade-guide-needed
label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidate
to be considered (see query).