forked from trent_larson/crowd-funder-for-time-pwa
jump from ideas directly into giving dialog choice
This commit is contained in:
@@ -463,7 +463,6 @@ import QuickNav from "@/components/QuickNav.vue";
|
||||
import { Account } from "@/db/tables/accounts";
|
||||
import {
|
||||
GenericCredWrapper,
|
||||
GiverReceiverInputInfo,
|
||||
OfferVerifiableCredential,
|
||||
} from "@/libs/endorserServer";
|
||||
|
||||
@@ -811,7 +810,7 @@ export default class ClaimView extends Vue {
|
||||
}
|
||||
|
||||
openFulfillGiftDialog() {
|
||||
const giver: GiverReceiverInputInfo = {
|
||||
const giver: libsUtil.GiverReceiverInputInfo = {
|
||||
did: libsUtil.offerGiverDid(
|
||||
this.veriClaim as GenericCredWrapper<OfferVerifiableCredential>,
|
||||
),
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
class="text-lg text-center px-2 py-1 absolute -left-2 -top-1"
|
||||
><fa icon="chevron-left" class="fa-fw"></fa
|
||||
></router-link>
|
||||
|
||||
Give to Contacts
|
||||
Given by...
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
@@ -72,6 +71,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from "vue-facing-decorator";
|
||||
import { Router } from "vue-router";
|
||||
|
||||
import GiftedDialog from "@/components/GiftedDialog.vue";
|
||||
import QuickNav from "@/components/QuickNav.vue";
|
||||
@@ -80,7 +80,7 @@ import { NotificationIface } from "@/constants/app";
|
||||
import { db } from "@/db/index";
|
||||
import { Contact } from "@/db/tables/contacts";
|
||||
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
|
||||
import { GiverReceiverInputInfo } from "@/libs/endorserServer";
|
||||
import { GiverReceiverInputInfo } from "@/libs/util";
|
||||
|
||||
@Component({
|
||||
components: { GiftedDialog, QuickNav, EntityIcon },
|
||||
@@ -91,7 +91,9 @@ export default class ContactGiftingView extends Vue {
|
||||
activeDid = "";
|
||||
allContacts: Array<Contact> = [];
|
||||
apiServer = "";
|
||||
description = "";
|
||||
projectId = localStorage.getItem("projectId") || "";
|
||||
prompt = "What was given";
|
||||
|
||||
async created() {
|
||||
try {
|
||||
@@ -107,6 +109,8 @@ export default class ContactGiftingView extends Vue {
|
||||
(a.name || "").localeCompare(b.name || ""),
|
||||
);
|
||||
|
||||
this.prompt = (this.$route as Router).query["prompt"] ?? this.prompt;
|
||||
|
||||
localStorage.removeItem("projectId");
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
@@ -135,6 +139,7 @@ export default class ContactGiftingView extends Vue {
|
||||
recipient,
|
||||
undefined,
|
||||
"Given by " + (giver?.name || "someone not named"),
|
||||
this.prompt,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +295,6 @@ import { getContactPayloadFromJwtUrl } from "@/libs/crypto";
|
||||
import {
|
||||
CONTACT_CSV_HEADER,
|
||||
CONTACT_URL_PREFIX,
|
||||
GiverReceiverInputInfo,
|
||||
GiveSummaryRecord,
|
||||
getHeaders,
|
||||
isDid,
|
||||
@@ -1010,7 +1009,8 @@ export default class ContactsView extends Vue {
|
||||
}
|
||||
|
||||
private showGiftedDialog(giverDid: string, recipientDid: string) {
|
||||
let giver: GiverReceiverInputInfo, receiver: GiverReceiverInputInfo;
|
||||
let giver: libsUtil.GiverReceiverInputInfo;
|
||||
let receiver: libsUtil.GiverReceiverInputInfo;
|
||||
if (giverDid) {
|
||||
giver = {
|
||||
did: giverDid,
|
||||
@@ -1048,6 +1048,7 @@ export default class ContactsView extends Vue {
|
||||
receiver,
|
||||
undefined as string,
|
||||
customTitle,
|
||||
undefined as string,
|
||||
callback,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -136,6 +136,9 @@
|
||||
Unnamed/Unknown
|
||||
</h3>
|
||||
</li>
|
||||
<li v-if="allContacts.length === 0" class="text-sm">
|
||||
(Add contacts to see more people worthy of recognition.)
|
||||
</li>
|
||||
<li
|
||||
v-for="contact in allContacts.slice(0, 6)"
|
||||
:key="contact.did"
|
||||
@@ -337,11 +340,11 @@ import {
|
||||
fetchEndorserRateLimits,
|
||||
getHeaders,
|
||||
getPlanFromCache,
|
||||
GiverReceiverInputInfo,
|
||||
GiveSummaryRecord,
|
||||
} from "@/libs/endorserServer";
|
||||
import {
|
||||
generateSaveAndActivateIdentity,
|
||||
GiverReceiverInputInfo,
|
||||
registerSaveAndActivatePasskey,
|
||||
} from "@/libs/util";
|
||||
|
||||
@@ -740,20 +743,23 @@ export default class HomeView extends Vue {
|
||||
return unitCode === "HUR" ? (single ? "hour" : "hours") : unitCode;
|
||||
}
|
||||
|
||||
openDialog(giver?: GiverReceiverInputInfo) {
|
||||
openDialog(giver?: GiverReceiverInputInfo, description?: string) {
|
||||
(this.$refs.customDialog as GiftedDialog).open(
|
||||
giver,
|
||||
{
|
||||
did: this.activeDid,
|
||||
name: "you",
|
||||
},
|
||||
} as GiverReceiverInputInfo,
|
||||
undefined,
|
||||
"Given by " + (giver?.name || "someone not named"),
|
||||
description,
|
||||
);
|
||||
}
|
||||
|
||||
openGiftedPrompts() {
|
||||
(this.$refs.giftedPrompts as GiftedPrompts).open();
|
||||
(this.$refs.giftedPrompts as GiftedPrompts).open((giver, description) =>
|
||||
this.openDialog(giver as GiverReceiverInputInfo, description),
|
||||
);
|
||||
}
|
||||
|
||||
openFeedFilters() {
|
||||
|
||||
@@ -440,7 +440,6 @@ import {
|
||||
BLANK_GENERIC_SERVER_RECORD,
|
||||
GenericCredWrapper,
|
||||
getHeaders,
|
||||
GiverReceiverInputInfo,
|
||||
GiveSummaryRecord,
|
||||
GiveVerifiableCredential,
|
||||
OfferSummaryRecord,
|
||||
@@ -861,7 +860,7 @@ export default class ProjectViewView extends Vue {
|
||||
);
|
||||
}
|
||||
|
||||
openGiftDialog(contact?: GiverReceiverInputInfo) {
|
||||
openGiftDialog(contact?: libsUtil.GiverReceiverInputInfo) {
|
||||
(this.$refs.customGiveDialog as GiftedDialog).open(
|
||||
contact,
|
||||
undefined,
|
||||
@@ -905,7 +904,7 @@ export default class ProjectViewView extends Vue {
|
||||
claim: offer.fullClaim,
|
||||
issuer: offer.offeredByDid,
|
||||
};
|
||||
const giver: GiverReceiverInputInfo = {
|
||||
const giver: libsUtil.GiverReceiverInputInfo = {
|
||||
did: libsUtil.offerGiverDid(offerRecord),
|
||||
};
|
||||
(this.$refs.customGiveDialog as GiftedDialog).open(
|
||||
|
||||
Reference in New Issue
Block a user