WIP: Add Create Meeting button for registered users with no meetings

- OnboardMeetingListView now shows Create Meeting button for registered users when meetings.length === 0
- Added createMeeting() method to route to meeting setup page
- Maintains "No meetings available" message for unregistered users
- Resolves Test User #0 import flow where chair icon should show Create Meeting option
- Fixed linter errors in databaseUtil.ts and ImportAccountView.vue
This commit is contained in:
Matthew Raymer
2025-07-08 06:18:11 +00:00
parent a81e912b9c
commit 49e57c3911
8 changed files with 520 additions and 107 deletions

View File

@@ -309,7 +309,6 @@ import {
NOTIFY_VISIBILITY_ERROR,
NOTIFY_UNCONFIRMED_HOURS_DYNAMIC,
NOTIFY_REGISTER_CONTACT,
NOTIFY_ONBOARDING_MEETING,
NOTIFY_CONTACT_NO_INFO,
NOTIFY_CONTACT_INVALID_URL,
NOTIFY_CONTACTS_ADDED_CSV,
@@ -323,7 +322,6 @@ import {
NOTIFY_CONTACT_IMPORT_CONSTRAINT,
NOTIFY_GIVES_LOAD_ERROR,
NOTIFY_CONTACT_SETTING_SAVE_ERROR,
NOTIFY_MEETING_STATUS_ERROR,
NOTIFY_CONTACTS_ADDED,
NOTIFY_CONTACT_INFO_COPY,
NOTIFY_CONTACTS_SELECT_TO_COPY,
@@ -1239,54 +1237,75 @@ export default class ContactsView extends Vue {
}
private async showOnboardMeetingDialog() {
console.log("🪑 DEBUG: showOnboardMeetingDialog() called");
console.log("🪑 DEBUG: activeDid =", this.activeDid);
console.log("🪑 DEBUG: apiServer =", this.apiServer);
console.log("🪑 DEBUG: isRegistered =", this.isRegistered);
if (!this.activeDid || !this.apiServer) {
console.log(
"🪑 DEBUG: Missing activeDid or apiServer, routing to meeting list",
);
this.$router.push({ name: "onboard-meeting-list" });
return;
}
try {
// First check if they're in a meeting
console.log("🪑 DEBUG: Checking if user is in a meeting as member...");
const headers = await getHeaders(this.activeDid);
console.log("🪑 DEBUG: Headers obtained:", headers);
const memberResponse = await this.axios.get(
this.apiServer + "/api/partner/groupOnboardMember",
{ headers },
);
console.log("🪑 DEBUG: Member response:", memberResponse.data);
if (memberResponse.data.data) {
// They're in a meeting, check if they're the host
if (memberResponse.data?.data?.groupId) {
console.log(
"🪑 DEBUG: User is in a meeting as member, checking if host...",
);
const hostResponse = await this.axios.get(
this.apiServer + "/api/partner/groupOnboard",
{ headers },
);
console.log("🪑 DEBUG: Host response:", hostResponse.data);
if (hostResponse.data.data) {
// They're the host, take them to setup
if (hostResponse.data?.data?.groupId) {
console.log("🪑 DEBUG: User is HOST, routing to setup");
this.$router.push({ name: "onboard-meeting-setup" });
} else {
// They're not the host, take them to list
this.$router.push({ name: "onboard-meeting-list" });
console.log("🪑 DEBUG: User is MEMBER, routing to members view");
this.$router.push({
name: "onboard-meeting-members",
params: { groupId: memberResponse.data.data.groupId },
});
}
} else {
// They're not in a meeting, show the dialog
this.$notify(
{
group: "modal",
type: "confirm",
title: NOTIFY_ONBOARDING_MEETING.title,
text: NOTIFY_ONBOARDING_MEETING.text,
onYes: async () => {
this.$router.push({ name: "onboard-meeting-setup" });
},
yesText: NOTIFY_ONBOARDING_MEETING.yesText,
onNo: async () => {
this.$router.push({ name: "onboard-meeting-list" });
},
noText: NOTIFY_ONBOARDING_MEETING.noText,
},
TIMEOUTS.MODAL,
console.log("🪑 DEBUG: User is NOT in a meeting, checking if host...");
const hostResponse = await this.axios.get(
this.apiServer + "/api/partner/groupOnboard",
{ headers },
);
console.log("🪑 DEBUG: Host response (no member):", hostResponse.data);
if (hostResponse.data?.data?.groupId) {
console.log(
"🪑 DEBUG: User is HOST with no member record, routing to setup",
);
this.$router.push({ name: "onboard-meeting-setup" });
} else {
console.log(
"🪑 DEBUG: User has NO meeting, routing to setup to CREATE",
);
this.$router.push({ name: "onboard-meeting-setup" });
}
}
} catch (error) {
this.$logAndConsole(
NOTIFY_MEETING_STATUS_ERROR.message + ": " + errorStringForLog(error),
true,
);
this.notify.error(NOTIFY_MEETING_STATUS_ERROR.message, TIMEOUTS.MODAL);
} catch (error: any) {
console.log("🪑 DEBUG: Error in API calls:", error);
console.log("🪑 DEBUG: Error response:", error.response?.data);
console.log("🪑 DEBUG: Routing to meeting list due to error");
this.$router.push({ name: "onboard-meeting-list" });
}
}