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

clone_dropdown_item.vue « clone_dropdown « components « vue_shared « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0e322ebc686bd9f363e73c484d99d0eb902bc244 (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
<script>
import {
  GlButton,
  GlDisclosureDropdownItem,
  GlFormGroup,
  GlFormInputGroup,
  GlTooltipDirective,
} from '@gitlab/ui';
import { __ } from '~/locale';

export default {
  components: {
    GlDisclosureDropdownItem,
    GlFormGroup,
    GlFormInputGroup,
    GlButton,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  props: {
    label: {
      type: String,
      required: true,
    },
    link: {
      type: String,
      required: true,
    },
    qaSelector: {
      type: String,
      required: true,
    },
  },
  copyURLTooltip: __('Copy URL'),
};
</script>
<template>
  <gl-disclosure-dropdown-item>
    <gl-form-group :label="label" class="gl-px-3 gl-mb-3">
      <gl-form-input-group :value="link" readonly select-on-click>
        <template #append>
          <gl-button
            v-gl-tooltip.hover
            :title="$options.copyURLTooltip"
            :aria-label="$options.copyURLTooltip"
            :data-clipboard-text="link"
            :data-qa-selector="qaSelector"
            icon="copy-to-clipboard"
            class="gl-display-inline-flex"
          />
        </template>
      </gl-form-input-group>
    </gl-form-group>
  </gl-disclosure-dropdown-item>
</template>