diff --git a/src/views/ClaimView.vue b/src/views/ClaimView.vue index f594dc9b..76b283f9 100644 --- a/src/views/ClaimView.vue +++ b/src/views/ClaimView.vue @@ -119,25 +119,17 @@ Fulfills a bigger plan... - -
+ +
Fulfills {{ capitalizeAndInsertSpacesBeforeCaps( - detailsForGive.fulfillsType, + offerFulfillment.offerType || "Offer", ) }}... @@ -556,6 +548,17 @@ export default class ClaimView extends Vue { fulfillsPlanHandleId?: string; fulfillsType?: string; fulfillsHandleId?: string; + fullClaim?: { + fulfills?: Array<{ + "@type": string; + identifier?: string; + }>; + }; + } | null = null; + // Additional offer information extracted from the fulfills array + offerFulfillment: { + offerHandleId?: string; + offerType?: string; } | null = null; detailsForOffer: { fulfillsPlanHandleId?: string } | null = null; // Project information for fulfillsPlanHandleId @@ -689,6 +692,7 @@ export default class ClaimView extends Vue { this.confsVisibleToIdList = []; this.detailsForGive = null; this.detailsForOffer = null; + this.offerFulfillment = null; this.projectInfo = null; this.fullClaim = null; this.fullClaimDump = ""; @@ -701,6 +705,33 @@ export default class ClaimView extends Vue { this.veriClaimDidsVisible = {}; } + /** + * Extract offer fulfillment information from the fulfills array + */ + extractOfferFulfillment() { + if (!this.detailsForGive?.fullClaim?.fulfills) { + this.offerFulfillment = null; + return; + } + + const fulfills = this.detailsForGive.fullClaim.fulfills; + if (!Array.isArray(fulfills)) { + this.offerFulfillment = null; + return; + } + + // Find the Offer in the fulfills array + const offerFulfill = fulfills.find((item) => item["@type"] === "Offer"); + if (offerFulfill) { + this.offerFulfillment = { + offerHandleId: offerFulfill.identifier, + offerType: offerFulfill["@type"], + }; + } else { + this.offerFulfillment = null; + } + } + // ================================================= // UTILITY METHODS // ================================================= @@ -821,6 +852,8 @@ export default class ClaimView extends Vue { }); if (giveResp.status === 200 && giveResp.data.data?.length > 0) { this.detailsForGive = giveResp.data.data[0]; + // Extract offer information from the fulfills array + this.extractOfferFulfillment(); } else { await this.$logError( "Error getting detailed give info: " + JSON.stringify(giveResp), diff --git a/src/views/ConfirmGiftView.vue b/src/views/ConfirmGiftView.vue index c2274dab..cf3f3a0c 100644 --- a/src/views/ConfirmGiftView.vue +++ b/src/views/ConfirmGiftView.vue @@ -113,26 +113,20 @@ />
- -
+ +
This fulfills {{ capitalizeAndInsertSpacesBeforeCapsWithAPrefix( - giveDetails?.fulfillsType || "", + offerFulfillment.offerType || "Offer", ) }} item["@type"] === "Offer"); + if (offerFulfill) { + this.offerFulfillment = { + offerHandleId: offerFulfill.identifier, + offerType: offerFulfill["@type"], + }; + } else { + this.offerFulfillment = null; + } + } + /** * Fetches confirmer information for the claim */