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

catalog_header.vue « list « components « catalog « ci « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3a9ec34178968201b87522ab8134657de2b7a78b (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
70
71
72
73
74
<script>
import { GlBanner, GlLink } from '@gitlab/ui';
import { __, s__ } from '~/locale';
import { helpPagePath } from '~/helpers/help_page_helper';
import BetaBadge from '~/vue_shared/components/badges/beta_badge.vue';
import { CATALOG_FEEDBACK_DISMISSED_KEY } from '../../constants';

const defaultTitle = __('CI/CD Catalog');
const defaultDescription = s__(
  'CiCatalog|Discover CI/CD components that can improve your pipeline with additional functionality.',
);

export default {
  components: {
    BetaBadge,
    GlBanner,
    GlLink,
  },
  inject: {
    pageTitle: { default: defaultTitle },
    pageDescription: {
      default: defaultDescription,
    },
  },
  data() {
    return {
      isFeedbackBannerDismissed: localStorage.getItem(CATALOG_FEEDBACK_DISMISSED_KEY) === 'true',
    };
  },
  methods: {
    handleDismissBanner() {
      localStorage.setItem(CATALOG_FEEDBACK_DISMISSED_KEY, 'true');
      this.isFeedbackBannerDismissed = true;
    },
  },
  i18n: {
    banner: {
      title: __('Your feedback is important to us 👋'),
      description: s__(
        "CiCatalog|We want to help you create and manage pipeline component repositories, while also making it easier to reuse pipeline configurations. Let us know how we're doing!",
      ),
      btnText: __('Give us some feedback'),
    },
    learnMore: __('Learn more'),
  },
  learnMorePath: helpPagePath('ci/components/index'),
};
</script>
<template>
  <div class="page-title-holder">
    <gl-banner
      v-if="!isFeedbackBannerDismissed"
      class="gl-mt-5"
      :title="$options.i18n.banner.title"
      :button-text="$options.i18n.banner.btnText"
      button-link="https://gitlab.com/gitlab-org/gitlab/-/issues/407556"
      @close="handleDismissBanner"
    >
      <p>
        {{ $options.i18n.banner.description }}
      </p>
    </gl-banner>
    <div class="gl-my-4 gl-display-flex gl-align-items-center">
      <h1 class="gl-m-0 gl-font-size-h-display">{{ pageTitle }}</h1>
      <beta-badge class="gl-ml-3" />
    </div>
    <p>
      <span data-testid="page-description">{{ pageDescription }}</span>
      <gl-link :href="$options.learnMorePath" target="_blank">{{
        $options.i18n.learnMore
      }}</gl-link>
    </p>
  </div>
</template>