Compare commits

...

3 Commits

Author SHA1 Message Date
Jakob Röhrl
7364f5dfe6 show only 6 cards
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
2021-06-07 10:35:16 +02:00
Jakob Röhrl
1d12ab93f5 fix cancel
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
2021-03-11 10:03:30 +01:00
Jakob Röhrl
435994fb1b nice dashboard add card button
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
2021-03-04 11:08:37 +01:00
5 changed files with 61 additions and 34 deletions

View File

@@ -168,6 +168,7 @@ export default {
}, },
close() { close() {
this.$emit('close')
this.$root.$emit('close') this.$root.$emit('close')
}, },
async select() { async select() {

View File

@@ -28,11 +28,11 @@
:members="members" :members="members"
name-key="uid" name-key="uid"
:tab-select="true"> :tab-select="true">
<template v-slot:item="s"> <template #item="s">
<Avatar class="atwho-li--avatar" :user="s.item.uid" :size="24" /> <Avatar class="atwho-li--avatar" :user="s.item.uid" :size="24" />
<span class="atwho-li--name" v-text="s.item.displayname" /> <span class="atwho-li--name" v-text="s.item.displayname" />
</template> </template>
<template v-slot:embeddedItem="scope"> <template #embeddedItem="scope">
<span> <span>
<UserBubble v-if="scope.current.uid" <UserBubble v-if="scope.current.uid"
:data-mention-id="scope.current.uid" :data-mention-id="scope.current.uid"

View File

@@ -149,6 +149,9 @@ export default {
directives: { directives: {
ClickOutside, ClickOutside,
}, },
inject: [
'boardApi',
],
props: { props: {
board: { board: {
type: Object, type: Object,
@@ -312,9 +315,6 @@ export default {
this.updateDueSetting = null this.updateDueSetting = null
}, },
}, },
inject: [
'boardApi',
],
} }
</script> </script>

View File

@@ -21,6 +21,7 @@
--> -->
<template> <template>
<div>
<DashboardWidget :items="cards" <DashboardWidget :items="cards"
empty-content-icon="icon-deck" empty-content-icon="icon-deck"
:empty-content-message="t('deck', 'No upcoming cards')" :empty-content-message="t('deck', 'No upcoming cards')"
@@ -29,7 +30,7 @@
:loading="loading" :loading="loading"
@hide="() => {}" @hide="() => {}"
@markDone="() => {}"> @markDone="() => {}">
<template v-slot:default="{ item }"> <template #default="{ item }">
<a :key="item.id" <a :key="item.id"
:href="cardLink(item)" :href="cardLink(item)"
target="_blank" target="_blank"
@@ -47,6 +48,13 @@
</a> </a>
</template> </template>
</DashboardWidget> </DashboardWidget>
<div class="center-button">
<button @click="toggleAddCardModel">
{{ t('deck', 'Add card') }}
</button>
<CardCreateDialog v-if="showAddCardModal" @close="toggleAddCardModel" />
</div>
</div>
</template> </template>
<script> <script>
@@ -55,17 +63,20 @@ import { mapGetters } from 'vuex'
import labelStyle from './../mixins/labelStyle' import labelStyle from './../mixins/labelStyle'
import DueDate from '../components/cards/badges/DueDate' import DueDate from '../components/cards/badges/DueDate'
import { generateUrl } from '@nextcloud/router' import { generateUrl } from '@nextcloud/router'
import CardCreateDialog from '../CardCreateDialog'
export default { export default {
name: 'Dashboard', name: 'Dashboard',
components: { components: {
DueDate, DueDate,
DashboardWidget, DashboardWidget,
CardCreateDialog,
}, },
mixins: [labelStyle], mixins: [labelStyle],
data() { data() {
return { return {
loading: false, loading: false,
showAddCardModal: false,
} }
}, },
computed: { computed: {
@@ -73,11 +84,17 @@ export default {
'assignedCardsDashboard', 'assignedCardsDashboard',
]), ]),
cards() { cards() {
const list = [ /* const list = [
...this.assignedCardsDashboard, ...this.assignedCardsDashboard,
].filter((card) => { ].filter((card) => {
return card.duedate !== null return card.duedate !== null
}) */
const list = this.assignedCardsDashboard.slice(0, 6)
.filter((card) => {
return card.duedate !== null
}) })
list.sort((a, b) => { list.sort((a, b) => {
return (new Date(a.duedate)).getTime() - (new Date(b.duedate)).getTime() return (new Date(a.duedate)).getTime() - (new Date(b.duedate)).getTime()
}) })
@@ -98,6 +115,11 @@ export default {
this.loading = false this.loading = false
}) })
}, },
methods: {
toggleAddCardModel() {
this.showAddCardModal = !this.showAddCardModal
},
},
} }
</script> </script>
@@ -145,4 +167,8 @@ export default {
.right { .right {
float: right; float: right;
} }
.center-button {
text-align: center;
}
</style> </style>

View File

@@ -11,7 +11,7 @@ const config = {
}, },
output: { output: {
filename: '[name].js', filename: '[name].js',
jsonpFunction: 'webpackJsonpOCADeck', // jsonpFunction: 'webpackJsonpOCADeck',
chunkFilename: '[name].js?v=[contenthash]', chunkFilename: '[name].js?v=[contenthash]',
}, },
resolve: { resolve: {