diff options
Diffstat (limited to 'apps/files_sharing/src/views/SharingList.vue')
-rw-r--r-- | apps/files_sharing/src/views/SharingList.vue | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/apps/files_sharing/src/views/SharingList.vue b/apps/files_sharing/src/views/SharingList.vue new file mode 100644 index 00000000000..2167059772e --- /dev/null +++ b/apps/files_sharing/src/views/SharingList.vue @@ -0,0 +1,63 @@ +<!-- + - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors + - SPDX-License-Identifier: AGPL-3.0-or-later +--> + +<template> + <ul class="sharing-sharee-list" :aria-label="t('files_sharing', 'Shares')"> + <SharingEntry v-for="share in shares" + :key="share.id" + :file-info="fileInfo" + :share="share" + :is-unique="isUnique(share)" + @open-sharing-details="openSharingDetails(share)" /> + </ul> +</template> + +<script> +import { t } from '@nextcloud/l10n' +import SharingEntry from '../components/SharingEntry.vue' +import ShareDetails from '../mixins/ShareDetails.js' +import { ShareType } from '@nextcloud/sharing' + +export default { + name: 'SharingList', + + components: { + SharingEntry, + }, + + mixins: [ShareDetails], + + props: { + fileInfo: { + type: Object, + default: () => { }, + required: true, + }, + shares: { + type: Array, + default: () => [], + required: true, + }, + }, + + setup() { + return { + t, + } + }, + computed: { + hasShares() { + return this.shares.length === 0 + }, + isUnique() { + return (share) => { + return [...this.shares].filter((item) => { + return share.type === ShareType.User && share.shareWithDisplayName === item.shareWithDisplayName + }).length <= 1 + } + }, + }, +} +</script> |