summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/blob/suggest_web_ide_ci/components/web_ide_alert.vue
blob: 1308ca53e7439f85ddc10fec8a703c0985b46ec5 (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
<script>
import { GlAlert, GlButton } from '@gitlab/ui';
import axios from '~/lib/utils/axios_utils';

export default {
  components: {
    GlAlert,
    GlButton,
  },
  props: {
    dismissEndpoint: {
      type: String,
      required: true,
    },
    featureId: {
      type: String,
      required: true,
    },
    editPath: {
      type: String,
      required: true,
    },
  },
  data() {
    return {
      showAlert: true,
    };
  },
  methods: {
    dismissAlert() {
      this.showAlert = false;

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

<template>
  <gl-alert v-if="showAlert" class="gl-mt-5" @dismiss="dismissAlert">
    {{ __('The Web IDE offers advanced syntax highlighting capabilities and more.') }}
    <div class="gl-mt-5">
      <gl-button :href="editPath" category="primary" variant="info">{{
        __('Open Web IDE')
      }}</gl-button>
    </div>
  </gl-alert>
</template>