summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-10-25 16:24:49 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2016-11-01 19:54:40 +0100
commit392c8a115f136b4aa63ee759cf359595256d153d (patch)
treecb631a34bdb9ebb51c12ca6d9cd831cd62ac1df5
parent8c8a019b7eb3de0262712aa145e5cd7e4f3cd2bd (diff)
downloadnextcloud-server-392c8a115f136b4aa63ee759cf359595256d153d.tar.gz
nextcloud-server-392c8a115f136b4aa63ee759cf359595256d153d.zip
unified way to display remote shares and mail shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
-rw-r--r--apps/files_sharing/lib/Controller/ShareesAPIController.php4
-rw-r--r--apps/files_sharing/tests/Controller/ShareAPIControllerTest.php2
-rw-r--r--core/js/sharedialogshareelistview.js14
-rw-r--r--core/js/sharedialogview.js7
4 files changed, 17 insertions, 10 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php
index 58648156a99..1e5bca46821 100644
--- a/apps/files_sharing/lib/Controller/ShareesAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php
@@ -298,7 +298,7 @@ class ShareesAPIController extends OCSController {
$foundRemoteById = true;
}
$this->result['exact']['remotes'][] = [
- 'label' => $contact['FN'],
+ 'label' => $contact['FN'] . " ($cloudId)",
'value' => [
'shareType' => Share::SHARE_TYPE_REMOTE,
'shareWith' => $cloudId,
@@ -307,7 +307,7 @@ class ShareesAPIController extends OCSController {
];
} else {
$this->result['remotes'][] = [
- 'label' => $contact['FN'],
+ 'label' => $contact['FN'] . " ($cloudId)",
'value' => [
'shareType' => Share::SHARE_TYPE_REMOTE,
'shareWith' => $cloudId,
diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
index 6ad0576b6fa..890fdb6eda0 100644
--- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
@@ -23,8 +23,10 @@
*/
namespace OCA\Files_Sharing\Tests\Controller;
+use OC\ContactsManager;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSNotFoundException;
+use OCP\Contacts;
use OCP\Files\Folder;
use OCP\IL10N;
use OCA\Files_Sharing\Controller\ShareAPIController;
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js
index 66ed85eda33..cca698905c2 100644
--- a/core/js/sharedialogshareelistview.js
+++ b/core/js/sharedialogshareelistview.js
@@ -24,7 +24,7 @@
'{{#if avatarEnabled}}' +
'<div class="avatar {{#if modSeed}}imageplaceholderseed{{/if}}" data-username="{{shareWith}}" {{#if modSeed}}data-seed="{{shareWith}} {{shareType}}"{{/if}}></div>' +
'{{/if}}' +
- '<span class="has-tooltip username" title="{{shareWith}}">{{shareWithDisplayName}}</span>' +
+ '<span class="has-tooltip username" title="{{shareWithTitle}}">{{shareWithDisplayName}}</span>' +
'<span class="sharingOptionsGroup">' +
'{{#if editPermissionPossible}}' +
'<span class="shareOption">' +
@@ -141,6 +141,7 @@
getShareeObject: function(shareIndex) {
var shareWith = this.model.getShareWith(shareIndex);
var shareWithDisplayName = this.model.getShareWithDisplayName(shareIndex);
+ var shareWithTitle = '';
var shareType = this.model.getShareType(shareIndex);
var hasPermissionOverride = {};
@@ -148,6 +149,16 @@
shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'group') + ')';
} else if (shareType === OC.Share.SHARE_TYPE_REMOTE) {
shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'remote') + ')';
+ } else if (shareType === OC.Share.SHARE_TYPE_EMAIL) {
+ shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'email') + ')';
+ }
+
+ if (shareType === OC.Share.SHARE_TYPE_GROUP) {
+ shareWithTitle = shareWith + " (" + t('core', 'group') + ')';
+ } else if (shareType === OC.Share.SHARE_TYPE_REMOTE) {
+ shareWithTitle = shareWith + " (" + t('core', 'remote') + ')';
+ } else if (shareType === OC.Share.SHARE_TYPE_EMAIL) {
+ shareWithTitle = shareWith + " (" + t('core', 'email') + ')';
}
return _.extend(hasPermissionOverride, {
@@ -160,6 +171,7 @@
wasMailSent: this.model.notificationMailWasSent(shareIndex),
shareWith: shareWith,
shareWithDisplayName: shareWithDisplayName,
+ shareWithTitle: shareWithTitle,
shareType: shareType,
shareId: this.model.get('shares')[shareIndex].id,
modSeed: shareType !== OC.Share.SHARE_TYPE_USER,
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index c22d9469da8..129206b0931 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -272,16 +272,9 @@
sharee: text
});
} else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE) {
- if (item.value.server) {
- text = t('core', '{sharee} (at {server})', {
- sharee: text,
- server: item.value.server
- });
- } else {
text = t('core', '{sharee} (remote)', {
sharee: text
});
- }
} else if (item.value.shareType === OC.Share.SHARE_TYPE_EMAIL) {
text = t('core', '{sharee} (email)', {
sharee: text