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
|
<script>
import { GlModal } from '@gitlab/ui';
import { __ } from '~/locale';
export const i18n = {
btnText: __('Fork project'),
title: __('Fork project?'),
message: __(
'You can’t edit files directly in this project. Fork this project and submit a merge request with your changes.',
),
};
export default {
name: 'ConfirmForkModal',
components: {
GlModal,
},
model: {
prop: 'visible',
event: 'change',
},
props: {
visible: {
type: Boolean,
required: false,
default: false,
},
modalId: {
type: String,
required: true,
},
forkPath: {
type: String,
required: true,
},
},
computed: {
btnActions() {
return {
cancel: { text: __('Cancel') },
primary: {
text: this.$options.i18n.btnText,
attributes: {
href: this.forkPath,
variant: 'confirm',
'data-qa-selector': 'fork_project_button',
'data-method': 'post',
},
},
};
},
},
i18n,
};
</script>
<template>
<gl-modal
:visible="visible"
data-qa-selector="confirm_fork_modal"
:modal-id="modalId"
:title="$options.i18n.title"
:action-primary="btnActions.primary"
:action-cancel="btnActions.cancel"
@change="$emit('change', $event)"
>
<p>{{ $options.i18n.message }}</p>
</gl-modal>
</template>
|