Commit 2f8b9931 authored by Phil Hughes's avatar Phil Hughes

CE backport of issue-boards-js-fix

parent 3f14c56b
/* eslint-disable quote-props, comma-dangle */
import $ from 'jquery';
import _ from 'underscore';
import Vue from 'vue';
......@@ -47,7 +45,7 @@ export default () => {
gl.IssueBoardsApp = new Vue({
el: $boardApp,
components: {
'board': gl.issueBoards.Board,
board: gl.issueBoards.Board,
'board-sidebar': gl.issueBoards.BoardSidebar,
BoardAddIssuesModal,
},
......@@ -65,11 +63,11 @@ export default () => {
defaultAvatar: $boardApp.dataset.defaultAvatar,
},
computed: {
detailIssueVisible () {
detailIssueVisible() {
return Object.keys(this.detailIssue.issue).length;
},
},
created () {
created() {
gl.boardService = new BoardService({
boardsEndpoint: this.boardsEndpoint,
listsEndpoint: this.listsEndpoint,
......@@ -89,15 +87,16 @@ export default () => {
eventHub.$off('clearDetailIssue', this.clearDetailIssue);
sidebarEventHub.$off('toggleSubscription', this.toggleSubscription);
},
mounted () {
mounted() {
this.filterManager = new FilteredSearchBoards(Store.filter, true, Store.cantEdit);
this.filterManager.setup();
Store.disabled = this.disabled;
gl.boardService.all()
gl.boardService
.all()
.then(res => res.data)
.then((data) => {
data.forEach((board) => {
.then(data => {
data.forEach(board => {
const list = Store.addList(board, this.defaultAvatar);
if (list.type === 'closed') {
......@@ -126,7 +125,7 @@ export default () => {
newIssue.setFetchingState('subscriptions', true);
BoardService.getIssueInfo(sidebarInfoEndpoint)
.then(res => res.data)
.then((data) => {
.then(data => {
newIssue.setFetchingState('subscriptions', false);
newIssue.updateData({
subscribed: data.subscribed,
......@@ -159,7 +158,7 @@ export default () => {
Flash(__('An error occurred when toggling the notification subscription'));
});
}
}
},
},
});
......@@ -168,13 +167,16 @@ export default () => {
data: {
filters: Store.state.filters,
},
mounted () {
mounted() {
gl.issueBoards.newListDropdownInit();
},
});
const issueBoardsModal = document.getElementById('js-add-issues-btn');
if (issueBoardsModal) {
gl.IssueBoardsModalAddBtn = new Vue({
el: document.getElementById('js-add-issues-btn'),
el: issueBoardsModal,
mixins: [modalMixin],
data() {
return {
......@@ -241,4 +243,5 @@ export default () => {
</div>
`,
});
}
};
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