From 254705c3f17e2939f381bb378de20f845587c12e Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 28 Jul 2016 13:47:19 +0100 Subject: [PATCH] Tidy up, and fall back to handling data.users. --- .../controllers/ShareProjectModalController.coffee | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee b/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee index b9567f46dd..4f3adbdcfd 100644 --- a/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee +++ b/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee @@ -51,7 +51,6 @@ define [ , (response) -> console.error response ) - window._x = getOutstandingInvites $scope.filterAutocompleteUsers = ($query) -> currentMemberEmails = getCurrentMemberEmails() @@ -84,7 +83,7 @@ define [ # Skip this existing member return addNextMember() - # TODO: double-check if member.type == 'user' needs to be an invite + # NOTE: groups aren't really a thing in ShareLaTeX, partially inherited from DJ if member.type == "user" request = projectInvites.sendInvite(member.email, $scope.inputs.privileges) else if member.type == "group" @@ -97,6 +96,15 @@ define [ if data.invite invite = data.invite $scope.state.invites.push invite + else + if data.users? + users = data.users + else if data.user? + users = [data.user] + else + users = [] + $scope.project.members.push users... + setTimeout () -> # Give $scope a chance to update $scope.canAddCollaborators # with new collaborator information.