Fix angular dependency in board selector
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -25,7 +25,8 @@
|
|||||||
<div id="modal-inner" :class="{ 'icon-loading': loading }">
|
<div id="modal-inner" :class="{ 'icon-loading': loading }">
|
||||||
<h1>{{ t('deck', 'Select the board to link to a project') }}</h1>
|
<h1>{{ t('deck', 'Select the board to link to a project') }}</h1>
|
||||||
<ul v-if="!loading">
|
<ul v-if="!loading">
|
||||||
<li v-for="board in boards" v-if="!currentBoard || ''+board.id !== ''+currentBoard" :class="{'selected': (selectedBoard === board.id) }"
|
<li v-for="board in boards" v-if="!currentBoard || ''+board.id !== ''+currentBoard" :key="board.id"
|
||||||
|
:class="{'selected': (selectedBoard === board.id) }"
|
||||||
@click="selectedBoard=board.id">
|
@click="selectedBoard=board.id">
|
||||||
<span :style="{ 'backgroundColor': '#' + board.color }" class="board-bullet" />
|
<span :style="{ 'backgroundColor': '#' + board.color }" class="board-bullet" />
|
||||||
<span>{{ board.title }}</span>
|
<span>{{ board.title }}</span>
|
||||||
@@ -87,17 +88,10 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
currentBoard: null
|
currentBoard: null
|
||||||
}
|
}
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
this.fetchBoards()
|
this.fetchBoards()
|
||||||
if (typeof angular !== 'undefined' && angular.element('#board')) {
|
this.currentBoard = window.location.hash.match(/\/boards\/([0-9]+)/)[1] || null
|
||||||
try {
|
|
||||||
this.currentBoard = angular.element('#board').scope().boardservice.id || null
|
|
||||||
} catch (e) {}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchBoards() {
|
fetchBoards() {
|
||||||
@@ -111,7 +105,6 @@ export default {
|
|||||||
},
|
},
|
||||||
select() {
|
select() {
|
||||||
this.$root.$emit('select', this.selectedBoard)
|
this.$root.$emit('select', this.selectedBoard)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,14 +21,14 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Modal @close="close" :title="t('deck', 'Select the card to link to a project')">
|
<Modal :title="t('deck', 'Select the card to link to a project')" @close="close">
|
||||||
<div id="modal-inner" :class="{ 'icon-loading': loading }">
|
<div id="modal-inner" :class="{ 'icon-loading': loading }">
|
||||||
<Multiselect :placeholder="t('deck', 'Select a board')" v-model="selectedBoard" :options="boards"
|
<Multiselect :placeholder="t('deck', 'Select a board')" v-model="selectedBoard" :options="boards"
|
||||||
label="title"
|
label="title"
|
||||||
@select="fetchCardsFromBoard" />
|
@select="fetchCardsFromBoard" />
|
||||||
|
|
||||||
<Multiselect :placeholder="t('deck', 'Select a card')" v-model="selectedCard" :options="cardsFromBoard"
|
<Multiselect :placeholder="t('deck', 'Select a card')" v-model="selectedCard" :options="cardsFromBoard"
|
||||||
label="title"/>
|
label="title" />
|
||||||
|
|
||||||
<button :disabled="!isBoardAndStackChoosen" class="primary" @click="select">{{ t('deck', 'Link to card') }}</button>
|
<button :disabled="!isBoardAndStackChoosen" class="primary" @click="select">{{ t('deck', 'Link to card') }}</button>
|
||||||
<button @click="close">{{ t('deck', 'Cancel') }}</button>
|
<button @click="close">{{ t('deck', 'Cancel') }}</button>
|
||||||
@@ -44,7 +44,7 @@ import axios from 'nextcloud-axios'
|
|||||||
export default {
|
export default {
|
||||||
name: 'CollaborationView',
|
name: 'CollaborationView',
|
||||||
components: {
|
components: {
|
||||||
Modal,
|
Modal,
|
||||||
Multiselect
|
Multiselect
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -85,7 +85,7 @@ export default {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$root.$emit('close')
|
this.$root.$emit('close')
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
|
|
||||||
<div class="section-wrapper">
|
<div class="section-wrapper">
|
||||||
<collection-list v-if="currentCard.id" :id="`${currentCard.id}`" :name="currentCard.title"
|
<collection-list v-if="currentCard.id" :id="`${currentCard.id}`" :name="currentCard.title"
|
||||||
type="deck-card" />
|
type="deck-card" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h5>Description</h5>
|
<h5>Description</h5>
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ import CardSelector from './CardSelector'
|
|||||||
|
|
||||||
import './../css/collections.css'
|
import './../css/collections.css'
|
||||||
|
|
||||||
'use strict'
|
|
||||||
|
|
||||||
/* global __webpack_nonce__ __webpack_public_path__ OC t n */
|
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
__webpack_nonce__ = btoa(OC.requestToken);
|
__webpack_nonce__ = btoa(OC.requestToken);
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
@@ -55,7 +52,7 @@ Vue.prototype.OC = OC;
|
|||||||
ComponentVM.$root.$on('close', () => {
|
ComponentVM.$root.$on('close', () => {
|
||||||
ComponentVM.$el.remove()
|
ComponentVM.$el.remove()
|
||||||
ComponentVM.$destroy()
|
ComponentVM.$destroy()
|
||||||
reject()
|
reject(new Error('Board selection canceled'))
|
||||||
})
|
})
|
||||||
ComponentVM.$root.$on('select', (id) => {
|
ComponentVM.$root.$on('select', (id) => {
|
||||||
resolve(id)
|
resolve(id)
|
||||||
@@ -82,7 +79,7 @@ Vue.prototype.OC = OC;
|
|||||||
ComponentVM.$root.$on('close', () => {
|
ComponentVM.$root.$on('close', () => {
|
||||||
ComponentVM.$el.remove()
|
ComponentVM.$el.remove()
|
||||||
ComponentVM.$destroy()
|
ComponentVM.$destroy()
|
||||||
reject()
|
reject(new Error('Card selection canceled'))
|
||||||
})
|
})
|
||||||
ComponentVM.$root.$on('select', (id) => {
|
ComponentVM.$root.$on('select', (id) => {
|
||||||
resolve(id)
|
resolve(id)
|
||||||
|
|||||||
Reference in New Issue
Block a user