Skip to content

Fix loading state for split button

Savas Vedova requested to merge 390529-fix-loading-state into master

What does this MR do and why?

This MR fixes the loading state being ignored in the finding modal.

Screenshots or screen recordings

before after
Screenshot_2023-02-06_at_13.56.32 Screenshot_2023-02-06_at_14.13.53

How to set up and validate locally

  1. Fork https://gitlab.com/gitlab-examples/security/security-reports/
  2. Create an MR
  3. Visit the MR page
  4. Find the container scanning report and click on a finding
  5. Click on the Resolve with MR (if you have :refactor_security_extension feature flag turned on it may not work, see the next step in that case)

You can also apply the following patch to force displaying the loading state:

diff --git a/ee/app/assets/javascripts/vue_shared/security_reports/components/modal_footer.vue b/ee/app/assets/javascripts/vue_shared/security_reports/components/modal_footer.vue
index 5dc9440c49cb..5f13f6a25d32 100644
--- a/ee/app/assets/javascripts/vue_shared/security_reports/components/modal_footer.vue
+++ b/ee/app/assets/javascripts/vue_shared/security_reports/components/modal_footer.vue
@@ -83,7 +83,7 @@ export default {
       const MRButton = {
         name: s__('ciReport|Resolve with merge request'),
         tagline: s__('ciReport|Automatically apply the patch in a new branch'),
-        loading: this.isCreatingMergeRequest,
+        loading: true,
         action: 'createMergeRequest',
       };
       const DownloadButton = {

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #390529 (closed)

Edited by Savas Vedova

Merge request reports