All files / app/assets/javascripts/vue_merge_request_widget mr_widget_options.vue

72.91% Statements 105/144
73.91% Branches 51/69
81.15% Functions 56/69
72.46% Lines 100/138

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612                                                                                                            2x                                                                                               61x     73x     141x       255x   129x   129x 129x 129x     129x     1x       146x     69x     73x                       65x 65x                             61x   61x                           62x     129x       129x   129x             161x     161x     19x     73x     74x   74x     63x     167x     65x         3x   3x       3x                 14x     107x     111x     106x   105x     61x                                                               104x   45x                                   61x   61x 49x     61x 2x         61x 61x         49x   49x 2x     49x       49x 49x   49x 2x     49x     49x             61x                                   61x     135x 6x     135x     135x   27x 27x   27x 1x                   76x 1x   75x     50x     2x     52x                 9x     9x   1x 1x                                           1x     1x 1x   1x 1x 1x                   45x   45x   44x 44x 44x               1x     1x     1x     1x     1x 1x     1x     1x 1x                                                       1x                                                                                                                                                                                    
<script>
import { isEmpty, clamp } from 'lodash';
import SafeHtml from '~/vue_shared/directives/safe_html';
import MrWidgetApprovals from 'ee_else_ce/vue_merge_request_widget/components/approvals/approvals.vue';
import MRWidgetService from 'ee_else_ce/vue_merge_request_widget/services/mr_widget_service';
import MRWidgetStore from 'ee_else_ce/vue_merge_request_widget/stores/mr_widget_store';
import { stateToComponentMap as classState } from 'ee_else_ce/vue_merge_request_widget/stores/state_maps';
import { createAlert } from '~/alert';
import { STATUS_CLOSED, STATUS_MERGED } from '~/issues/constants';
import notify from '~/lib/utils/notify';
import { sprintf, s__, __ } from '~/locale';
import SmartInterval from '~/smart_interval';
import { TYPENAME_MERGE_REQUEST } from '~/graphql_shared/constants';
import { convertToGraphQLId } from '~/graphql_shared/utils';
import { setFaviconOverlay } from '~/lib/utils/favicon';
import Loading from './components/loading.vue';
import MrWidgetAlertMessage from './components/mr_widget_alert_message.vue';
import MrWidgetPipelineContainer from './components/mr_widget_pipeline_container.vue';
import WidgetSuggestPipeline from './components/mr_widget_suggest_pipeline.vue';
import SourceBranchRemovalStatus from './components/source_branch_removal_status.vue';
import ArchivedState from './components/states/mr_widget_archived.vue';
import MrWidgetAutoMergeEnabled from './components/states/mr_widget_auto_merge_enabled.vue';
import AutoMergeFailed from './components/states/mr_widget_auto_merge_failed.vue';
import CheckingState from './components/states/mr_widget_checking.vue';
import PreparingState from './components/states/mr_widget_preparing.vue';
import ClosedState from './components/states/mr_widget_closed.vue';
import ConflictsState from './components/states/mr_widget_conflicts.vue';
import FailedToMerge from './components/states/mr_widget_failed_to_merge.vue';
import MergedState from './components/states/mr_widget_merged.vue';
import MergingState from './components/states/mr_widget_merging.vue';
import MissingBranchState from './components/states/mr_widget_missing_branch.vue';
import NotAllowedState from './components/states/mr_widget_not_allowed.vue';
import PipelineBlockedState from './components/states/mr_widget_pipeline_blocked.vue';
import RebaseState from './components/states/mr_widget_rebase.vue';
import NothingToMergeState from './components/states/nothing_to_merge.vue';
import PipelineFailedState from './components/states/pipeline_failed.vue';
import ReadyToMergeState from './components/states/ready_to_merge.vue';
import ShaMismatch from './components/states/sha_mismatch.vue';
import UnresolvedDiscussionsState from './components/states/unresolved_discussions.vue';
import WorkInProgressState from './components/states/work_in_progress.vue';
import WidgetContainer from './components/widget/app.vue';
import {
  STATE_MACHINE,
  stateToComponentMap,
  STATE_QUERY_POLLING_INTERVAL_DEFAULT,
  STATE_QUERY_POLLING_INTERVAL_BACKOFF,
  FOUR_MINUTES_IN_MS,
} from './constants';
import eventHub from './event_hub';
import mergeRequestQueryVariablesMixin from './mixins/merge_request_query_variables';
import getStateQuery from './queries/get_state.query.graphql';
import getStateSubscription from './queries/get_state.subscription.graphql';
import ReportWidgetContainer from './components/report_widget_container.vue';
import MrWidgetReadyToMerge from './components/states/new_ready_to_merge.vue';
import MergeChecks from './components/merge_checks.vue';
 
