Browse Source

suggest new user going to the front page

Trent Larson 1 month ago
parent
commit
51149ebb04
  1. 2
      src/components/InviteDialog.vue
  2. 21
      src/views/ContactsView.vue
  3. 25
      src/views/InviteOneView.vue
  4. 2
      test-playwright/00-noid-tests.spec.ts

2
src/components/InviteDialog.vue

@ -58,7 +58,7 @@ export default class InviteDialog extends Vue {
inviteIdentifier = "";
text = "";
visible = false;
expiresAt = new Date(Date.now() + 1000 * 60 * 60 * 24 * 30 * 3)
expiresAt = new Date(Date.now() + 1000 * 60 * 60 * 24 * 7)
.toISOString()
.substring(0, 10);

21
src/views/ContactsView.vue

@ -454,21 +454,25 @@ export default class ContactsView extends Vue {
decodeEndorserJwt(importedInviteJwt).payload;
const registration = payload as VerifiableCredential;
(this.$refs.contactNameDialog as ContactNameDialog).open(
"Contact Name",
"Who Invited You?",
"",
(name) => {
// not doing await on purpose, so that they always see the onboarding
this.addContact({
did: registration.vc.credentialSubject.agent.identifier,
name: name,
registered: true,
});
this.showOnboardingInfo();
},
() => {
// not doing await on purpose, so that they always see the onboarding
this.addContact({
did: registration.vc.credentialSubject.agent.identifier,
name: "(person who invited you)",
registered: true,
});
this.showOnboardingInfo();
},
);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@ -513,6 +517,21 @@ export default class ContactsView extends Vue {
);
}
private showOnboardingInfo() {
this.$notify(
{
group: "modal",
type: "confirm",
title: "They're Added To Your List",
text: "Would you like to go to the main page now?",
onYes: async () => {
(this.$router as Router).push({ name: "home" });
},
},
-1,
);
}
private filteredContacts() {
return this.showGiveNumbers
? this.contactsSelected.length === 0

25
src/views/InviteOneView.vue

@ -46,7 +46,10 @@
>
<td>
<span
v-if="!invite.redeemedAt"
v-if="
!invite.redeemedAt &&
invite.expiresAt > new Date().toISOString()
"
@click="
copyInviteAndNotify(invite.inviteIdentifier, invite.jwt)
"
@ -57,7 +60,13 @@
</span>
<span
v-else
@click="showInvite(invite.inviteIdentifier)"
@click="
showInvite(
invite.inviteIdentifier,
!!invite.redeemedAt,
invite.expiresAt < new Date().toISOString(),
)
"
class="text-center text-slate-500 cursor-pointer"
:title="inviteLink(invite.jwt)"
>
@ -201,20 +210,26 @@ export default class InviteOneView extends Vue {
);
}
showInvite(inviteId: string) {
showInvite(inviteId: string, redeemed: boolean, expired: boolean) {
let message = `Your clipboard now contains the invite ID ${inviteId}`;
if (redeemed) {
message += " (This invite has been used.)";
} else if (expired) {
message += " (This invite has expired.)";
}
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}`,
text: message,
},
5000,
);
}
lookForErrorAndNotify(error, title, defaultMessage) {
lookForErrorAndNotify(error, title: string, defaultMessage: string) {
console.error(title, "-", error);
let message = defaultMessage;
if (error.response && error.response.data && error.response.data.error) {

2
test-playwright/00-noid-tests.spec.ts

@ -1,7 +1,7 @@
import { test, expect } from '@playwright/test';
import { deleteContact, generateAndRegisterEthrUser, importUser } from './testUtils';
test('Check activity feed', async ({ page }) => {
test('Check activity feed - check that server is running', async ({ page }) => {
// Load app homepage
await page.goto('./');
await page.getByTestId('closeOnboardingAndFinish').click();

Loading…
Cancel
Save