Skip to content

Commit

Permalink
Support bugrefs in all text results (not just softfailures)
Browse files Browse the repository at this point in the history
* Render the result of all text results (not just softfailures) on the server
  via the `rendered_refs_no_shortening` helper that is also already used in
  `viewtext.html`.
* Remove the condition ` && title !== 'Soft Failed'` so softfailures are no
  longer a special case; this way the existing test for softfailures will
  cover these code changes without extending tests
  • Loading branch information
Martchus committed Oct 17, 2023
1 parent f46075b commit 4cf66b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 2 additions & 6 deletions assets/javascripts/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,12 @@ function renderModuleRow(module, snippets) {
const content = step.title || E('i', [], {class: 'fa fa fa-question'});
box.push(E('span', [content], {class: 'resborder ' + resborder}));
}
if (step.text && title !== 'Soft Failed') {
if (step.text) {
const stepActions = E('span', [], {class: 'step_actions', style: 'float: right'});
stepActions.innerHTML = renderTemplate(snippets.bug_actions, {MODULE: module.name, STEP: step.num});
const textresult = E('pre', [textData]);
var html = stepActions.outerHTML;
html += textresult.outerHTML;
const txt = escape(html);
const link = E('a', box, {
class: 'no_hover' + (title === 'wait_serial' ? ' serial-result-preview' : ''),
'data-text': txt,
'data-text': escape(stepActions.outerHTML + '<pre>' + textData + '</pre>'),
title: title,
href: href
});
Expand Down
7 changes: 6 additions & 1 deletion lib/OpenQA/WebAPI/Controller/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,12 @@ sub details ($self) {
my @ret;

for my $module (@{$modules->{modules}}) {
delete $_->{needles} for @{$module->{details}};
for my $detail (@{$module->{details}}) {
if (my $text_data = $detail->{text_data}) {
$detail->{text_data} = $self->rendered_refs_no_shortening($text_data);
}
delete $detail->{needles};
}
my $hash = {
name => $module->{name},
category => $module->{category},
Expand Down

0 comments on commit 4cf66b5

Please sign in to comment.