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() {
this.$emit('close')
this.$root.$emit('close')
},
async select() {

View File

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

View File

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

View File

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

View File

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