forked from jsnbuchanan/crowd-funder-for-time-pwa
(chore): merge mostly pathway changes
This commit is contained in:
@@ -23,27 +23,50 @@
|
||||
|
||||
<!-- New Contact -->
|
||||
<div id="formAddNewContact" class="mt-4 mb-4 flex items-stretch">
|
||||
<router-link
|
||||
v-if="isRegistered"
|
||||
:to="{ name: 'invite-one' }"
|
||||
class="flex items-center bg-gradient-to-b from-green-400 to-green-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 mr-1 rounded-md"
|
||||
>
|
||||
<fa icon="envelope-open-text" class="fa-fw text-2xl" />
|
||||
</router-link>
|
||||
<span
|
||||
v-else
|
||||
class="flex items-center bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 mr-1 rounded-md"
|
||||
>
|
||||
<fa
|
||||
icon="envelope-open-text"
|
||||
class="fa-fw text-2xl"
|
||||
@click="
|
||||
danger(
|
||||
'You must get registered before you can invite others.',
|
||||
'Not Registered',
|
||||
)
|
||||
"
|
||||
/>
|
||||
<span class="flex" v-if="isRegistered">
|
||||
<router-link
|
||||
:to="{ name: 'invite-one' }"
|
||||
class="flex items-center bg-gradient-to-b from-green-400 to-green-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 mr-1 rounded-md"
|
||||
>
|
||||
<fa icon="envelope-open-text" class="fa-fw text-2xl" />
|
||||
</router-link>
|
||||
|
||||
<button
|
||||
@click="showOnboardMeetingDialog()"
|
||||
class="flex items-center bg-gradient-to-b from-green-400 to-green-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 mr-1 rounded-md"
|
||||
>
|
||||
<fa icon="chair" class="fa-fw text-2xl" />
|
||||
</button>
|
||||
</span>
|
||||
<span v-else class="flex">
|
||||
<span
|
||||
class="flex items-center bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 mr-1 rounded-md"
|
||||
>
|
||||
<fa
|
||||
icon="envelope-open-text"
|
||||
class="fa-fw text-2xl"
|
||||
@click="
|
||||
warning(
|
||||
'You must get registered before you can create invites.',
|
||||
'Not Registered',
|
||||
)
|
||||
"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
class="flex items-center bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 mr-1 rounded-md"
|
||||
>
|
||||
<fa
|
||||
icon="chair"
|
||||
class="fa-fw text-2xl"
|
||||
@click="
|
||||
warning(
|
||||
'You must get registered before you can initiate an onboarding meeting.',
|
||||
'Not Registered',
|
||||
)
|
||||
"
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<router-link
|
||||
@@ -196,7 +219,7 @@
|
||||
</router-link>
|
||||
|
||||
<span class="ml-4 text-sm overflow-hidden">{{
|
||||
shortDid(contact.did)
|
||||
libsUtil.shortDid(contact.did)
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="ml-4 text-sm">
|
||||
@@ -587,6 +610,18 @@ export default class ContactsView extends Vue {
|
||||
);
|
||||
}
|
||||
|
||||
private warning(message: string, title: string = "Error", timeout = 5000) {
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "warning",
|
||||
title: title,
|
||||
text: message,
|
||||
},
|
||||
timeout,
|
||||
);
|
||||
}
|
||||
|
||||
private showOnboardingInfo() {
|
||||
this.$notify(
|
||||
{
|
||||
@@ -1338,21 +1373,6 @@ export default class ContactsView extends Vue {
|
||||
});
|
||||
}
|
||||
|
||||
private shortDid(did: string) {
|
||||
if (did.startsWith("did:peer:")) {
|
||||
return (
|
||||
did.substring(0, "did:peer:".length + 2) +
|
||||
"..." +
|
||||
did.substring("did:peer:".length + 18, "did:peer:".length + 25) +
|
||||
"..."
|
||||
);
|
||||
} else if (did.startsWith("did:ethr:")) {
|
||||
return did.substring(0, "did:ethr:".length + 9) + "...";
|
||||
} else {
|
||||
return did.substring(0, did.indexOf(":", 4) + 7) + "...";
|
||||
}
|
||||
}
|
||||
|
||||
private showCopySelectionsInfo() {
|
||||
this.$notify(
|
||||
{
|
||||
@@ -1364,5 +1384,57 @@ export default class ContactsView extends Vue {
|
||||
5000,
|
||||
);
|
||||
}
|
||||
|
||||
private async showOnboardMeetingDialog() {
|
||||
try {
|
||||
// First check if they're in a meeting
|
||||
const headers = await getHeaders(this.activeDid);
|
||||
const memberResponse = await this.axios.get(
|
||||
this.apiServer + "/api/partner/groupOnboardMember",
|
||||
{ headers }
|
||||
);
|
||||
|
||||
if (memberResponse.data.data) {
|
||||
// They're in a meeting, check if they're the host
|
||||
const hostResponse = await this.axios.get(
|
||||
this.apiServer + "/api/partner/groupOnboard",
|
||||
{ headers }
|
||||
);
|
||||
|
||||
if (hostResponse.data.data) {
|
||||
// They're the host, take them to setup
|
||||
(this.$router as Router).push({ name: "onboard-meeting-setup" });
|
||||
} else {
|
||||
// They're not the host, take them to list
|
||||
(this.$router as Router).push({ name: "onboard-meeting-list" });
|
||||
}
|
||||
} else {
|
||||
// They're not in a meeting, show the dialog
|
||||
this.$notify(
|
||||
{
|
||||
group: "modal",
|
||||
type: "confirm",
|
||||
title: "Onboarding Meeting",
|
||||
text: "Would you like to start a new meeting?",
|
||||
onYes: () => {
|
||||
(this.$router as Router).push({ name: "onboard-meeting-setup" });
|
||||
},
|
||||
yesText: "Start New Meeting",
|
||||
onNo: () => {
|
||||
(this.$router as Router).push({ name: "onboard-meeting-list" });
|
||||
},
|
||||
noText: "Join Existing Meeting"
|
||||
},
|
||||
-1
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
logConsoleAndDb("Error checking meeting status:" + errorStringForLog(error));
|
||||
this.danger(
|
||||
"There was an error checking your meeting status.",
|
||||
"Meeting Error"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user