mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
- allow searching/sorting by locale
This commit is contained in:
parent
3bb332bc10
commit
11c79ce25f
@ -187,6 +187,8 @@ sub getTestResults($\@\@$) {
|
||||
foreach my $criterion (@$where_criteria) {
|
||||
if ($criterion->{'field'} eq 'branch') {
|
||||
$where .= " AND b.name='" . $criterion->{'value'} . "'";
|
||||
} elsif ($criterion->{'field'} eq 'locale') {
|
||||
$where .= " AND tr.locale_abbrev='" . $criterion->{'value'} . "'";
|
||||
} elsif ($criterion->{'field'} eq 'product') {
|
||||
$where .= " AND pr.name='" . $criterion->{'value'} . "'";
|
||||
} elsif ($criterion->{'field'} eq 'platform') {
|
||||
@ -228,7 +230,7 @@ sub getTestResults($\@\@$) {
|
||||
$where .= " AND tr.submission_time>=$timestamp";
|
||||
|
||||
} elsif ($criterion->{'field'} eq 'search_field') {
|
||||
my $rv = &_processSearchField($criterion,\$from,\$where);
|
||||
($from,$where) = &_processSearchField($criterion,$from,$where);
|
||||
} else {
|
||||
# Skip unknown field
|
||||
}
|
||||
@ -255,6 +257,8 @@ sub getTestResults($\@\@$) {
|
||||
$order_by .= "trsl.class_name $criterion->{'direction'},";
|
||||
} elsif ($criterion->{'field'} eq 'branch') {
|
||||
$order_by .= "b.name $criterion->{'direction'},";
|
||||
} elsif ($criterion->{'field'} eq 'locale') {
|
||||
$order_by .= "tr.locale_abbrev $criterion->{'direction'},";
|
||||
} else {
|
||||
# Skip unknown field
|
||||
}
|
||||
@ -283,17 +287,19 @@ sub getTestResults($\@\@$) {
|
||||
}
|
||||
|
||||
#########################################################################
|
||||
# &_processSearchField(\%)
|
||||
# &_processSearchField(\%\$\$)
|
||||
#
|
||||
#########################################################################
|
||||
sub _processSearchField(\%) {
|
||||
my ($search_field,$from,$where) = @_;
|
||||
|
||||
|
||||
my $table_field = "";
|
||||
if ($search_field->{'search_field'} eq 'buildid') {
|
||||
$table_field='tr.build_id';
|
||||
} elsif ($search_field->{'search_field'} eq 'comments') {
|
||||
$table_field='c.comment';
|
||||
} elsif ($search_field->{'search_field'} eq 'locale') {
|
||||
$table_field='tr.locale_abbrev';
|
||||
} elsif ($search_field->{'search_field'} eq 'opsys') {
|
||||
$table_field='o.name';
|
||||
} elsif ($search_field->{'search_field'} eq 'platform') {
|
||||
@ -319,7 +325,7 @@ sub _processSearchField(\%) {
|
||||
} elsif ($search_field->{'search_field'} eq 'user_agent') {
|
||||
$table_field='tr.user_agent';
|
||||
} else {
|
||||
return undef;
|
||||
return ($from,$where);
|
||||
}
|
||||
|
||||
if ($search_field->{'match_criteria'} eq 'contains_all' or
|
||||
@ -361,11 +367,11 @@ sub _processSearchField(\%) {
|
||||
} elsif ($search_field->{'match_criteria'} eq 'not_regexp') {
|
||||
$where .= " AND $table_field NOT REGEXP '" . $search_field->{'value'} . "'";
|
||||
} else {
|
||||
# Ignore unknown match criteria.
|
||||
return undef;
|
||||
# Ignore unknown match criteria.
|
||||
return ($from,$where);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ($from,$where);
|
||||
}
|
||||
|
||||
#########################################################################
|
||||
|
@ -133,6 +133,13 @@ sub getBranches()
|
||||
return _getValues($sql);
|
||||
}
|
||||
|
||||
#########################################################################
|
||||
sub getLocales()
|
||||
{
|
||||
my $sql = "SELECT DISTINCT(abbrev) FROM locale_lookup ORDER BY abbrev";
|
||||
return _getValues($sql);
|
||||
}
|
||||
|
||||
#########################################################################
|
||||
sub getOpsyses()
|
||||
{
|
||||
@ -183,6 +190,8 @@ sub getFields()
|
||||
display_string => "Build ID", },
|
||||
{ name => 'comment',
|
||||
display_string => "Comments", },
|
||||
{ name => 'locale',
|
||||
display_string => "Locale", },
|
||||
{ name => 'opsys',
|
||||
display_string => "Operating System", },
|
||||
{ name => 'platform',
|
||||
@ -251,6 +260,8 @@ sub getSortFields()
|
||||
display_string => "Status"},
|
||||
{ name => "branch",
|
||||
display_string => "Branch"},
|
||||
{ name => "locale",
|
||||
display_string => "Locale"},
|
||||
);
|
||||
return \@sort_fields;
|
||||
}
|
||||
|
@ -125,6 +125,12 @@ if ($c->param) {
|
||||
value => $value};
|
||||
$where_criteria .= "Branch is \'".$c->param($param)."\'<br/>";
|
||||
$defaults->{branch} = $c->param($param);
|
||||
} elsif ($param eq 'locale') {
|
||||
my $value = $c->param($param);
|
||||
push @where, {field => 'locale',
|
||||
value => $value};
|
||||
$where_criteria .= "Locale is \'".$c->param($param)."\'<br/>";
|
||||
$defaults->{locale} = $c->param($param);
|
||||
} elsif ($param eq 'product') {
|
||||
my $value = $c->param($param);
|
||||
push @where, {field => $param,
|
||||
@ -195,6 +201,7 @@ my $test_groups = Litmus::FormWidget->getTestGroups;
|
||||
my $test_ids = Litmus::FormWidget->getTestIDs;
|
||||
my $result_statuses = Litmus::FormWidget->getResultStatuses;
|
||||
my $branches = Litmus::FormWidget->getBranches;
|
||||
my $locales = Litmus::FormWidget->getLocales;
|
||||
|
||||
my $fields = Litmus::FormWidget->getFields;
|
||||
my $match_criteria = Litmus::FormWidget->getMatchCriteria;
|
||||
@ -211,6 +218,7 @@ my $vars = {
|
||||
test_ids => $test_ids,
|
||||
result_statuses => $result_statuses,
|
||||
branches => $branches,
|
||||
locales => $locales,
|
||||
fields => $fields,
|
||||
match_criteria => $match_criteria,
|
||||
sort_fields => $sort_fields,
|
||||
|
@ -56,10 +56,10 @@ our \$db_pass = "";
|
||||
our \$user_cookiename = "litmus_login";
|
||||
our \$sysconfig_cookiename = "litmustestingconfiguration";
|
||||
|
||||
our $bugzilla_db = "bugzilla";
|
||||
our $bugzilla_host = "localhost";
|
||||
our $bugzilla_user = "litmus";
|
||||
out $bugzilla_pass = "litmus";
|
||||
our \$bugzilla_db = "bugzilla";
|
||||
our \$bugzilla_host = "localhost";
|
||||
our \$bugzilla_user = "litmus";
|
||||
out \$bugzilla_pass = "litmus";
|
||||
EOT
|
||||
close(OUT);
|
||||
print "Go edit 'localconfig' with your configuration and \n";
|
||||
|
@ -69,6 +69,11 @@ if ($c->param) {
|
||||
push @where, {field => $param,
|
||||
value => $value};
|
||||
$where_criteria .= "Branch is \'".$c->param($param)."\'<br/>";
|
||||
} elsif ($param eq 'locale') {
|
||||
my $value = quotemeta($c->param($param));
|
||||
push @where, {field => 'locale_abbrev',
|
||||
value => $value};
|
||||
$where_criteria .= "Branch is \'".$c->param($param)."\'<br/>";
|
||||
} elsif ($param eq 'product') {
|
||||
my $value = quotemeta($c->param($param));
|
||||
push @where, {field => $param,
|
||||
|
@ -106,22 +106,3 @@ if ($c->param && $c->param('id')) {
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -71,6 +71,10 @@ Limit your search to specific values of visible fields.
|
||||
<td class="heading">Branch:</td>
|
||||
<td>[% INCLUDE form_widgets/select_branch.tmpl name="branch" placeholder=1 %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="heading">Locale:</td>
|
||||
<td>[% INCLUDE form_widgets/select_locale.tmpl name="locale" placeholder=1 %]</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -80,6 +80,9 @@ Product and Platform
|
||||
<td>Build ID:</td><td>[% result.buildid | html %]</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>Locale:</td><td>[% result.locale_abbrev.name | html %] ([% result.locale_abbrev | html %])</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>User Agent:</td><td>[% result.user_agent | html %]</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
Loading…
Reference in New Issue
Block a user