-
Notifications
You must be signed in to change notification settings - Fork 205
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
Make "last good" a link to a job instead of plain job ID #3261
Conversation
In this case, more Perl code is present controlling what to paint and how to paint |
I am not sure that add the html conde in the Perl side is a good idea. last_good:link = { link: '...', text:'...'} What do you think? |
I like the |
I add a new commit with the new approach |
lib/OpenQA/Schema/Result/Jobs.pm
Outdated
@@ -2142,4 +2142,3 @@ sub video_file_paths { | |||
} | |||
|
|||
1; | |||
|
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.
unrelated whitespace change, please revert
assets/javascripts/test_result.js
Outdated
if (textLines.length > lineLimit) { | ||
textLinesRest = textLines.slice(lineLimit, textLines.length); | ||
textLines = textLines.slice(0, lineLimit); | ||
if (type === "link"){ |
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.
again some style issues. Please add the whitespace between )
and {
https://progress.opensuse.org/issues/19720 If a valid last_good job ID is present in the investigation result set, then it is replaced by html code <a> to link directly to this job. In order to tell to the JS that this is a link, backend adds the type of this variable. Using ':' to split <name>[:<type>]. In this case the type is link. The key will be now 'last_good:link' In JS detects if a type has being defined or not. If is link then creates a link with the information. In other cases, now only traditional use, then creates a <pre> element. This allows to add typed information like links to files, tables, but also colorize the values is needed.
a251d58
to
e4f74b0
Compare
var spl = key.split(':'); | ||
var value = response[key]; | ||
var type = "pre"; | ||
|
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.
How about documenting the format explicitly?
// Parse optional type specifier, e.g. "last_good:link" |
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.
Please add/change a test accordingly.
we can go with #3272 as Martchus also proposed |
https://progress.opensuse.org/issues/19720
If a valid last_good job ID is present in the investigation result
set, then it is replaced by html code to link directly to this job.
In order to tell to the JS that this is a piece of HTML, backend adds
the type of this variable. Using ':' to split [:].
In this case the type is html. The key will be now 'last_good:html'
In JS detects if a type has being defined or not. If is html then
use this html. In other cases, now only traditional use, then creates
a < pre > element.
This allows to add typed information like links to files,
tables, but also colorize the values is needed.
Alternative to #3259