2020-10-08 15:08:17 +00:00
|
|
|
<script>
|
|
|
|
import { GlForm, GlFormGroup, GlFormInput, GlFormTextarea } from '@gitlab/ui';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
GlForm,
|
|
|
|
GlFormGroup,
|
|
|
|
GlFormInput,
|
|
|
|
GlFormTextarea,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
description: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
2020-10-15 15:08:45 +00:00
|
|
|
mounted() {
|
|
|
|
this.preSelect();
|
|
|
|
},
|
2020-10-08 15:08:17 +00:00
|
|
|
methods: {
|
|
|
|
getId(type, key) {
|
|
|
|
return `sse-merge-request-meta-${type}-${key}`;
|
|
|
|
},
|
2020-10-15 15:08:45 +00:00
|
|
|
preSelect() {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs.title.$el.select();
|
|
|
|
});
|
|
|
|
},
|
2020-10-22 12:08:41 +00:00
|
|
|
onUpdate(field, value) {
|
|
|
|
const payload = {
|
|
|
|
title: this.title,
|
|
|
|
description: this.description,
|
|
|
|
[field]: value,
|
|
|
|
};
|
2020-10-15 15:08:45 +00:00
|
|
|
this.$emit('updateSettings', payload);
|
2020-10-08 15:08:17 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<gl-form>
|
|
|
|
<gl-form-group
|
|
|
|
key="title"
|
|
|
|
:label="__('Brief title about the change')"
|
|
|
|
:label-for="getId('control', 'title')"
|
|
|
|
>
|
|
|
|
<gl-form-input
|
|
|
|
:id="getId('control', 'title')"
|
2020-10-15 15:08:45 +00:00
|
|
|
ref="title"
|
2020-10-22 12:08:41 +00:00
|
|
|
:value="title"
|
2020-10-08 15:08:17 +00:00
|
|
|
type="text"
|
2020-10-22 12:08:41 +00:00
|
|
|
@input="onUpdate('title', $event)"
|
2020-10-08 15:08:17 +00:00
|
|
|
/>
|
|
|
|
</gl-form-group>
|
|
|
|
|
|
|
|
<gl-form-group
|
|
|
|
key="description"
|
|
|
|
:label="__('Goal of the changes and what reviewers should be aware of')"
|
|
|
|
:label-for="getId('control', 'description')"
|
|
|
|
>
|
|
|
|
<gl-form-textarea
|
|
|
|
:id="getId('control', 'description')"
|
2020-10-22 12:08:41 +00:00
|
|
|
:value="description"
|
|
|
|
@input="onUpdate('description', $event)"
|
2020-10-08 15:08:17 +00:00
|
|
|
/>
|
|
|
|
</gl-form-group>
|
|
|
|
</gl-form>
|
|
|
|
</template>
|