debian-mirror-gitlab/app/assets/javascripts/issue_show/components/fields/description.vue

69 lines
1.7 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
2018-12-13 13:39:08 +05:30
import updateMixin from '../../mixins/update';
import markdownField from '../../../vue_shared/components/markdown/field.vue';
2017-09-10 17:25:29 +05:30
2018-12-13 13:39:08 +05:30
export default {
components: {
markdownField,
},
mixins: [updateMixin],
props: {
formState: {
type: Object,
required: true,
2018-03-17 18:26:18 +05:30
},
2018-12-13 13:39:08 +05:30
markdownPreviewPath: {
type: String,
required: true,
2017-09-10 17:25:29 +05:30
},
2018-12-13 13:39:08 +05:30
markdownDocsPath: {
type: String,
required: true,
2017-09-10 17:25:29 +05:30
},
2018-12-13 13:39:08 +05:30
canAttachFile: {
type: Boolean,
required: false,
default: true,
},
enableAutocomplete: {
type: Boolean,
required: false,
default: true,
},
},
mounted() {
this.$refs.textarea.focus();
},
};
2017-09-10 17:25:29 +05:30
</script>
<template>
<div class="common-note-form">
2019-09-30 21:07:59 +05:30
<label class="sr-only" for="issue-description">{{ __('Description') }}</label>
2017-09-10 17:25:29 +05:30
<markdown-field
2018-03-17 18:26:18 +05:30
:markdown-preview-path="markdownPreviewPath"
:markdown-docs-path="markdownDocsPath"
:can-attach-file="canAttachFile"
:enable-autocomplete="enableAutocomplete"
2020-05-24 23:13:21 +05:30
:textarea-value="formState.description"
2018-03-17 18:26:18 +05:30
>
2020-05-24 23:13:21 +05:30
<template #textarea>
<textarea
id="issue-description"
ref="textarea"
v-model="formState.description"
class="note-textarea js-gfm-input js-autosize markdown-area
qa-description-textarea"
dir="auto"
data-supports-quick-actions="false"
:aria-label="__('Description')"
:placeholder="__('Write a comment or drag your files here…')"
@keydown.meta.enter="updateIssuable"
@keydown.ctrl.enter="updateIssuable"
>
</textarea>
</template>
2017-09-10 17:25:29 +05:30
</markdown-field>
</div>
</template>