summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/members
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-28 18:09:27 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-28 18:09:27 +0000
commite1b9b92a49eea88ea7c3b101aec0315e64e94678 (patch)
treefadb5aa290045f6b345ad51b4752515d5a126dd7 /app/assets/javascripts/members
parentc6ee7ef0f577e0155740d022babdc1b2b0e28d87 (diff)
downloadgitlab-ce-e1b9b92a49eea88ea7c3b101aec0315e64e94678.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/members')
-rw-r--r--app/assets/javascripts/members/components/table/members_table.vue6
-rw-r--r--app/assets/javascripts/members/components/table/members_table_cell.vue8
-rw-r--r--app/assets/javascripts/members/utils.js14
3 files changed, 13 insertions, 15 deletions
diff --git a/app/assets/javascripts/members/components/table/members_table.vue b/app/assets/javascripts/members/components/table/members_table.vue
index 82728a27b8f..2a27b0358a0 100644
--- a/app/assets/javascripts/members/components/table/members_table.vue
+++ b/app/assets/javascripts/members/components/table/members_table.vue
@@ -32,7 +32,7 @@ export default {
import('ee_component/members/components/ldap/ldap_override_confirmation_modal.vue'),
},
computed: {
- ...mapState(['members', 'tableFields', 'tableAttrs', 'currentUserId', 'sourceId']),
+ ...mapState(['members', 'tableFields', 'tableAttrs', 'currentUserId']),
filteredFields() {
return FIELDS.filter(
(field) => this.tableFields.includes(field.key) && this.showField(field),
@@ -55,9 +55,9 @@ export default {
methods: {
hasActionButtons(member) {
return (
- canRemove(member, this.sourceId) ||
+ canRemove(member) ||
canResend(member) ||
- canUpdate(member, this.currentUserId, this.sourceId) ||
+ canUpdate(member, this.currentUserId) ||
canOverride(member)
);
},
diff --git a/app/assets/javascripts/members/components/table/members_table_cell.vue b/app/assets/javascripts/members/components/table/members_table_cell.vue
index 20aa01b96bc..1f537740f94 100644
--- a/app/assets/javascripts/members/components/table/members_table_cell.vue
+++ b/app/assets/javascripts/members/components/table/members_table_cell.vue
@@ -19,7 +19,7 @@ export default {
},
},
computed: {
- ...mapState(['sourceId', 'currentUserId']),
+ ...mapState(['currentUserId']),
isGroup() {
return isGroup(this.member);
},
@@ -41,19 +41,19 @@ export default {
return MEMBER_TYPES.user;
},
isDirectMember() {
- return isDirectMember(this.member, this.sourceId);
+ return isDirectMember(this.member);
},
isCurrentUser() {
return isCurrentUser(this.member, this.currentUserId);
},
canRemove() {
- return canRemove(this.member, this.sourceId);
+ return canRemove(this.member);
},
canResend() {
return canResend(this.member);
},
canUpdate() {
- return canUpdate(this.member, this.currentUserId, this.sourceId);
+ return canUpdate(this.member, this.currentUserId);
},
},
render() {
diff --git a/app/assets/javascripts/members/utils.js b/app/assets/javascripts/members/utils.js
index 723b371ccb0..bac83533214 100644
--- a/app/assets/javascripts/members/utils.js
+++ b/app/assets/javascripts/members/utils.js
@@ -35,26 +35,24 @@ export const isGroup = (member) => {
return Boolean(member.sharedWithGroup);
};
-export const isDirectMember = (member, sourceId) => {
- return isGroup(member) || member.source?.id === sourceId;
+export const isDirectMember = (member) => {
+ return isGroup(member) || member.isDirectMember;
};
export const isCurrentUser = (member, currentUserId) => {
return member.user?.id === currentUserId;
};
-export const canRemove = (member, sourceId) => {
- return isDirectMember(member, sourceId) && member.canRemove;
+export const canRemove = (member) => {
+ return isDirectMember(member) && member.canRemove;
};
export const canResend = (member) => {
return Boolean(member.invite?.canResend);
};
-export const canUpdate = (member, currentUserId, sourceId) => {
- return (
- !isCurrentUser(member, currentUserId) && isDirectMember(member, sourceId) && member.canUpdate
- );
+export const canUpdate = (member, currentUserId) => {
+ return !isCurrentUser(member, currentUserId) && isDirectMember(member) && member.canUpdate;
};
export const parseSortParam = (sortableFields) => {