From 8d1a1a081226bd2037865cd5c673caf761d2bc35 Mon Sep 17 00:00:00 2001 From: fenn-cs Date: Mon, 15 Apr 2024 22:06:40 +0100 Subject: [PATCH] fix(sharingDetails): Show correct share target The share details page should show the target email or user/server to which the user is creating the share. Signed-off-by: fenn-cs [skip ci] --- .../src/views/SharingDetailsTab.vue | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index 5e7f7c1b45267..1b764528cb4d7 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -340,20 +340,30 @@ export default { switch (this.share.type) { case this.SHARE_TYPES.SHARE_TYPE_USER: return t('files_sharing', 'Share with {userName}', { userName: this.share.shareWithDisplayName }) + case this.SHARE_TYPES.SHARE_TYPE_EMAIL: + return t('files_sharing', 'Share with email {email}', { email: this.share.shareWith }) case this.SHARE_TYPES.SHARE_TYPE_LINK: return t('files_sharing', 'Share link') case this.SHARE_TYPES.SHARE_TYPE_GROUP: return t('files_sharing', 'Share with group') case this.SHARE_TYPES.SHARE_TYPE_ROOM: return t('files_sharing', 'Share in conversation') - case this.SHARE_TYPES.SHARE_TYPE_REMOTE: - return t('files_sharing', 'Share with remote') + case this.SHARE_TYPES.SHARE_TYPE_REMOTE: { + const [user, server] = this.share.shareWith.split('@') + return t('files_sharing', 'Share with {user} on remote server {server}', { user, server }) + } case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP: return t('files_sharing', 'Share with remote group') case this.SHARE_TYPES.SHARE_TYPE_GUEST: return t('files_sharing', 'Share with guest') - default: - return t('files_sharing', 'Share with') + default: { + if (this.share.id) { + // Share already exists + return t('files_sharing', 'Update share') + } else { + return t('files_sharing', 'Create share') + } + } } }, /**