Skip to content

Commit 5c54278

Browse files
committed
Merge remote-tracking branch 'origin/master' into production
* origin/master: Bug 1277863 - Add crash signature field for "External Software Affecting Firefox" product Bug 1270720 - Do not add reporter email address to CC list when flagging "Need more information from reporter" Bug 1269549 - Component watching prefix matches too much Bug 1146778 - link to the classic printing format for now Bug 1153105 - add orange factor to modal view Bug 1272546 - unauthenticated users cannot expand the cc list Bug 1262459 - restyle the "this bug has been marked as a duplicate" comment Bug 1262474 - the 'rank' field label is incorrectly visible in view mode
2 parents 2096d16 + 13161f4 commit 5c54278

File tree

17 files changed

+245
-111
lines changed

17 files changed

+245
-111
lines changed

Bugzilla/Flag.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ sub set_flag {
397397
if ($obj_flag
398398
&& $requestee_changed
399399
&& $obj_flag->requestee_id
400-
&& $obj_flag->requestee->setting('requestee_cc') eq 'on')
400+
&& $obj_flag->requestee->setting('requestee_cc') eq 'on'
401+
&& $bug->reporter->id != $obj_flag->requestee->id)
401402
{
402403
$bug->add_cc($obj_flag->requestee);
403404
}

extensions/BMO/Extension.pm

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,22 @@ sub bug_end_of_create {
965965
}
966966
}
967967

