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

organization_url_field.vue « components « shared « organizations « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d36f62477e6b566489be74bdd49203e31e2e5390 (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
<script>
import { GlFormInputGroup, GlFormInput, GlInputGroupText, GlTruncate } from '@gitlab/ui';
import { s__ } from '~/locale';
import { joinPaths } from '~/lib/utils/url_utility';

export default {
  name: 'OrganizationUrlField',
  components: {
    GlFormInputGroup,
    GlFormInput,
    GlInputGroupText,
    GlTruncate,
  },
  i18n: {
    pathPlaceholder: s__('Organization|my-organization'),
  },
  formId: 'new-organization-form',
  inject: ['organizationsPath', 'rootUrl'],
  props: {
    id: {
      type: String,
      required: true,
    },
    value: {
      type: String,
      required: true,
    },
    validation: {
      type: Object,
      required: true,
    },
  },
  computed: {
    baseUrl() {
      return joinPaths(this.rootUrl, this.organizationsPath, '/');
    },
  },
};
</script>

<template>
  <gl-form-input-group>
    <template #prepend>
      <gl-input-group-text class="organization-root-path">
        <gl-truncate :text="baseUrl" position="middle" />
      </gl-input-group-text>
    </template>
    <gl-form-input
      v-bind="validation"
      :id="id"
      :value="value"
      :placeholder="$options.i18n.pathPlaceholder"
      class="gl-h-auto! gl-md-form-input-lg"
      @input="$emit('input', $event)"
      @blur="$emit('blur', $event)"
    />
  </gl-form-input-group>
</template>