Skip to content

Commit

Permalink
Remove Action from CheckboxBlankCircle and add more description text
Browse files Browse the repository at this point in the history
Signed-off-by: julia.kirschenheuter <julia.kirschenheuter@nextcloud.com>
  • Loading branch information
JuliaKirschenheuter committed Mar 21, 2022
1 parent 2d6fad3 commit 03be8db
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions src/components/AppNavigation/CalendarList/CalendarListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,19 @@
<AppNavigationItem
v-click-outside="closeShareMenu"
:loading="calendar.loading"
:aria-description="descriptionAppNavigationItem"
:title="calendar.displayName || $t('calendar', 'Untitled calendar')"
:class="{deleted: !!deleteTimeout, disabled: !calendar.enabled, 'open-sharing': shareMenuOpen}"
@click.prevent.stop="toggleEnabled">
<template slot="icon">
<Actions>
<ActionButton @click.prevent.stop="toggleEnabled">
<template #icon>
<CheckboxBlankCircle
v-if="calendar.enabled"
:title="$t('calendar', 'Disable calendar')"
:size="20"
:fill-color="calendar.color" />
<CheckboxBlankCircleOutline
v-else
:title="$t('calendar', 'Enable calendar')"
:size="20"
:fill-color="calendar.color" />
</template>
</ActionButton>
</Actions>
<CheckboxBlankCircle
v-if="calendar.enabled"
:size="20"
:fill-color="calendar.color" />
<CheckboxBlankCircleOutline
v-else
:size="20"
:fill-color="calendar.color" />
</template>

<template v-if="!deleteTimeout" slot="counter">
Expand Down Expand Up @@ -342,6 +335,24 @@ export default {
return ''
},
/**
* compute aria-description for AppNavigationItem link
*
* @return {string}
*/
descriptionAppNavigationItem() {
let description
if (this.calendar.enabled && this.calendar.displayName) {
description = t('calendar', 'Disable calendar "{calendar}"', { calendar: this.calendar.displayName })
} else if (this.calendar.enabled && !this.calendar.displayName) {
description = t('calendar', 'Disable calendar "{calendar}"', { calendar: 'Untitled calendar' })
} else if (!this.calendar.enabled && this.calendar.displayName) {
description = t('calendar', 'Enable calendar "{calendar}"', { calendar: this.calendar.displayName })
} else if (!this.calendar.enabled && !this.calendar.displayName) {
description = t('calendar', 'Enable calendar "{calendar}"', { calendar: 'Untitled calendar' })
}
return description
},
},
methods: {
/**
Expand Down

0 comments on commit 03be8db

Please sign in to comment.