Skip to content

Commit 296f0c0

Browse files
committed
show text results in correct order
1 parent f911e7f commit 296f0c0

File tree

2 files changed

+19
-31
lines changed

2 files changed

+19
-31
lines changed

Diff for: lib/OpenQA/WebAPI/Controller/Test.pm

+7-17
Original file line numberDiff line numberDiff line change
@@ -207,31 +207,21 @@ sub read_test_modules {
207207
for my $module (OpenQA::Schema::Result::JobModules::job_modules($job)) {
208208
my $name = $module->name();
209209
# add link to $testresultdir/$name*.png via png CGI
210-
my @imglist;
211-
my @wavlist;
212-
my @textlist;
210+
my @details;
211+
213212
my $num = 1;
214-
for my $img (@{$module->details}) {
215-
$img->{num} = $num++;
216-
if ($img->{screenshot}) {
217-
push(@imglist, $img);
218-
}
219-
elsif ($img->{audio}) {
220-
push(@wavlist, $img);
221-
}
222-
elsif ($img->{text}) {
223-
push(@textlist, $img);
224-
}
213+
214+
for my $step (@{$module->details}) {
215+
$step->{num} = $num++;
216+
push(@details, $step);
225217
}
226218

227219
push(
228220
@modlist,
229221
{
230222
name => $module->name,
231223
result => $module->result,
232-
screenshots => \@imglist,
233-
wavs => \@wavlist,
234-
texts => \@textlist,
224+
details => \@details,
235225
soft_failure => $module->soft_failure,
236226
milestone => $module->milestone,
237227
important => $module->important,

Diff for: templates/test/result.html.ep

+12-14
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,19 @@
144144
</td>
145145
<td class="links">
146146

147-
% for my $screenshot (@{$module->{screenshots}}) {
148-
%= step_thumbnail($screenshot, 60, $testid, $module->{name}, $screenshot->{num})
149-
% }
150-
151-
% for my $wav (@{$module->{wavs}}) {
152-
%= link_to url_for('step', moduleid => $module->{name}, stepid => $wav->{num}) => title => $wav->{name} => begin
153-
<img src="/images/audio.png" width="28" height="26" alt="<%= $wav->{name} %>" class="<%= "resborder_\L$wav->{result}" %>"/>
154-
% end
147+
% for my $step (@{$module->{details}}) {
148+
% if($step->{screenshot}) {
149+
%= step_thumbnail($step, 60, $testid, $module->{name}, $step->{num})
150+
% } elsif ($step->{audio}) {
151+
%= link_to url_for('step', moduleid => $module->{name}, stepid => $step->{num}) => title => $step->{name} => begin
152+
<img src="/images/audio.png" width="28" height="26" alt="<%= $step->{name} %>" class="<%= "resborder_\L$step->{result}" %>"/>
153+
% end
154+
% } elsif ($step->{text}) {
155+
%= link_to url_for('step', moduleid => $module->{name}, stepid => $step->{num}) => title => $step->{title} => begin
156+
<span class="<%= "resborder_\L$step->{result}" %>" ><%= $step->{title} || 'Text' %></span>
157+
% end
158+
% }
155159
% }
156-
157-
<% for my $text (@{$module->{texts}}) { %>
158-
%= link_to url_for('step', moduleid => $module->{name}, stepid => $text->{num}) => title => $text->{title} => begin
159-
<span class="<%= "resborder_\L$text->{result}" %>" ><%= $text->{title} || 'Text' %></span>
160-
% end
161-
<% } %>
162160
</td>
163161
</tr>
164162
<% } %>

0 commit comments

Comments
 (0)