Commit af527e27 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Merge branch '2518-saved-configuration-for-issue-board' of...

Merge branch '2518-saved-configuration-for-issue-board' of https://gitlab.com/gitlab-org/gitlab-ee into 2518-saved-configuration-for-issue-board
parents 1ea0cd21 63b7cdc6
<script>
/* global BoardService */
/* global Flash */
import Flash from '~/flash';
import PopupDialog from '~/vue_shared/components/popup_dialog.vue';
import BoardMilestoneSelect from './milestone_select.vue';
import BoardWeightSelect from './weight_select.vue';
......@@ -65,7 +65,7 @@ export default {
currentPage: Store.state.currentPage,
milestones: [],
milestoneDropdownOpen: false,
submitDisabled: false,
isLoading: false,
};
},
components: {
......@@ -115,9 +115,6 @@ export default {
}
return 'Edit board';
},
milestoneToggleText() {
return this.board.milestone ? this.board.milestone.title : 'Milestone';
},
expandButtonText() {
return this.expanded ? 'Collapse' : 'Expand';
},
......@@ -130,18 +127,22 @@ export default {
weightsArray() {
return JSON.parse(this.weights);
},
submitDisabled() {
return this.isLoading || this.board.name.length === 0;
},
},
methods: {
submit() {
if (this.board.name.length === 0) return;
this.isLoading = true;
if (this.isDeleteForm) {
this.submitDisabled = true;
gl.boardService.deleteBoard(this.currentBoard)
.then(() => {
gl.utils.visitUrl(Store.rootPath);
})
.catch(() => {
Flash('Failed to delete board. Please try again.');
this.submitDisabled = false;
this.isLoading = false;
});
} else {
gl.boardService.createBoard(this.board)
......@@ -151,6 +152,7 @@ export default {
})
.catch(() => {
Flash('Unable to save your changes. Please try again.');
this.isLoading = false;
});
}
},
......@@ -194,6 +196,7 @@ export default {
<form
v-else
class="js-board-config-modal"
@submit.prevent
>
<div
v-if="!readonly"
......@@ -211,6 +214,7 @@ export default {
type="text"
id="board-new-name"
v-model="board.name"
@keyup.enter="submit"
placeholder="Enter board name"
>
</div>
......
......@@ -112,9 +112,6 @@ export default {
</div>
</div>
</div>
<div
class="modal-backdrop fade in"
@click="close"
/>
<div class="modal-backdrop fade in" />
</div>
</template>
......@@ -12,15 +12,17 @@ class BoardsStoreEE {
this.removePromotion();
};
this.store.boardConfig = {
milestoneId: parseInt(this.$boardApp.dataset.boardMilestoneId, 10),
milestoneTitle: this.$boardApp.dataset.boardMilestoneTitle,
assigneeUsername: this.$boardApp.dataset.boardAssigneeUsername,
labels: JSON.parse(this.$boardApp.dataset.labels || []),
weight: parseInt(this.$boardApp.dataset.boardWeight, 10),
};
this.store.cantEdit = [];
this.initBoardFilters();
if (this.$boardApp) {
this.store.boardConfig = {
milestoneId: parseInt(this.$boardApp.dataset.boardMilestoneId, 10),
milestoneTitle: this.$boardApp.dataset.boardMilestoneTitle,
assigneeUsername: this.$boardApp.dataset.boardAssigneeUsername,
labels: JSON.parse(this.$boardApp.dataset.labels || []),
weight: parseInt(this.$boardApp.dataset.boardWeight, 10),
};
this.store.cantEdit = [];
this.initBoardFilters();
}
}
initBoardFilters() {
......
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