aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorPytal <24800714+Pytal@users.noreply.github.com>2023-07-18 17:33:16 -0700
committerGitHub <noreply@github.com>2023-07-18 17:33:16 -0700
commiteaf19c482970d1aa45ee4660bccf9726f3156310 (patch)
tree2e639fd61a0ab38c6d3b5b259d07f31df0e507c8 /apps/files
parent46d80b4f706b750e3535814a17ba3caefbde1b98 (diff)
parentbb9c7ee75c431ef085952af4b48763a5d3ae1277 (diff)
downloadnextcloud-server-eaf19c482970d1aa45ee4660bccf9726f3156310.tar.gz
nextcloud-server-eaf19c482970d1aa45ee4660bccf9726f3156310.zip
Merge pull request #39229 from nextcloud/fix/default-empty-content-files
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/src/components/FilesListVirtual.vue2
-rw-r--r--apps/files/src/services/Navigation.ts8
-rw-r--r--apps/files/src/views/FilesList.vue10
-rw-r--r--apps/files/src/views/favorites.spec.ts2
-rw-r--r--apps/files/src/views/favorites.ts3
5 files changed, 17 insertions, 8 deletions
diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue
index e215714882c..e1bfb95e4db 100644
--- a/apps/files/src/components/FilesListVirtual.vue
+++ b/apps/files/src/components/FilesListVirtual.vue
@@ -45,7 +45,7 @@
<template #before>
<!-- Accessibility description -->
<caption class="hidden-visually">
- {{ currentView.caption || '' }}
+ {{ currentView.caption || t('files', 'List of files and folders.') }}
{{ t('files', 'This list is not fully rendered for performances reasons. The files will be rendered as you navigate through the list.') }}
</caption>
diff --git a/apps/files/src/services/Navigation.ts b/apps/files/src/services/Navigation.ts
index 767ab197c39..56d3ba0b97d 100644
--- a/apps/files/src/services/Navigation.ts
+++ b/apps/files/src/services/Navigation.ts
@@ -51,8 +51,14 @@ export interface Navigation {
id: string
/** Translated view name */
name: string
- /** Translated view accessible description */
+ /** Translated accessible description of the view */
caption?: string
+
+ /** Translated title of the empty view */
+ emptyTitle?: string
+ /** Translated description of the empty view */
+ emptyCaption?: string
+
/**
* Method return the content of the provided path
* This ideally should be a cancellable promise.
diff --git a/apps/files/src/views/FilesList.vue b/apps/files/src/views/FilesList.vue
index 8b42cfe6133..b14e3287939 100644
--- a/apps/files/src/views/FilesList.vue
+++ b/apps/files/src/views/FilesList.vue
@@ -39,8 +39,8 @@
<!-- Empty content placeholder -->
<NcEmptyContent v-else-if="!loading && isEmptyDir"
- :title="t('files', 'No files in here')"
- :description="t('files', 'No files or folders have been deleted yet')"
+ :title="currentView?.emptyTitle || t('files', 'No files in here')"
+ :description="currentView?.emptyCaption || t('files', 'Upload some content or sync with your devices!')"
data-cy-files-content-empty>
<template #action>
<NcButton v-if="dir !== '/'"
@@ -51,7 +51,7 @@
</NcButton>
</template>
<template #icon>
- <TrashCan />
+ <NcIconSvgWrapper :svg="currentView.icon" />
</template>
</NcEmptyContent>
@@ -72,7 +72,6 @@ import NcAppContent from '@nextcloud/vue/dist/Components/NcAppContent.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
-import TrashCan from 'vue-material-design-icons/TrashCan.vue'
import Vue from 'vue'
import { useFilesStore } from '../store/files.ts'
@@ -85,6 +84,7 @@ import FilesListVirtual from '../components/FilesListVirtual.vue'
import filesSortingMixin from '../mixins/filesSorting.ts'
import logger from '../logger.js'
import Navigation, { ContentsWithRoot } from '../services/Navigation.ts'
+import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
export default Vue.extend({
name: 'FilesList',
@@ -95,8 +95,8 @@ export default Vue.extend({
NcAppContent,
NcButton,
NcEmptyContent,
+ NcIconSvgWrapper,
NcLoadingIcon,
- TrashCan,
},
mixins: [
diff --git a/apps/files/src/views/favorites.spec.ts b/apps/files/src/views/favorites.spec.ts
index a1999624f2f..d39def283a9 100644
--- a/apps/files/src/views/favorites.spec.ts
+++ b/apps/files/src/views/favorites.spec.ts
@@ -68,7 +68,7 @@ describe('Favorites view definition', () => {
expect(favoritesView?.id).toBe('favorites')
expect(favoritesView?.name).toBe('Favorites')
- expect(favoritesView?.caption).toBe('List of favorites files and folders.')
+ expect(favoritesView?.caption).toBeDefined()
expect(favoritesView?.icon).toBe('<svg>SvgMock</svg>')
expect(favoritesView?.order).toBe(5)
expect(favoritesView?.columns).toStrictEqual([])
diff --git a/apps/files/src/views/favorites.ts b/apps/files/src/views/favorites.ts
index 571db4faab3..20baa2c582d 100644
--- a/apps/files/src/views/favorites.ts
+++ b/apps/files/src/views/favorites.ts
@@ -68,6 +68,9 @@ export default () => {
name: t('files', 'Favorites'),
caption: t('files', 'List of favorites files and folders.'),
+ emptyTitle: t('files', 'No favorites yet'),
+ emptyCaption: t('files', 'Files and folders you mark as favorite will show up here'),
+
icon: StarSvg,
order: 5,