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

cli_commands.vue « list_page « components « explorer « registry « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 319666210d64fa3ef997c010b21c64da11079db9 (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
<script>
import { GlDropdown } from '@gitlab/ui';
import Tracking from '~/tracking';
import CodeInstruction from '~/vue_shared/components/registry/code_instruction.vue';
import {
  QUICK_START,
  LOGIN_COMMAND_LABEL,
  COPY_LOGIN_TITLE,
  BUILD_COMMAND_LABEL,
  COPY_BUILD_TITLE,
  PUSH_COMMAND_LABEL,
  COPY_PUSH_TITLE,
} from '../../constants/index';

const trackingLabel = 'quickstart_dropdown';

export default {
  components: {
    GlDropdown,
    CodeInstruction,
  },
  inject: ['config', 'dockerBuildCommand', 'dockerPushCommand', 'dockerLoginCommand'],
  mixins: [Tracking.mixin({ label: trackingLabel })],
  trackingLabel,
  i18n: {
    QUICK_START,
    LOGIN_COMMAND_LABEL,
    COPY_LOGIN_TITLE,
    BUILD_COMMAND_LABEL,
    COPY_BUILD_TITLE,
    PUSH_COMMAND_LABEL,
    COPY_PUSH_TITLE,
  },
};
</script>
<template>
  <gl-dropdown
    :text="$options.i18n.QUICK_START"
    variant="info"
    right
    @shown="track('click_dropdown')"
  >
    <!-- This li is used as a container since gl-dropdown produces a root ul, this mimics the functionality exposed by b-dropdown-form -->
    <li role="presentation" class="px-2 py-1">
      <code-instruction
        :label="$options.i18n.LOGIN_COMMAND_LABEL"
        :instruction="dockerLoginCommand"
        :copy-text="$options.i18n.COPY_LOGIN_TITLE"
        tracking-action="click_copy_login"
        :tracking-label="$options.trackingLabel"
      />

      <code-instruction
        :label="$options.i18n.BUILD_COMMAND_LABEL"
        :instruction="dockerBuildCommand"
        :copy-text="$options.i18n.COPY_BUILD_TITLE"
        tracking-action="click_copy_build"
        :tracking-label="$options.trackingLabel"
      />

      <code-instruction
        class="mb-0"
        :label="$options.i18n.PUSH_COMMAND_LABEL"
        :instruction="dockerPushCommand"
        :copy-text="$options.i18n.COPY_PUSH_TITLE"
        tracking-action="click_copy_push"
        :tracking-label="$options.trackingLabel"
      />
    </li>
  </gl-dropdown>
</template>