Complete OnboardingDialog.vue Enhanced Triple Migration Pattern (3.5 minutes)

• Database Migration: Replace databaseUtil with PlatformServiceMixin methods
• SQL Abstraction: Replace raw SQL with $getAllContacts() and $accountSettings()
• Template Streamlining: Add 5 computed properties for consistent styling
• Vue Syntax Fix: Correct vue-facing-decorator mixin and computed property syntax

Migration Details:
- Removed: databaseUtil imports and PlatformServiceFactory usage
- Added: PlatformServiceMixin with $accountSettings(), $getAllContacts(), $updateSettings()
- Created: 5 computed properties (primaryButtonClasses, secondaryButtonClasses, etc.)
- Fixed: Proper @Component mixin declaration and class getter syntax
- Quality: Zero linting errors, full TypeScript compliance

Component provides 3-page onboarding flow (Home, Discover, Create) with
dynamic content based on user registration and contact status.
Ready for human testing across all platforms.
This commit is contained in:
Matthew Raymer
2025-07-08 02:32:15 +00:00
parent 071a3c59ce
commit 7d0486a4cf
6 changed files with 343 additions and 112 deletions

View File

@@ -141,10 +141,10 @@ import TopMessage from "../components/TopMessage.vue";
import { NotificationIface } from "../constants/app";
import { PlatformServiceMixin } from "../utils/PlatformServiceMixin";
import { createNotifyHelpers, TIMEOUTS } from "../utils/notify";
import {
import {
NOTIFY_CONTACT_NOT_FOUND,
NOTIFY_CONTACT_METHODS_UPDATED,
NOTIFY_CONTACT_SAVED
NOTIFY_CONTACT_SAVED,
} from "../constants/notifications";
import { Contact, ContactMethod } from "../db/tables/contacts";
import { AppString } from "../constants/app";
@@ -231,17 +231,20 @@ export default class ContactEditView extends Vue {
*/
async created() {
this.notify = createNotifyHelpers(this.$notify);
const contactDid = this.$route.params.did as string;
const contact = await this.$getContact(contactDid);
if (contact) {
this.contact = contact;
this.contactName = contact.name || "";
this.contactNotes = contact.notes || "";
this.contactMethods = contact.contactMethods || [];
} else {
this.notify.error(`${NOTIFY_CONTACT_NOT_FOUND.message} ${contactDid}`, TIMEOUTS.LONG);
this.notify.error(
`${NOTIFY_CONTACT_NOT_FOUND.message} ${contactDid}`,
TIMEOUTS.LONG,
);
(this.$router as Router).push({ path: "/contacts" });
return;
}
@@ -320,20 +323,17 @@ export default class ContactEditView extends Vue {
this.contactMethods = contactMethods;
this.notify.warning(
NOTIFY_CONTACT_METHODS_UPDATED.message,
TIMEOUTS.LONG
TIMEOUTS.LONG,
);
return;
}
// Save to database via PlatformServiceMixin
await this.$updateContact(
this.contact?.did || "",
{
name: this.contactName,
notes: this.contactNotes,
contactMethods: contactMethods
}
);
await this.$updateContact(this.contact?.did || "", {
name: this.contactName,
notes: this.contactNotes,
contactMethods: contactMethods,
});
// Notify success and redirect
this.notify.success(NOTIFY_CONTACT_SAVED.message, TIMEOUTS.STANDARD);