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

121 lines
2.6 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
2018-12-13 13:39:08 +05:30
import lockedWarning from './locked_warning.vue';
import titleField from './fields/title.vue';
import descriptionField from './fields/description.vue';
import editActions from './edit_actions.vue';
import descriptionTemplate from './fields/description_template.vue';
2017-09-10 17:25:29 +05:30
2018-12-13 13:39:08 +05:30
export default {
components: {
lockedWarning,
titleField,
descriptionField,
descriptionTemplate,
editActions,
},
props: {
canDestroy: {
type: Boolean,
required: true,
2018-03-17 18:26:18 +05:30
},
2018-12-13 13:39:08 +05:30
formState: {
type: Object,
required: true,
2017-09-10 17:25:29 +05:30
},
2018-12-13 13:39:08 +05:30
issuableTemplates: {
type: Array,
required: false,
default: () => [],
2017-09-10 17:25:29 +05:30
},
2018-12-13 13:39:08 +05:30
issuableType: {
type: String,
required: true,
},
markdownPreviewPath: {
type: String,
required: true,
},
markdownDocsPath: {
type: String,
required: true,
},
markdownVersion: {
type: Number,
required: false,
default: 0,
},
projectPath: {
type: String,
required: true,
},
projectNamespace: {
type: String,
required: true,
},
showDeleteButton: {
type: Boolean,
required: false,
default: true,
},
canAttachFile: {
type: Boolean,
required: false,
default: true,
},
enableAutocomplete: {
type: Boolean,
required: false,
default: true,
},
},
computed: {
hasIssuableTemplates() {
return this.issuableTemplates.length;
},
},
};
2017-09-10 17:25:29 +05:30
</script>
<template>
<form>
<locked-warning v-if="formState.lockedWarningVisible" />
<div class="row">
2019-01-03 12:48:30 +05:30
<div
v-if="hasIssuableTemplates"
class="col-sm-4 col-lg-3">
2017-09-10 17:25:29 +05:30
<description-template
:form-state="formState"
:issuable-templates="issuableTemplates"
:project-path="projectPath"
2018-03-17 18:26:18 +05:30
:project-namespace="projectNamespace"
/>
2017-09-10 17:25:29 +05:30
</div>
<div
:class="{
'col-sm-8 col-lg-9': hasIssuableTemplates,
2018-11-08 19:23:39 +05:30
'col-12': !hasIssuableTemplates,
2018-03-17 18:26:18 +05:30
}"
>
2019-01-03 12:48:30 +05:30
<title-field
:form-state="formState"
:issuable-templates="issuableTemplates"
/>
2017-09-10 17:25:29 +05:30
</div>
</div>
<description-field
:form-state="formState"
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
<edit-actions
:form-state="formState"
2018-03-17 18:26:18 +05:30
:can-destroy="canDestroy"
:show-delete-button="showDeleteButton"
2018-12-05 23:21:45 +05:30
:issuable-type="issuableType"
2018-03-17 18:26:18 +05:30
/>
2017-09-10 17:25:29 +05:30
</form>
</template>