зеркало из https://github.com/mozilla/pjs.git
Add locale to search result display, and allow searching/limiting of results by locale.
Add separate form widget for dealing with unique platofrm (vs. associated with product).
This commit is contained in:
Родитель
4e7c6efff5
Коммит
ceaeecbfcf
|
@ -101,11 +101,18 @@ sub is_completed {
|
|||
user => $user,
|
||||
);
|
||||
} else {
|
||||
@results = $self->testresults(
|
||||
platform => $platform,
|
||||
buildid => $build_id,
|
||||
locale => $locale,
|
||||
);
|
||||
@results = Litmus::DB::Testresult->retrieve_from_sql(
|
||||
"platform_id = " . $platform->{'platform_id'} . " AND " .
|
||||
"buildid LIKE \'\%" . $build_id . "\%\' AND " .
|
||||
"locale_abbrev = \'" . $locale->{'abbrev'} . "\' AND " .
|
||||
"test_id = " . $self->{'test_id'}
|
||||
);
|
||||
|
||||
# @results = $self->testresults(
|
||||
# platform => $platform,
|
||||
# buildid => $build_id,
|
||||
# locale => $locale,
|
||||
# );
|
||||
}
|
||||
|
||||
return scalar @results;
|
||||
|
|
|
@ -81,7 +81,7 @@ Litmus::DB::Testresult->has_many(bugs => "Litmus::DB::Resultbug", {order_by => '
|
|||
Litmus::DB::Testresult->autoinflate(dates => 'Time::Piece');
|
||||
|
||||
Litmus::DB::Testresult->set_sql(DefaultTestResults => qq{
|
||||
SELECT tr.testresult_id,tr.test_id,t.summary,tr.submission_time AS created,p.name AS platform_name,pr.name as product_name,trsl.name AS result_status,trsl.class_name result_status_class,b.name AS branch_name,tg.name AS test_group_name
|
||||
SELECT tr.testresult_id,tr.test_id,t.summary,tr.submission_time AS created,p.name AS platform_name,pr.name as product_name,trsl.name AS result_status,trsl.class_name result_status_class,b.name AS branch_name,tg.name AS test_group_name, tr.locale_abbrev
|
||||
FROM test_results tr, tests t, platforms p, opsyses o, branches b, products
|
||||
pr, test_result_status_lookup trsl, test_groups tg, subgroups sg
|
||||
WHERE tr.test_id=t.test_id AND tr.platform_id=p.platform_id AND tr.opsys_id=o.opsys_id AND tr.branch_id=b.branch_id AND b.product_id=pr.product_id AND tr.result_id=trsl.result_status_id AND t.subgroup_id=sg.subgroup_id AND sg.testgroup_id=tg.testgroup_id
|
||||
|
@ -176,7 +176,7 @@ sub getDefaultTestResults($) {
|
|||
sub getTestResults($\@\@$) {
|
||||
my ($self,$where_criteria,$order_by_criteria,$limit_value) = @_;
|
||||
|
||||
my $select = 'SELECT tr.testresult_id,tr.test_id,t.summary,tr.submission_time AS created,p.name AS platform_name,pr.name as product_name,trsl.name AS result_status,trsl.class_name AS result_status_class,b.name AS branch_name,tg.name AS test_group_name';
|
||||
my $select = 'SELECT tr.testresult_id,tr.test_id,t.summary,tr.submission_time AS created,p.name AS platform_name,pr.name as product_name,trsl.name AS result_status,trsl.class_name AS result_status_class,b.name AS branch_name,tg.name AS test_group_name, tr.locale_abbrev';
|
||||
|
||||
my $from = 'FROM test_results tr, tests t, platforms p, opsyses o, branches b, products pr, test_result_status_lookup trsl, test_groups tg, subgroups sg';
|
||||
|
||||
|
|
|
@ -120,12 +120,19 @@ sub getProducts()
|
|||
}
|
||||
|
||||
#########################################################################
|
||||
sub getPlatforms()
|
||||
sub getUniquePlatforms()
|
||||
{
|
||||
my $sql = "SELECT DISTINCT(name) FROM platforms ORDER BY name";
|
||||
return _getValues($sql);
|
||||
}
|
||||
|
||||
#########################################################################
|
||||
sub getPlatforms()
|
||||
{
|
||||
my $sql = "SELECT pl.name AS platform_name, pr.name AS product_name, pl.platform_id AS platform_id FROM platforms pl, products pr WHERE pl.product_id=pr.product_id ORDER BY pl.name, pr.name";
|
||||
return _getValues($sql);
|
||||
}
|
||||
|
||||
#########################################################################
|
||||
sub getBranches()
|
||||
{
|
||||
|
@ -182,6 +189,15 @@ sub getTestIDs()
|
|||
return _getValues($sql);
|
||||
}
|
||||
|
||||
#########################################################################
|
||||
sub getLocales()
|
||||
{
|
||||
my @locales = Litmus::DB::Locale->retrieve_all(
|
||||
{ order_by => 'abbrev' }
|
||||
);
|
||||
return \@locales;
|
||||
}
|
||||
|
||||
#########################################################################
|
||||
sub getFields()
|
||||
{
|
||||
|
|
|
@ -196,7 +196,7 @@ if ($c->param) {
|
|||
# Populate each of our form widgets for select/input.
|
||||
# Set a default value as appropriate.
|
||||
my $products = Litmus::FormWidget->getProducts;
|
||||
my $platforms = Litmus::FormWidget->getPlatforms;
|
||||
my $platforms = Litmus::FormWidget->getUniquePlatforms;
|
||||
my $test_groups = Litmus::FormWidget->getTestGroups;
|
||||
my $test_ids = Litmus::FormWidget->getTestIDs;
|
||||
my $result_statuses = Litmus::FormWidget->getResultStatuses;
|
||||
|
|
|
@ -47,7 +47,7 @@ use diagnostics;
|
|||
my ($criteria,$results) = Litmus::DB::Testresult->getDefaultTestResults;
|
||||
|
||||
my $products = Litmus::FormWidget->getProducts();
|
||||
my $platforms = Litmus::FormWidget->getPlatforms();
|
||||
my $platforms = Litmus::FormWidget->getUniquePlatforms();
|
||||
my $test_groups = Litmus::FormWidget->getTestGroups();
|
||||
my $result_statuses = Litmus::FormWidget->getResultStatuses;
|
||||
my $branches = Litmus::FormWidget->getBranches();
|
||||
|
|
|
@ -71,9 +71,9 @@ if ($c->param) {
|
|||
$where_criteria .= "Branch is \'".$c->param($param)."\'<br/>";
|
||||
} elsif ($param eq 'locale') {
|
||||
my $value = quotemeta($c->param($param));
|
||||
push @where, {field => 'locale_abbrev',
|
||||
push @where, {field => 'locale',
|
||||
value => $value};
|
||||
$where_criteria .= "Branch is \'".$c->param($param)."\'<br/>";
|
||||
$where_criteria .= "Locale is \'".$c->param($param)."\'<br/>";
|
||||
} elsif ($param eq 'product') {
|
||||
my $value = quotemeta($c->param($param));
|
||||
push @where, {field => $param,
|
||||
|
@ -147,10 +147,11 @@ if ($c->param) {
|
|||
# Populate each of our form widgets for select/input.
|
||||
# Set a default value as appropriate.
|
||||
my $products = Litmus::FormWidget->getProducts;
|
||||
my $platforms = Litmus::FormWidget->getPlatforms;
|
||||
my $platforms = Litmus::FormWidget->getUniquePlatforms;
|
||||
my $test_groups = Litmus::FormWidget->getTestGroups;
|
||||
my $result_statuses = Litmus::FormWidget->getResultStatuses;
|
||||
my $branches = Litmus::FormWidget->getBranches;
|
||||
my $locales = Litmus::FormWidget->getLocales;
|
||||
|
||||
my $title = 'Search Test Results';
|
||||
|
||||
|
@ -162,6 +163,7 @@ my $vars = {
|
|||
test_groups => $test_groups,
|
||||
result_statuses => $result_statuses,
|
||||
branches => $branches,
|
||||
locales => $locales,
|
||||
limit => $limit,
|
||||
};
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<select name="[% name %]"[% IF size %] size="[% size %]"[% END %][% IF disabled %] disabled[% END %]>
|
||||
<select id="[% name %]" name="[% name %]"[% IF size %] size="[% size %]"[% END %][% IF disabled %] disabled[% END %][% IF onChange %] onChange="[% onChange %]"[% END %]>
|
||||
[% IF placeholder %]<option value="">-Platform-</option>[% END %]
|
||||
[% IF platforms %]
|
||||
[% FOREACH platform=platforms %]
|
||||
<option[% IF defaults.platform==platform.name %] selected[% END %]
|
||||
value="[% platform.name | html %]">[% platform.name | html %]</option>
|
||||
<option[% IF defaults.platform==platform.platform_id %] selected[% END %]
|
||||
value="[% platform.platform_id | html %]">[% platform.platform_name | html %]: [% platform.product_name | html %]</option>
|
||||
[% END %]
|
||||
[% END %]
|
||||
</select>
|
|
@ -0,0 +1,9 @@
|
|||
<select name="[% name %]"[% IF size %] size="[% size %]"[% END %][% IF disabled %] disabled[% END %]>
|
||||
[% IF placeholder %]<option value="">-Platform-</option>[% END %]
|
||||
[% IF platforms %]
|
||||
[% FOREACH platform=platforms %]
|
||||
<option[% IF defaults.platform==platform.name %] selected[% END %]
|
||||
value="[% platform.name | html %]">[% platform.name | html %]</option>
|
||||
[% END %]
|
||||
[% END %]
|
||||
</select>
|
|
@ -53,7 +53,7 @@ Limit your search to specific values of visible fields.
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="heading">Platform:</td>
|
||||
<td>[% INCLUDE form_widgets/select_platform.tmpl name="platform" placeholder=1 %]</td>
|
||||
<td>[% INCLUDE form_widgets/select_unique_platform.tmpl name="platform" placeholder=1 %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="heading">Testgroup:</td>
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
<td class="header">Product</td>
|
||||
<td class="header">Platform</td>
|
||||
<td class="header">Branch</td>
|
||||
<td class="header">Locale</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
|
@ -82,9 +83,11 @@
|
|||
<td align="center">[% result.product_name | html %]</td>
|
||||
<td align="center">[% result.platform_name | html %]</td>
|
||||
<td align="center">[% result.branch_name | html %]</td>
|
||||
<td align="center">[% result.locale_abbrev | html %]</td>
|
||||
</tr>
|
||||
[% subscript=subscript+1 %]
|
||||
[% END %]
|
||||
|
||||
[% ELSE %]
|
||||
<tr>
|
||||
<td class="no-results" colspan="8">No test results match the search criteria.</td>
|
||||
|
|
|
@ -78,6 +78,12 @@ function init()
|
|||
<option[% IF order_bys.branch == 'ASC' %] selected[% END %] value="ASC">A->Z</option>
|
||||
<option[% IF order_bys.branch == 'DESC' %] selected[% END %] value="DESC">Z->A</option>
|
||||
</select></td>
|
||||
|
||||
<td class="search"><select name="order_by_locale">
|
||||
<option value="">-Sort-</option>
|
||||
<option[% IF order_bys.locale == 'ASC' %] selected[% END %] value="ASC">A->Z</option>
|
||||
<option[% IF order_bys.locale == 'DESC' %] selected[% END %] value="DESC">Z->A</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
|
||||
<!--# Add a row to order the results by each field. -->
|
||||
|
@ -88,8 +94,9 @@ function init()
|
|||
<td class="search">[% INCLUDE form_widgets/input_summary.tmpl %]</td>
|
||||
<td class="search">[% INCLUDE form_widgets/select_test_group.tmpl name="test_group" placeholder=1 %]</td>
|
||||
<td class="search">[% INCLUDE form_widgets/select_product.tmpl name="product" placeholder=1 %]</td>
|
||||
<td class="search">[% INCLUDE form_widgets/select_platform.tmpl name="platform" placeholder=1 %]</td>
|
||||
<td class="search">[% INCLUDE form_widgets/select_unique_platform.tmpl name="platform" placeholder=1 %]</td>
|
||||
<td class="search">[% INCLUDE form_widgets/select_branch.tmpl name="branch" placeholder=1 %]</td>
|
||||
<td class="search">[% INCLUDE form_widgets/select_locale.tmpl name="locale" placeholder=1 %]</td>
|
||||
</tr>
|
||||
|
||||
<tr class="search">
|
||||
|
@ -97,7 +104,7 @@ function init()
|
|||
Limit to</td>
|
||||
<td class="search">
|
||||
<input type="text" name="limit" value="[% limit | html %]" size="5"> results</td>
|
||||
<td class="search-submit" colspan="6">
|
||||
<td class="search-submit" colspan="7">
|
||||
<input class="button" type="reset" onclick="FormInit(this.parent, '');">
|
||||
<input class="button" type="submit" value="Show Results">
|
||||
</td>
|
||||
|
|
Загрузка…
Ссылка в новой задаче