aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-04-01 15:07:35 +0200
committernpmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>2020-04-29 17:53:35 +0000
commitd466a7b80834b6e31bfcb9d764816a01da0cbc7c (patch)
tree8283f4910aeb186c89085224ac109df5bbe4af85 /apps/files_sharing/src
parentb219eadb8f3f459f2c71e937dfd3542f0792da8e (diff)
downloadnextcloud-server-d466a7b80834b6e31bfcb9d764816a01da0cbc7c.tar.gz
nextcloud-server-d466a7b80834b6e31bfcb9d764816a01da0cbc7c.zip
Allow to navigate to others with access from the sidebar
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r--apps/files_sharing/src/components/SharingEntryInherited.vue15
-rw-r--r--apps/files_sharing/src/models/Share.js20
-rw-r--r--apps/files_sharing/src/views/SharingInherited.vue1
3 files changed, 31 insertions, 5 deletions
diff --git a/apps/files_sharing/src/components/SharingEntryInherited.vue b/apps/files_sharing/src/components/SharingEntryInherited.vue
index 259599359d4..b8b5674efc9 100644
--- a/apps/files_sharing/src/components/SharingEntryInherited.vue
+++ b/apps/files_sharing/src/components/SharingEntryInherited.vue
@@ -35,10 +35,10 @@
<ActionText icon="icon-user">
{{ t('files_sharing', 'Added by {initiator}', { initiator: share.ownerDisplayName }) }}
</ActionText>
- <ActionLink v-if="share.canDelete && share.fileSource"
+ <ActionLink v-if="share.viaPath && share.viaFileid"
icon="icon-folder"
- :href="fileTargetUrl">
- {{ t('files_sharing', 'Via folder') }}
+ :href="viaFileTargetUrl">
+ {{ t('files_sharing', 'Via “{folder}”', {folder: viaFolderName} ) }}
</ActionLink>
<ActionButton v-if="share.canDelete"
icon="icon-close"
@@ -50,6 +50,7 @@
<script>
import { generateUrl } from '@nextcloud/router'
+import { basename } from '@nextcloud/paths'
import Avatar from '@nextcloud/vue/dist/Components/Avatar'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
import ActionLink from '@nextcloud/vue/dist/Components/ActionLink'
@@ -81,11 +82,15 @@ export default {
},
computed: {
- fileTargetUrl() {
+ viaFileTargetUrl() {
return generateUrl('/f/{fileid}', {
- fileid: this.share.fileSource,
+ fileid: this.share.viaFileid,
})
},
+
+ viaFolderName() {
+ return basename(this.share.viaPath)
+ },
},
}
</script>
diff --git a/apps/files_sharing/src/models/Share.js b/apps/files_sharing/src/models/Share.js
index 1c8c24cfc7b..92ea314071f 100644
--- a/apps/files_sharing/src/models/Share.js
+++ b/apps/files_sharing/src/models/Share.js
@@ -467,6 +467,26 @@ export default class Share {
return this.#share.can_delete === true
}
+ /**
+ * Top level accessible shared folder fileid for the current user
+ * @returns {string}
+ * @readonly
+ * @memberof Share
+ */
+ get viaFileid() {
+ return this.#share.via_fileid
+ }
+
+ /**
+ * Top level accessible shared folder path for the current user
+ * @returns {string}
+ * @readonly
+ * @memberof Share
+ */
+ get viaPath() {
+ return this.#share.via_path
+ }
+
// TODO: SORT THOSE PROPERTIES
get label() {
return this.#share.label
diff --git a/apps/files_sharing/src/views/SharingInherited.vue b/apps/files_sharing/src/views/SharingInherited.vue
index 67a57a96b62..b688a70fa1a 100644
--- a/apps/files_sharing/src/views/SharingInherited.vue
+++ b/apps/files_sharing/src/views/SharingInherited.vue
@@ -38,6 +38,7 @@
<!-- Inherited shares list -->
<SharingEntryInherited v-for="share in shares"
:key="share.id"
+ :file-info="fileInfo"
:share="share" />
</ul>
</template>