]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1527178 - If an uplift request answers Yes to needing manual QA, automatically...
authorKohei Yoshino <kohei.yoshino@gmail.com>
Thu, 28 Feb 2019 05:31:55 +0000 (00:31 -0500)
committerGitHub <noreply@github.com>
Thu, 28 Feb 2019 05:31:55 +0000 (00:31 -0500)
extensions/BMO/template/en/default/hook/flag/type_comment-form.html.tmpl
extensions/FlagTypeComment/web/js/ftc.js

index 011bd92dd962768d8811ca4d98667983a1fc7648..4cbe7df1744cb7d9e61d5e7f1cb24b8d8c8b370e 100644 (file)
@@ -45,7 +45,7 @@
         <th id="_ar_beta_i5_label">Needs manual test from QE?</th>
         <td>
           <div role="radiogroup" class="buttons toggle" aria-labelledby="_ar_beta_i5_label">
-            <div class="item"><input id="_ar_beta_i5_r1" type="radio" name="_ar_beta_i5_radio" value="Yes"><label for="_ar_beta_i5_r1">Yes</label></div>
+            <div class="item"><input id="_ar_beta_i5_r1" type="radio" name="_ar_beta_i5_radio" value="Yes" data-bug-flag="qe-verify"><label for="_ar_beta_i5_r1">Yes</label></div>
             <div class="item"><input id="_ar_beta_i5_r2" type="radio" name="_ar_beta_i5_radio" value="No"><label for="_ar_beta_i5_r2">No</label></div>
           </div>
         </td>
index 539eebd34423c040484beb7919a737ac3a8adc2e..855ca7748457b0ac0954413cfd3e7727f4829ae3 100644 (file)
@@ -282,6 +282,21 @@ Bugzilla.FlagTypeComment = class FlagTypeComment {
       }
     })));
 
+    // Collect bug flags from checkboxes
+    const bug_flags = [...this.$fieldset_wrapper.querySelectorAll('input[data-bug-flag]:checked')]
+      .map($input => ({ name: $input.getAttribute('data-bug-flag'), status: '?' }));
+
+    // Update bug flags if needed
+    if (bug_flags.length) {
+      await new Promise(resolve => {
+        bugzilla_ajax({
+          type: 'PUT',
+          url: `${BUGZILLA.config.basepath}rest/bug/${this.bug_id}`,
+          data: { flags: bug_flags },
+        }, () => resolve(), () => resolve());
+      });
+    }
+
     // Redirect to the bug once everything is done
     location.href = `${BUGZILLA.config.basepath}show_bug.cgi?id=${this.bug_id}`;