summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs/components/merge_conflict_warning.vue
blob: e47bea8e58999067cf00eb23cd8981538df3d1b3 (plain)
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
<script>
import { GlButton, GlAlert } from '@gitlab/ui';
import { CENTERED_LIMITED_CONTAINER_CLASSES } from '../constants';

export default {
  components: {
    GlAlert,
    GlButton,
  },
  props: {
    limited: {
      type: Boolean,
      required: true,
    },
    mergeable: {
      type: Boolean,
      required: true,
    },
    resolutionPath: {
      type: String,
      required: true,
    },
  },
  computed: {
    containerClasses() {
      return {
        [CENTERED_LIMITED_CONTAINER_CLASSES]: this.limited,
      };
    },
  },
};
</script>

<template>
  <div :class="containerClasses">
    <gl-alert
      :dismissible="false"
      :title="__('There are merge conflicts')"
      variant="warning"
      class="gl-mb-5"
    >
      <p class="gl-mb-2">
        {{ __('The comparison view may be inaccurate due to merge conflicts.') }}
      </p>
      <p class="gl-mb-0">
        {{
          __(
            'Resolve these conflicts or ask someone with write access to this repository to merge it locally.',
          )
        }}
      </p>
      <template #actions>
        <gl-button
          v-if="resolutionPath"
          :href="resolutionPath"
          variant="info"
          class="gl-mr-5 gl-alert-action"
        >
          {{ __('Resolve conflicts') }}
        </gl-button>
        <gl-button
          v-if="mergeable"
          class="gl-alert-action"
          data-toggle="modal"
          data-target="#modal_merge_info"
        >
          {{ __('Merge locally') }}
        </gl-button>
      </template>
    </gl-alert>
  </div>
</template>