summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue
blob: dad4b0fe49d4dde52156fc2bf15b06aebcbd5b52 (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
<script>
  import statusIcon from '../mr_widget_status_icon.vue';

  export default {
    name: 'MRWidgetConflicts',
    components: {
      statusIcon,
    },
    props: {
      /* TODO: This is providing all store and service down when it
      only needs a few props */
      mr: {
        type: Object,
        required: true,
        default: () => ({}),
      },
    },
  };
</script>
<template>
  <div class="mr-widget-body media">
    <status-icon
      status="warning"
      :show-disabled-button="true"
    />

    <div class="media-body space-children">
      <span
        v-if="mr.shouldBeRebased"
        class="bold"
      >
        {{ s__(`mrWidget|Fast-forward merge is not possible.
To merge this request, first rebase locally.`) }}
      </span>
      <template v-else>
        <span class="bold">
          {{ s__("mrWidget|There are merge conflicts") }}<span v-if="!mr.canMerge">.</span>
          <span v-if="!mr.canMerge">
            {{ s__(`mrWidget|Resolve these conflicts or ask someone
            with write access to this repository to merge it locally`) }}
          </span>
        </span>
        <a
          v-if="mr.canMerge && mr.conflictResolutionPath"
          :href="mr.conflictResolutionPath"
          class="js-resolve-conflicts-button btn btn-default btn-xs"
        >
          {{ s__("mrWidget|Resolve conflicts") }}
        </a>
        <button
          v-if="mr.canMerge"
          class="js-merge-locally-button btn btn-default btn-xs"
          data-toggle="modal"
          data-target="#modal_merge_info"
        >
          {{ s__("mrWidget|Merge locally") }}
        </button>
      </template>
    </div>
  </div>
</template>