forked from jsnbuchanan/crowd-funder-for-time-pwa
Feature: Project Gifting
- Gifting dialog: added ability to pick a project to benefit from - Project view: modified dialog calls in Project view to toggle between giving to and benefiting from a project - Project view: removed redundant person selection - Project view: benefiting from a project locks the project selection in dialog to enforce context.
This commit is contained in:
@@ -3,24 +3,71 @@
|
|||||||
<div class="dialog">
|
<div class="dialog">
|
||||||
<!-- Step 1: Giver -->
|
<!-- Step 1: Giver -->
|
||||||
<div id="sectionGiftedGiver" v-show="currentStep === 1">
|
<div id="sectionGiftedGiver" v-show="currentStep === 1">
|
||||||
<label class="block font-bold mb-4">Choose a person to receive from:</label>
|
<label class="block font-bold mb-4">
|
||||||
|
{{ showProjects ? 'Choose a project to benefit from:' : 'Choose a person to receive from:' }}
|
||||||
|
</label>
|
||||||
|
|
||||||
<!-- Quick-pick grid -->
|
<!-- Unified Quick-pick grid for People and Projects -->
|
||||||
<ul
|
<ul :class="showProjects ? 'grid grid-cols-3 md:grid-cols-4 gap-x-2 gap-y-4 text-center mb-4' : 'grid grid-cols-4 sm:grid-cols-5 md:grid-cols-6 gap-x-2 gap-y-4 text-center mb-4'">
|
||||||
class="grid grid-cols-4 sm:grid-cols-5 md:grid-cols-6 gap-x-2 gap-y-4 text-center mb-4"
|
<template v-if="showProjects">
|
||||||
|
<li
|
||||||
|
v-for="project in projects.slice(0, 7)"
|
||||||
|
:key="project.handleId"
|
||||||
|
@click="selectProject(project)"
|
||||||
|
class="cursor-pointer"
|
||||||
>
|
>
|
||||||
|
<div class="relative w-fit mx-auto">
|
||||||
|
<ProjectIcon
|
||||||
|
:entity-id="project.handleId"
|
||||||
|
:icon-size="48"
|
||||||
|
:image-url="project.image"
|
||||||
|
class="!size-[3rem] mx-auto border border-slate-300 bg-white overflow-hidden rounded-full mb-1"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<h3 class="text-xs font-medium text-ellipsis whitespace-nowrap overflow-hidden">
|
||||||
|
{{ project.name }}
|
||||||
|
</h3>
|
||||||
|
<div class="text-xs text-slate-500 truncate">
|
||||||
|
<font-awesome icon="user" class="fa-fw text-slate-400" />
|
||||||
|
{{ didInfo(project.issuerDid, activeDid, allMyDids, allContacts) }}
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li v-if="projects.length === 0" class="text-xs text-slate-500 italic col-span-full">
|
||||||
|
(No projects found.)
|
||||||
|
</li>
|
||||||
|
<li v-if="projects.length > 0">
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'discover' }"
|
||||||
|
class="cursor-pointer"
|
||||||
|
>
|
||||||
|
<font-awesome icon="circle-right" class="text-blue-500 text-5xl mb-1" />
|
||||||
|
<h3 class="text-xs text-slate-500 font-medium italic text-ellipsis whitespace-nowrap overflow-hidden">
|
||||||
|
Show All
|
||||||
|
</h3>
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<li
|
||||||
|
v-if="isFromProjectView && activeDid"
|
||||||
|
@click="selectGiver({ did: activeDid, name: 'You' })"
|
||||||
|
class="cursor-pointer"
|
||||||
|
>
|
||||||
|
<font-awesome icon="hand" class="text-blue-500 text-5xl mb-1" />
|
||||||
|
<h3 class="text-xs text-blue-500 font-medium text-ellipsis whitespace-nowrap overflow-hidden">
|
||||||
|
You
|
||||||
|
</h3>
|
||||||
|
</li>
|
||||||
<li
|
<li
|
||||||
@click="selectGiver()"
|
@click="selectGiver()"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
>
|
>
|
||||||
<font-awesome icon="circle-question" class="text-slate-400 text-5xl mb-1" />
|
<font-awesome icon="circle-question" class="text-slate-400 text-5xl mb-1" />
|
||||||
<h3
|
<h3 class="text-xs text-slate-500 font-medium italic text-ellipsis whitespace-nowrap overflow-hidden">
|
||||||
class="text-xs text-slate-500 font-medium italic text-ellipsis whitespace-nowrap overflow-hidden"
|
|
||||||
>
|
|
||||||
Unnamed
|
Unnamed
|
||||||
</h3>
|
</h3>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="allContacts.length === 0" class="text-xs text-slate-500 italic">
|
<li v-if="allContacts.length === 0" class="text-xs text-slate-500 italic col-span-full">
|
||||||
(Add friends to see more people worthy of recognition.)
|
(Add friends to see more people worthy of recognition.)
|
||||||
</li>
|
</li>
|
||||||
<li
|
<li
|
||||||
@@ -34,16 +81,11 @@
|
|||||||
:contact="contact"
|
:contact="contact"
|
||||||
class="!size-[3rem] mx-auto border border-slate-300 bg-white overflow-hidden rounded-full mb-1"
|
class="!size-[3rem] mx-auto border border-slate-300 bg-white overflow-hidden rounded-full mb-1"
|
||||||
/>
|
/>
|
||||||
|
<div class="rounded-full bg-slate-400 absolute bottom-0 right-0 p-1 translate-x-1/3">
|
||||||
<div
|
|
||||||
class="rounded-full bg-slate-400 absolute bottom-0 right-0 p-1 translate-x-1/3"
|
|
||||||
>
|
|
||||||
<font-awesome icon="clock" class="block text-white text-xs w-[1em]" />
|
<font-awesome icon="clock" class="block text-white text-xs w-[1em]" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h3
|
<h3 class="text-xs font-medium text-ellipsis whitespace-nowrap overflow-hidden">
|
||||||
class="text-xs font-medium text-ellipsis whitespace-nowrap overflow-hidden"
|
|
||||||
>
|
|
||||||
{{ contact.name || contact.did }}
|
{{ contact.name || contact.did }}
|
||||||
</h3>
|
</h3>
|
||||||
</li>
|
</li>
|
||||||
@@ -53,13 +95,12 @@
|
|||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
>
|
>
|
||||||
<font-awesome icon="circle-right" class="text-blue-500 text-5xl mb-1" />
|
<font-awesome icon="circle-right" class="text-blue-500 text-5xl mb-1" />
|
||||||
<h3
|
<h3 class="text-xs text-slate-500 font-medium italic text-ellipsis whitespace-nowrap overflow-hidden">
|
||||||
class="text-xs text-slate-500 font-medium italic text-ellipsis whitespace-nowrap overflow-hidden"
|
|
||||||
>
|
|
||||||
Show All
|
Show All
|
||||||
</h3>
|
</h3>
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
@@ -72,8 +113,22 @@
|
|||||||
|
|
||||||
<!-- Step 2: Gift -->
|
<!-- Step 2: Gift -->
|
||||||
<div id="sectionGiftedGift" v-show="currentStep === 2">
|
<div id="sectionGiftedGift" v-show="currentStep === 2">
|
||||||
<button class="w-full flex items-center gap-2 bg-slate-100 border border-slate-300 rounded-md p-2 mb-4" @click="goBackToStep1">
|
<button
|
||||||
|
v-if="!fromProjectId"
|
||||||
|
class="w-full flex items-center gap-2 bg-slate-100 border border-slate-300 rounded-md p-2 mb-4"
|
||||||
|
@click="goBackToStep1"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
|
<template v-if="showProjects">
|
||||||
|
<ProjectIcon
|
||||||
|
v-if="giver?.handleId"
|
||||||
|
:entity-id="giver.handleId"
|
||||||
|
:icon-size="32"
|
||||||
|
:image-url="giver.image"
|
||||||
|
class="rounded-full bg-white overflow-hidden !size-[2rem] object-cover"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<EntityIcon
|
<EntityIcon
|
||||||
v-if="giver?.did"
|
v-if="giver?.did"
|
||||||
:contact="giver"
|
:contact="giver"
|
||||||
@@ -84,15 +139,46 @@
|
|||||||
icon="circle-question"
|
icon="circle-question"
|
||||||
class="text-slate-400 text-3xl"
|
class="text-slate-400 text-3xl"
|
||||||
/>
|
/>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-start min-w-0">
|
<div class="text-start min-w-0">
|
||||||
<p class="text-xs text-slate-500 leading-1 -mb-1 uppercase">Received from:</p>
|
<p class="text-xs text-slate-500 leading-1 -mb-1 uppercase">{{ showProjects ? 'Benefited from:' : 'Received from:' }}</p>
|
||||||
<h3 class="font-semibold truncate">{{ giver?.name || 'Unnamed' }}</h3>
|
<h3 class="font-semibold truncate">{{ giver?.name || 'Unnamed' }}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="ms-auto text-sm uppercase font-medium pe-2">Change</p>
|
<p class="ms-auto text-sm uppercase font-medium pe-2">Change</p>
|
||||||
</button>
|
</button>
|
||||||
|
<div v-else class="w-full flex items-center gap-2 bg-slate-100 border border-slate-300 rounded-md p-2 mb-4">
|
||||||
|
<div>
|
||||||
|
<template v-if="showProjects">
|
||||||
|
<ProjectIcon
|
||||||
|
v-if="giver?.handleId"
|
||||||
|
:entity-id="giver.handleId"
|
||||||
|
:icon-size="32"
|
||||||
|
:image-url="giver.image"
|
||||||
|
class="rounded-full bg-white overflow-hidden !size-[2rem] object-cover"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<EntityIcon
|
||||||
|
v-if="giver?.did"
|
||||||
|
:contact="giver"
|
||||||
|
class="rounded-full bg-white overflow-hidden !size-[2rem] object-cover"
|
||||||
|
/>
|
||||||
|
<font-awesome
|
||||||
|
v-else
|
||||||
|
icon="circle-question"
|
||||||
|
class="text-slate-400 text-3xl"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-start min-w-0">
|
||||||
|
<p class="text-xs text-slate-500 leading-1 -mb-1 uppercase">{{ showProjects ? 'Benefited from:' : 'Received from:' }}</p>
|
||||||
|
<h3 class="font-semibold truncate">{{ giver?.name || 'Unnamed' }}</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<input
|
<input
|
||||||
v-model="description"
|
v-model="description"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -182,6 +268,7 @@ import {
|
|||||||
createAndSubmitGive,
|
createAndSubmitGive,
|
||||||
didInfo,
|
didInfo,
|
||||||
serverMessageForUser,
|
serverMessageForUser,
|
||||||
|
getHeaders,
|
||||||
} from "../libs/endorserServer";
|
} from "../libs/endorserServer";
|
||||||
import * as libsUtil from "../libs/util";
|
import * as libsUtil from "../libs/util";
|
||||||
import { db, retrieveSettingsForActiveAccount } from "../db/index";
|
import { db, retrieveSettingsForActiveAccount } from "../db/index";
|
||||||
@@ -191,10 +278,13 @@ import { retrieveAccountDids } from "../libs/util";
|
|||||||
import { logger } from "../utils/logger";
|
import { logger } from "../utils/logger";
|
||||||
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
|
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
|
||||||
import EntityIcon from "../components/EntityIcon.vue";
|
import EntityIcon from "../components/EntityIcon.vue";
|
||||||
|
import ProjectIcon from "../components/ProjectIcon.vue";
|
||||||
|
import { PlanData } from "../interfaces/records";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
EntityIcon,
|
EntityIcon,
|
||||||
|
ProjectIcon,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class GiftedDialog extends Vue {
|
export default class GiftedDialog extends Vue {
|
||||||
@@ -202,6 +292,8 @@ export default class GiftedDialog extends Vue {
|
|||||||
|
|
||||||
@Prop() fromProjectId = "";
|
@Prop() fromProjectId = "";
|
||||||
@Prop() toProjectId = "";
|
@Prop() toProjectId = "";
|
||||||
|
@Prop({ default: false }) showProjects = false;
|
||||||
|
@Prop() isFromProjectView = false;
|
||||||
|
|
||||||
activeDid = "";
|
activeDid = "";
|
||||||
allContacts: Array<Contact> = [];
|
allContacts: Array<Contact> = [];
|
||||||
@@ -222,6 +314,10 @@ export default class GiftedDialog extends Vue {
|
|||||||
|
|
||||||
libsUtil = libsUtil;
|
libsUtil = libsUtil;
|
||||||
|
|
||||||
|
projects: PlanData[] = [];
|
||||||
|
|
||||||
|
didInfo = didInfo;
|
||||||
|
|
||||||
async open(
|
async open(
|
||||||
giver?: libsUtil.GiverReceiverInputInfo,
|
giver?: libsUtil.GiverReceiverInputInfo,
|
||||||
receiver?: libsUtil.GiverReceiverInputInfo,
|
receiver?: libsUtil.GiverReceiverInputInfo,
|
||||||
@@ -234,7 +330,6 @@ export default class GiftedDialog extends Vue {
|
|||||||
this.giver = giver;
|
this.giver = giver;
|
||||||
this.prompt = prompt || "";
|
this.prompt = prompt || "";
|
||||||
this.receiver = receiver;
|
this.receiver = receiver;
|
||||||
// if we show "given to user" selection, default checkbox to true
|
|
||||||
this.amountInput = "0";
|
this.amountInput = "0";
|
||||||
this.callbackOnSuccess = callbackOnSuccess;
|
this.callbackOnSuccess = callbackOnSuccess;
|
||||||
this.offerId = offerId || "";
|
this.offerId = offerId || "";
|
||||||
@@ -269,7 +364,10 @@ export default class GiftedDialog extends Vue {
|
|||||||
this.allContacts,
|
this.allContacts,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
|
if (this.showProjects) {
|
||||||
|
await this.loadProjects();
|
||||||
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
logger.error("Error retrieving settings from database:", err);
|
logger.error("Error retrieving settings from database:", err);
|
||||||
this.$notify(
|
this.$notify(
|
||||||
@@ -404,7 +502,7 @@ export default class GiftedDialog extends Vue {
|
|||||||
this.axios,
|
this.axios,
|
||||||
this.apiServer,
|
this.apiServer,
|
||||||
this.activeDid,
|
this.activeDid,
|
||||||
giverDid as string,
|
this.showProjects ? undefined : giverDid as string,
|
||||||
recipientDid as string,
|
recipientDid as string,
|
||||||
description,
|
description,
|
||||||
amount,
|
amount,
|
||||||
@@ -413,7 +511,7 @@ export default class GiftedDialog extends Vue {
|
|||||||
this.offerId,
|
this.offerId,
|
||||||
false,
|
false,
|
||||||
undefined,
|
undefined,
|
||||||
this.fromProjectId,
|
this.showProjects ? this.giver?.handleId : undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
@@ -506,6 +604,49 @@ export default class GiftedDialog extends Vue {
|
|||||||
goBackToStep1() {
|
goBackToStep1() {
|
||||||
this.currentStep = 1;
|
this.currentStep = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async loadProjects() {
|
||||||
|
try {
|
||||||
|
const response = await fetch(this.apiServer + "/api/v2/report/plans", {
|
||||||
|
method: "GET",
|
||||||
|
headers: await getHeaders(this.activeDid),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.status !== 200) {
|
||||||
|
throw new Error("Failed to load projects");
|
||||||
|
}
|
||||||
|
|
||||||
|
const results = await response.json();
|
||||||
|
if (results.data) {
|
||||||
|
this.projects = results.data;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
logger.error("Error loading projects:", error);
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error",
|
||||||
|
text: "Failed to load projects",
|
||||||
|
},
|
||||||
|
3000,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
selectProject(project: PlanData) {
|
||||||
|
this.giver = {
|
||||||
|
did: project.handleId,
|
||||||
|
name: project.name,
|
||||||
|
image: project.image,
|
||||||
|
handleId: project.handleId
|
||||||
|
};
|
||||||
|
this.receiver = {
|
||||||
|
did: this.activeDid,
|
||||||
|
name: "You"
|
||||||
|
};
|
||||||
|
this.currentStep = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ import { insertDidSpecificSettings, parseJsonField } from "../db/databaseUtil";
|
|||||||
export interface GiverReceiverInputInfo {
|
export interface GiverReceiverInputInfo {
|
||||||
did?: string;
|
did?: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
|
image?: string;
|
||||||
|
handleId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum OnboardPage {
|
export enum OnboardPage {
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ Raymer * @version 1.0.0 */
|
|||||||
<div class="grid grid-cols-2 gap-2">
|
<div class="grid grid-cols-2 gap-2">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@click="openDialog()"
|
@click="openDialogPerson()"
|
||||||
class="text-center text-base uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-3 py-2 rounded-lg"
|
class="text-center text-base uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-3 py-2 rounded-lg"
|
||||||
>
|
>
|
||||||
<font-awesome icon="user" />
|
<font-awesome icon="user" />
|
||||||
@@ -140,7 +140,7 @@ Raymer * @version 1.0.0 */
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@click="openDialog()"
|
@click="openProjectDialog()"
|
||||||
class="text-center text-base uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-3 py-2 rounded-lg"
|
class="text-center text-base uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-3 py-2 rounded-lg"
|
||||||
>
|
>
|
||||||
<font-awesome icon="folder-open" />
|
<font-awesome icon="folder-open" />
|
||||||
@@ -153,7 +153,7 @@ Raymer * @version 1.0.0 */
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<GiftedDialog ref="customDialog" />
|
<GiftedDialog ref="customDialog" :show-projects="showProjectsDialog" />
|
||||||
<GiftedPrompts ref="giftedPrompts" />
|
<GiftedPrompts ref="giftedPrompts" />
|
||||||
<FeedFilters ref="feedFilters" />
|
<FeedFilters ref="feedFilters" />
|
||||||
|
|
||||||
@@ -439,6 +439,7 @@ export default class HomeView extends Vue {
|
|||||||
selectedImageData: Blob | null = null;
|
selectedImageData: Blob | null = null;
|
||||||
isImageViewerOpen = false;
|
isImageViewerOpen = false;
|
||||||
imageCache: Map<string, Blob | null> = new Map();
|
imageCache: Map<string, Blob | null> = new Map();
|
||||||
|
showProjectsDialog = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the component on mount
|
* Initializes the component on mount
|
||||||
@@ -1862,5 +1863,15 @@ export default class HomeView extends Vue {
|
|||||||
this.$router.push({ name: "contact-qr" });
|
this.$router.push({ name: "contact-qr" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openDialogPerson(giver?: GiverReceiverInputInfo | "Unnamed", description?: string) {
|
||||||
|
this.showProjectsDialog = false;
|
||||||
|
this.openDialog(giver, description);
|
||||||
|
}
|
||||||
|
|
||||||
|
openProjectDialog() {
|
||||||
|
this.showProjectsDialog = true;
|
||||||
|
(this.$refs.customDialog as any).open();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -196,63 +196,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="activeDid && isRegistered">
|
<GiftedDialog ref="giveDialogToThis" :to-project-id="projectId" :is-from-project-view="true" />
|
||||||
<div class="text-center">
|
|
||||||
<p class="mt-2 mt-4 text-center">Record a contribution from:</p>
|
|
||||||
</div>
|
|
||||||
<ul
|
|
||||||
class="grid grid-cols-4 sm:grid-cols-5 md:grid-cols-6 gap-x-3 gap-y-5 text-center mb-5 mt-2"
|
|
||||||
>
|
|
||||||
<li @click="openGiftDialogToProject({ name: 'you', did: activeDid })">
|
|
||||||
<font-awesome
|
|
||||||
icon="hand"
|
|
||||||
class="fa-fw text-blue-500 text-5xl cursor-pointer"
|
|
||||||
/>
|
|
||||||
<h3
|
|
||||||
class="mt-5 text-xs text-blue-500 font-medium text-ellipsis whitespace-nowrap overflow-hidden cursor-pointer"
|
|
||||||
>
|
|
||||||
You
|
|
||||||
</h3>
|
|
||||||
</li>
|
|
||||||
<li @click="openGiftDialogToProject()">
|
|
||||||
<img
|
|
||||||
src="../assets/blank-square.svg"
|
|
||||||
class="mx-auto border border-blue-300 rounded-md mb-1 cursor-pointer"
|
|
||||||
/>
|
|
||||||
<h3
|
|
||||||
class="text-xs text-blue-500 italic font-medium text-ellipsis whitespace-nowrap overflow-hidden cursor-pointer"
|
|
||||||
>
|
|
||||||
Unnamed/Unknown
|
|
||||||
</h3>
|
|
||||||
</li>
|
|
||||||
<li
|
|
||||||
v-for="contact in allContacts.slice(0, 5)"
|
|
||||||
:key="contact.did"
|
|
||||||
@click="openGiftDialogToProject(contact)"
|
|
||||||
>
|
|
||||||
<EntityIcon
|
|
||||||
:contact="contact"
|
|
||||||
:icon-size="64"
|
|
||||||
class="mx-auto border border-blue-300 rounded-md mb-1 cursor-pointer"
|
|
||||||
/>
|
|
||||||
<h3
|
|
||||||
class="text-xs text-blue-500 font-medium text-ellipsis whitespace-nowrap overflow-hidden cursor-pointer"
|
|
||||||
>
|
|
||||||
{{ contact.name || "(no name)" }}
|
|
||||||
</h3>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<span
|
|
||||||
v-if="allContacts.length >= 5"
|
|
||||||
class="flex align-bottom text-xs text-blue-500 mt-12 cursor-pointer"
|
|
||||||
@click="onClickAllContactsGifting()"
|
|
||||||
>
|
|
||||||
... or someone else...
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<GiftedDialog ref="giveDialogToThis" :to-project-id="projectId" />
|
|
||||||
|
|
||||||
<!-- Offers & Gifts to & from this -->
|
<!-- Offers & Gifts to & from this -->
|
||||||
<div class="grid items-start grid-cols-1 sm:grid-cols-3 gap-4 mt-4">
|
<div class="grid items-start grid-cols-1 sm:grid-cols-3 gap-4 mt-4">
|
||||||
@@ -518,7 +462,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<GiftedDialog ref="giveDialogFromThis" :from-project-id="projectId" />
|
<GiftedDialog ref="giveDialogFromThis" :from-project-id="projectId" :show-projects="true" />
|
||||||
|
|
||||||
<h3 class="text-lg font-bold mb-3 mt-4">
|
<h3 class="text-lg font-bold mb-3 mt-4">
|
||||||
Benefitted From This Project
|
Benefitted From This Project
|
||||||
@@ -1241,21 +1185,26 @@ export default class ProjectViewView extends Vue {
|
|||||||
// Immediately select "Unnamed" and move to Step 2
|
// Immediately select "Unnamed" and move to Step 2
|
||||||
(this.$refs.giveDialogToThis as GiftedDialog).selectGiver();
|
(this.$refs.giveDialogToThis as GiftedDialog).selectGiver();
|
||||||
} else {
|
} else {
|
||||||
|
// Set only the project as recipient, allowing user to select giver in Step 1
|
||||||
(this.$refs.giveDialogToThis as GiftedDialog).open(
|
(this.$refs.giveDialogToThis as GiftedDialog).open(
|
||||||
contact,
|
|
||||||
undefined,
|
undefined,
|
||||||
|
{ did: this.issuer, name: this.name, handleId: this.projectId, image: this.imageUrl },
|
||||||
undefined,
|
undefined,
|
||||||
(contact?.name || "Someone not named") + ` gave to this project`,
|
`Given to ${this.name}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
openGiftDialogFromProject() {
|
openGiftDialogFromProject() {
|
||||||
|
// Set the project as giver and the current user as recipient
|
||||||
(this.$refs.giveDialogFromThis as GiftedDialog).open(
|
(this.$refs.giveDialogFromThis as GiftedDialog).open(
|
||||||
undefined,
|
{ did: undefined, name: this.name, handleId: this.projectId, image: this.imageUrl },
|
||||||
{ did: this.activeDid, name: "You" },
|
{ did: this.activeDid, name: "You" },
|
||||||
undefined,
|
undefined,
|
||||||
`This project gave to you`,
|
`${this.name} gave to you`,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1530,3 +1479,4 @@ export default class ProjectViewView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user