forked from jsnbuchanan/crowd-funder-for-time-pwa
Complete InviteOneView.vue Enhanced Triple Migration Pattern with human validation
- Database migration: databaseUtil → PlatformServiceMixin methods - SQL abstraction: Raw contact insertion → $insertContact() service method - Notification migration: 7 patterns → helper system + constants - Template streamlining: 5 computed properties + helper methods added - Human testing: Complete invitation lifecycle validated - Time: 9m 5s (50% faster than estimate) - Project: 43% complete (40/92 components migrated)
This commit is contained in:
@@ -655,3 +655,101 @@ export const NOTIFY_CONFIRMATION_RESTRICTION = {
|
||||
title: "Not Allowed",
|
||||
message: "Only the recipient can confirm final receipt.",
|
||||
};
|
||||
|
||||
// =================================================
|
||||
// INVITE MANAGEMENT NOTIFICATIONS
|
||||
// =================================================
|
||||
|
||||
/**
|
||||
* Invite Management Notifications
|
||||
* For InviteOneView.vue component
|
||||
*/
|
||||
export const NOTIFY_INVITE_LOAD_ERROR = {
|
||||
group: "alert",
|
||||
type: "danger",
|
||||
title: "Load Error",
|
||||
message: "Got an error loading your invites.",
|
||||
} as const;
|
||||
|
||||
export const NOTIFY_INVITE_LINK_COPIED = {
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: "Copied",
|
||||
message: "Your clipboard now contains the link for invite",
|
||||
} as const;
|
||||
|
||||
export const NOTIFY_INVITE_ID_COPIED = {
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: "Copied",
|
||||
message: "Your clipboard now contains the invite ID",
|
||||
} as const;
|
||||
|
||||
export const NOTIFY_CONTACT_ADDED = {
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: "Contact Added",
|
||||
message: "has been added to your contacts.",
|
||||
} as const;
|
||||
|
||||
export const NOTIFY_INVITE_DELETE_CONFIRM = {
|
||||
group: "modal",
|
||||
type: "confirm",
|
||||
title: "Delete Invite?",
|
||||
message: "Are you sure you want to erase the invite for",
|
||||
} as const;
|
||||
|
||||
export const NOTIFY_INVITE_DELETED = {
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: "Deleted",
|
||||
message: "Invite deleted.",
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Creates invite link copy notification message
|
||||
* @param inviteId - ID of the invitation
|
||||
* @returns Formatted notification message
|
||||
*/
|
||||
export function createInviteLinkCopyMessage(inviteId: string): string {
|
||||
return `${NOTIFY_INVITE_LINK_COPIED.message} ${inviteId}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates invite ID copy notification message with status
|
||||
* @param inviteId - ID of the invitation
|
||||
* @param redeemed - Whether invite has been redeemed
|
||||
* @param expired - Whether invite has expired
|
||||
* @returns Formatted notification message
|
||||
*/
|
||||
export function createInviteIdCopyMessage(
|
||||
inviteId: string,
|
||||
redeemed: boolean,
|
||||
expired: boolean,
|
||||
): string {
|
||||
let message = `${NOTIFY_INVITE_ID_COPIED.message} ${inviteId}`;
|
||||
if (redeemed) {
|
||||
message += " (This invite has been used.)";
|
||||
} else if (expired) {
|
||||
message += " (This invite has expired.)";
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates contact added notification message
|
||||
* @param contactName - Name of the contact added
|
||||
* @returns Formatted notification message
|
||||
*/
|
||||
export function createContactAddedMessage(contactName: string): string {
|
||||
return `${contactName} ${NOTIFY_CONTACT_ADDED.message}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates invite delete confirmation message
|
||||
* @param notes - Notes from the invite
|
||||
* @returns Formatted confirmation message
|
||||
*/
|
||||
export function createInviteDeleteConfirmMessage(notes: string): string {
|
||||
return `${NOTIFY_INVITE_DELETE_CONFIRM.message} "${notes}"? (There is no undo.)`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user