Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JanAckermann committed Jul 27, 2022
1 parent 145ac03 commit 65431fd
Showing 1 changed file with 7 additions and 31 deletions.
38 changes: 7 additions & 31 deletions packages/web-app-files/src/views/shares/SharedWithMe.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="oc-flex oc-flex-column">
<app-bar :has-shares-navigation="true" :has-bulk-actions="true" />
<app-loading-spinner v-if="areResourcesLoading" />
<app-loading-spinner v-if="loadResourcesTask.isRunning" />
<template v-else>
<shared-with-me-section
v-if="pendingItems.length > 0"
Expand Down Expand Up @@ -41,18 +41,14 @@
<script lang="ts">
import { mapGetters, mapState } from 'vuex'
import { useSort, useResourcesViewDefaults } from '../../composables'
import { useCapabilityShareJailEnabled, useStore } from 'web-pkg/src/composables'
import AppLoadingSpinner from 'web-pkg/src/components/AppLoadingSpinner.vue'
import AppBar from '../../components/AppBar/AppBar.vue'
import SharedWithMeSection from '../../components/Shares/SharedWithMeSection.vue'
import { ShareStatus } from '../../helpers/share'
import { computed, defineComponent, unref } from '@vue/composition-api'
import { createLocationSpaces } from '../../router'
import { Resource } from '../../helpers/resource'
const displayedFields = ['name', 'status', 'owner', 'sdate', 'sharedWith']
export default defineComponent({
components: {
AppBar,
Expand All @@ -61,24 +57,11 @@ export default defineComponent({
},
setup() {
const { fileListHeaderY, storeItems, fields, loadResourcesTask, areResourcesLoading } =
useResourcesViewDefaults<Resource, any, any[]>()
const store = useStore()
const hasShareJail = useCapabilityShareJailEnabled()
const resourceTargetLocation = computed(() =>
unref(hasShareJail)
? createLocationSpaces('files-spaces-share')
: createLocationSpaces('files-spaces-personal', {
params: { storageId: store.getters.user.id }
})
)
const resourceTargetParamMapping = computed(() =>
unref(hasShareJail) ? { name: 'shareName', path: 'item' } : undefined
)
const resourceTargetQueryMapping = computed(() =>
unref(hasShareJail) ? { id: 'shareId' } : undefined
)
const { storeItems, fields, loadResourcesTask } = useResourcesViewDefaults<
Resource,
any,
any[]
>()
// pending shares
const pending = computed(() =>
Expand Down Expand Up @@ -130,9 +113,7 @@ export default defineComponent({
return {
// defaults
fileListHeaderY,
loadResourcesTask,
areResourcesLoading,
// view specific
pendingHandleSort,
Expand All @@ -148,12 +129,7 @@ export default defineComponent({
declinedHandleSort,
declinedSortBy,
declinedSortDir,
declinedItems,
displayedFields,
resourceTargetLocation,
resourceTargetParamMapping,
resourceTargetQueryMapping
declinedItems
}
},
Expand Down

0 comments on commit 65431fd

Please sign in to comment.