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/07/13 00:18:10 UTC
[airavata-django-portal] 05/07: AIRAVATA-2835 Hide Admins/Read Only
Admins groups
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
commit f76496916464702e8f5092e8c7bc352f650d4f71
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Thu Jul 12 18:29:21 2018 -0400
AIRAVATA-2835 Hide Admins/Read Only Admins groups
---
.../static/common/js/components/ShareButton.vue | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/django_airavata/static/common/js/components/ShareButton.vue b/django_airavata/static/common/js/components/ShareButton.vue
index b92d2d2..fbb4097 100644
--- a/django_airavata/static/common/js/components/ShareButton.vue
+++ b/django_airavata/static/common/js/components/ShareButton.vue
@@ -41,7 +41,7 @@
<a href="#" @click.prevent="removeUser(data.item.user)"><span class="fa fa-trash"></span></a>
</template>
</b-table>
- <b-table v-if="groupsCount > 0" id="modal-group-table" hover :items="sharedEntity.groupPermissions" :fields="groupFields">
+ <b-table v-if="groupsCount > 0" id="modal-group-table" hover :items="filteredGroupPermissions" :fields="groupFields">
<template slot="name" slot-scope="data">
{{data.item.group.name}}
</template>
@@ -104,13 +104,16 @@ export default {
? this.sharedEntity.userPermissions.map(userPerm => userPerm.user.firstName + " " + userPerm.user.lastName)
: null;
},
- groupNames: function() {
+ filteredGroupPermissions: function() {
return this.sharedEntity && this.sharedEntity.groupPermissions
- ? this.sharedEntity.groupPermissions.map(groupPerm => groupPerm.group.name)
- : null;
+ ? this.sharedEntity.groupPermissions.filter(grp => !grp.group.isGatewayAdminsGroup && !grp.group.isReadOnlyGatewayAdminsGroup)
+ : [];
+ },
+ groupNames: function() {
+ return this.filteredGroupPermissions.map(groupPerm => groupPerm.group.name);
},
groupsCount: function() {
- return this.sharedEntity && this.sharedEntity.groupPermissions ? this.sharedEntity.groupPermissions.length: 0;
+ return this.filteredGroupPermissions.length;
},
totalCount: function() {
return this.usersCount + this.groupsCount;
@@ -126,9 +129,11 @@ export default {
},
groupSuggestions: function() {
// filter out already selected groups
- const currentGroupIds = this.sharedEntity.groupPermissions ? this.sharedEntity.groupPermissions.map(groupPerm => groupPerm.group.id) : [];
+ const currentGroupIds = this.filteredGroupPermissions.map(groupPerm => groupPerm.group.id);
return this.groups
- .filter(group => currentGroupIds.indexOf(group.id) < 0)
+ .filter(group => currentGroupIds.indexOf(group.id) < 0
+ && !group.isGatewayAdminsGroup
+ && !group.isReadOnlyGatewayAdminsGroup)
.map(group => {
return {
id: group.id,