Skip to content

Commit

Permalink
Merge pull request #10696 from owncloud/remove-shares-panel-separation
Browse files Browse the repository at this point in the history
refactor: remove shares panel separation for details query
  • Loading branch information
JammingBen authored Apr 2, 2024
2 parents 7a78e3c + 1faec3f commit c2308f3
Showing 1 changed file with 5 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,19 @@
<div>
<oc-loader v-if="sharesLoading" :aria-label="$gettext('Loading list of shares')" />
<template v-else>
<space-members
v-if="showSpaceMembers"
ref="peopleShares"
class="oc-background-highlight oc-p-m oc-mb-s"
/>
<file-shares v-else ref="peopleShares" class="oc-background-highlight oc-p-m oc-mb-s" />
<file-links v-if="showLinks" ref="linkShares" class="oc-background-highlight oc-p-m" />
<space-members v-if="showSpaceMembers" class="oc-background-highlight oc-p-m oc-mb-s" />
<file-shares v-else class="oc-background-highlight oc-p-m oc-mb-s" />
<file-links v-if="showLinks" class="oc-background-highlight oc-p-m" />
</template>
</div>
</template>

<script lang="ts">
import { ComponentPublicInstance, defineComponent, inject, Ref } from 'vue'
import { defineComponent } from 'vue'
import FileLinks from './FileLinks.vue'
import FileShares from './FileShares.vue'
import SpaceMembers from './SpaceMembers.vue'
import { useSharesStore } from '@ownclouders/web-pkg'
import { Resource } from '@ownclouders/web-client'
import { storeToRefs } from 'pinia'
export default defineComponent({
Expand All @@ -39,31 +34,7 @@ export default defineComponent({
const { loading: sharesLoading } = storeToRefs(sharesStore)
return {
sharesLoading,
resource: inject<Ref<Resource>>('resource'),
activePanel: inject<String>('activePanel')
}
},
watch: {
sharesLoading: {
handler: function (sharesLoading, old) {
// FIXME: !old can be removed as soon as https://github.com/owncloud/web/issues/7621 has been fixed
if (!this.activePanel || !old) {
return
}
this.$nextTick(() => {
const [panelName, ref] = this.activePanel.split('#')
if (!ref || !this.$refs[ref]) {
return
}
this.$emit('scrollToElement', {
element: (this.$refs[ref] as ComponentPublicInstance).$el,
panelName
})
})
},
immediate: true
sharesLoading
}
}
})
Expand Down

0 comments on commit c2308f3

Please sign in to comment.