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

116 lines
2.7 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
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';
export default {
2018-03-17 18:26:18 +05:30
components: {
lockedWarning,
titleField,
descriptionField,
descriptionTemplate,
editActions,
},
2017-09-10 17:25:29 +05:30
props: {
canDestroy: {
type: Boolean,
required: true,
},
formState: {
type: Object,
required: true,
},
issuableTemplates: {
type: Array,
required: false,
default: () => [],
},
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,
},
2017-09-10 17:25:29 +05:30
projectPath: {
type: String,
required: true,
},
projectNamespace: {
type: String,
required: true,
},
2018-03-17 18:26:18 +05:30
showDeleteButton: {
type: Boolean,
required: false,
default: true,
},
canAttachFile: {
type: Boolean,
required: false,
default: true,
},
enableAutocomplete: {
type: Boolean,
required: false,
default: true,
2017-09-10 17:25:29 +05:30
},
},
computed: {
hasIssuableTemplates() {
return this.issuableTemplates.length;
},
},
};
</script>
<template>
<form>
<locked-warning v-if="formState.lockedWarningVisible" />
<div class="row">
<div
2018-11-08 19:23:39 +05:30
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
}"
>
2017-09-10 17:25:29 +05:30
<title-field
:form-state="formState"
2018-03-17 18:26:18 +05:30
: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"
/>
2017-09-10 17:25:29 +05:30
</form>
</template>