968+
sub sanitycheck_check {
969+
my ($self, $args) = @_;
970+
971+
my $dbh = Bugzilla->dbh;
972+
my $status = $args->{'status'};
973+
$status->('bmo_check_cf_visible_in_products');
974+
975+
my $products = $dbh->selectcol_arrayref('SELECT name FROM products');
976+
my %product = map { $_ => 1 } @$products;
977+
my @cf_products = map { keys %$_ } values %$cf_visible_in_products;
978+
foreach my $cf_product (@cf_products) {
979+
$status->('bmo_check_cf_visible_in_products_missing',
980+
{ cf_product => $cf_product }, 'alert') unless $product{$cf_product};
981+
}
982+
}
983+
968984
sub db_sanitize {
969985
print "deleting reporter's user-agents...\n";
970986
Bugzilla->dbh->do("TRUNCATE TABLE bug_user_agent");

extensions/BMO/lib/Data.pm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,10 @@ tie(%$cf_visible_in_products, "Tie::IxHash",
7777
"Android Background Services" => [],
7878
"B2GDroid" => [],
7979
"Calendar" => [],
80-
"Camino" => [],
8180
"Composer" => [],
8281
"Core" => [],
8382
"Directory" => [],
84-
"Fennec" => [],
83+
"External Software Affecting Firefox" => [],
8584
"Firefox" => [],
8685
"Firefox for Android" => [],
8786
"Firefox for Metro" => [],
@@ -96,7 +95,6 @@ tie(%$cf_visible_in_products, "Tie::IxHash",
9695
"NSS" => [],
9796
"Other Applications" => [],
9897
"Penelope" => [],
99-
"Plugins" => [],
10098
"Release Engineering" => [],
10199
"Rhino" => [],
102100
"SeaMonkey" => [],
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[%# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
#
5+
# This Source Code Form is "Incompatible With Secondary Licenses", as
6+
# defined by the Mozilla Public License, v. 2.0.
7+
#%]
8+
9+
[% IF san_tag == "bmo_check_cf_visible_in_products" %]
10+
Checking $cf_visibile_in_products for missing product names.
11+
12+
[% ELSIF san_tag == "bmo_check_cf_visible_in_products_missing" %]
13+
... there are custom fields for [% cf_product FILTER html %] but it does not exist!
14+
15+
[% END %]

extensions/BugModal/lib/ActivityStream.pm

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ sub _add_comments_to_stream {
178178
$comment->{collapsed} = 1;
179179
$comment->{collapsed_reason} = 'empty';
180180
}
181+
# If comment type is resolved as duplicate, do not add '...marked as duplicate...' string to comment body
182+
if ($comment->type == CMT_DUPE_OF) {
183+
$comment->set_type(0);
184+
# Skip if user did not supply comment also
185+
next if $comment->body eq '';
186+
}
181187

182188
_add_comment_to_stream($stream, date_str_to_time($comment->creation_ts), $comment->author->id, $comment);
183189
}
@@ -345,20 +351,21 @@ sub _add_duplicates_to_stream {
345351
SELECT longdescs.who,
346352
UNIX_TIMESTAMP(bug_when), " .
347353
$dbh->sql_date_format('bug_when') . ",
354+
type,
348355
extra_data
349356
FROM longdescs
350357
INNER JOIN profiles ON profiles.userid = longdescs.who
351-
WHERE bug_id = ? AND type = ?
358+
WHERE bug_id = ? AND (type = ? OR type = ?)
352359
ORDER BY bug_when
353360
");
354-
$sth->execute($bug->id, CMT_HAS_DUPE);
361+
$sth->execute($bug->id, CMT_HAS_DUPE, CMT_DUPE_OF);
355362

356-
while (my($who, $time, $when, $dupe_id) = $sth->fetchrow_array) {
363+
while (my($who, $time, $when, $type, $dupe_id) = $sth->fetchrow_array) {
357364
_add_activity_to_stream($stream, $time, $who, {
358365
who => Bugzilla::User->new({ id => $who, cache => 1 }),
359366
when => $when,
360367
changes => [{
361-
fieldname => 'duplicate',
368+
fieldname => ($type == CMT_HAS_DUPE ? 'has_dupe' : 'dupe_of'),
362369
added => $dupe_id,
363370
buglist => 1,
364371
}],

extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,10 @@
254254
END;
255255

256256
IF change.buglist;
257-
IF change.fieldname == 'duplicate';
257+
IF change.fieldname == 'has_dupe';
258258
label = "Duplicate of this " _ terms.bug;
259+
ELSIF change.fieldname == 'dupe_of';
260+
label = "Duplicate of " _ terms.bug;
259261
ELSE;
260262
label = field_descs.${change.fieldname};
261263
END;

extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,10 @@
653653
[% END %]
654654

655655
[% IF bug.cc && bug.cc.size %]
656-
<input type="hidden" name="removecc" id="removecc">
657-
<span id="cc-latch">&#9656;</span>
656+
[% IF user.id %]
657+
<input type="hidden" name="removecc" id="removecc">
658+
<span id="cc-latch">&#9656;</span>
659+
[% END %]
658660
<span id="cc-summary" data-count="[% bug.cc.size FILTER none %]">
659661
[%
660662
IF bug.cc.size == 1;
@@ -985,6 +987,7 @@
985987
END;
986988
%]
987989

990+
[% Hook.process('details_lhs') %]
988991
[% END %]
989992
[% WRAPPER fields_rhs %]
990993

@@ -1005,6 +1008,7 @@
10051008
hide_on_view = bug.see_also.size == 0
10061009
%]
10071010

1011+
[% Hook.process('details_rhs') %]
10081012
[% END %]
10091013

10101014
[%# custom fields (textarea) %]
@@ -1214,6 +1218,7 @@
12141218
<div id="bottom-actions">
12151219
<div id="bottom-right-actions">
12161220
<button type="button" id="top-btn" class="minor">Top &uarr;</button>
1221+
<button type="button" id="format-btn" class="minor">Format &#9662;</button>
12171222
[% IF user.id %]
12181223
<button type="button" id="new-bug-btn" class="minor">New/Clone [% terms.Bug %] &#9662;</button>
12191224
[% END %]

extensions/BugModal/template/en/default/bug_modal/field.html.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ END;
101101
[% IF hide_on_view %] style="display:none"[% END %]
102102
>
103103
[% IF label.defined && !no_label %]
104-
<div class="name">
104+
<div class="name
105+
[%~ " edit-show" IF hide_on_view %]"
106+
[% IF hide_on_view %] style="display:none"[% END %]>
105107
[%~ IF help.defined %]<a href="[% help FILTER none %]" class="help">[% END %]
106108
[%~ label _ ":" FILTER html IF label %]
107109
[%~ IF help.defined %]</a>[% END ~%]

extensions/BugModal/web/bug_modal.css

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,10 @@ input[type="number"] {
326326
color: #999;
327327
}
328328

329-
#cc-latch, #cc-summary {
329+
#cc-latch {
330330
cursor: pointer;
331331
}
332332

333-
#cc-summary:hover {
334-
text-decoration: underline;
335-
}
336-
337333
#cc-list {
338334
max-height: 150px;
339335
overflow-y: auto;
@@ -365,6 +361,14 @@ input[type="number"] {
365361
width: 100%;
366362
}
367363

364+
.cc-loadable {
365+
cursor: pointer;
366+
}
367+
368+
.cc-loadable:hover {
369+
text-decoration: underline;
370+
}
371+
368372
/* actions */
369373

370374
#top-actions {

extensions/BugModal/web/bug_modal.js

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -226,24 +226,27 @@ $(function() {
226226
);
227227
}
228228

229-
$('#cc-latch, #cc-summary')
230-
.click(function(event) {
231-
event.preventDefault();
232-
var latch = $('#cc-latch');
229+
if (BUGZILLA.user.id) {
230+
$('#cc-summary').addClass('cc-loadable');
231+
$('#cc-latch, #cc-summary')
232+
.click(function(event) {
233+
event.preventDefault();
234+
var latch = $('#cc-latch');
233235

234-
if (latch.data('expanded')) {
235-
latch.data('expanded', false).html('&#9656;');
236-
$('#cc-list').hide();
237-
}
238-
else {
239-
latch.data('expanded', true).html('&#9662;');
240-
$('#cc-list').show();
241-
if (!latch.data('fetched')) {
242-
ccListLoading();
243-
ccListUpdate();
236+
if (latch.data('expanded')) {
237+
latch.data('expanded', false).html('&#9656;');
238+
$('#cc-list').hide();
244239
}
245-
}
246-
});
240+
else {
241+
latch.data('expanded', true).html('&#9662;');
242+
$('#cc-list').show();
243+
if (!latch.data('fetched')) {
244+
ccListLoading();
245+
ccListUpdate();
246+
}
247+
}
248+
});
249+
}
247250

248251
// copy summary to clipboard
249252

@@ -1023,6 +1026,30 @@ $(function() {
10231026
},
10241027
]
10251028
});
1029+
$.contextMenu({
1030+
selector: '#format-btn',
1031+
trigger: 'left',
1032+
items: [
1033+
{
1034+
name: 'For Printing',
1035+
callback: function() {
1036+
window.location.href = 'show_bug.cgi?format=multiple&id=' + BUGZILLA.bug_id;
1037+
}
1038+
},
1039+
{
1040+
name: 'XML',
1041+
callback: function() {
1042+
window.location.href = 'show_bug.cgi?ctype=xml&id=' + BUGZILLA.bug_id;
1043+
}
1044+
},
1045+
{
1046+
name: 'Legacy',
1047+
callback: function() {
1048+
window.location.href = 'show_bug.cgi?format=default&id=' + BUGZILLA.bug_id;
1049+
}
1050+
}
1051+
]
1052+
});
10261053

10271054
// "reset to default" checkboxes
10281055
$('#product, #component')

0 commit comments

Comments
 (0)