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

Support bugrefs in all text results (not just softfailures) #5334

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions assets/javascripts/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ function renderModuleRow(module, snippets) {
const tplargs = {MODULE: encodeURIComponent(module.name), STEP: step.num};
const alt = step.name || '';

const textData = step.text_data;
if (step.is_parser_text_result) {
const elements = [];
const stepActions = E('span', [], {class: 'step_actions'});
stepActions.innerHTML = renderTemplate(snippets.bug_actions, {MODULE: module.name, STEP: step.num});
const stepFrame = E('span', [stepActions, step.text_data], {class: 'resborder ' + step.resborder});
const template = renderTemplate(snippets.bug_actions, {MODULE: module.name, STEP: step.num});
const stepFrame = E('span', [], {class: 'resborder ' + step.resborder});
stepFrame.innerHTML = '<span class="step_actions">' + template + '</span>' + textData;
const textResult = E('span', [stepFrame], {
title: step.is_parser_text_result ? title : undefined,
'data-href': href,
Expand All @@ -136,7 +137,6 @@ function renderModuleRow(module, snippets) {

const url = renderTemplate(snippets.module_url, tplargs);
const box = [];
const textData = step.text_data;
let resborder = step.resborder;
if (step.screenshot) {
let thumb;
Expand Down 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
Loading