You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/11/16 22:05:34 UTC
[airavata-django-portal] branch master updated: AIRAVATA-2949 Fix
list of current group members
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
The following commit(s) were added to refs/heads/master by this push:
new a928e60 AIRAVATA-2949 Fix list of current group members
a928e60 is described below
commit a928e60e3fa54f2f81fa8626f03141c3662cbcd2
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Fri Nov 16 17:05:25 2018 -0500
AIRAVATA-2949 Fix list of current group members
---
.../js/group_components/GroupMembersEditor.vue | 34 +++++++++++++---------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/django_airavata/apps/groups/static/django_airavata_groups/js/group_components/GroupMembersEditor.vue b/django_airavata/apps/groups/static/django_airavata_groups/js/group_components/GroupMembersEditor.vue
index 6c9ac66..53531e3 100644
--- a/django_airavata/apps/groups/static/django_airavata_groups/js/group_components/GroupMembersEditor.vue
+++ b/django_airavata/apps/groups/static/django_airavata_groups/js/group_components/GroupMembersEditor.vue
@@ -95,20 +95,26 @@ export default {
if (!this.userProfilesMap) {
return [];
}
- return this.members.map(m => {
- const userProfile = this.userProfilesMap[m];
- const isAdmin = this.admins.indexOf(m) >= 0;
- // Owners can edit all members and admins can edit non-admin members
- const editable = this.group.isOwner || (this.group.isAdmin && !isAdmin);
- return {
- id: m,
- name: userProfile.firstName + " " + userProfile.lastName,
- username: userProfile.userId,
- email: userProfile.email,
- role: isAdmin ? "ADMIN" : "MEMBER",
- editable: editable
- };
- });
+ return (
+ this.members
+ // Filter out users that are missing profiles
+ .filter(m => m in this.userProfilesMap)
+ .map(m => {
+ const userProfile = this.userProfilesMap[m];
+ const isAdmin = this.admins.indexOf(m) >= 0;
+ // Owners can edit all members and admins can edit non-admin members
+ const editable =
+ this.group.isOwner || (this.group.isAdmin && !isAdmin);
+ return {
+ id: m,
+ name: userProfile.firstName + " " + userProfile.lastName,
+ username: userProfile.userId,
+ email: userProfile.email,
+ role: isAdmin ? "ADMIN" : "MEMBER",
+ editable: editable
+ };
+ })
+ );
},
membersCount() {
return this.members.length;