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

work_item_title_with_edit.vue « components « work_items « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6af564a6a915df4ef526c8e65269102361f07f2d (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
<script>
import { GlFormGroup, GlFormInput } from '@gitlab/ui';
import { __ } from '~/locale';

export default {
  components: {
    GlFormGroup,
    GlFormInput,
  },
  i18n: {
    titleLabel: __('Title (required)'),
  },
  props: {
    title: {
      type: String,
      required: true,
    },
    isEditing: {
      type: Boolean,
      required: false,
      default: false,
    },
  },
};
</script>

<template>
  <gl-form-group v-if="isEditing" :label="$options.i18n.titleLabel" label-for="work-item-title">
    <gl-form-input
      class="gl-w-full"
      :value="title"
      data-testid="work-item-title-with-edit"
      @keydown.meta.enter="$emit('updateWorkItem')"
      @keydown.ctrl.enter="$emit('updateWorkItem')"
      @input="$emit('updateDraft', $event)"
    />
  </gl-form-group>
  <h1
    v-else
    data-testid="work-item-title"
    class="gl-w-full gl-font-weight-normal gl-sm-font-weight-bold gl-mb-1 gl-mt-0 gl-font-size-h-display"
  >
    {{ title }}
  </h1>
</template>