зеркало из https://github.com/mozilla/pjs.git
b=392894
- don't drop locale data on result submission when we're not en-US
This commit is contained in:
Родитель
bb102a1571
Коммит
b7fdb91df1
|
@ -37,18 +37,17 @@ use base 'Litmus::DBI';
|
|||
|
||||
Litmus::DB::Locale->table('locale_lookup');
|
||||
|
||||
Litmus::DB::Locale->columns(All => qw/abbrev name/);
|
||||
Litmus::DB::Locale->columns(All => qw/locale_abbrev name/);
|
||||
Litmus::DB::Locale->columns(TEMP => qw //);
|
||||
|
||||
Litmus::DB::Locale->column_alias("abbrev", "locale");
|
||||
Litmus::DB::Locale->column_alias("abbrev", "locale_abbrev");
|
||||
Litmus::DB::Locale->column_alias("locale_abbrev", "locale");
|
||||
|
||||
Litmus::DB::Locale->has_many(test_results => "Litmus::DB::Testresult");
|
||||
|
||||
__PACKAGE__->set_sql(RetrieveAll => qq{
|
||||
SELECT __ESSENTIAL__
|
||||
FROM __TABLE__
|
||||
ORDER BY abbrev ASC
|
||||
ORDER BY locale_abbrev ASC
|
||||
});
|
||||
|
||||
1;
|
||||
|
|
|
@ -45,6 +45,7 @@ our $_num_results_default = 15;
|
|||
Litmus::DB::Testresult->table('test_results');
|
||||
|
||||
Litmus::DB::Testresult->columns(All => qw/testresult_id testcase_id last_updated submission_time user_id opsys_id branch_id build_id user_agent result_status_id build_type_id machine_name exit_status_id duration_ms talkback_id valid vetted validated_by_user_id vetted_by_user_id validated_timestamp vetted_timestamp locale_abbrev is_automated_result/);
|
||||
Litmus::DB::Testresult->columns(Essential => qw/testresult_id testcase_id last_updated submission_time user_id opsys_id branch_id build_id user_agent result_status_id build_type_id machine_name exit_status_id duration_ms talkback_id valid vetted validated_by_user_id vetted_by_user_id validated_timestamp vetted_timestamp locale_abbrev is_automated_result/);
|
||||
Litmus::DB::Testresult->columns(TEMP => qw /summary created platform_name product_name result_status class_name result_status_class branch_name email num_results most_recent max_id/);
|
||||
|
||||
Litmus::DB::Testresult->column_alias("testcase_id", "testcase");
|
||||
|
|
|
@ -94,6 +94,7 @@ sub _bind_values_to_string {
|
|||
if ($bind_values_string ne "") {
|
||||
$bind_values_string .= ",";
|
||||
}
|
||||
next if (!$bind_value);
|
||||
if ($bind_value =~ /^\d+$/) {
|
||||
$bind_values_string .= $bind_value;
|
||||
} else {
|
||||
|
@ -240,5 +241,5 @@ sub _auto_increment_value {
|
|||
if (! defined $id) { return $self->SUPER::_auto_increment_value() }
|
||||
return $id;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
|
|
@ -270,7 +270,7 @@ sub getLocales()
|
|||
my @locales = Litmus::DB::Locale->retrieve_all();
|
||||
# Append an extra copy of 'en-US' at the start of the list.
|
||||
foreach my $locale (@locales) {
|
||||
if ($locale->abbrev eq 'en-US') {
|
||||
if ($locale->locale_abbrev eq 'en-US') {
|
||||
unshift @locales, $locale;
|
||||
last;
|
||||
}
|
||||
|
|
|
@ -310,7 +310,7 @@ sub validateResults {
|
|||
}
|
||||
|
||||
my @locales = Litmus::DB::Locale->search(
|
||||
abbrev => $self->{'sysconfig'}->{'locale'}->string_value());
|
||||
locale_abbrev => $self->{'sysconfig'}->{'locale'}->string_value());
|
||||
unless ($locales[0]) {
|
||||
$self->respErrFatal("Invalid locale: ".$self->{'sysconfig'}->{'locale'});
|
||||
return 0;
|
||||
|
|
|
@ -277,6 +277,8 @@ $dbtool->AddPrimaryKey('test_result_bugs',"(test_result_id,bug_id)");
|
|||
$dbtool->AddKey('security_groups', '(grouptype)', '');
|
||||
$dbtool->AddKey('security_groups', 'idtype (group_id, grouptype)', '');
|
||||
|
||||
$dbtool->RenameField("locale_lookup", "abbrev", "locale_abbrev");
|
||||
|
||||
print "Schema update complete.\n\n";
|
||||
|
||||
# javascript cache
|
||||
|
|
|
@ -81,8 +81,8 @@ if (!$sysconfig) {
|
|||
};
|
||||
|
||||
$c->storeCookie($sysconfig->setCookie());
|
||||
|
||||
$test_run->flagCriteriaInUse($sysconfig);
|
||||
my $locale = Litmus::DB::Locale->retrieve($sysconfig->{'locale'});
|
||||
|
||||
my @names = $c->param();
|
||||
|
||||
|
@ -126,7 +126,8 @@ foreach my $curtestid (@tests) {
|
|||
my $bugs = $c->param("bugs_".$curtestid);
|
||||
|
||||
my $time = &Date::Manip::UnixDate("now","%q");
|
||||
$user = $user || Litmus::Auth::getCookie()->user_id();
|
||||
$user = $user || Litmus::Auth::getCookie()->user_id();
|
||||
|
||||
my $tr = Litmus::DB::Testresult->create({
|
||||
user_id => $user,
|
||||
testcase => $curtest,
|
||||
|
@ -137,7 +138,7 @@ foreach my $curtestid (@tests) {
|
|||
opsys_id => $sysconfig->{'opsys_id'},
|
||||
branch_id => $test_run->branch_id,
|
||||
build_id => $sysconfig->{'build_id'},
|
||||
locale_abbrev => $sysconfig->{'locale'},
|
||||
locale => $locale,
|
||||
});
|
||||
|
||||
# if there's a note, create an entry in the comments table for it
|
||||
|
@ -189,6 +190,7 @@ $vars->{"test_runs"} = [$test_run];
|
|||
$vars->{'testcount'} = $testcount;
|
||||
$vars->{'resultcounts'} = \%resultcounts || undef;
|
||||
$vars->{'testgroup'} = $testgroup || undef;
|
||||
$vars->{'sysconfig'} = $sysconfig;
|
||||
$vars->{'return'} = $c->param("return") || undef;
|
||||
|
||||
Litmus->template()->process("process/process.html.tmpl", $vars) ||
|
||||
|
|
|
@ -66,7 +66,7 @@ $table{exit_status_lookup} =
|
|||
index(name)';
|
||||
|
||||
$table{locale_lookup} =
|
||||
'abbrev varchar(16) not null primary key,
|
||||
'locale_abbrev varchar(16) not null primary key,
|
||||
name varchar(64) not null,
|
||||
|
||||
index(name)';
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
[% IF placeholder %]<option value="">-Locale-</option>[% END %]
|
||||
[% IF locales %]
|
||||
[% FOREACH locale=locales %]
|
||||
<option[% IF defaults.locale==locale.abbrev %] selected[% END %]
|
||||
value="[% locale.abbrev | html %]">[% locale.abbrev | html %]</option>
|
||||
<option[% IF defaults.locale==locale.locale_abbrev %] selected[% END %]
|
||||
value="[% locale.locale_abbrev | html %]">[% locale.locale_abbrev | html %]</option>
|
||||
[% END %]
|
||||
[% END %]
|
||||
</select>
|
||||
|
|
|
@ -67,6 +67,9 @@ Build ID: [% IF criterion.build_id_from_user %]<em>[% END %][% criterion.build_i
|
|||
[% IF ! loop.last %]<td><strong>OR</strong></td>[%END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
[% IF sysconfig.locale %]
|
||||
<tr><td><strong>Locale:</strong></td><td colspan="2"><em>[% sysconfig.locale %]</em></td></tr>
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
<td>
|
||||
No further criteria specified
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
<td>
|
||||
<div class="dh">Product:</div><div class="dv">[% sysconfig.product.name FILTER html %]</div>
|
||||
<div class="dh">Locale:</div><div class="dv">[% sysconfig.locale.name FILTER html %] ([% sysconfig.locale.abbrev FILTER html %])</div>
|
||||
<div class="dh">Locale:</div><div class="dv">[% sysconfig.locale.name FILTER html %] ([% sysconfig.locale.locale_abbrev FILTER html %])</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="dh">Platform:</div><div class="dv">[% sysconfig.platform.name FILTER html %]</div>
|
||||
|
|
Загрузка…
Ссылка в новой задаче