Merge remote-tracking branch 'origin/master' into stable22

This commit is contained in:
Julius Härtl
2021-06-25 15:39:38 +02:00
6 changed files with 71 additions and 32 deletions

View File

@@ -36,8 +36,8 @@ class Circle extends RelationalObject {
public function getObjectSerialization() {
return [
'uid' => $this->object->getUniqueId(),
'displayname' => $this->object->getName(),
'typeString' => $this->object->getTypeString(),
'displayname' => $this->object->getDisplayName(),
'typeString' => '',
'circleOwner' => $this->object->getOwner(),
'type' => 7
];

View File

@@ -268,7 +268,11 @@ class PermissionService {
continue;
}
foreach ($circle->getMembers() as $member) {
foreach ($circle->getInheritedMembers() as $member) {
if ($member->getUserType() !== 1) {
// deck currently only supports user members in circles
continue;
}
$user = $this->userManager->get($member->getUserId());
if ($user === null) {
$this->logger->info('No user found for circle member ' . $member->getUserId());

View File

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

View File

@@ -25,6 +25,12 @@
<div v-if="overviewName" class="board-title">
<div class="board-bullet icon-calendar-dark" />
<h2>{{ overviewName }}</h2>
<Actions>
<ActionButton icon="icon-add" @click="clickShowAddCardModel">
{{ t('deck', 'Add card') }}
</ActionButton>
</Actions>
<CardCreateDialog v-if="showAddCardModal" @close="clickHideAddCardModel" />
</div>
<div v-else-if="board" class="board-title">
<div :style="{backgroundColor: '#' + board.color}" class="board-bullet" />
@@ -206,11 +212,12 @@
import { mapState, mapGetters } from 'vuex'
import { Actions, ActionButton, Popover, Avatar } from '@nextcloud/vue'
import labelStyle from '../mixins/labelStyle'
import CardCreateDialog from '../CardCreateDialog'
export default {
name: 'Controls',
components: {
Actions, ActionButton, Popover, Avatar,
Actions, ActionButton, Popover, Avatar, CardCreateDialog,
},
mixins: [labelStyle],
props: {
@@ -233,6 +240,7 @@ export default {
showArchived: false,
isAddStackVisible: false,
filter: { tags: [], users: [], due: '', unassigned: false },
showAddCardModal: false,
}
},
@@ -318,6 +326,12 @@ export default {
this.$store.dispatch('setFilter', { ...filterReset })
this.filter = filterReset
},
clickShowAddCardModel() {
this.showAddCardModal = true
},
clickHideAddCardModel() {
this.showAddCardModal = false
},
},
}
</script>

View File

@@ -32,7 +32,7 @@
</div>
<EmptyContent v-else-if="isEmpty" key="empty" icon="icon-deck">
{{ t('deck', 'No lists available') }}
<template #desc>
<template v-if="canManage" #desc>
{{ t('deck', 'Create a new list to add cards to this board') }}
<form @submit.prevent="addNewStack()">
<input id="new-stack-input-main"
@@ -110,6 +110,7 @@ export default {
}),
...mapGetters([
'canEdit',
'canManage',
]),
stacksByBoard() {
return this.$store.getters.stacksByBoard(this.board.id)

View File

@@ -21,32 +21,39 @@
-->
<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 #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')"
: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 +62,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: {
@@ -81,7 +91,7 @@ export default {
list.sort((a, b) => {
return (new Date(a.duedate)).getTime() - (new Date(b.duedate)).getTime()
})
return list
return list.slice(0, 6)
},
cardLink() {
return (card) => {
@@ -98,12 +108,21 @@ export default {
this.loading = false
})
},
methods: {
toggleAddCardModel() {
this.showAddCardModal = !this.showAddCardModal
},
},
}
</script>
<style lang="scss" scoped>
@import './../css/labels';
.center-button {
text-align: center;
}
#deck-widget-empty-content {
text-align: center;
margin-top: 5vh;