From 1fc7e4726dcc40c7a406aa9a40a71d2e82dbe841 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 18 Jan 2026 20:03:54 -0700 Subject: [PATCH] do the same for the recipient: allow editing on the details page --- src/views/GiftedDetailsView.vue | 147 +++++++++++++++++++------------- 1 file changed, 90 insertions(+), 57 deletions(-) diff --git a/src/views/GiftedDetailsView.vue b/src/views/GiftedDetailsView.vue index 6bc28db5..b8389308 100644 --- a/src/views/GiftedDetailsView.vue +++ b/src/views/GiftedDetailsView.vue @@ -160,57 +160,46 @@
-
- - - - + +
+
+ + Change + +
-
- - - - +
+
@@ -335,6 +324,7 @@ export default class GiftedDetails extends Vue { recipientName = ""; showGeneralAdvanced = false; showGiverSelection = false; + showRecipientSelection = false; unitCode = "HUR"; libsUtil = libsUtil; @@ -743,12 +733,12 @@ export default class GiftedDetails extends Vue { this.axios, this.apiServer, this.activeDid, - giverDid, - recipientDid, + this.giverDid, + this.recipientDid, this.description, parseFloat(this.amountInput), this.unitCode, - fulfillsProjectId, + this.fulfillsProjectId, this.offerId, false, this.imageUrl, @@ -887,7 +877,6 @@ export default class GiftedDetails extends Vue { const contact = entity.data as Contact; this.giverDid = contact.did; this.giverName = contact.name || ""; - this.providedByGiver = true; this.providerProjectId = ""; } else if (entity.type === "project") { const project = entity.data as PlanData; @@ -895,21 +884,65 @@ export default class GiftedDetails extends Vue { this.providerProjectName = project.name ? `the project "${project.name}"` : "a project"; - this.providedByGiver = false; this.giverDid = ""; } this.showGiverSelection = false; } + /** + * Open recipient selection interface + */ + openRecipientSelection() { + this.showRecipientSelection = true; + } + + /** + * Close recipient selection interface + */ + closeRecipientSelection() { + this.showRecipientSelection = false; + } + + /** + * Handle recipient entity selection + */ + handleRecipientEntitySelected(entity: { + type: "person" | "project"; + data: Contact | PlanData; + stepType: "giver" | "recipient"; + }) { + if (entity.type === "person") { + const contact = entity.data as Contact; + this.recipientDid = contact.did; + this.recipientName = contact.name || ""; + this.fulfillsProjectId = ""; + } else if (entity.type === "project") { + const project = entity.data as PlanData; + this.fulfillsProjectId = project.handleId || ""; + this.fulfillsProjectName = project.name + ? `the project "${project.name}"` + : "a project"; + this.recipientDid = ""; + } + this.showRecipientSelection = false; + } + /** * Check if selecting an entity would create a conflict */ wouldCreateConflict(identifier: string): boolean { - // Check if it would conflict with recipient - if (this.givenToRecipient && this.recipientDid === identifier) { + // Check if it would conflict with giver + if (this.giverDid === identifier) { return true; } - if (this.givenToProject && this.fulfillsProjectId === identifier) { + if (this.providerProjectId === identifier) { + return true; + } + // Check if it would conflict with recipient + if (this.recipientDid === identifier) { + return true; + } + if (this.fulfillsProjectId === identifier) { return true; } return false;