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