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

ci_editor_header.vue « editor « components « pipeline_editor « ci « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 201fba837e2cdb436ff1122c7c8a1aa63528f123 (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
<script>
import { GlButton } from '@gitlab/ui';
import { __ } from '~/locale';
import Tracking from '~/tracking';
import { pipelineEditorTrackingOptions, TEMPLATE_REPOSITORY_URL } from '../../constants';

export default {
  i18n: {
    browseTemplates: __('Browse templates'),
    help: __('Help'),
  },
  TEMPLATE_REPOSITORY_URL,
  components: {
    GlButton,
  },
  mixins: [Tracking.mixin()],
  props: {
    showDrawer: {
      type: Boolean,
      required: true,
    },
  },
  methods: {
    toggleDrawer() {
      if (this.showDrawer) {
        this.$emit('close-drawer');
      } else {
        this.$emit('open-drawer');
        this.trackHelpDrawerClick();
      }
    },
    trackHelpDrawerClick() {
      const { label, actions } = pipelineEditorTrackingOptions;
      this.track(actions.openHelpDrawer, { label });
    },
    trackTemplateBrowsing() {
      const { label, actions } = pipelineEditorTrackingOptions;

      this.track(actions.browseTemplates, { label });
    },
  },
};
</script>

<template>
  <div class="gl-display-flex gl-p-3 gl-gap-3 gl-border-solid gl-border-gray-100 gl-border-1">
    <gl-button
      :href="$options.TEMPLATE_REPOSITORY_URL"
      size="small"
      icon="external-link"
      target="_blank"
      data-testid="template-repo-link"
      data-qa-selector="template_repo_link"
      @click="trackTemplateBrowsing"
    >
      {{ $options.i18n.browseTemplates }}
    </gl-button>
    <gl-button
      icon="information-o"
      size="small"
      data-testid="drawer-toggle"
      data-qa-selector="drawer_toggle"
      @click="toggleDrawer"
    >
      {{ $options.i18n.help }}
    </gl-button>
  </div>
</template>