Skip to content

Commit f79a1ad

Browse files
committed
fix(files): Remove aria-label from span and move to favorite icon
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 2091b5a commit f79a1ad

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

apps/files/src/components/FileEntry/FavoriteIcon.vue

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020
-
2121
-->
2222
<template>
23-
<NcIconSvgWrapper class="favorite-marker-icon" :svg="StarSvg" />
23+
<NcIconSvgWrapper class="favorite-marker-icon" :name="t('files', 'Favorite')" :svg="StarSvg" />
2424
</template>
2525

26-
<script>
26+
<script lang="ts">
27+
import { translate as t } from '@nextcloud/l10n'
28+
import { defineComponent } from 'vue'
29+
2730
import StarSvg from '@mdi/svg/svg/star.svg?raw'
2831
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
2932
@@ -38,7 +41,7 @@ import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js
3841
* }
3942
* ```
4043
*/
41-
export default {
44+
export default defineComponent({
4245
name: 'FavoriteIcon',
4346
components: {
4447
NcIconSvgWrapper,
@@ -52,10 +55,14 @@ export default {
5255
await this.$nextTick()
5356
// MDI default viewbox is "0 0 24 24" but we add a stroke of 10px so we must adjust it
5457
const el = this.$el.querySelector('svg')
55-
el.setAttribute('viewBox', '-4 -4 30 30')
58+
el?.setAttribute?.('viewBox', '-4 -4 30 30')
5659
},
57-
}
60+
methods: {
61+
t,
62+
},
63+
})
5864
</script>
65+
5966
<style lang="scss" scoped>
6067
.favorite-marker-icon {
6168
color: #a08b00;

apps/files/src/components/FileEntry/FileEntryPreview.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<template>
2323
<span class="files-list__row-icon">
2424
<template v-if="source.type === 'folder'">
25-
<FolderOpenIcon v-once v-if="dragover" />
25+
<FolderOpenIcon v-if="dragover" v-once />
2626
<template v-else>
2727
<FolderIcon v-once />
2828
<OverlayIcon :is="folderOverlay"
@@ -42,12 +42,10 @@
4242
@error="backgroundFailed = true"
4343
@load="backgroundFailed = false">
4444

45-
<FileIcon v-once v-else />
45+
<FileIcon v-else v-once />
4646

4747
<!-- Favorite icon -->
48-
<span v-if="isFavorite"
49-
class="files-list__row-icon-favorite"
50-
:aria-label="t('files', 'Favorite')">
48+
<span v-if="isFavorite" class="files-list__row-icon-favorite">
5149
<FavoriteIcon v-once />
5250
</span>
5351

0 commit comments

Comments
 (0)