Merge pull request #2047 from nextcloud/enh/cardDetailsInExt
This commit is contained in:
38
src/App.vue
38
src/App.vue
@@ -26,7 +26,14 @@
|
|||||||
<div id="app-content">
|
<div id="app-content">
|
||||||
<router-view />
|
<router-view />
|
||||||
</div>
|
</div>
|
||||||
<router-view name="sidebar" />
|
|
||||||
|
<Modal v-if="cardDetailsInModal && $route.params.cardId" :title="t('deck', 'Card details')" @close="hideModal()">
|
||||||
|
<div class="modal__content modal__card">
|
||||||
|
<router-view name="sidebar" />
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
|
||||||
|
<router-view v-show="!cardDetailsInModal || !$route.params.cardId" name="sidebar" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -34,6 +41,7 @@
|
|||||||
|
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import AppNavigation from './components/navigation/AppNavigation'
|
import AppNavigation from './components/navigation/AppNavigation'
|
||||||
|
import { Modal } from '@nextcloud/vue'
|
||||||
import { BoardApi } from './services/BoardApi'
|
import { BoardApi } from './services/BoardApi'
|
||||||
|
|
||||||
const boardApi = new BoardApi()
|
const boardApi = new BoardApi()
|
||||||
@@ -42,6 +50,7 @@ export default {
|
|||||||
name: 'App',
|
name: 'App',
|
||||||
components: {
|
components: {
|
||||||
AppNavigation,
|
AppNavigation,
|
||||||
|
Modal,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -67,6 +76,7 @@ export default {
|
|||||||
navShown: state => state.navShown,
|
navShown: state => state.navShown,
|
||||||
sidebarShownState: state => state.sidebarShown,
|
sidebarShownState: state => state.sidebarShown,
|
||||||
currentBoard: state => state.currentBoard,
|
currentBoard: state => state.currentBoard,
|
||||||
|
cardDetailsInModal: state => state.cardDetailsInModal,
|
||||||
}),
|
}),
|
||||||
// TODO: properly handle sidebar showing for route subview and board sidebar
|
// TODO: properly handle sidebar showing for route subview and board sidebar
|
||||||
sidebarRouterView() {
|
sidebarRouterView() {
|
||||||
@@ -77,17 +87,21 @@ export default {
|
|||||||
return this.sidebarRouterView || this.sidebarShownState
|
return this.sidebarRouterView || this.sidebarShownState
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.$store.dispatch('loadBoards')
|
||||||
|
this.$store.dispatch('loadSharees')
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
hideModal() {
|
||||||
|
this.$router.push({ name: 'board' })
|
||||||
|
},
|
||||||
|
},
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
boardApi,
|
boardApi,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
this.$store.dispatch('loadBoards')
|
|
||||||
this.$store.dispatch('loadSharees')
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -117,11 +131,19 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style lang="scss">
|
||||||
|
|
||||||
.multiselect {
|
.multiselect {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal__card {
|
||||||
|
min-width: 320px;
|
||||||
|
width: 50vw;
|
||||||
|
max-width: 800px;
|
||||||
|
min-height: 200px;
|
||||||
|
height: 80vh;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -27,7 +27,16 @@
|
|||||||
:title-editable.sync="titleEditable"
|
:title-editable.sync="titleEditable"
|
||||||
@update:title="updateTitle"
|
@update:title="updateTitle"
|
||||||
@close="closeSidebar">
|
@close="closeSidebar">
|
||||||
<template #secondary-actions />
|
<template #secondary-actions>
|
||||||
|
<ActionButton v-if="cardDetailsInModal" icon="icon-menu-sidebar" @click.stop="showModal()">
|
||||||
|
{{ t('deck', 'Open in sidebar view') }}
|
||||||
|
</ActionButton>
|
||||||
|
|
||||||
|
<ActionButton v-else icon="icon-external" @click.stop="showModal()">
|
||||||
|
{{ t('deck', 'Open in bigger view') }}
|
||||||
|
</ActionButton>
|
||||||
|
</template>
|
||||||
|
|
||||||
<AppSidebarTab id="details"
|
<AppSidebarTab id="details"
|
||||||
:order="0"
|
:order="0"
|
||||||
:name="t('deck', 'Details')"
|
:name="t('deck', 'Details')"
|
||||||
@@ -278,6 +287,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
currentBoard: state => state.currentBoard,
|
currentBoard: state => state.currentBoard,
|
||||||
|
cardDetailsInModal: state => state.cardDetailsInModal,
|
||||||
}),
|
}),
|
||||||
...mapGetters(['canEdit', 'assignables']),
|
...mapGetters(['canEdit', 'assignables']),
|
||||||
attachments() {
|
attachments() {
|
||||||
@@ -505,6 +515,9 @@ export default {
|
|||||||
parse(value) {
|
parse(value) {
|
||||||
return moment(value, 'LLL', this.locale).toDate()
|
return moment(value, 'LLL', this.locale).toDate()
|
||||||
},
|
},
|
||||||
|
showModal() {
|
||||||
|
this.$store.dispatch('setCardDetailsInModal', true)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -532,6 +545,42 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
// FIXME: Obivously we should at some point not randomly reuse the sidebar component
|
||||||
|
// since this is not oficially supported
|
||||||
|
.modal__card .app-sidebar {
|
||||||
|
border: 0;
|
||||||
|
min-width: 100%;
|
||||||
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
&::v-deep {
|
||||||
|
.app-sidebar-header {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 100;
|
||||||
|
background-color: var(--color-main-background);
|
||||||
|
}
|
||||||
|
.app-sidebar-tabs__nav {
|
||||||
|
position: sticky;
|
||||||
|
top: 87px;
|
||||||
|
margin: 0;
|
||||||
|
z-index: 100;
|
||||||
|
background-color: var(--color-main-background);
|
||||||
|
}
|
||||||
|
|
||||||
|
section {
|
||||||
|
min-height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#emptycontent, .emptycontent {
|
||||||
|
margin-top: 88px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
h5 {
|
h5 {
|
||||||
border-bottom: 1px solid var(--color-border);
|
border-bottom: 1px solid var(--color-border);
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
|||||||
@@ -52,6 +52,13 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<AppNavigationSettings>
|
<AppNavigationSettings>
|
||||||
<div>
|
<div>
|
||||||
|
<input id="toggle-modal"
|
||||||
|
v-model="cardDetailsInModal"
|
||||||
|
type="checkbox"
|
||||||
|
class="checkbox">
|
||||||
|
<label for="toggle-modal">
|
||||||
|
{{ t('deck', 'Use modal card view') }}
|
||||||
|
</label>
|
||||||
<Multiselect v-model="groupLimit"
|
<Multiselect v-model="groupLimit"
|
||||||
:class="{'icon-loading-small': groupLimitDisabled}"
|
:class="{'icon-loading-small': groupLimitDisabled}"
|
||||||
open-direction="bottom"
|
open-direction="bottom"
|
||||||
@@ -119,6 +126,14 @@ export default {
|
|||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
return OC.isUserAdmin()
|
return OC.isUserAdmin()
|
||||||
},
|
},
|
||||||
|
cardDetailsInModal: {
|
||||||
|
get() {
|
||||||
|
return this.$store.getters.cardDetailsInModal
|
||||||
|
},
|
||||||
|
set(newValue) {
|
||||||
|
this.$store.dispatch('setCardDetailsInModal', newValue)
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
if (this.isAdmin) {
|
if (this.isAdmin) {
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ export default new Vuex.Store({
|
|||||||
showArchived: false,
|
showArchived: false,
|
||||||
navShown: true,
|
navShown: true,
|
||||||
compactMode: localStorage.getItem('deck.compactMode') === 'true',
|
compactMode: localStorage.getItem('deck.compactMode') === 'true',
|
||||||
|
cardDetailsInModal: localStorage.getItem('deck.cardDetailsInModal') === 'true',
|
||||||
sidebarShown: false,
|
sidebarShown: false,
|
||||||
currentBoard: null,
|
currentBoard: null,
|
||||||
currentCard: null,
|
currentCard: null,
|
||||||
@@ -72,6 +73,9 @@ export default new Vuex.Store({
|
|||||||
filter: { tags: [], users: [], due: '' },
|
filter: { tags: [], users: [], due: '' },
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
|
cardDetailsInModal: state => {
|
||||||
|
return state.cardDetailsInModal
|
||||||
|
},
|
||||||
getSearchQuery: state => {
|
getSearchQuery: state => {
|
||||||
return state.searchQuery
|
return state.searchQuery
|
||||||
},
|
},
|
||||||
@@ -202,6 +206,10 @@ export default new Vuex.Store({
|
|||||||
state.compactMode = !state.compactMode
|
state.compactMode = !state.compactMode
|
||||||
localStorage.setItem('deck.compactMode', state.compactMode)
|
localStorage.setItem('deck.compactMode', state.compactMode)
|
||||||
},
|
},
|
||||||
|
setCardDetailsInModal(state) {
|
||||||
|
state.cardDetailsInModal = !state.cardDetailsInModal
|
||||||
|
localStorage.setItem('deck.cardDetailsInModal', state.cardDetailsInModal)
|
||||||
|
},
|
||||||
setBoards(state, boards) {
|
setBoards(state, boards) {
|
||||||
state.boards = boards
|
state.boards = boards
|
||||||
},
|
},
|
||||||
@@ -276,6 +284,7 @@ export default new Vuex.Store({
|
|||||||
Vue.delete(state.currentBoard.acl, removeIndex)
|
Vue.delete(state.currentBoard.acl, removeIndex)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
setFilter({ commit }, filter) {
|
setFilter({ commit }, filter) {
|
||||||
@@ -389,6 +398,9 @@ export default new Vuex.Store({
|
|||||||
toggleCompactMode({ commit }) {
|
toggleCompactMode({ commit }) {
|
||||||
commit('toggleCompactMode')
|
commit('toggleCompactMode')
|
||||||
},
|
},
|
||||||
|
setCardDetailsInModal({ commit }, show) {
|
||||||
|
commit('setCardDetailsInModal', show)
|
||||||
|
},
|
||||||
setCurrentBoard({ commit }, board) {
|
setCurrentBoard({ commit }, board) {
|
||||||
commit('setCurrentBoard', board)
|
commit('setCurrentBoard', board)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user