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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 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';
2022-06-21 17:19:12 +05:30
import { helpPagePath } from '~/helpers/help_page_helper';
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,
},
2022-04-04 11:22:00 +05:30
mixins: [updateMixin],
2018-12-13 13:39:08 +05:30
props: {
2022-06-21 17:19:12 +05:30
value: {
type: String,
2018-12-13 13:39:08 +05:30
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,
},
},
2022-06-21 17:19:12 +05:30
computed: {
quickActionsDocsPath() {
return helpPagePath('user/project/quick_actions');
},
},
2018-12-13 13:39:08 +05:30
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"
2022-06-21 17:19:12 +05:30
:quick-actions-docs-path="quickActionsDocsPath"
2018-03-17 18:26:18 +05:30
:can-attach-file="canAttachFile"
:enable-autocomplete="enableAutocomplete"
2022-06-21 17:19:12 +05:30
:textarea-value="value"
2018-03-17 18:26:18 +05:30
>
2020-05-24 23:13:21 +05:30
<template #textarea>
<textarea
id="issue-description"
ref="textarea"
2022-06-21 17:19:12 +05:30
:value="value"
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"
2022-04-04 11:22:00 +05:30
data-supports-quick-actions="true"
2020-05-24 23:13:21 +05:30
:aria-label="__('Description')"
:placeholder="__('Write a comment or drag your files here…')"
2022-06-21 17:19:12 +05:30
@input="$emit('input', $event.target.value)"
2020-05-24 23:13:21 +05:30
@keydown.meta.enter="updateIssuable"
@keydown.ctrl.enter="updateIssuable"
>
</textarea>
</template>
2017-09-10 17:25:29 +05:30
</markdown-field>
</div>
</template>