Skip to content

Commit 1463592

Browse files
committed
fix(files): Keep 'back'-button for not found directories or if user can not upload
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 1526a6f commit 1463592

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

apps/files/src/views/FilesList.vue

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,21 @@
7676
:name="currentView?.emptyTitle || t('files', 'No files in here')"
7777
:description="currentView?.emptyCaption || t('files', 'Upload some content or sync with your devices!')"
7878
data-cy-files-content-empty>
79-
<template #action>
79+
<template v-if="dir !== '/'" #action>
8080
<!-- Uploader -->
81-
<UploadPicker v-if="dir !== '/'"
81+
<UploadPicker v-if="currentFolder && canUpload && !isQuotaExceeded"
8282
:content="dirContents"
8383
:destination="currentFolder"
84-
:multiple="true"
8584
class="files-list__header-upload-button"
85+
multiple
8686
@failed="onUploadFail"
8787
@uploaded="onUpload" />
88+
<NcButton v-else
89+
:aria-label="t('files', 'Go to the previous folder')"
90+
:to="toPreviousDir"
91+
type="primary">
92+
{{ t('files', 'Go back') }}
93+
</NcButton>
8894
</template>
8995
<template #icon>
9096
<NcIconSvgWrapper :svg="currentView.icon" />
@@ -353,6 +359,14 @@ export default defineComponent({
353359
&& this.loading
354360
},
355361
362+
/**
363+
* Route to the previous directory.
364+
*/
365+
toPreviousDir(): Route {
366+
const dir = this.dir.split('/').slice(0, -1).join('/') || '/'
367+
return { ...this.$route, query: { dir } }
368+
},
369+
356370
shareAttributes(): number[] | undefined {
357371
if (!this.currentFolder?.attributes?.['share-types']) {
358372
return undefined

dist/files-main.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)