@ -119,25 +119,17 @@
Fulfills a bigger plan ...
Fulfills a bigger plan ...
< / r o u t e r - l i n k >
< / r o u t e r - l i n k >
< / div >
< / div >
<!-- if there 's another, it' s probably fulfilling an offer , too -- >
<!-- Show offer fulfillment if this give fulfills an offer -- >
< div
< div v-if ="offerFulfillment?.offerHandleId" >
v - if = "
detailsForGive ? . fulfillsType &&
detailsForGive ? . fulfillsType !== 'PlanAction' &&
detailsForGive ? . fulfillsHandleId
"
>
<!-- router - link to / claim / only changes URL path -- >
<!-- router - link to / claim / only changes URL path -- >
< a
< a
class = "text-blue-500 mt-4 cursor-pointer"
class = "text-blue-500 mt-4 cursor-pointer"
@ click = "
@ click = "showDifferentClaimPage(offerFulfillment.offerHandleId)"
showDifferentClaimPage ( detailsForGive ? . fulfillsHandleId )
"
>
>
Fulfills
Fulfills
{ {
{ {
capitalizeAndInsertSpacesBeforeCaps (
capitalizeAndInsertSpacesBeforeCaps (
detailsForGive . fulfillsType ,
offerFulfillment . offerType || "Offer" ,
)
)
} } ...
} } ...
< / a >
< / a >
@ -556,6 +548,17 @@ export default class ClaimView extends Vue {
fulfillsPlanHandleId ? : string ;
fulfillsPlanHandleId ? : string ;
fulfillsType ? : string ;
fulfillsType ? : string ;
fulfillsHandleId ? : string ;
fulfillsHandleId ? : string ;
fullClaim ? : {
fulfills ? : Array < {
"@type" : string ;
identifier ? : string ;
} > ;
} ;
} | null = null ;
/ / A d d i t i o n a l o f f e r i n f o r m a t i o n e x t r a c t e d f r o m t h e f u l f i l l s a r r a y
offerFulfillment : {
offerHandleId ? : string ;
offerType ? : string ;
} | null = null ;
} | null = null ;
detailsForOffer : { fulfillsPlanHandleId ? : string } | null = null ;
detailsForOffer : { fulfillsPlanHandleId ? : string } | null = null ;
/ / P r o j e c t i n f o r m a t i o n f o r f u l f i l l s P l a n H a n d l e I d
/ / P r o j e c t i n f o r m a t i o n f o r f u l f i l l s P l a n H a n d l e I d
@ -689,6 +692,7 @@ export default class ClaimView extends Vue {
this . confsVisibleToIdList = [ ] ;
this . confsVisibleToIdList = [ ] ;
this . detailsForGive = null ;
this . detailsForGive = null ;
this . detailsForOffer = null ;
this . detailsForOffer = null ;
this . offerFulfillment = null ;
this . projectInfo = null ;
this . projectInfo = null ;
this . fullClaim = null ;
this . fullClaim = null ;
this . fullClaimDump = "" ;
this . fullClaimDump = "" ;
@ -701,6 +705,33 @@ export default class ClaimView extends Vue {
this . veriClaimDidsVisible = { } ;
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 ;
}
/ / F i n d t h e O f f e r i n t h e f u l f i l l s a r r a y
const offerFulfill = fulfills . find ( ( item ) => item [ "@type" ] === "Offer" ) ;
if ( offerFulfill ) {
this . offerFulfillment = {
offerHandleId : offerFulfill . identifier ,
offerType : offerFulfill [ "@type" ] ,
} ;
} else {
this . offerFulfillment = null ;
}
}
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / U T I L I T Y M E T H O D S
/ / U T I L I T Y M E T H O D S
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
@ -821,6 +852,8 @@ export default class ClaimView extends Vue {
} ) ;
} ) ;
if ( giveResp . status === 200 && giveResp . data . data ? . length > 0 ) {
if ( giveResp . status === 200 && giveResp . data . data ? . length > 0 ) {
this . detailsForGive = giveResp . data . data [ 0 ] ;
this . detailsForGive = giveResp . data . data [ 0 ] ;
/ / E x t r a c t o f f e r i n f o r m a t i o n f r o m t h e f u l f i l l s a r r a y
this . extractOfferFulfillment ( ) ;
} else {
} else {
await this . $logError (
await this . $logError (
"Error getting detailed give info: " + JSON . stringify ( giveResp ) ,
"Error getting detailed give info: " + JSON . stringify ( giveResp ) ,