Skip to content

Commit

Permalink
Rebase and make better use of composition API
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed Apr 28, 2023
1 parent 57801e1 commit a615b39
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions packages/web-app-files/src/views/spaces/GenericSpace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@
:side-bar-open="sideBarOpen"
class="oc-px-m oc-mt-m"
/>

<no-content-message v-if="isEmpty" id="files-space-empty" class="files-empty" icon="folder">
<no-content-message
v-if="isCurrentFolderEmpty"
id="files-space-empty"
class="files-empty"
icon="folder"
>
<template #message>
<span v-text="$gettext('No resources found')" />
</template>
Expand Down Expand Up @@ -252,6 +256,12 @@ export default defineComponent({
return props.space.driveType === 'project' && props.item === '/'
})
const folderNotFound = computed(() => store.getters['Files/currentFolder'] === null)
const isCurrentFolderEmpty = computed(
() => unref(resourcesViewDefaults.paginatedResources).length < 1
)
const titleSegments = computed(() => {
const segments = [props.space.name]
if (props.item !== '/') {
Expand Down Expand Up @@ -414,7 +424,9 @@ export default defineComponent({
...resourcesViewDefaults,
canUpload,
breadcrumbs,
folderNotFound,
hasSpaceHeader,
isCurrentFolderEmpty,
resourceTargetRouteCallback,
performLoaderTask,
ViewModeConstants,
Expand All @@ -431,14 +443,6 @@ export default defineComponent({
...mapGetters('Files', ['currentFolder', 'totalFilesCount', 'totalFilesSize']),
...mapGetters(['user', 'configuration']),
folderNotFound() {
return this.currentFolder === null
},
isEmpty() {
return this.paginatedResources.length < 1
},
isRunningOnEos() {
return !!this.configuration?.options?.runningOnEos
},
Expand All @@ -458,11 +462,7 @@ export default defineComponent({
) {
return true
}
if (
isPublicSpaceResource(this.space) &&
!this.currentFolder.canUpload({ user: this.user }) &&
!this.paginatedResources[0].isFolder
) {
if (isPublicSpaceResource(this.space) && !this.paginatedResources[0].isFolder) {
return true
}
Expand Down

0 comments on commit a615b39

Please sign in to comment.