diff --git a/src/components/GiftedDialog.vue b/src/components/GiftedDialog.vue index 4f44bb8d..bfc0f095 100644 --- a/src/components/GiftedDialog.vue +++ b/src/components/GiftedDialog.vue @@ -1,464 +1,51 @@ @@ -482,12 +69,16 @@ import { logger } from "../utils/logger"; import { PlatformServiceFactory } from "@/services/PlatformServiceFactory"; import EntityIcon from "../components/EntityIcon.vue"; import ProjectIcon from "../components/ProjectIcon.vue"; +import EntitySelectionStep from "../components/EntitySelectionStep.vue"; +import GiftDetailsStep from "../components/GiftDetailsStep.vue"; import { PlanData } from "../interfaces/records"; @Component({ components: { EntityIcon, ProjectIcon, + EntitySelectionStep, + GiftDetailsStep, }, }) export default class GiftedDialog extends Vue { @@ -1031,6 +622,45 @@ export default class GiftedDialog extends Vue { unitCode: this.unitCode, }; } + + // New event handlers for component integration + + /** + * Handle entity selection from EntitySelectionStep + * @param entity - The selected entity (person or project) + */ + handleEntitySelected(entity: { type: 'person' | 'project', data: Contact | PlanData }) { + if (entity.type === 'person') { + const contact = entity.data as Contact; + if (this.stepType === 'giver') { + this.selectGiver(contact); + } else { + this.selectRecipient(contact); + } + } else { + const project = entity.data as PlanData; + if (this.stepType === 'giver') { + this.selectProject(project); + } else { + this.selectRecipientProject(project); + } + } + } + + /** + * Handle edit entity request from GiftDetailsStep + * @param entityType - 'giver' or 'recipient' + */ + handleEditEntity(entityType: 'giver' | 'recipient') { + this.goBackToStep1(entityType); + } + + /** + * Handle form submission from GiftDetailsStep + */ + handleSubmit() { + this.confirm(); + } } diff --git a/src/components/ProjectCard.vue b/src/components/ProjectCard.vue index cef10d3a..21812b95 100644 --- a/src/components/ProjectCard.vue +++ b/src/components/ProjectCard.vue @@ -34,9 +34,9 @@