+
+
+ Offered To This Project
+
+
+
+ (None yet. Record one above.)
+
+
+
+ -
+
+
+
+ {{ didInfo(offer.agentDid, activeDid, allMyDids, allContacts) }}
+
+
+
+ {{ offer.amount }}
+
+
+
+
+ {{ offer.objectDescription }}
+
+
+
+
+
Given To This Project
@@ -199,11 +243,13 @@
+
+
@@ -214,6 +260,7 @@ import { IIdentifier } from "@veramo/core";
import { Component, Vue } from "vue-facing-decorator";
import GiftedDialog from "@/components/GiftedDialog.vue";
+import OfferDialog from "@/components/OfferDialog.vue";
import { accountsDB, db } from "@/db/index";
import { Contact } from "@/db/tables/contacts";
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
@@ -222,6 +269,7 @@ import {
didInfo,
GiverInputInfo,
GiveServerRecord,
+ OfferServerRecord,
PlanServerRecord,
} from "@/libs/endorserServer";
import QuickNav from "@/components/QuickNav.vue";
@@ -236,7 +284,7 @@ interface Notification {
}
@Component({
- components: { GiftedDialog, QuickNav, EntityIcon },
+ components: { EntityIcon, GiftedDialog, OfferDialog, QuickNav },
})
export default class ProjectViewView extends Vue {
$notify!: (notification: Notification, timeout?: number) => void;
@@ -250,10 +298,11 @@ export default class ProjectViewView extends Vue {
fulfilledByThis: PlanServerRecord | null = null;
fulfillersToThis: Array
= [];
givesToThis: Array = [];
+ issuer = "";
latitude = 0;
longitude = 0;
name = "";
- issuer = "";
+ offersToThis: Array = [];
projectId = localStorage.getItem("projectId") || ""; // handle ID
timeSince = "";
truncatedDesc = "";
@@ -433,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 =
this.apiServer +
"/api/v2/report/planFulfilledByPlan?planHandleId=" +
@@ -533,8 +618,12 @@ export default class ProjectViewView extends Vue {
);
}
- openDialog(contact: GiverInputInfo) {
- (this.$refs.customDialog as GiftedDialog).open(contact);
+ openGiftDialog(contact: GiverInputInfo) {
+ (this.$refs.customGiveDialog as GiftedDialog).open(contact);
+ }
+
+ openOfferDialog() {
+ (this.$refs.customOfferDialog as OfferDialog).open();
}
}