|
6 | 6 | # defined by the Mozilla Public License, v. 2.0. |
7 | 7 | #%] |
8 | 8 |
|
9 | | -[% RETURN UNLESS tracking_flag_components %] |
| 9 | +[% |
| 10 | + RETURN UNLESS tracking_flag_components; |
| 11 | + |
| 12 | + # A list of products that will automatically set cf_status_firefox to |
| 13 | + # "affected" when filing bugs with nightly. An empty component list |
| 14 | + # denotes all components. |
| 15 | + auto_affected = { |
| 16 | + "Firefox" = [], |
| 17 | + "Firefox for Android" = [], |
| 18 | + "Firefox OS" = [], |
| 19 | + "Core" = [], |
| 20 | + "Toolkit" = [], |
| 21 | + "Firefox Health Report" = [ "Client: Desktop", "Client: Android" ], |
| 22 | + }; |
| 23 | + |
| 24 | + # map product names to lowercase |
| 25 | + FOREACH key IN auto_affected.keys; |
| 26 | + key_lc = key.lower; |
| 27 | + auto_affected.$key_lc = auto_affected.item(key); |
| 28 | + END; |
| 29 | +%] |
10 | 30 |
|
11 | 31 | <script type="text/javascript"> |
12 | 32 | $(function() { |
|
26 | 46 | }); |
27 | 47 | }).click(); |
28 | 48 |
|
29 | | - [% IF highest_status_firefox %] |
30 | | - $('#version, #bug_status') |
| 49 | + [% IF highest_status_firefox && auto_affected.exists(product.name.lower) %] |
| 50 | + $('#version, #bug_status, #component') |
31 | 51 | .change(function() { |
32 | 52 | var version = $('#version').val(); |
| 53 | + var component = $('#component').val() || ''; |
33 | 54 | if ($('#bug_status').val() != 'UNCONFIRMED' |
34 | 55 | && ( |
35 | 56 | version.toLowerCase() == 'trunk' |
36 | 57 | || version == highest_status_firefox + ' Branch' |
37 | 58 | || version == 'Firefox ' + highest_status_firefox |
38 | | - )) |
| 59 | + ) |
| 60 | + [% auto_components = auto_affected.item(product.name.lower) %] |
| 61 | + [% IF auto_components.size %] |
| 62 | + && ( |
| 63 | + [% FOREACH auto_component IN auto_components %] |
| 64 | + [% " || " UNLESS loop.first %] |
| 65 | + component.toLowerCase() === '[% auto_component.lower FILTER js %]' |
| 66 | + [% END %] |
| 67 | + ) |
| 68 | + [% END %] |
| 69 | + ) |
39 | 70 | { |
40 | 71 | $('#cf_status_firefox' + highest_status_firefox).val('affected'); |
41 | 72 | } |
|
0 commit comments