Skip to content

Commit

Permalink
Merge pull request #2436 from nextcloud/feat/1961/link-deck
Browse files Browse the repository at this point in the history
  • Loading branch information
raimund-schluessler authored Jan 4, 2024
2 parents 8fa0445 + 426290f commit 381262d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/views/AppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
</template>
{{ t('tasks', 'Show in Calendar') }}
</NcActionLink>
<NcActionLink v-if="deckLink"
:href="deckLink"
:close-after-click="true"
target="_blank">
<template #icon>
<span class="material-design-icon icon-deck" />
</template>
{{ t('tasks', 'Show in Deck') }}
</NcActionLink>
<NcActionButton v-if="!readOnly"
:close-after-click="true"
@click="editSummary(true)">
Expand Down Expand Up @@ -544,6 +553,19 @@ export default {
calendarLink() {
return generateUrl(`apps/calendar/${this.calendarView}/${this.task.dueMoment.format('YYYY-MM-DD')}`)
},
deckLink() {
const deckAppPrefix = 'app-generated--deck--board-'
if (this.task.calendar.id.startsWith(deckAppPrefix)) {
const board = this.task.calendar.id.slice(deckAppPrefix.length)
if (this.task.uri.startsWith('card')) {
const card = this.task.uri.slice('card-'.length).replace('.ics', '')
return generateUrl(`apps/deck/#/board/${board}/card/${card}`)
} else {
return generateUrl(`apps/deck/#/board/${board}`)
}
}
return null
},
startDateString() {
if (this.task.startMoment.isValid()) {
if (this.allDay) {
Expand Down

0 comments on commit 381262d

Please sign in to comment.