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

71 lines
1.9 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
2021-03-08 18:12:59 +05:30
import markdownField from '~/vue_shared/components/markdown/field.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
2021-03-11 19:13:27 +05:30
import updateMixin from '../../mixins/update';
2017-09-10 17:25:29 +05:30
2018-12-13 13:39:08 +05:30
export default {
components: {
markdownField,
},
2021-03-08 18:12:59 +05:30
mixins: [glFeatureFlagsMixin(), updateMixin],
2018-12-13 13:39:08 +05:30
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>
2021-03-11 19:13:27 +05:30
<!-- eslint-disable vue/no-mutating-props -->
2020-05-24 23:13:21 +05:30
<textarea
id="issue-description"
ref="textarea"
v-model="formState.description"
2021-03-08 18:12:59 +05:30
class="note-textarea js-gfm-input js-autosize markdown-area qa-description-textarea"
2020-05-24 23:13:21 +05:30
dir="auto"
2021-03-08 18:12:59 +05:30
:data-supports-quick-actions="!glFeatures.tributeAutocomplete"
2020-05-24 23:13:21 +05:30
:aria-label="__('Description')"
:placeholder="__('Write a comment or drag your files here…')"
@keydown.meta.enter="updateIssuable"
@keydown.ctrl.enter="updateIssuable"
>
</textarea>
2021-03-11 19:13:27 +05:30
<!-- eslint-enable vue/no-mutating-props -->
2020-05-24 23:13:21 +05:30
</template>
2017-09-10 17:25:29 +05:30
</markdown-field>
</div>
</template>