Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2241 - Bug-fix in invited-by tooltip #2295

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/views/containers/dashboard/GroupMembers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
i18n.pill.is-neutral(v-if='invitedBy' data-test='pillPending') pending
i18n.pill.is-primary(v-else-if='isNew' data-test='pillNew') new

group-members-tooltip-pending.c-menu(v-if='invitedBy' :contractID='contractID')
group-members-tooltip-pending.c-menu(v-if='invitedBy' :contractID='contractID' :data='invitedBy')

i18n.link(
tag='button'
Expand Down
17 changes: 12 additions & 5 deletions frontend/views/containers/dashboard/GroupMembersTooltipPending.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
span.button.is-icon-small(data-test='pendingTooltip')
i.icon-question-circle
template(slot='tooltip')
p {{tooltipText }}
p {{ tooltipText }}
</template>

<script>
Expand All @@ -17,17 +17,24 @@ export default ({
Tooltip
},
props: {
contractID: String
contractID: String,
data: Object
},
methods: {
getDisplayName (memberID) {
const profile = this.globalProfile(memberID)
return profile?.displayName || profile?.username || memberID
}
},
computed: {
...mapGetters([
'ourIdentityContractId',
'groupMembersPending'
'globalProfile'
]),
tooltipText () {
const invitedBy = (this.groupMembersPending[this.username] || {}).invitedBy
const invitedBy = this.getDisplayName(this.data?.invitedBy)

return this.contractID === this.ourIdentityContractId
return this.ourIdentityContractId === this.data?.invitedBy
Comment on lines -28 to +37
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing logic here is apparently based on the legacy logic, causing the bug. So needs to be updated accordingly.

? L('This member did not use their invite link to join the group yet. This link should be given to them by {invitedBy} (you).', { invitedBy })
: L('This member did not use their invite link to join the group yet. This link should be given to them by {invitedBy}.', { invitedBy })
}
Expand Down