|
@ -42,22 +42,35 @@ |
|
|
<tr |
|
|
<tr |
|
|
v-for="invite in invites" |
|
|
v-for="invite in invites" |
|
|
:key="invite.inviteIdentifier" |
|
|
:key="invite.inviteIdentifier" |
|
|
class="border-t" |
|
|
class="border-t py-2" |
|
|
> |
|
|
> |
|
|
<td |
|
|
<td> |
|
|
class="py-2 text-center text-blue-500 cursor-pointer" |
|
|
<span |
|
|
@click="copyInviteAndNotify(invite.inviteIdentifier, invite.jwt)" |
|
|
v-if="!invite.redeemedAt" |
|
|
title="{{ inviteLink(invite.jwt) }}" |
|
|
@click=" |
|
|
|
|
|
copyInviteAndNotify(invite.inviteIdentifier, invite.jwt) |
|
|
|
|
|
" |
|
|
|
|
|
class="text-center text-blue-500 cursor-pointer" |
|
|
|
|
|
:title="inviteLink(invite.jwt)" |
|
|
|
|
|
> |
|
|
|
|
|
{{ getTruncatedInviteId(invite.inviteIdentifier) }} |
|
|
|
|
|
</span> |
|
|
|
|
|
<span |
|
|
|
|
|
v-else |
|
|
|
|
|
@click="showInvite(invite.inviteIdentifier)" |
|
|
|
|
|
class="text-center text-slate-500 cursor-pointer" |
|
|
|
|
|
:title="inviteLink(invite.jwt)" |
|
|
> |
|
|
> |
|
|
{{ getTruncatedInviteId(invite.inviteIdentifier) }} |
|
|
{{ getTruncatedInviteId(invite.inviteIdentifier) }} |
|
|
|
|
|
</span> |
|
|
</td> |
|
|
</td> |
|
|
<td class="py-2 text-left" :data-testId="inviteLink(invite.jwt)"> |
|
|
<td class="text-left" :data-testId="inviteLink(invite.jwt)"> |
|
|
{{ invite.notes }} |
|
|
{{ invite.notes }} |
|
|
</td> |
|
|
</td> |
|
|
<td class="py-2 text-center"> |
|
|
<td class="text-center"> |
|
|
{{ invite.expiresAt.substring(0, 10) }} |
|
|
{{ invite.expiresAt.substring(0, 10) }} |
|
|
</td> |
|
|
</td> |
|
|
<td class="py-2 text-center"> |
|
|
<td class="text-center"> |
|
|
{{ invite.redeemedAt?.substring(0, 10) }} |
|
|
{{ invite.redeemedAt?.substring(0, 10) }} |
|
|
<br /> |
|
|
<br /> |
|
|
{{ getTruncatedRedeemedBy(invite.redeemedBy) }} |
|
|
{{ getTruncatedRedeemedBy(invite.redeemedBy) }} |
|
@ -159,7 +172,7 @@ export default class InviteOneView extends Vue { |
|
|
|
|
|
|
|
|
getTruncatedInviteId(inviteId: string): string { |
|
|
getTruncatedInviteId(inviteId: string): string { |
|
|
if (inviteId.length <= 9) return inviteId; |
|
|
if (inviteId.length <= 9) return inviteId; |
|
|
return `${inviteId.slice(0, 3)}...${inviteId.slice(-3)}`; |
|
|
return `${inviteId.slice(0, 6)}...`; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
getTruncatedRedeemedBy(redeemedBy: string | null): string { |
|
|
getTruncatedRedeemedBy(redeemedBy: string | null): string { |
|
@ -174,6 +187,7 @@ export default class InviteOneView extends Vue { |
|
|
inviteLink(jwt: string): string { |
|
|
inviteLink(jwt: string): string { |
|
|
return APP_SERVER + "/contacts?inviteJwt=" + jwt; |
|
|
return APP_SERVER + "/contacts?inviteJwt=" + jwt; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
copyInviteAndNotify(inviteId: string, jwt: string) { |
|
|
copyInviteAndNotify(inviteId: string, jwt: string) { |
|
|
useClipboard().copy(this.inviteLink(jwt)); |
|
|
useClipboard().copy(this.inviteLink(jwt)); |
|
|
this.$notify( |
|
|
this.$notify( |
|
@ -187,6 +201,19 @@ export default class InviteOneView extends Vue { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
showInvite(inviteId: string) { |
|
|
|
|
|
useClipboard().copy(inviteId); |
|
|
|
|
|
this.$notify( |
|
|
|
|
|
{ |
|
|
|
|
|
group: "alert", |
|
|
|
|
|
type: "success", |
|
|
|
|
|
title: "Copied", |
|
|
|
|
|
text: `The link has been used, but your clipboard now contains the invite ID ${inviteId}`, |
|
|
|
|
|
}, |
|
|
|
|
|
5000, |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
lookForErrorAndNotify(error, title, defaultMessage) { |
|
|
lookForErrorAndNotify(error, title, defaultMessage) { |
|
|
console.error(title, "-", error); |
|
|
console.error(title, "-", error); |
|
|
let message = defaultMessage; |
|
|
let message = defaultMessage; |
|
@ -258,7 +285,10 @@ export default class InviteOneView extends Vue { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
addNewContact(did) { |
|
|
addNewContact(did) { |
|
|
(this.$refs.contactNameDialog as ContactNameDialog).open((name) => { |
|
|
(this.$refs.contactNameDialog as ContactNameDialog).open( |
|
|
|
|
|
"Who Sent You The Invite?", |
|
|
|
|
|
"Their name will be added to your contact list.", |
|
|
|
|
|
(name) => { |
|
|
// the person obviously registered themselves and this user already granted visibility, so we just add them |
|
|
// the person obviously registered themselves and this user already granted visibility, so we just add them |
|
|
const contact = { |
|
|
const contact = { |
|
|
did: did, |
|
|
did: did, |
|
@ -276,7 +306,8 @@ export default class InviteOneView extends Vue { |
|
|
}, |
|
|
}, |
|
|
3000, |
|
|
3000, |
|
|
); |
|
|
); |
|
|
}); |
|
|
}, |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
deleteInvite(inviteId: string, notes: string) { |
|
|
deleteInvite(inviteId: string, notes: string) { |
|
|