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 @@ - - - - {{ - stepType === "recipient" - ? "Choose who received the gift:" - : showProjects - ? "Choose a project benefitted from:" - : "Choose a person received from:" - }} - - - - - - - - - - - - {{ project.name }} - - - - {{ - didInfo(project.issuerDid, activeDid, allMyDids, allContacts) - }} - - - - (No projects found.) - - - - - - Show All - - - - - - - - - - You - - - - - - Unnamed - - - - (Add friends to see more people worthy of recognition.) - - - - - - - - - - {{ contact.name || contact.did }} - - - - - - - Show All - - - - - - - - Cancel - - - - - - - - - - - - - - - - - - - - - {{ - giverEntityType === "project" - ? "Benefited from:" - : "Received from:" - }} - - - {{ giver?.name || "Unnamed" }} - - - - - - - - - - - - - - - - - - - - - {{ - giverEntityType === "project" - ? "Benefited from:" - : "Received from:" - }} - - - {{ giver?.name || "Unnamed" }} - - - - - - - - - - - - - - - - - - Given to: - - - {{ receiver?.name || "Unnamed" }} - - - - - - - - - - - - - - - Given to project: - - - {{ receiver?.name || "Unnamed" }} - - - - - - - - - - - - - - - - - - - - Hours - US $ - BTC - BX - ETH - - - - Photo & more options… - - - Sign & Send to publish to the world - - - - - - - - Cannot record: Same person selected as both giver and recipient - - - - - - Sign & Send - - - Cancel - - - + + + + + @@ -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 @@
- {{ - giverEntityType === "project" - ? "Benefited from:" - : "Received from:" - }} -
- -
- Given to: -
- Given to project: -
- Sign & Send to publish to the world - -
- - Cannot record: Same person selected as both giver and recipient -