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
|
<script>
import { mapActions } from 'vuex';
import { GlAlert, GlButton } from '@gitlab/ui';
import { CENTERED_LIMITED_CONTAINER_CLASSES } from '../constants';
export default {
components: {
GlAlert,
GlButton,
},
props: {
limited: {
type: Boolean,
required: false,
default: false,
},
dismissed: {
type: Boolean,
required: false,
default: false,
},
},
data() {
return {
isDismissed: this.dismissed,
};
},
computed: {
containerClasses() {
return {
[CENTERED_LIMITED_CONTAINER_CLASSES]: this.limited,
};
},
},
methods: {
...mapActions('diffs', ['expandAllFiles']),
dismiss() {
this.isDismissed = true;
this.$emit('dismiss');
},
expand() {
this.expandAllFiles();
this.dismiss();
},
},
};
</script>
<template>
<div v-if="!isDismissed" data-testid="root" :class="containerClasses" class="col-12">
<gl-alert
:dismissible="true"
:title="__('Some changes are not shown')"
variant="warning"
class="gl-mb-5"
@dismiss="dismiss"
>
<p class="gl-mb-0">
{{ __('For a faster browsing experience, some files are collapsed by default.') }}
</p>
<template #actions>
<gl-button category="secondary" variant="warning" class="gl-alert-action" @click="expand">
{{ __('Expand all files') }}
</gl-button>
</template>
</gl-alert>
</div>
</template>
|