summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/serverless/survey_banner.vue
blob: a0a90fa5e80e29da8685fef86c9822491bbdd2be (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
<script>
import Cookies from 'js-cookie';
import { parseBoolean } from '~/lib/utils/common_utils';
import { GlBanner } from '@gitlab/ui';

export default {
  components: {
    GlBanner,
  },
  props: {
    surveyUrl: {
      type: String,
      required: true,
    },
  },
  data() {
    return {
      visible: true,
    };
  },
  created() {
    if (parseBoolean(Cookies.get('hide_serverless_survey'))) {
      this.visible = false;
    }
  },
  methods: {
    handleClose() {
      Cookies.set('hide_serverless_survey', 'true', { expires: 365 * 10 });
      this.visible = false;
    },
  },
};
</script>

<template>
  <gl-banner
    v-if="visible"
    class="mt-4"
    :title="s__('Serverless|Help shape the future of Serverless at GitLab')"
    :button-text="s__('Serverless|Sign up for First Look')"
    :button-link="surveyUrl"
    @close="handleClose"
  >
    <p>
      {{
        s__(
          'Serverless|We are continually striving to improve our Serverless functionality. As a Knative user, we would love to hear how we can make this experience better for you. Sign up for GitLab First Look today and we will be in touch shortly.',
        )
      }}
    </p>
  </gl-banner>
</template>