aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/src/components/FileEntry.vue2
-rw-r--r--apps/files/src/components/FilesListHeaderActions.vue4
-rw-r--r--apps/files/src/views/FilesList.vue19
-rw-r--r--apps/files/src/views/Navigation.cy.ts62
-rw-r--r--apps/files/src/views/Navigation.vue6
-rw-r--r--apps/files/src/views/Settings.vue8
-rw-r--r--apps/files/src/views/Sidebar.vue10
7 files changed, 46 insertions, 65 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index 8fcf6846375..c71cf488077 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -105,7 +105,7 @@
:boundaries-element="boundariesElement"
:container="boundariesElement"
:disabled="source._loading"
- :force-title="true"
+ :force-name="true"
:force-menu="enabledInlineActions.length === 0 /* forceMenu only if no inline actions */"
:inline="enabledInlineActions.length"
:open.sync="openedMenu">
diff --git a/apps/files/src/components/FilesListHeaderActions.vue b/apps/files/src/components/FilesListHeaderActions.vue
index f8c60a5cd1b..e419c8e5abd 100644
--- a/apps/files/src/components/FilesListHeaderActions.vue
+++ b/apps/files/src/components/FilesListHeaderActions.vue
@@ -23,9 +23,9 @@
<th class="files-list__column files-list__row-actions-batch" colspan="2">
<NcActions ref="actionsMenu"
:disabled="!!loading || areSomeNodesLoading"
- :force-title="true"
+ :force-name="true"
:inline="inlineActions"
- :menu-title="inlineActions <= 1 ? t('files', 'Actions') : null"
+ :menu-name="inlineActions <= 1 ? t('files', 'Actions') : null"
:open.sync="openedMenu">
<NcActionButton v-for="action in enabledActions"
:key="action.id"
diff --git a/apps/files/src/views/FilesList.vue b/apps/files/src/views/FilesList.vue
index 99d7767ebc7..1a7ca5769aa 100644
--- a/apps/files/src/views/FilesList.vue
+++ b/apps/files/src/views/FilesList.vue
@@ -35,11 +35,11 @@
<NcLoadingIcon v-if="loading && !isRefreshing"
class="files-list__loading-icon"
:size="38"
- :title="t('files', 'Loading current folder')" />
+ :name="t('files', 'Loading current folder')" />
<!-- Empty content placeholder -->
<NcEmptyContent v-else-if="!loading && isEmptyDir"
- :title="currentView?.emptyTitle || t('files', 'No files in here')"
+ :name="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>
@@ -287,14 +287,15 @@ export default Vue.extend({
// If we're in the root dir, define the root
if (dir === '/') {
this.filesStore.setRoot({ service: currentView.id, root: folder })
- } else
- // Otherwise, add the folder to the store
- if (folder.fileid) {
- this.filesStore.updateNodes([folder])
- this.pathsStore.addPath({ service: currentView.id, fileid: folder.fileid, path: dir })
} else {
- // If we're here, the view API messed up
- logger.error('Invalid root folder returned', { dir, folder, currentView })
+ // Otherwise, add the folder to the store
+ if (folder.fileid) {
+ this.filesStore.updateNodes([folder])
+ this.pathsStore.addPath({ service: currentView.id, fileid: folder.fileid, path: dir })
+ } else {
+ // If we're here, the view API messed up
+ logger.error('Invalid root folder returned', { dir, folder, currentView })
+ }
}
// Update paths store
diff --git a/apps/files/src/views/Navigation.cy.ts b/apps/files/src/views/Navigation.cy.ts
index 65964832e8a..8678465841a 100644
--- a/apps/files/src/views/Navigation.cy.ts
+++ b/apps/files/src/views/Navigation.cy.ts
@@ -1,5 +1,3 @@
-import * as InitialState from '@nextcloud/initial-state'
-import * as L10n from '@nextcloud/l10n'
import FolderSvg from '@mdi/svg/svg/folder.svg'
import ShareSvg from '@mdi/svg/svg/share-variant.svg'
import { createTestingPinia } from '@pinia/testing'
@@ -13,13 +11,14 @@ describe('Navigation renders', () => {
const Navigation = new NavigationService() as NavigationService
before(() => {
- cy.stub(InitialState, 'loadState')
- .returns({
- used: 1000 * 1000 * 1000,
- quota: -1,
- })
+ cy.mockInitialState('files', 'storageStats', {
+ used: 1000 * 1000 * 1000,
+ quota: -1,
+ })
})
+ after(() => cy.unmockInitialState())
+
it('renders', () => {
cy.mount(NavigationView, {
propsData: {
@@ -157,22 +156,9 @@ describe('Navigation API', () => {
describe('Quota rendering', () => {
const Navigation = new NavigationService()
- beforeEach(() => {
- // TODO: remove when @nextcloud/l10n 2.0 is released
- // https://github.com/nextcloud/nextcloud-l10n/pull/542
- cy.stub(L10n, 'translate', (app, text, vars = {}, number) => {
- cy.log({ app, text, vars, number })
- return text.replace(/%n/g, '' + number).replace(/{([^{}]*)}/g, (match, key) => {
- return vars[key]
- })
- })
- })
+ afterEach(() => cy.unmockInitialState())
it('Unknown quota', () => {
- cy.stub(InitialState, 'loadState')
- .as('loadStateStats')
- .returns(undefined)
-
cy.mount(NavigationView, {
propsData: {
Navigation,
@@ -188,12 +174,10 @@ describe('Quota rendering', () => {
})
it('Unlimited quota', () => {
- cy.stub(InitialState, 'loadState')
- .as('loadStateStats')
- .returns({
- used: 1000 * 1000 * 1000,
- quota: -1,
- })
+ cy.mockInitialState('files', 'storageStats', {
+ used: 1000 * 1000 * 1000,
+ quota: -1,
+ })
cy.mount(NavigationView, {
propsData: {
@@ -212,13 +196,11 @@ describe('Quota rendering', () => {
})
it('Non-reached quota', () => {
- cy.stub(InitialState, 'loadState')
- .as('loadStateStats')
- .returns({
- used: 1000 * 1000 * 1000,
- quota: 5 * 1000 * 1000 * 1000,
- relative: 20, // percent
- })
+ cy.mockInitialState('files', 'storageStats', {
+ used: 1000 * 1000 * 1000,
+ quota: 5 * 1000 * 1000 * 1000,
+ relative: 20, // percent
+ })
cy.mount(NavigationView, {
propsData: {
@@ -238,13 +220,11 @@ describe('Quota rendering', () => {
})
it('Reached quota', () => {
- cy.stub(InitialState, 'loadState')
- .as('loadStateStats')
- .returns({
- used: 5 * 1000 * 1000 * 1000,
- quota: 1000 * 1000 * 1000,
- relative: 500, // percent
- })
+ cy.mockInitialState('files', 'storageStats', {
+ used: 5 * 1000 * 1000 * 1000,
+ quota: 1000 * 1000 * 1000,
+ relative: 500, // percent
+ })
cy.mount(NavigationView, {
propsData: {
diff --git a/apps/files/src/views/Navigation.vue b/apps/files/src/views/Navigation.vue
index e164880003a..81ceac80a7f 100644
--- a/apps/files/src/views/Navigation.vue
+++ b/apps/files/src/views/Navigation.vue
@@ -29,7 +29,7 @@
:icon="view.iconClass"
:open="isExpanded(view)"
:pinned="view.sticky"
- :title="view.name"
+ :name="view.name"
:to="generateToNavigation(view)"
@update:open="onToggleExpand(view)">
<!-- Sanitized icon as svg if provided -->
@@ -41,7 +41,7 @@
:data-cy-files-navigation-item="child.id"
:exact="true"
:icon="child.iconClass"
- :title="child.name"
+ :name="child.name"
:to="generateToNavigation(child)">
<!-- Sanitized icon as svg if provided -->
<NcIconSvgWrapper v-if="child.icon" slot="icon" :svg="child.icon" />
@@ -57,7 +57,7 @@
<!-- Files settings modal toggle-->
<NcAppNavigationItem :aria-label="t('files', 'Open the files app settings')"
- :title="t('files', 'Files settings')"
+ :name="t('files', 'Files settings')"
data-cy-files-navigation-settings-button
@click.prevent.stop="openSettings">
<Cog slot="icon" :size="20" />
diff --git a/apps/files/src/views/Settings.vue b/apps/files/src/views/Settings.vue
index 82580d7c504..957b26b30dc 100644
--- a/apps/files/src/views/Settings.vue
+++ b/apps/files/src/views/Settings.vue
@@ -22,10 +22,10 @@
<template>
<NcAppSettingsDialog :open="open"
:show-navigation="true"
- :title="t('files', 'Files settings')"
+ :name="t('files', 'Files settings')"
@update:open="onClose">
<!-- Settings API-->
- <NcAppSettingsSection id="settings" :title="t('files', 'Files settings')">
+ <NcAppSettingsSection id="settings" :name="t('files', 'Files settings')">
<NcCheckboxRadioSwitch :checked="userConfig.sort_favorites_first"
@update:checked="setConfig('sort_favorites_first', $event)">
{{ t('files', 'Sort favorites first') }}
@@ -43,14 +43,14 @@
<!-- Settings API-->
<NcAppSettingsSection v-if="settings.length !== 0"
id="more-settings"
- :title="t('files', 'Additional settings')">
+ :name="t('files', 'Additional settings')">
<template v-for="setting in settings">
<Setting :key="setting.name" :el="setting.el" />
</template>
</NcAppSettingsSection>
<!-- Webdav URL-->
- <NcAppSettingsSection id="webdav" :title="t('files', 'WebDAV')">
+ <NcAppSettingsSection id="webdav" :name="t('files', 'WebDAV')">
<NcInputField id="webdav-url-input"
:show-trailing-button="true"
:success="webdavUrlCopied"
diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue
index f173ff3333a..12581222f8e 100644
--- a/apps/files/src/views/Sidebar.vue
+++ b/apps/files/src/views/Sidebar.vue
@@ -244,15 +244,15 @@ export default {
compact: this.hasLowHeight || !this.fileInfo.hasPreview || this.isFullScreen,
loading: this.loading,
starred: this.fileInfo.isFavourited,
- subtitle: this.subtitle,
- subtitleTooltip: this.fullTime,
+ subname: this.subtitle,
+ subtitle: this.fullTime,
+ name: this.fileInfo.name,
title: this.fileInfo.name,
- titleTooltip: this.fileInfo.name,
}
} else if (this.error) {
return {
key: 'error', // force key to re-render
- subtitle: '',
+ subname: '',
title: '',
class: {
'app-sidebar--full': this.isFullScreen,
@@ -262,7 +262,7 @@ export default {
// no fileInfo yet, showing empty data
return {
loading: this.loading,
- subtitle: '',
+ subname: '',
title: '',
class: {
'app-sidebar--full': this.isFullScreen,