summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/access_tokens/components/token.vue
blob: 3954e541fe045040a897b0a71dd42a75805655bd (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
<script>
import InputCopyToggleVisibility from '~/vue_shared/components/form/input_copy_toggle_visibility.vue';

export default {
  components: { InputCopyToggleVisibility },
  props: {
    token: {
      type: String,
      required: true,
    },
    inputId: {
      type: String,
      required: true,
    },
    inputLabel: {
      type: String,
      required: true,
    },
    copyButtonTitle: {
      type: String,
      required: true,
    },
  },
  computed: {
    formInputGroupProps() {
      return { id: this.inputId };
    },
  },
};
</script>

<template>
  <div class="row">
    <div class="col-lg-12">
      <hr />
    </div>
    <div class="col-lg-4">
      <h4 class="gl-mt-0"><slot name="title"></slot></h4>
      <slot name="description"></slot>
    </div>
    <div class="col-lg-8">
      <input-copy-toggle-visibility
        :label="inputLabel"
        :label-for="inputId"
        :form-input-group-props="formInputGroupProps"
        :value="token"
        :copy-button-title="copyButtonTitle"
      >
        <template #description>
          <slot name="input-description"></slot>
        </template>
      </input-copy-toggle-visibility>
    </div>
  </div>
</template>