Skip to content

Commit

Permalink
Display recurrence summary
Browse files Browse the repository at this point in the history
Signed-off-by: Sunik <[email protected]>
Signed-off-by: Sunik Kupfer <[email protected]>
  • Loading branch information
sunkup committed Dec 10, 2023
1 parent dd1fadd commit 050627f
Show file tree
Hide file tree
Showing 10 changed files with 1,048 additions and 20 deletions.
22 changes: 18 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@
"@nextcloud/initial-state": "2.1.0",
"@nextcloud/l10n": "^2.2.0",
"@nextcloud/logger": "^2.7.0",
"@nextcloud/moment": "^1.2.2",
"@nextcloud/router": "^2.2.0",
"@nextcloud/vue": "^7.12.7",
"@vueuse/components": "^10.7.0",
"@nextcloud/moment": "^1.2.1",
"@nextcloud/router": "^2.1.2",
"@nextcloud/vue": "^7.12.6",
"@vueuse/components": "^10.4.1",
"calendar-js": "^1.4.4",
"color-convert": "^2.0.1",
"debounce": "^1.2.1",
"ical.js": "^1.5.0",
Expand Down
17 changes: 14 additions & 3 deletions src/components/AppSidebar/RepeatItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Nextcloud - Tasks

@author Sunik Kupfer
@copyright 2023 Sunik Kupfer <mail@sunik.de>
@author Raimund Schlüßler
@copyright 2018 Raimund Schlüßler <[email protected]>

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Expand All @@ -24,21 +26,24 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
<div class="repeat__icon">
<component :is="icon" :size="20" />
</div>
{{ recurrence }}
<RepeatSummary class="property-repeat__summary__content"
:recurrence-rule="recurrence" />
</div>
</template>

<script>

import { translate as t } from '@nextcloud/l10n'
import RepeatSummary from './RepeatItem/RepeatSummary.vue'

export default {
components: {
RepeatSummary,
},
props: {
recurrence: {
type: String,
default: null,
type: Object,
required: true,
},
disabled: {
type: Boolean,
Expand Down Expand Up @@ -74,5 +79,11 @@ export default {
flex-basis: 44px;
flex-shrink: 0;
}

.property-repeat__summary__content {
display: flex;
align-items: center;
margin-bottom: 5px;
}
}
</style>
66 changes: 66 additions & 0 deletions src/components/AppSidebar/RepeatItem/RepeatSummary.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!--
- @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
-
- @author Georg Ehrke <[email protected]>
- @author Richard Steinmetz <[email protected]>
-
- @license AGPL-3.0-or-later
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->

<template>
<span v-if="display">
{{ recurrenceRule | formatRecurrenceRule }}
</span>
<span v-else>
{{ t('calendar', 'No recurrence') }}
</span>
</template>

<script>
import { translate as t } from '@nextcloud/l10n'
import formatRecurrenceRule from '../../../filters/recurrenceRuleFormat.js'

export default {
name: 'RepeatSummary',
filters: {
formatRecurrenceRule,
},
props: {
/**
* The recurrence-rule object as defined on the eventComponent
*/
recurrenceRule: {
type: Object,
required: true,
},
},
computed: {
/**
* Returns whether to display the summary.
* We do not want to show it if it doesn't repeat
*
* @return {boolean}
*/
display() {
return this.recurrenceRule.frequency !== 'NONE'
},
},
methods: {
t,
},
}
</script>
Loading

0 comments on commit 050627f

Please sign in to comment.