Skip to content

Commit

Permalink
Bug 1754540 - Remove code that handles change requests as no longer n…
Browse files Browse the repository at this point in the history
…eeded
  • Loading branch information
dklawren committed Feb 28, 2022
1 parent 99e288e commit 810a972
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 94 deletions.
5 changes: 0 additions & 5 deletions extensions/BMO/lib/Data.pm
Expand Up @@ -185,11 +185,6 @@ tie(
"Toolkit" => [],
"WebExtensions" => [],
},
qr/^cf_cab_review$/ => {
"Infrastructure & Operations Graveyard" => [],
"Infrastructure & Operations" => [],
"Data & BI Services Team" => [],
}
);

# Who to CC on particular bugmails when certain groups are added or removed.
Expand Down
Expand Up @@ -60,45 +60,3 @@
RETURN;
END;
%]

[%
IF field.name == 'cf_cab_review' AND bug.cf_cab_review == '---';
field.hidden = 1;
value = '---';
%]
[%# lifted from bug/field.html.tmpl %]
<tr>
[% PROCESS "bug/field-label.html.tmpl" hidden=0 %]
<td class="field_value" id="field_container_[% field.name FILTER html %]" colspan="2">
<span id="cab-review-gate">
<a href="https://mozilla.service-now.com/change_request.do?sysparm_stack=change_request_list.do&amp;sys_id=-1&amp;sysparm_query=active=true" target="_blank">ServiceNow Change Request</a>
(<a href="#" id="cab-review-gate-close">use flag</a>)
</span>
<span id="cab-review-edit" style="display:none">
<input type="hidden" id="[% field.name FILTER html %]_dirty">
<select id="[% field.name FILTER html %]" name="[% field.name FILTER html %]">
[%
FOREACH legal_value = field.legal_values;
NEXT IF NOT legal_value.is_active AND NOT value.contains(legal_value.name).size;
NEXT UNLESS bug.check_can_change_field(field.name, '---', legal_value.name).allowed
OR value.contains(legal_value.name).size;
%]
<option value="[% legal_value.name FILTER html %]"
id="v[% legal_value.id FILTER html %]_[% field.name FILTER html %]"
[% IF value.contains(legal_value.name).size %]
selected
[% ELSIF bug AND !legal_value.is_visible_on_bug(bug) %]
class="bz_hidden_option" disabled
[% END %]
>[% display_value(field.name, legal_value.name) FILTER html %]</option>
[%
END;
%]
</select>
</span>
</td>
</tr>
[%
RETURN;
END;
%]
31 changes: 0 additions & 31 deletions extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
Expand Up @@ -1088,37 +1088,6 @@
%]
[% END %]

[%# cab review %]
[% UNLESS cf_hidden_in_product('cf_cab_review', bug.product, bug.component, bug) %]
[% rendered_custom_fields.push('cf_cab_review') %]
[% IF bug.cf_cab_review == "---" %]
[% WRAPPER bug_modal/field.html.tmpl
field = bug_fields.cf_cab_review
field_type = bug_fields.cf_cab_review.type
container = 1
hide_on_view = 1
%]
<span id="cab-review-gate">
<a href="https://mozilla.service-now.com/change_request.do?sysparm_stack=change_request_list.do&amp;sys_id=-1&amp;sysparm_query=active=true" target="_blank" rel="noopener noreferrer">ServiceNow Change Request</a>
<button id="cab-review-gate-close" type="button" class="secondary">Use Flag</button>
</span>
<span id="cab-review-edit" style="display:none">
[% INCLUDE bug_modal/field.html.tmpl
field = bug_fields.cf_cab_review
field_type = bug_fields.cf_cab_review.type
inline = 1
no_indent = 1
%]
</span>
[% END %]
[% ELSE %]
[% INCLUDE bug_modal/field.html.tmpl
field = bug_fields.cf_cab_review
field_type = bug_fields.cf_cab_review.type
%]
[% END %]
[% END %]

[%# custom fields (except textarea) %]
[%
FOREACH field = custom_fields;
Expand Down
17 changes: 2 additions & 15 deletions extensions/MozChangeField/lib/Pre/CustomField.pm
Expand Up @@ -29,22 +29,9 @@ sub evaluate_change {

if (!@$priv_results && $new_value ne '---') {

# Cannot use the standard %cf_setter mapping as we want anyone
# to be able to set ?, just not the other values.
if ($field eq 'cf_cab_review') {
if ( $new_value ne '1'
&& $new_value ne '?'
&& !$user->in_group('infra', $bug->product_id))
{
return {
result => PRIVILEGES_REQUIRED_EMPOWERED,
reason => 'Specific permissions are required to make this change.',
};
}
}

# "other" custom field setters restrictions
elsif (exists $cf_setters->{$field}) {
# Custom field setters restrictions
if (exists $cf_setters->{$field}) {
my $in_group = 0;
foreach my $group (@{$cf_setters->{$field}}) {
if ($user->in_group($group, $bug->product_id)) {
Expand Down
1 change: 0 additions & 1 deletion template/en/default/bug/field.html.tmpl
Expand Up @@ -161,7 +161,6 @@
[% IF field.name.match("^cf_blocking_") OR
field.name.match("^cf_status_") OR
field.name.match("^cf_tracking_") OR
field.name == "cf_cab_review" OR
field.name == "resolution" %]
[% NEXT UNLESS bug.check_can_change_field(field.name, '---', legal_value.name).allowed OR
selected %]
Expand Down

0 comments on commit 810a972

Please sign in to comment.