export default {
  // False positive i18n lint: https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/25
  // eslint-disable-next-line @gitlab/require-i18n-strings
  name: 'MRWidget',
  directives: {
    SafeHtml,
  },
  components: {
    Loading,
    WidgetContainer,
    MrWidgetSuggestPipeline: WidgetSuggestPipeline,
    MrWidgetPipelineContainer,
    MrWidgetAlertMessage,
    MrWidgetMerged: MergedState,
    MrWidgetClosed: ClosedState,
    MrWidgetMerging: MergingState,
    MrWidgetFailedToMerge: FailedToMerge,
    MrWidgetWip: WorkInProgressState,
    MrWidgetArchived: ArchivedState,
    MrWidgetConflicts: ConflictsState,
    MrWidgetNothingToMerge: NothingToMergeState,
    MrWidgetNotAllowed: NotAllowedState,
    MrWidgetMissingBranch: MissingBranchState,
    MrWidgetReadyToMerge,
    ShaMismatch,
    MrWidgetChecking: CheckingState,
    MrWidgetPreparing: PreparingState,
    MrWidgetUnresolvedDiscussions: UnresolvedDiscussionsState,
    MrWidgetPipelineBlocked: PipelineBlockedState,
    MrWidgetPipelineFailed: PipelineFailedState,
    MrWidgetAutoMergeEnabled,
    MrWidgetAutoMergeFailed: AutoMergeFailed,
    MrWidgetRebase: RebaseState,
    SourceBranchRemovalStatus,
    MrWidgetApprovals,
    MergeChecksFailed: () => import('./components/states/merge_checks_failed.vue'),
    ReadyToMerge: ReadyToMergeState,
    ReportWidgetContainer,
    MergeChecks,
  },
  apollo: {
    state: {
      query: getStateQuery,
      notifyOnNetworkStatusChange: true,
      manual: true,
      skip() {
        return !this.mr;
      },
      variables() {
        return this.mergeRequestQueryVariables;
      },
      pollInterval() {
        return this.pollInterval;
      },
      result(response) {
        // 7 is the value for when the network status is ready
        if (response.networkStatus !== 7) return;
 
        this.pollInterval = this.apolloStateQueryPollingInterval;
 
        if (response.data?.project) {
          this.mr.setGraphqlData(response.data.project);
          this.loading = false;
        }
 
        this.checkStatus(undefined, undefined, false);
      },
      error() {
        this.pollInterval = null;
      },
      subscribeToMore: {
        document() {
          return getStateSubscription;
        },
        skip() {
          return !this.mr?.id || this.loading;
        },
        variables() {
          return {
            issuableId: convertToGraphQLId(TYPENAME_MERGE_REQUEST, this.mr?.id),
          };
        },
        updateQuery(
          _,
          {
            subscriptionData: {
              data: { mergeRequestMergeStatusUpdated },
            },
          },
        ) {
          if (mergeRequestMergeStatusUpdated) {
            this.mr.setGraphqlSubscriptionData(mergeRequestMergeStatusUpdated);
          }
        },
      },
    },
  },
  mixins: [mergeRequestQueryVariablesMixin],
  props: {
    mrData: {
      type: Object,
      required: false,
      default: null,
    },
  },
  data() {
    const store = this.mrData && new MRWidgetStore(this.mrData);
 
    return {
      mr: store,
      state: store && store.state,
      service: store && this.createService(store),
      machineState: store?.machineValue || STATE_MACHINE.definition.initial,
      loading: true,
      recomputeComponentName: 0,
      issuableId: false,
      startingPollInterval: STATE_QUERY_POLLING_INTERVAL_DEFAULT,
      pollInterval: STATE_QUERY_POLLING_INTERVAL_DEFAULT,
    };
  },
  computed: {
    apolloStateQueryMaxPollingInterval() {
      return this.startingPollInterval + FOUR_MINUTES_IN_MS;
    },
    apolloStateQueryPollingInterval() {
      Iif (this.startingPollInterval < 0) {
        return 0;
      }
 
      const unboundedInterval = STATE_QUERY_POLLING_INTERVAL_BACKOFF * this.pollInterval;
 
      return clamp(
        unboundedInterval,
        this.startingPollInterval,
        this.apolloStateQueryMaxPollingInterval,
      );
    },
    shouldRenderApprovals() {
      return !['preparing', 'nothingToMerge'].includes(this.mr.state);
    },
    componentName() {
      return stateToComponentMap[this.machineState] || classState[this.mr.state];
    },
    hasPipelineMustSucceedConflict() {
      return !this.mr.hasCI && this.mr.onlyAllowMergeIfPipelineSucceeds;
    },
    shouldRenderPipelines() {
      return this.mr.hasCI || this.hasPipelineMustSucceedConflict;
    },
    shouldSuggestPipelines() {
      const { hasCI, mergeRequestAddCiConfigPath, isDismissedSuggestPipeline } = this.mr;
 
      return !hasCI && mergeRequestAddCiConfigPath && !isDismissedSuggestPipeline;
    },
    shouldRenderCollaborationStatus() {
      return this.mr.allowCollaboration && this.mr.isOpen;
    },
    shouldRenderMergedPipeline() {
      return this.mr.state === STATUS_MERGED && !isEmpty(this.mr.mergePipeline);
    },
    showMergePipelineForkWarning() {
      return Boolean(
        this.mr.mergePipelinesEnabled && this.mr.sourceProjectId !== this.mr.targetProjectId,
      );
    },
    mergeError() {
      let { mergeError } = this.mr;
 
      Iif (mergeError && mergeError.slice(-1) === '.') {
        mergeError = mergeError.slice(0, -1);
      }
 
      return sprintf(
        s__('mrWidget|%{mergeError}. Try again.'),
        {
          mergeError,
        },
        false,
      );
    },
    formattedHumanAccess() {
      return (this.mr.humanAccess || '').toLowerCase();
    },
    hasMergeError() {
      return this.mr.mergeError && this.state !== STATUS_CLOSED;
    },
    hasAlerts() {
      return this.hasMergeError || this.showMergePipelineForkWarning;
    },
    shouldShowMergeDetails() {
      if (this.mr.state === 'readyToMerge') return true;
 
      return !this.mr.mergeDetailsCollapsed;
    },
    mergeBlockedComponentEnabled() {
      return (
        window.gon?.features?.mergeBlockedComponent &&
        !(
          [
            'checking',
            'preparing',
            'nothingToMerge',
            'archived',
            'missingBranch',
            'merged',
            'closed',
            'merging',
            'shaMismatch',
          ].includes(this.mr.state) || this.mr.machineValue === 'MERGING'
        )
      );
    },
  },
  watch: {
    'mr.machineValue': {
      handler(newValue) {
        this.machineState = newValue;
      },
    },
    state(newVal, oldVal) {
      Iif (newVal !== oldVal && this.shouldRenderMergedPipeline) {
        // init polling
        this.initPostMergeDeploymentsPolling();
      }
    },
    'mr.ciStatus': {
      handler(newValue) {
        if (!newValue || this.loading) return;
 
        this.handleNotification();
      },
    },
  },
  mounted() {
    MRWidgetService.fetchInitialData()
      .then(({ data, headers }) => {
        this.startingPollInterval =
          Number(headers['POLL-INTERVAL']) || STATE_QUERY_POLLING_INTERVAL_DEFAULT;
        this.initWidget(data);
      })
      .catch(() =>
        createAlert({
          message: __('Unable to load the merge request widget. Try reloading the page.'),
        }),
      );
  },
  beforeDestroy() {
    this.unbindEventListeners();
 
    if (this.deploymentsInterval) {
      this.deploymentsInterval.destroy();
    }
 
    if (this.postMergeDeploymentsInterval) {
      this.postMergeDeploymentsInterval.destroy();
    }
  },
  methods: {
    initWidget(data = {}) {
      if (this.mr) {
        this.mr.setData({ ...window.gl.mrWidgetData, ...data });
      } else E{
        this.mr = new MRWidgetStore({ ...window.gl.mrWidgetData, ...data });
      }
 
      this.machineState = this.mr.machineValue;
 
      if (!this.state) {
        this.state = this.mr.state;
      }
 
      Iif (!this.service) {
        this.service = this.createService(this.mr);
      }
 
      this.setFaviconHelper();
      this.initDeploymentsPolling();
 
      if (this.shouldRenderMergedPipeline) {
        this.initPostMergeDeploymentsPolling();
      }
 
      this.bindEventHubListeners();
      eventHub.$on('mr.discussion.updated', this.checkStatus);
 
      window.addEventListener('resize', () => {
        Iif (window.innerWidth >= 768) {
          this.mr.toggleMergeDetails(false);
        }
      });
    },
    getServiceEndpoints(store) {
      return {
        mergePath: store.mergePath,
        mergeCheckPath: store.mergeCheckPath,
        cancelAutoMergePath: store.cancelAutoMergePath,
        removeWIPPath: store.removeWIPPath,
        sourceBranchPath: store.sourceBranchPath,
        ciEnvironmentsStatusPath: store.ciEnvironmentsStatusPath,
        mergeRequestBasicPath: store.mergeRequestBasicPath,
        mergeRequestWidgetPath: store.mergeRequestWidgetPath,
        mergeRequestCachedWidgetPath: store.mergeRequestCachedWidgetPath,
        mergeActionsContentPath: store.mergeActionsContentPath,
        rebasePath: store.rebasePath,
        apiApprovalsPath: store.apiApprovalsPath,
        apiApprovePath: store.apiApprovePath,
        apiUnapprovePath: store.apiUnapprovePath,
      };
    },
    createService(store) {
      return new MRWidgetService(this.getServiceEndpoints(store));
    },
    checkStatus(cb, isRebased, refetch = true) {
      if (refetch) {
        this.$apollo.queries.state.refetch();
      }
 
      return this.service
        .checkStatus()
        .then(({ data }) => {
          if (!Object.keys(data).length) return;
 
          this.mr.setData(data, isRebased);
          this.setFaviconHelper();
 
          if (cb) {
            cb.call(null, data);
          }
        })
        .catch(() =>
          createAlert({
            message: __('Something went wrong. Please try again.'),
          }),
        );
    },
    setFaviconHelper() {
      if (this.mr.faviconOverlayPath) {
        return setFaviconOverlay(this.mr.faviconOverlayPath);
      }
      return Promise.resolve();
    },
    initDeploymentsPolling() {
      this.deploymentsInterval = this.deploymentsPoll(this.fetchPreMergeDeployments);
    },
    initPostMergeDeploymentsPolling() {
      this.postMergeDeploymentsInterval = this.deploymentsPoll(this.fetchPostMergeDeployments);
    },
    deploymentsPoll(callback) {
      return new SmartInterval({
        callback,
        startingInterval: 30 * 1000,
        maxInterval: 240 * 1000,
        incrementByFactorOf: 4,
        immediateExecution: true,
      });
    },
    fetchDeployments(target) {
      return this.service.fetchDeployments(target);
    },
    fetchPreMergeDeployments() {
      return this.fetchDeployments()
        .then(({ data }) => {
          if (data.length) {
            this.mr.deployments = data;
          }
        })
        .catch(() => this.throwDeploymentsError());
    },
    fetchPostMergeDeployments() {
      return this.fetchDeployments('merge_commit')
        .then(({ data }) => {
          Iif (data.length) {
            this.mr.postMergeDeployments = data;
          }
        })
        .catch(() => this.throwDeploymentsError());
    },
    throwDeploymentsError() {
      createAlert({
        message: __(
          'Something went wrong while fetching the environments for this merge request. Please try again.',
        ),
      });
    },
    fetchActionsContent() {
      this.service
        .fetchMergeActionsContent()
        .then((res) => {
          if (res.data) {
            const el = document.createElement('div');
            // eslint-disable-next-line no-unsanitized/property
            el.innerHTML = res.data;
            document.body.appendChild(el);
            document.dispatchEvent(new CustomEvent('merged:UpdateActions'));
          }
        })
        .catch(() =>
          createAlert({
            message: __('Something went wrong. Please try again.'),
          }),
        );
    },
    handleNotification() {
      const { pipeline } = this.mr;
 
      if (!pipeline || !Object.keys(pipeline).length) return;
 
      const { label } = pipeline.details.status;
      const title = sprintf(__('Pipeline %{label}'), { label });
      const message = sprintf(__('Pipeline %{label} for "%{dataTitle}"'), {
        dataTitle: this.mr.title,
        label,
      });
 
      notify.notifyMe(title, message, this.mr.gitlabLogo);
    },
    resumePolling() {
      this.$apollo.queries.state.startPolling(this.pollInterval);
    },
    stopPolling() {
      this.$apollo.queries.state.stopPolling();
    },
    checkRebasedStatus(cb) {
      this.checkStatus(cb, true);
    },
    setIsRemovingSourceBranch([value]) {
      this.mr.isRemovingSourceBranch = value;
    },
    setMergeError(mergeError) {
      this.mr.state = 'failedToMerge';
      this.mr.mergeError = mergeError;
    },
    setMrData(data) {
      this.mr.setData(data);
    },
    onFetchDeployments() {
      this.fetchPreMergeDeployments();
      Iif (this.shouldRenderMergedPipeline) {
        this.fetchPostMergeDeployments();
      }
    },
    bindEventHubListeners() {
      eventHub.$on('MRWidgetUpdateRequested', this.checkStatus);
      eventHub.$on('MRWidgetRebaseSuccess', this.checkRebasedStatus);
      eventHub.$on('SetBranchRemoveFlag', this.setIsRemovingSourceBranch);
      eventHub.$on('FailedToMerge', this.setMergeError);
      eventHub.$on('UpdateWidgetData', this.setMrData);
      eventHub.$on('FetchActionsContent', this.fetchActionsContent);
      eventHub.$on('EnablePolling', this.resumePolling);
      eventHub.$on('DisablePolling', this.stopPolling);
      eventHub.$on('FetchDeployments', this.onFetchDeployments);
    },
    unbindEventListeners() {
      eventHub.$off('MRWidgetUpdateRequested', this.checkStatus);
      eventHub.$off('MRWidgetRebaseSuccess', this.checkRebasedStatus);
      eventHub.$off('SetBranchRemoveFlag', this.setIsRemovingSourceBranch);
      eventHub.$off('FailedToMerge', this.setMergeError);
      eventHub.$off('UpdateWidgetData', this.setMrData);
      eventHub.$off('FetchActionsContent', this.fetchActionsContent);
      eventHub.$off('EnablePolling', this.resumePolling);
      eventHub.$off('DisablePolling', this.stopPolling);
      eventHub.$off('FetchDeployments', this.onFetchDeployments);
      eventHub.$off('mr.discussion.updated', this.checkStatus);
    },
    dismissSuggestPipelines() {
      this.mr.isDismissedSuggestPipeline = true;
    },
  },
};
</script>
<template>
  <div v-if="!loading" id="widget-state" class="mr-state-widget gl-mt-5">
    <header
      v-if="shouldRenderCollaborationStatus"
      class="gl-rounded-base gl-border-solid gl-border-1 gl-border-gray-100 gl-overflow-hidden mr-widget-workflow gl-mt-0!"
    >
      <mr-widget-alert-message v-if="shouldRenderCollaborationStatus" type="info">
        {{ s__('mrWidget|Members who can merge are allowed to add commits.') }}
      </mr-widget-alert-message>
    </header>
    <mr-widget-suggest-pipeline
      v-if="shouldSuggestPipelines"
      class="mr-widget-workflow"
      :pipeline-path="mr.mergeRequestAddCiConfigPath"
      :pipeline-svg-path="mr.pipelinesEmptySvgPath"
      :human-access="formattedHumanAccess"
      :user-callouts-path="mr.userCalloutsPath"
      :user-callout-feature-id="mr.suggestPipelineFeatureId"
      @dismiss="dismissSuggestPipelines"
    />
    <mr-widget-pipeline-container
      v-if="shouldRenderPipelines"
      :mr="mr"
      data-testid="pipeline-container"
    />
    <mr-widget-approvals v-if="shouldRenderApprovals" :mr="mr" :service="service" />
    <report-widget-container>
      <widget-container :mr="mr" />
    </report-widget-container>
    <div class="mr-section-container mr-widget-workflow">
      <div v-if="hasAlerts" class="gl-overflow-hidden mr-widget-alert-container">
        <mr-widget-alert-message
          v-if="hasMergeError"
          type="danger"
          dismissible
          data-testid="merge-error"
        >
          <span v-safe-html="mergeError"></span>
        </mr-widget-alert-message>
        <mr-widget-alert-message
          v-if="showMergePipelineForkWarning"
          type="warning"
          :help-path="mr.mergeRequestPipelinesHelpPath"
          data-testid="merge-pipeline-fork-warning"
        >
          {{
            s__(
              'mrWidget|If the last pipeline ran in the fork project, it may be inaccurate. Before merge, we advise running a pipeline in this project.',
            )
          }}
          <template #link-content>
            {{ __('Learn more') }}
          </template>
        </mr-widget-alert-message>
      </div>
 
      <div class="mr-widget-section" data-testid="mr-widget-content">
        <template v-if="mergeBlockedComponentEnabled">
          <mr-widget-auto-merge-enabled
            v-if="mr.autoMergeEnabled"
            :mr="mr"
            :service="service"
            class="gl-border-b-1 gl-border-b-solid gl-border-gray-100"
          />
          <merge-checks :mr="mr" :service="service" />
        </template>
        <component :is="componentName" v-else :mr="mr" :service="service" />
        <ready-to-merge
          v-if="mr.commitsCount"
          v-show="shouldShowMergeDetails"
          :mr="mr"
          :service="service"
        />
      </div>
    </div>
    <mr-widget-pipeline-container
      v-if="shouldRenderMergedPipeline"
      class="js-post-merge-pipeline mr-widget-workflow"
      :mr="mr"
      :is-post-merge="true"
      data-testid="merged-pipeline-container"
    />
  </div>
  <loading v-else />
</template>