Skip to content

Commit

Permalink
#1119 | If a memberSubjectType individual is voided, but its membersh…
Browse files Browse the repository at this point in the history
…ip isn't, hide it from the membership list of all its groupSubjects
  • Loading branch information
himeshr committed Oct 17, 2023
1 parent 613237f commit af2d97f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,13 @@ class SubjectDashboardProfileTab extends AbstractComponent {
label: 'remove',
fn: (groupSubject) => this.onMemberRemove(groupSubject)
});
const nonVoidedMembersGroupSubjects = _.filter(groupSubjects, (groupSubject) => !groupSubject.memberSubject.voided);
return (
<View style={styles.container}>
<TouchableOpacity
onPress={() => this.dispatchAction(Actions.ON_TOGGLE, {keyName: 'expandMembers'})}>
<ObservationsSectionTitle contextActions={this.addMemberActions()}
title={`${this.I18n.t('members')} (${groupSubjects.length})`}
title={`${this.I18n.t('members')} (${nonVoidedMembersGroupSubjects.length})`}
titleStyle={Styles.cardTitle}/>
<View style={{right: 2, position: 'absolute', alignSelf: 'center'}}>
{this.state.expandMembers === false ?
Expand All @@ -201,9 +202,9 @@ class SubjectDashboardProfileTab extends AbstractComponent {
</View>
</TouchableOpacity>
<View style={{marginTop: 3}}>
{this.state.expandMembers === true && groupSubjects.length > 0 ?
{this.state.expandMembers === true && nonVoidedMembersGroupSubjects.length > 0 ?
<View style={styles.memberCard}>
<Members groupSubjects={groupSubjects}
<Members groupSubjects={nonVoidedMembersGroupSubjects}
onMemberSelection={(memberSubjectUUID) => this.onSubjectSelection(memberSubjectUUID)}
actions={applicableActions}
editAllowed={editAllowed}
Expand Down

0 comments on commit af2d97f

Please sign in to comment.