diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-10-20 13:58:01 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-03-22 06:34:09 +0100 |
commit | 100d5d9a4707dd7f5f6572d69dd55cb3d62b955f (patch) | |
tree | 200cea3d7d942c48d308497e1e5abf78e7f38f59 /apps/files_sharing | |
parent | ae19cb168f9d3c45964ed50d868258798edb3f55 (diff) | |
download | nextcloud-server-100d5d9a4707dd7f5f6572d69dd55cb3d62b955f.tar.gz nextcloud-server-100d5d9a4707dd7f5f6572d69dd55cb3d62b955f.zip |
Add labels to mail shares
Now the email is shown on a second line if a label is set.
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 13 | ||||
-rw-r--r-- | apps/files_sharing/src/components/SharingEntryLink.vue | 24 |
2 files changed, 29 insertions, 8 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index a051f9141ff..044a2f51c19 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -558,11 +558,11 @@ class ShareAPIController extends OCSController { // Only share by mail have a recipient if ($shareType === IShare::TYPE_EMAIL) { $share->setSharedWith($shareWith); - } else { - // Only link share have a label - if (!empty($label)) { - $share->setLabel($label); - } + } + + // If we have a label, use it + if (!empty($label)) { + $share->setLabel($label); } if ($sendPasswordByTalk === 'true') { @@ -1127,8 +1127,7 @@ class ShareAPIController extends OCSController { $share->setPassword($password); } - // only link shares have labels - if ($share->getShareType() === IShare::TYPE_LINK && $label !== null) { + if ($label !== null) { if (strlen($label) > 255) { throw new OCSBadRequestException("Maxmimum label length is 255"); } diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index 44c3c986e17..982ed4bff3a 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -29,6 +29,9 @@ <h5 :title="title"> {{ title }} </h5> + <p v-if="subtitle"> + {{ subtitle }} + </p> </div> <!-- clipboard --> @@ -406,7 +409,6 @@ export default { /** * Link share label - * TODO: allow editing * @returns {string} */ title() { @@ -424,6 +426,11 @@ export default { }) } if (this.share.label && this.share.label.trim() !== '') { + if (this.isEmailShareType) { + return t('files_sharing', 'Mail share ({label})', { + label: this.share.label.trim(), + }) + } return t('files_sharing', 'Share link ({label})', { label: this.share.label.trim(), }) @@ -436,6 +443,18 @@ export default { }, /** + * Show the email on a second line if a label is set for mail shares + * @returns {string} + */ + subtitle() { + if (this.isEmailShareType + && this.title !== this.share.shareWith) { + return this.share.shareWith + } + return null + }, + + /** * Does the current share have an expiration date * @returns {boolean} */ @@ -933,6 +952,9 @@ export default { overflow: hidden; white-space: nowrap; } + p { + color: var(--color-text-maxcontrast); + } } &:not(.sharing-entry--share) &__actions { |