Commit 8e2f8b83 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '229677-mr-conflicts' into 'master'

Migrate merge conflicts modal

See merge request gitlab-org/gitlab!48370
parents d1823551 089884db
<script> <script>
import { GlLoadingIcon } from '@gitlab/ui'; import { GlButton, GlLoadingIcon } from '@gitlab/ui';
import ciIcon from '../../vue_shared/components/ci_icon.vue'; import ciIcon from '../../vue_shared/components/ci_icon.vue';
export default { export default {
components: { components: {
ciIcon, ciIcon,
GlButton,
GlLoadingIcon, GlLoadingIcon,
}, },
props: { props: {
...@@ -32,21 +33,23 @@ export default { ...@@ -32,21 +33,23 @@ export default {
}; };
</script> </script>
<template> <template>
<div class="d-flex align-self-start"> <div class="gl-display-flex gl-align-self-start">
<div class="square s24 h-auto d-flex-center gl-mr-3"> <div class="square s24 h-auto d-flex-center gl-mr-3">
<div v-if="isLoading" class="mr-widget-icon d-inline-flex"> <div v-if="isLoading" class="mr-widget-icon gl-display-inline-flex">
<gl-loading-icon size="md" class="mr-loading-icon d-inline-flex" /> <gl-loading-icon size="md" class="mr-loading-icon gl-display-inline-flex" />
</div> </div>
<ci-icon v-else :status="statusObj" :size="24" /> <ci-icon v-else :status="statusObj" :size="24" />
</div> </div>
<button <gl-button
v-if="showDisabledButton" v-if="showDisabledButton"
type="button" type="button"
class="js-disabled-merge-button btn btn-success btn-sm" category="primary"
disabled="true" variant="success"
class="js-disabled-merge-button"
:disabled="true"
> >
{{ s__('mrWidget|Merge') }} {{ s__('mrWidget|Merge') }}
</button> </gl-button>
</div> </div>
</template> </template>
<script> <script>
import $ from 'jquery'; import $ from 'jquery';
import { escape } from 'lodash'; import { escape } from 'lodash';
import { GlButton, GlModalDirective } from '@gitlab/ui';
import { s__, sprintf } from '~/locale'; import { s__, sprintf } from '~/locale';
import { mouseenter, debouncedMouseleave, togglePopover } from '~/shared/popover'; import { mouseenter, debouncedMouseleave, togglePopover } from '~/shared/popover';
import StatusIcon from '../mr_widget_status_icon.vue'; import StatusIcon from '../mr_widget_status_icon.vue';
...@@ -9,6 +10,10 @@ export default { ...@@ -9,6 +10,10 @@ export default {
name: 'MRWidgetConflicts', name: 'MRWidgetConflicts',
components: { components: {
StatusIcon, StatusIcon,
GlButton,
},
directives: {
GlModalDirective,
}, },
props: { props: {
/* TODO: This is providing all store and service down when it /* TODO: This is providing all store and service down when it
...@@ -89,22 +94,21 @@ To merge this request, first rebase locally.`) ...@@ -89,22 +94,21 @@ To merge this request, first rebase locally.`)
</span> </span>
</span> </span>
<span v-if="showResolveButton" ref="popover"> <span v-if="showResolveButton" ref="popover">
<a <gl-button
:href="mr.conflictResolutionPath" :href="mr.conflictResolutionPath"
:disabled="mr.sourceBranchProtected" :disabled="mr.sourceBranchProtected"
class="js-resolve-conflicts-button btn btn-default btn-sm" class="js-resolve-conflicts-button"
> >
{{ s__('mrWidget|Resolve conflicts') }} {{ s__('mrWidget|Resolve conflicts') }}
</a> </gl-button>
</span> </span>
<button <gl-button
v-if="mr.canMerge" v-if="mr.canMerge"
class="js-merge-locally-button btn btn-default btn-sm" v-gl-modal-directive="'modal-merge-info'"
data-toggle="modal" class="js-merge-locally-button"
data-target="#modal_merge_info"
> >
{{ s__('mrWidget|Merge locally') }} {{ s__('mrWidget|Merge locally') }}
</button> </gl-button>
</template> </template>
</div> </div>
</div> </div>
......
---
title: Make How to merge modal in merge requests widget conform to correct modal styling
merge_request: 48370
author:
type: changed
...@@ -194,7 +194,7 @@ describe('MRWidgetConflicts', () => { ...@@ -194,7 +194,7 @@ describe('MRWidgetConflicts', () => {
}); });
it('sets resolve button as disabled', () => { it('sets resolve button as disabled', () => {
expect(vm.find('.js-resolve-conflicts-button').attributes('disabled')).toBe('disabled'); expect(vm.find('.js-resolve-conflicts-button').attributes('disabled')).toBe('true');
}); });
it('renders popover', () => { it('renders popover', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment