diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-07-02 11:29:03 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2018-07-11 10:11:47 +0200 |
commit | 2abc70563221457843346e452f916bf2b49a00ad (patch) | |
tree | af698d867dfeac7f74625963616e6f4f3aefa823 /core/js | |
parent | 1d5a9c3f979b23bac98243ba2245a21bdff722c8 (diff) | |
download | nextcloud-server-2abc70563221457843346e452f916bf2b49a00ad.tar.gz nextcloud-server-2abc70563221457843346e452f916bf2b49a00ad.zip |
start to get fed group shares into the share dialog
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/share.js | 1 | ||||
-rw-r--r-- | core/js/sharedialogshareelistview.js | 8 | ||||
-rw-r--r-- | core/js/sharedialogview.js | 26 |
3 files changed, 30 insertions, 5 deletions
diff --git a/core/js/share.js b/core/js/share.js index f301de25415..e4d9364b2d1 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -11,6 +11,7 @@ OC.Share = _.extend(OC.Share || {}, { SHARE_TYPE_REMOTE:6, SHARE_TYPE_CIRCLE:7, SHARE_TYPE_GUEST:8, + SHARE_TYPE_REMOTE_GROUP:9, /** * Regular expression for splitting parts of remote share owners: diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index 1e873a7208e..0ff4c36b712 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -198,6 +198,8 @@ 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_REMOTE_GROUP) { + shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'remote group') + ')'; } else if (shareType === OC.Share.SHARE_TYPE_EMAIL) { shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'email') + ')'; } else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) { @@ -207,7 +209,10 @@ 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) { + } else if (shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP) { + shareWithTitle = shareWith + " (" + t('core', 'remote group') + ')'; + } + else if (shareType === OC.Share.SHARE_TYPE_EMAIL) { shareWithTitle = shareWith + " (" + t('core', 'email') + ')'; } else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) { shareWithTitle = shareWith; @@ -243,6 +248,7 @@ shareId: this.model.get('shares')[shareIndex].id, modSeed: shareType !== OC.Share.SHARE_TYPE_USER && shareType !== OC.Share.SHARE_TYPE_CIRCLE, isRemoteShare: shareType === OC.Share.SHARE_TYPE_REMOTE, + isRemoteGroupShare: shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP, isMailShare: shareType === OC.Share.SHARE_TYPE_EMAIL, isCircleShare: shareType === OC.Share.SHARE_TYPE_CIRCLE, isFileSharedByMail: shareType === OC.Share.SHARE_TYPE_EMAIL && !this.model.isFolder(), diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index dede768fad5..d886e45856f 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -93,6 +93,9 @@ this.configModel.on('change:isRemoteShareAllowed', function() { view.render(); }); + this.configModel.on('change:isRemoteGroupShareAllowed', function() { + view.render(); + }); this.model.on('change:permissions', function() { view.render(); }); @@ -161,7 +164,7 @@ }, function (result) { if (result.ocs.meta.statuscode === 100) { - var filter = function(users, groups, remotes, emails, circles) { + var filter = function(users, groups, remotes, remote_groups, emails, circles) { if (typeof(emails) === 'undefined') { emails = []; } @@ -172,6 +175,7 @@ var usersLength; var groupsLength; var remotesLength; + var remoteGroupsLength; var emailsLength; var circlesLength; @@ -228,6 +232,14 @@ break; } } + } else if (share.share_type === OC.Share.SHARE_TYPE_REMOTE_GROUP) { + remoteGroupsLength = remote_groups.length; + for (j = 0; j < remoteGroupsLength; j++) { + if (remote_groups[j].value.shareWith === share.share_with) { + remote_groups.splice(j, 1); + break; + } + } } else if (share.share_type === OC.Share.SHARE_TYPE_EMAIL) { emailsLength = emails.length; for (j = 0; j < emailsLength; j++) { @@ -252,6 +264,7 @@ result.ocs.data.exact.users, result.ocs.data.exact.groups, result.ocs.data.exact.remotes, + result.ocs.data.exact.remote_groups, result.ocs.data.exact.emails, result.ocs.data.exact.circles ); @@ -259,6 +272,7 @@ var exactUsers = result.ocs.data.exact.users; var exactGroups = result.ocs.data.exact.groups; var exactRemotes = result.ocs.data.exact.remotes; + var exactRemoteGroups = result.ocs.data.exact.remote_groups; var exactEmails = []; if (typeof(result.ocs.data.emails) !== 'undefined') { exactEmails = result.ocs.data.exact.emails; @@ -268,12 +282,13 @@ exactCircles = result.ocs.data.exact.circles; } - var exactMatches = exactUsers.concat(exactGroups).concat(exactRemotes).concat(exactEmails).concat(exactCircles); + var exactMatches = exactUsers.concat(exactGroups).concat(exactRemotes).concat(exactRemoteGroups).concat(exactEmails).concat(exactCircles); filter( result.ocs.data.users, result.ocs.data.groups, result.ocs.data.remotes, + result.ocs.data.remote_groups, result.ocs.data.emails, result.ocs.data.circles ); @@ -281,6 +296,7 @@ var users = result.ocs.data.users; var groups = result.ocs.data.groups; var remotes = result.ocs.data.remotes; + var remoteGroups = result.ocs.data.remote_groups; var lookup = result.ocs.data.lookup; var emails = []; if (typeof(result.ocs.data.emails) !== 'undefined') { @@ -291,7 +307,7 @@ circles = result.ocs.data.circles; } - var suggestions = exactMatches.concat(users).concat(groups).concat(remotes).concat(emails).concat(circles).concat(lookup); + var suggestions = exactMatches.concat(users).concat(groups).concat(remotes).concat(remoteGroups).concat(emails).concat(circles).concat(lookup); deferred.resolve(suggestions, exactMatches); } else { @@ -414,7 +430,9 @@ if (item.value.shareType === OC.Share.SHARE_TYPE_GROUP) { text = t('core', '{sharee} (group)', { sharee: text }, undefined, { escape: false }); } else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE) { - text = t('core', '{sharee} (remote)', { sharee: text }, undefined, { escape: false }); + text = t('core', '{sharee} (remote)', {sharee: text}, undefined, {escape: false}); + } else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP) { + text = t('core', '{sharee} (remote group)', { sharee: text }, undefined, { escape: false }); } else if (item.value.shareType === OC.Share.SHARE_TYPE_EMAIL) { text = t('core', '{sharee} (email)', { sharee: text }, undefined, { escape: false }); } else if (item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) { |