Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(files): Remove aria-label from span and move to favorite icon
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Dec 3, 2023
commit 93017848f0ba020fae1090ced224f584e417754f
17 changes: 12 additions & 5 deletions apps/files/src/components/FileEntry/FavoriteIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
-
-->
<template>
<NcIconSvgWrapper class="favorite-marker-icon" :svg="StarSvg" />
<NcIconSvgWrapper class="favorite-marker-icon" :name="t('files', 'Favorite')" :svg="StarSvg" />
</template>

<script>
<script lang="ts">
import { translate as t } from '@nextcloud/l10n'
import { defineComponent } from 'vue'

import StarSvg from '@mdi/svg/svg/star.svg?raw'
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'

Expand All @@ -38,7 +41,7 @@ import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js
* }
* ```
*/
export default {
export default defineComponent({
name: 'FavoriteIcon',
components: {
NcIconSvgWrapper,
Expand All @@ -52,10 +55,14 @@ export default {
await this.$nextTick()
// MDI default viewbox is "0 0 24 24" but we add a stroke of 10px so we must adjust it
const el = this.$el.querySelector('svg')
el.setAttribute('viewBox', '-4 -4 30 30')
el?.setAttribute?.('viewBox', '-4 -4 30 30')
},
}
methods: {
t,
},
})
</script>

<style lang="scss" scoped>
.favorite-marker-icon {
color: #a08b00;
Expand Down
8 changes: 3 additions & 5 deletions apps/files/src/components/FileEntry/FileEntryPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<template>
<span class="files-list__row-icon">
<template v-if="source.type === 'folder'">
<FolderOpenIcon v-once v-if="dragover" />
<FolderOpenIcon v-if="dragover" v-once />
<template v-else>
<FolderIcon v-once />
<OverlayIcon :is="folderOverlay"
Expand All @@ -42,12 +42,10 @@
@error="backgroundFailed = true"
@load="backgroundFailed = false">

<FileIcon v-once v-else />
<FileIcon v-else v-once />

<!-- Favorite icon -->
<span v-if="isFavorite"
class="files-list__row-icon-favorite"
:aria-label="t('files', 'Favorite')">
<span v-if="isFavorite" class="files-list__row-icon-favorite">
<FavoriteIcon v-once />
</span>

Expand Down