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

75 lines
1.8 KiB
Vue
Raw Normal View History

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