summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/web
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-12-06 21:18:08 +0100
committerDavid Lawrence <dkl@mozilla.com>2016-12-06 21:18:08 +0100
commit2dec6dcbe885cfd804fb003337b5ef61737c82b9 (patch)
tree83034c4fc54ccc7a18d593e174b4f1370a686f04 /extensions/BugModal/web
parent6d01972698db25da5f6285dad9d9713d1d769016 (diff)
downloadbugzilla-2dec6dcbe885cfd804fb003337b5ef61737c82b9.tar.gz
bugzilla-2dec6dcbe885cfd804fb003337b5ef61737c82b9.tar.xz
Bug 1215501 - [modal ui only?] When moving a bug to a different product and removing a security-group, the other product's security group gets added automatically anyway
Diffstat (limited to 'extensions/BugModal/web')
-rw-r--r--extensions/BugModal/web/bug_modal.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js
index 1282ff838..a2e7be0c7 100644
--- a/extensions/BugModal/web/bug_modal.js
+++ b/extensions/BugModal/web/bug_modal.js
@@ -1173,12 +1173,16 @@ $(function() {
// update groups
var dirtyGroups = [];
+ var any_groups_checked = 0;
$('#module-security').find('input[name=groups]').each(function() {
var that = $(this);
var defaultChecked = !!that.attr('checked');
if (defaultChecked !== that.is(':checked')) {
dirtyGroups.push({ name: that.val(), value: that.is(':checked') });
}
+ if (that.is(':checked')) {
+ any_groups_checked = 1;
+ }
});
$('#module-security .module-content')
.html(data.groups)
@@ -1186,6 +1190,16 @@ $(function() {
$.each(dirtyGroups, function() {
$('#module-security').find('input[value=' + this.name + ']').prop('checked', this.value);
});
+ // clear any default groups if user was making bug public
+ // unless the group is mandatory for the new product
+ if (!any_groups_checked) {
+ $('#module-security').find('input[name=groups]').each(function() {
+ var that = $(this);
+ if (!that.data('mandatory')) {
+ that.prop('checked', false);
+ }
+ });
+ }
},
function() {
$('#product-throbber').hide();