Skip to content

Commit

Permalink
Show upload menu in folders' emptycontent
Browse files Browse the repository at this point in the history
Signed-off-by: Marco <[email protected]>
  • Loading branch information
marcoambrosini committed Mar 18, 2024
1 parent ce864b4 commit 45f02fb
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions apps/files/src/views/FilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,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" />
Expand Down Expand Up @@ -350,14 +352,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
Expand Down

0 comments on commit 45f02fb

Please sign in to comment.