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
|
<script>
import { GlModal, GlButton } from '@gitlab/ui';
import { __ } from '~/locale';
export default {
name: 'MergeFailedPipelineConfirmationDialog',
i18n: {
primary: __('Merge unverified changes'),
cancel: __('Cancel'),
info: __(
'The latest pipeline for this merge request did not succeed. The latest changes are unverified.',
),
confirmation: __('Are you sure you want to attempt to merge?'),
title: __('Merge unverified changes?'),
},
components: {
GlModal,
GlButton,
},
props: {
visible: {
type: Boolean,
required: true,
},
},
methods: {
hide() {
this.$refs.modal.hide();
},
cancel() {
this.hide();
this.$emit('cancel');
},
focusCancelButton() {
this.$refs.cancelButton.$el.focus();
},
mergeChanges() {
this.$emit('mergeWithFailedPipeline');
this.hide();
},
},
};
</script>
<template>
<gl-modal
ref="modal"
size="sm"
modal-id="merge-train-failed-pipeline-confirmation-dialog"
:title="$options.i18n.title"
:visible="visible"
data-testid="merge-failed-pipeline-confirmation-dialog"
@shown="focusCancelButton"
@hide="$emit('cancel')"
>
<p>{{ $options.i18n.info }}</p>
<p>{{ $options.i18n.confirmation }}</p>
<template #modal-footer>
<gl-button ref="cancelButton" data-testid="merge-cancel-btn" @click="cancel">{{
$options.i18n.cancel
}}</gl-button>
<gl-button variant="danger" data-testid="merge-unverified-changes" @click="mergeChanges">
{{ $options.i18n.primary }}
</gl-button>
</template>
</gl-modal>
</template>
|