Skip to content

Commit

Permalink
Update root folder icon and label for upload location
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Feb 15, 2024
1 parent 2cebaf0 commit c357cb2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/components/Settings/PhotosFolder.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="folder">
<FolderMultiple v-if="path === '/'" />
<component :is="rootFolderIcon" v-if="path === '/'" />
<Folder v-else />
<span class="folder__info">
<div class="folder__path">{{ folderName }}</div>
Expand All @@ -23,7 +23,6 @@
import { defineComponent } from 'vue'
import Folder from 'vue-material-design-icons/Folder.vue'
import FolderMultiple from 'vue-material-design-icons/FolderMultiple.vue'
import Close from 'vue-material-design-icons/Close.vue'
import { NcButton } from '@nextcloud/vue'
Expand All @@ -35,7 +34,6 @@ export default defineComponent({
components: {
NcButton,
Folder,
FolderMultiple,
Close,
},
Expand All @@ -52,6 +50,10 @@ export default defineComponent({
type: String,
required: true,
},
rootFolderIcon: {
type: Object,
required: true,
},
},
emits: ['remove-folder'],
Expand Down
10 changes: 9 additions & 1 deletion src/components/Settings/PhotosSourceLocationsSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<template>
<div class="photos-locations">
<ul>
<PhotosFolder :path="photosSourceFolder" :root-folder-label="t('photos', 'All folders')" />
<PhotosFolder :path="photosSourceFolder" :root-folder-label="t('photos', 'All folders')" :root-folder-icon="FolderMultiple" />
<!-- TODO: uncomment when SEARCH on multiple folders is implemented. -->
<!-- <li v-for="(source, index) in photosSourceFolder"
:key="index">
Expand All @@ -49,6 +49,8 @@
import debounce from 'debounce'
import { defineComponent } from 'vue'
import FolderMultiple from 'vue-material-design-icons/FolderMultiple.vue'
import { NcButton } from '@nextcloud/vue'
import { getFilePickerBuilder } from '@nextcloud/dialogs'
import { translate as t } from '@nextcloud/l10n'
Expand All @@ -63,6 +65,12 @@ export default defineComponent({
PhotosFolder,
},
data() {
return {
FolderMultiple,
}
},
computed: {
/** @return {string} */
photosSourceFolder() {
Expand Down
10 changes: 9 additions & 1 deletion src/components/Settings/PhotosUploadLocationSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<template>
<div class="photos-location">
<PhotosFolder :path="photosLocation" :root-folder-label="t('photos', 'Root folder')" />
<PhotosFolder :path="photosLocation" :root-folder-label="t('photos', 'Home')" :root-folder-icon="Home" />

<NcButton :aria-label="t('photos', 'Choose default Photos upload and Albums location')"
@click="debounceSelectPhotosFolder">
Expand All @@ -35,6 +35,8 @@
import debounce from 'debounce'
import { defineComponent } from 'vue'
import Home from 'vue-material-design-icons/Home.vue'
import { NcButton } from '@nextcloud/vue'
import { getFilePickerBuilder } from '@nextcloud/dialogs'
import { translate as t } from '@nextcloud/l10n'
Expand All @@ -49,6 +51,12 @@ export default defineComponent({
PhotosFolder,
},
data() {
return {
Home,
}
},
computed: {
/** @return {string} */
photosLocation() {
Expand Down

0 comments on commit c357cb2

Please sign in to comment.