feat(files): Show upload menu in folders' emptycontent

Signed-off-by: Marco <marcoambrosini@icloud.com>
This commit is contained in:
Marco 2024-03-18 12:55:23 +01:00 committed by Ferdinand Thiessen
parent a7a055726e
commit 1526a6f7c2
No known key found for this signature in database
GPG key ID: 45FAE7268762B400

View file

@ -77,12 +77,14 @@
:description="currentView?.emptyCaption || t('files', 'Upload some content or sync with your devices!')"
data-cy-files-content-empty>
<template #action>
<NcButton v-if="dir !== '/'"
:aria-label="t('files', 'Go to the previous folder')"
type="primary"
:to="toPreviousDir">
{{ t('files', 'Go back') }}
</NcButton>
<!-- Uploader -->
<UploadPicker v-if="dir !== '/'"
:content="dirContents"
:destination="currentFolder"
:multiple="true"
class="files-list__header-upload-button"
@failed="onUploadFail"
@uploaded="onUpload" />
</template>
<template #icon>
<NcIconSvgWrapper :svg="currentView.icon" />
@ -351,14 +353,6 @@ export default defineComponent({
&& this.loading
},
/**
* Route to the previous directory.
*/
toPreviousDir(): Route {
const dir = this.dir.split('/').slice(0, -1).join('/') || '/'
return { ...this.$route, query: { dir } }
},
shareAttributes(): number[] | undefined {
if (!this.currentFolder?.attributes?.['share-types']) {
return undefined