]> source.dussan.org Git - nextcloud-server.git/commitdiff
unified way to display remote shares and mail shares
authorBjoern Schiessle <bjoern@schiessle.org>
Tue, 25 Oct 2016 14:24:49 +0000 (16:24 +0200)
committerBjoern Schiessle <bjoern@schiessle.org>
Tue, 1 Nov 2016 18:54:40 +0000 (19:54 +0100)
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
apps/files_sharing/lib/Controller/ShareesAPIController.php
apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
core/js/sharedialogshareelistview.js
core/js/sharedialogview.js

index 58648156a99e886832230c8d8dc6bfb73d8f811f..1e5bca468214fc2a2fbaf46dac2fdcff05cdd851 100644 (file)
@@ -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,
index 6ad0576b6fa919f36f715017603c24b261f402a6..890fdb6eda0e493e9c488328f4e22e150bfd192f 100644 (file)
  */
 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;
index 66ed85eda33f78414e4a3c6c63ac136488250065..cca698905c200ba8b6a78130f56c004abaf22d55 100644 (file)
@@ -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">' +
                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 = {};
                                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, {
                                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,
index c22d9469da8d0df36266ca977599bcfb80d237dc..129206b0931cc61e066c443d08b6d1b9321eef13 100644 (file)
                                        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