Merge branch 'master' into gifting-ui-2025-05

This commit is contained in:
Jose Olarte III
2025-06-11 19:10:59 +08:00
231 changed files with 22243 additions and 7198 deletions

View File

@@ -54,11 +54,7 @@
></font-awesome>
{{ issuerInfoObject?.displayName }}
<span v-if="!serverUtil.isEmptyOrHiddenDid(issuer)">
<a
:href="`/did/${issuer}`"
target="_blank"
class="text-blue-500"
>
<a :href="`/did/${issuer}`" class="text-blue-500">
<font-awesome
icon="arrow-up-right-from-square"
class="fa-fw"
@@ -255,8 +251,8 @@
</span>
</li>
</ul>
<GiftedDialog ref="giveDialogToThis" :to-project-id="projectId" />
</div>
<GiftedDialog ref="giveDialogToThis" :to-project-id="projectId" />
<!-- Offers & Gifts to & from this -->
<div class="grid items-start grid-cols-1 sm:grid-cols-3 gap-4 mt-4">
@@ -386,11 +382,15 @@
>
<!-- just show the hours, or alternatively whatever is first -->
<span v-if="givenTotalHours() > 0">
{{ givenTotalHours() }} {{ libsUtil.UNIT_SHORT["HUR"] }}
{{ libsUtil.formattedAmount(givenTotalHours(), "HUR") }}
</span>
<span v-else>
{{ givesTotalsByUnit[0].amount }}
{{ libsUtil.UNIT_SHORT[givesTotalsByUnit[0].unit] }}
{{
libsUtil.formattedAmount(
givesTotalsByUnit[0].amount,
givesTotalsByUnit[0].unit,
)
}}
</span>
<span v-if="givesTotalsByUnit.length > 1">...</span>
<span>
@@ -411,7 +411,7 @@
:icon="libsUtil.iconForUnitCode(total.unit)"
class="fa-fw text-slate-400 mr-1"
/>
{{ total.amount }} {{ libsUtil.UNIT_LONG[total.unit] }}
{{ libsUtil.formattedAmount(total.amount, total.unit) }}
</div>
</div>
</span>
@@ -613,9 +613,9 @@ import {
GenericVerifiableCredential,
GenericCredWrapper,
GiveSummaryRecord,
GiveVerifiableCredential,
GiveActionClaim,
OfferSummaryRecord,
OfferVerifiableCredential,
OfferClaim,
PlanSummaryRecord,
} from "../interfaces";
import GiftedDialog from "../components/GiftedDialog.vue";
@@ -624,7 +624,8 @@ import TopMessage from "../components/TopMessage.vue";
import QuickNav from "../components/QuickNav.vue";
import EntityIcon from "../components/EntityIcon.vue";
import ProjectIcon from "../components/ProjectIcon.vue";
import { NotificationIface } from "../constants/app";
import { NotificationIface, USE_DEXIE_DB } from "../constants/app";
import * as databaseUtil from "../db/databaseUtil";
import {
db,
logConsoleAndDb,
@@ -636,6 +637,7 @@ import * as serverUtil from "../libs/endorserServer";
import { retrieveAccountDids } from "../libs/util";
import HiddenDidDialog from "../components/HiddenDidDialog.vue";
import { logger } from "../utils/logger";
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
/**
* Project View Component
* @author Matthew Raymer
@@ -778,10 +780,21 @@ export default class ProjectViewView extends Vue {
* @emits Notification on profile loading errors
*/
async created() {
const settings = await retrieveSettingsForActiveAccount();
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
if (USE_DEXIE_DB) {
settings = await retrieveSettingsForActiveAccount();
}
this.activeDid = settings.activeDid || "";
this.apiServer = settings.apiServer || "";
this.allContacts = await db.contacts.toArray();
const platformService = PlatformServiceFactory.getInstance();
const queryResult = await platformService.dbQuery("SELECT * FROM contacts");
this.allContacts = databaseUtil.mapQueryResultToValues(
queryResult,
) as unknown as Contact[];
if (USE_DEXIE_DB) {
await db.open();
this.allContacts = await db.contacts.toArray();
}
this.isRegistered = !!settings.isRegistered;
try {
@@ -1268,23 +1281,23 @@ export default class ProjectViewView extends Vue {
}
checkIsFulfillable(offer: OfferSummaryRecord) {
const offerRecord: GenericCredWrapper<OfferVerifiableCredential> = {
const offerRecord: GenericCredWrapper<OfferClaim> = {
...serverUtil.BLANK_GENERIC_SERVER_RECORD,
claim: offer.fullClaim,
claimType: "Offer",
issuer: offer.offeredByDid,
};
return libsUtil.canFulfillOffer(offerRecord);
return libsUtil.canFulfillOffer(offerRecord, this.isRegistered);
}
onClickFulfillGiveToOffer(offer: OfferSummaryRecord) {
const offerRecord: GenericCredWrapper<OfferVerifiableCredential> = {
const offerClaimCred: GenericCredWrapper<OfferClaim> = {
...serverUtil.BLANK_GENERIC_SERVER_RECORD,
claim: offer.fullClaim,
issuer: offer.offeredByDid,
};
const giver: libsUtil.GiverReceiverInputInfo = {
did: libsUtil.offerGiverDid(offerRecord),
did: libsUtil.offerGiverDid(offerClaimCred),
};
(this.$refs.giveDialogToThis as GiftedDialog).open(
giver,
@@ -1326,7 +1339,7 @@ export default class ProjectViewView extends Vue {
* @param confirmerIdList optional list of DIDs who confirmed; if missing, doesn't do a full server check
*/
checkIsConfirmable(give: GiveSummaryRecord, confirmerIdList?: string[]) {
const giveDetails: GenericCredWrapper<GiveVerifiableCredential> = {
const giveDetails: GenericCredWrapper<GiveActionClaim> = {
...serverUtil.BLANK_GENERIC_SERVER_RECORD,
claim: give.fullClaim,
claimType: "GiveAction",