Skip to content

Commit

Permalink
Merge pull request #39229 from nextcloud/fix/default-empty-content-files
Browse files Browse the repository at this point in the history
  • Loading branch information
Pytal authored Jul 19, 2023
2 parents 46d80b4 + bb9c7ee commit eaf19c4
Show file tree
Hide file tree
Showing 69 changed files with 150 additions and 106 deletions.
2 changes: 1 addition & 1 deletion apps/files/src/components/FilesListVirtual.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
8 changes: 7 additions & 1 deletion apps/files/src/services/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions apps/files/src/views/FilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 !== '/'"
Expand All @@ -51,7 +51,7 @@
</NcButton>
</template>
<template #icon>
<TrashCan />
<NcIconSvgWrapper :svg="currentView.icon" />
</template>
</NcEmptyContent>

Expand All @@ -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'
Expand All @@ -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',
Expand All @@ -95,8 +95,8 @@ export default Vue.extend({
NcAppContent,
NcButton,
NcEmptyContent,
NcIconSvgWrapper,
NcLoadingIcon,
TrashCan,
},

mixins: [
Expand Down
2 changes: 1 addition & 1 deletion apps/files/src/views/favorites.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([])
Expand Down
3 changes: 3 additions & 0 deletions apps/files/src/views/favorites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
14 changes: 8 additions & 6 deletions apps/files_sharing/src/views/shares.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,20 @@ describe('Sharing views definition', () => {
expect(shareOverviewView?.getContents).toBeDefined()

const dataProvider = [
{ id: 'sharingin', name: 'Shared with you', caption: 'List of files that are shared with you.' },
{ id: 'sharingout', name: 'Shared with others', caption: 'List of files that you shared with others.' },
{ id: 'sharinglinks', name: 'Shared by link', caption: 'List of files that are shared by link.' },
{ id: 'deletedshares', name: 'Deleted shares', caption: 'List of shares that you removed yourself from.' },
{ id: 'pendingshares', name: 'Pending shares', caption: 'List of unapproved shares.' },
{ id: 'sharingin', name: 'Shared with you' },
{ id: 'sharingout', name: 'Shared with others' },
{ id: 'sharinglinks', name: 'Shared by link' },
{ id: 'deletedshares', name: 'Deleted shares' },
{ id: 'pendingshares', name: 'Pending shares' },
]

sharesChildViews.forEach((view, index) => {
expect(view?.id).toBe(dataProvider[index].id)
expect(view?.parent).toBe('shareoverview')
expect(view?.name).toBe(dataProvider[index].name)
expect(view?.caption).toBe(dataProvider[index].caption)
expect(view?.caption).toBeDefined()
expect(view?.emptyTitle).toBeDefined()
expect(view?.emptyCaption).toBeDefined()
expect(view?.icon).toBe('<svg>SvgMock</svg>')
expect(view?.order).toBe(index + 1)
expect(view?.columns).toStrictEqual([])
Expand Down
20 changes: 19 additions & 1 deletion apps/files_sharing/src/views/shares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ export default () => {
name: t('files_sharing', 'Shares'),
caption: t('files_sharing', 'Overview of shared files.'),

emptyTitle: t('files_sharing', 'No shares'),
emptyCaption: t('files_sharing', 'Files and folders you shared or have been shared with you will show up here'),

icon: ShareVariantSvg,
order: 20,

Expand All @@ -59,6 +62,9 @@ export default () => {
name: t('files_sharing', 'Shared with you'),
caption: t('files_sharing', 'List of files that are shared with you.'),

emptyTitle: t('files_sharing', 'Nothing shared with you yet'),
emptyCaption: t('files_sharing', 'Files and folders others shared with you will show up here'),

icon: AccountSvg,
order: 1,
parent: sharesViewId,
Expand All @@ -73,6 +79,9 @@ export default () => {
name: t('files_sharing', 'Shared with others'),
caption: t('files_sharing', 'List of files that you shared with others.'),

emptyTitle: t('files_sharing', 'Nothing shared yet'),
emptyCaption: t('files_sharing', 'Files and folders you shared will show up here'),

icon: AccountGroupSvg,
order: 2,
parent: sharesViewId,
Expand All @@ -87,6 +96,9 @@ export default () => {
name: t('files_sharing', 'Shared by link'),
caption: t('files_sharing', 'List of files that are shared by link.'),

emptyTitle: t('files_sharing', 'No shared links'),
emptyCaption: t('files_sharing', 'Files and folders you shared by link will show up here'),

icon: LinkSvg,
order: 3,
parent: sharesViewId,
Expand All @@ -99,7 +111,10 @@ export default () => {
Navigation.register({
id: deletedSharesViewId,
name: t('files_sharing', 'Deleted shares'),
caption: t('files_sharing', 'List of shares that you removed yourself from.'),
caption: t('files_sharing', 'List of shares you left.'),

emptyTitle: t('files_sharing', 'No deleted shares'),
emptyCaption: t('files_sharing', 'Shares you have left will show up here'),

icon: DeleteSvg,
order: 4,
Expand All @@ -115,6 +130,9 @@ export default () => {
name: t('files_sharing', 'Pending shares'),
caption: t('files_sharing', 'List of unapproved shares.'),

emptyTitle: t('files_sharing', 'No pending shares'),
emptyCaption: t('files_sharing', 'Shares you have received but not approved will show up here'),

icon: AccountClockSvg,
order: 5,
parent: sharesViewId,
Expand Down
3 changes: 3 additions & 0 deletions apps/files_trashbin/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Navigation.register({
name: t('files_trashbin', 'Deleted files'),
caption: t('files_trashbin', 'List of files that have been deleted.'),

emptyTitle: t('files_trashbin', 'No deleted files'),
emptyCaption: t('files_trashbin', 'Files and folders you have deleted will show up here'),

icon: DeleteSvg,
order: 50,
sticky: true,
Expand Down
4 changes: 2 additions & 2 deletions dist/2246-2246.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/2246-2246.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/2323-2323.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/2323-2323.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/3832-3832.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/3832-3832.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/comments-comments-app.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/comments-comments-app.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/*! For license information please see richEditor.js.LICENSE.txt */

/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */

/*! https://mths.be/he v1.2.0 by @mathias | MIT license */
Expand Down
2 changes: 1 addition & 1 deletion dist/comments-comments-app.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/core-main.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@
* http://jquery.org/license
*/

/*! For license information please see NcHeaderMenu.js.LICENSE.txt */

/*! jQuery Migrate v3.4.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */

/*! jQuery UI - v1.13.2 - 2022-07-14
Expand Down
2 changes: 1 addition & 1 deletion dist/core-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-unified-search.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/core-unified-search.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/*! For license information please see NcHeaderMenu.js.LICENSE.txt */

/**
* @copyright 2020, John Molakvoæ <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion dist/core-unified-search.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/dav-settings-personal-availability.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dav-settings-personal-availability.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/files-main.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@

/*! For license information please see NcAppSettingsDialog.js.LICENSE.txt */

/*! For license information please see NcAppSettingsSection.js.LICENSE.txt */

/*! For license information please see NcBreadcrumb.js.LICENSE.txt */

/*! For license information please see NcBreadcrumbs.js.LICENSE.txt */

/*! For license information please see NcIconSvgWrapper.js.LICENSE.txt */

/*! For license information please see NcInputField.js.LICENSE.txt */

/*! https://mths.be/punycode v1.4.1 by @mathias */
Expand Down
2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-reference-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-reference-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-sidebar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-sidebar.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit eaf19c4

Please sign in to comment.