Commit c42728f0 authored by Simon Knox's avatar Simon Knox

fix form to work with popup_dialog, remove some unused values

parent f6dd6228
......@@ -12,6 +12,15 @@ window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
const Store = gl.issueBoards.BoardsStore;
const boardDefaults = {
id: false,
name: '',
labels: [],
milestone_id: undefined,
assignee: {},
assignee_id: undefined,
weight: null,
};
export default {
props: {
......@@ -49,7 +58,7 @@ export default {
},
data() {
return {
board: { ...Store.state.currentBoard },
board: { ...boardDefaults, ...this.currentBoard },
expanded: false,
issue: {},
currentBoard: Store.state.currentBoard,
......@@ -151,18 +160,9 @@ export default {
resetFormState() {
if (this.isNewForm) {
// Clear the form when we open the "New board" modal
this.board = {
id: false,
name: '',
labels: [],
milestone: {},
milestone_id: undefined,
assignee: {},
assignee_id: undefined,
weight: null,
};
this.board = { ...boardDefaults };
} else if (this.currentBoard && Object.keys(this.currentBoard).length) {
this.board = { ...this.currentBoard };
this.board = { ...boardDefaults, ...this.currentBoard };
}
},
},
......@@ -187,6 +187,7 @@ export default {
@toggle="cancel"
@submit="submit"
>
<template slot="body">
<p v-if="isDeleteForm">
Are you sure you want to delete this board?
</p>
......@@ -237,13 +238,11 @@ export default {
<board-milestone-select
:board="board"
:milestone-path="milestonePath"
title="Milestone"
:can-edit="canAdminBoard"
/>
<board-labels-select
:board="board"
title="Labels"
:can-edit="canAdminBoard"
:labels-path="labelsPath"
/>
......@@ -270,5 +269,6 @@ export default {
</div>
</div>
</form>
</template>
</popup-dialog>
</template>
......@@ -45,12 +45,6 @@ body.modal-open {
.modal.popup-dialog {
display: block;
@media (min-width: $screen-md-min) {
.modal-dialog {
margin-top: $new-navbar-height;
}
}
}
.modal-body {
......
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