Welcome to mirror list, hosted at ThFree Co, Russian Federation.

popover.vue « components « mr_tabs_popover « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 304557091496ade2bc4c1c5f200dfedb410e1738 (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
<script>
import { GlPopover, GlDeprecatedButton, GlLink } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import axios from '~/lib/utils/axios_utils';

export default {
  components: {
    GlPopover,
    GlDeprecatedButton,
    GlLink,
    Icon,
  },
  props: {
    dismissEndpoint: {
      type: String,
      required: true,
    },
    featureId: {
      type: String,
      required: true,
    },
  },
  data() {
    return {
      showPopover: false,
    };
  },
  mounted() {
    setTimeout(() => {
      this.showPopover = true;
    }, 2000);
  },
  methods: {
    onDismiss() {
      this.showPopover = false;

      axios.post(this.dismissEndpoint, {
        feature_name: this.featureId,
      });
    },
  },
};
</script>

<template>
  <gl-popover target="#diffs-tab" placement="bottom" :show="showPopover">
    <p class="mb-2">
      {{
        __(
          'Now you can access the merge request navigation tabs at the top, where they’re easier to find.',
        )
      }}
    </p>
    <p>
      <gl-link href="https://gitlab.com/gitlab-org/gitlab/issues/36125" target="_blank">
        {{ __('More information and share feedback') }}
        <icon name="external-link" :size="10" />
      </gl-link>
    </p>
    <gl-deprecated-button
      variant="primary"
      size="sm"
      data-qa-selector="dismiss_popover_button"
      @click="onDismiss"
    >
      {{ __('Got it') }}
    </gl-deprecated-button>
  </gl-popover>
</template>