Commit 64e159ad authored by Phil Hughes's avatar Phil Hughes

Created form component instead of using :is incorrectly

[ci skip]
parent 36df19e7
...@@ -7,7 +7,7 @@ import Service from '../services/index'; ...@@ -7,7 +7,7 @@ import Service from '../services/index';
import Store from '../stores'; import Store from '../stores';
import titleComponent from './title.vue'; import titleComponent from './title.vue';
import descriptionComponent from './description.vue'; import descriptionComponent from './description.vue';
import editActions from './edit_actions.vue'; import formComponent from './form.vue';
export default { export default {
props: { props: {
...@@ -56,9 +56,6 @@ export default { ...@@ -56,9 +56,6 @@ export default {
}; };
}, },
computed: { computed: {
elementType() {
return this.showForm ? 'form' : 'div';
},
formState() { formState() {
return this.store.formState; return this.store.formState;
}, },
...@@ -66,7 +63,7 @@ export default { ...@@ -66,7 +63,7 @@ export default {
components: { components: {
descriptionComponent, descriptionComponent,
titleComponent, titleComponent,
editActions, formComponent,
}, },
methods: { methods: {
openForm() { openForm() {
...@@ -143,22 +140,23 @@ export default { ...@@ -143,22 +140,23 @@ export default {
</script> </script>
<template> <template>
<div :is="elementType"> <div>
<title-component <form-component
:form-state="formState"
:show-form="showForm"
:issuable-ref="issuableRef"
:title-html="state.titleHtml"
:title-text="state.titleText" />
<description-component
v-if="state.descriptionHtml"
:can-update="canUpdate"
:description-html="state.descriptionHtml"
:description-text="state.descriptionText"
:updated-at="state.updatedAt"
:task-status="state.taskStatus" />
<edit-actions
v-if="canUpdate && showForm" v-if="canUpdate && showForm"
:form-state="formState"
:can-destroy="canDestroy" /> :can-destroy="canDestroy" />
<div v-else>
<title-component
:issuable-ref="issuableRef"
:title-html="state.titleHtml"
:title-text="state.titleText" />
<description-component
v-if="state.descriptionHtml"
:can-update="canUpdate"
:description-html="state.descriptionHtml"
:description-text="state.descriptionText"
:updated-at="state.updatedAt"
:task-status="state.taskStatus" />
</div>
</div> </div>
</template> </template>
<script>
import titleField from './fields/title.vue';
import editActions from './edit_actions.vue';
export default {
props: {
canDestroy: {
type: Boolean,
required: true,
},
formState: {
type: Object,
required: true,
},
},
components: {
titleField,
editActions,
},
};
</script>
<template>
<form>
<title-field
:form-state="formState" />
<edit-actions
:can-destroy="canDestroy" />
</form>
</template>
<script> <script>
import animateMixin from '../mixins/animate'; import animateMixin from '../mixins/animate';
import titleField from './fields/title.vue';
export default { export default {
mixins: [animateMixin], mixins: [animateMixin],
components: {
titleField,
},
data() { data() {
return { return {
preAnimation: false, preAnimation: false,
...@@ -27,14 +23,6 @@ ...@@ -27,14 +23,6 @@
type: String, type: String,
required: true, required: true,
}, },
formState: {
type: Object,
required: true,
},
showForm: {
type: Boolean,
required: true,
},
}, },
watch: { watch: {
titleHtml() { titleHtml() {
...@@ -53,19 +41,13 @@ ...@@ -53,19 +41,13 @@
</script> </script>
<template> <template>
<div> <h2
<title-field class="title"
v-if="showForm" :class="{
:form-state="formState" /> 'issue-realtime-pre-pulse': preAnimation,
<h2 'issue-realtime-trigger-pulse': pulseAnimation
v-else }"
class="title" v-html="titleHtml"
:class="{ >
'issue-realtime-pre-pulse': preAnimation, </h2>
'issue-realtime-trigger-pulse': pulseAnimation
}"
v-html="titleHtml"
>
</h2>
</div>
</template> </template>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment