|
@ -146,13 +146,38 @@ |
|
|
|
|
|
|
|
|
<!-- Gifts to & from this --> |
|
|
<!-- Gifts to & from this --> |
|
|
<div class="grid items-start grid-cols-1 sm:grid-cols-3 gap-4"> |
|
|
<div class="grid items-start grid-cols-1 sm:grid-cols-3 gap-4"> |
|
|
<!-- |
|
|
|
|
|
<div class="bg-slate-100 px-4 py-3 rounded-md"> |
|
|
<div class="bg-slate-100 px-4 py-3 rounded-md"> |
|
|
<h3 class="text-sm uppercase font-semibold mb-3"> |
|
|
<h3 class="text-sm uppercase font-semibold mb-3"> |
|
|
Offered To This Project |
|
|
Offered To This Project |
|
|
</h3> |
|
|
</h3> |
|
|
|
|
|
|
|
|
|
|
|
<div v-if="offersToThis.length === 0"> |
|
|
|
|
|
(None yet. Record one above.) |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<ul v-else class="text-sm border-t border-slate-300"> |
|
|
|
|
|
<li |
|
|
|
|
|
v-for="offer in offersToThis" |
|
|
|
|
|
:key="offer.id" |
|
|
|
|
|
class="py-1.5 border-b border-slate-300" |
|
|
|
|
|
> |
|
|
|
|
|
<div class="flex justify-between gap-4"> |
|
|
|
|
|
<span> |
|
|
|
|
|
<fa icon="user" class="fa-fw text-slate-400"></fa> |
|
|
|
|
|
{{ didInfo(offer.agentDid, activeDid, allMyDids, allContacts) }} |
|
|
|
|
|
</span> |
|
|
|
|
|
<span v-if="offer.amount"> |
|
|
|
|
|
<fa icon="coins" class="fa-fw text-slate-400"></fa> |
|
|
|
|
|
{{ offer.amount }} |
|
|
|
|
|
</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-if="offer.objectDescription" class="text-slate-500"> |
|
|
|
|
|
<fa icon="comment" class="fa-fw text-slate-400"></fa> |
|
|
|
|
|
{{ offer.objectDescription }} |
|
|
|
|
|
</div> |
|
|
|
|
|
</li> |
|
|
|
|
|
</ul> |
|
|
</div> |
|
|
</div> |
|
|
--> |
|
|
|
|
|
|
|
|
|
|
|
<div class="bg-slate-100 px-4 py-3 rounded-md"> |
|
|
<div class="bg-slate-100 px-4 py-3 rounded-md"> |
|
|
<h3 class="text-sm uppercase font-semibold mb-3"> |
|
|
<h3 class="text-sm uppercase font-semibold mb-3"> |
|
@ -244,6 +269,7 @@ import { |
|
|
didInfo, |
|
|
didInfo, |
|
|
GiverInputInfo, |
|
|
GiverInputInfo, |
|
|
GiveServerRecord, |
|
|
GiveServerRecord, |
|
|
|
|
|
OfferServerRecord, |
|
|
PlanServerRecord, |
|
|
PlanServerRecord, |
|
|
} from "@/libs/endorserServer"; |
|
|
} from "@/libs/endorserServer"; |
|
|
import QuickNav from "@/components/QuickNav.vue"; |
|
|
import QuickNav from "@/components/QuickNav.vue"; |
|
@ -272,10 +298,11 @@ export default class ProjectViewView extends Vue { |
|
|
fulfilledByThis: PlanServerRecord | null = null; |
|
|
fulfilledByThis: PlanServerRecord | null = null; |
|
|
fulfillersToThis: Array<PlanServerRecord> = []; |
|
|
fulfillersToThis: Array<PlanServerRecord> = []; |
|
|
givesToThis: Array<GiveServerRecord> = []; |
|
|
givesToThis: Array<GiveServerRecord> = []; |
|
|
|
|
|
issuer = ""; |
|
|
latitude = 0; |
|
|
latitude = 0; |
|
|
longitude = 0; |
|
|
longitude = 0; |
|
|
name = ""; |
|
|
name = ""; |
|
|
issuer = ""; |
|
|
offersToThis: Array<OfferServerRecord> = []; |
|
|
projectId = localStorage.getItem("projectId") || ""; // handle ID |
|
|
projectId = localStorage.getItem("projectId") || ""; // handle ID |
|
|
timeSince = ""; |
|
|
timeSince = ""; |
|
|
truncatedDesc = ""; |
|
|
truncatedDesc = ""; |
|
@ -455,6 +482,42 @@ export default class ProjectViewView extends Vue { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const offersToUrl = |
|
|
|
|
|
this.apiServer + |
|
|
|
|
|
"/api/v2/report/offersToPlans?planIds=" + |
|
|
|
|
|
encodeURIComponent(JSON.stringify([projectId])); |
|
|
|
|
|
try { |
|
|
|
|
|
const resp = await this.axios.get(offersToUrl, { headers }); |
|
|
|
|
|
if (resp.status === 200 && resp.data.data) { |
|
|
|
|
|
this.offersToThis = resp.data.data; |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$notify( |
|
|
|
|
|
{ |
|
|
|
|
|
group: "alert", |
|
|
|
|
|
type: "danger", |
|
|
|
|
|
title: "Error", |
|
|
|
|
|
text: "Failed to retrieve offers to this project.", |
|
|
|
|
|
}, |
|
|
|
|
|
-1, |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error: unknown) { |
|
|
|
|
|
const serverError = error as AxiosError; |
|
|
|
|
|
this.$notify( |
|
|
|
|
|
{ |
|
|
|
|
|
group: "alert", |
|
|
|
|
|
type: "danger", |
|
|
|
|
|
title: "Error", |
|
|
|
|
|
text: "Something went wrong retrieving offers to this project.", |
|
|
|
|
|
}, |
|
|
|
|
|
-1, |
|
|
|
|
|
); |
|
|
|
|
|
console.error( |
|
|
|
|
|
"Error retrieving offers to this project:", |
|
|
|
|
|
serverError.message, |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const fulfilledByUrl = |
|
|
const fulfilledByUrl = |
|
|
this.apiServer + |
|
|
this.apiServer + |
|
|
"/api/v2/report/planFulfilledByPlan?planHandleId=" + |
|
|
"/api/v2/report/planFulfilledByPlan?planHandleId=" + |
|
|