From ef8c2e60933f0dcea9b85105756e117293e20f02 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Thu, 27 Feb 2025 21:12:29 +0800 Subject: [PATCH 01/13] In-progress: homeview design refresh I had to comment out line 544 because it was causing errors (and seemed redundant?) --- src/views/HomeView.vue | 154 +++++++++++++++++++++++++----- src/views/ProjectViewView.vue | 172 ++++++++++++++++++++-------------- 2 files changed, 231 insertions(+), 95 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index b30682ab3..38578ae29 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -186,23 +186,23 @@ -
+
-

+

Latest Activity - +

@@ -249,19 +249,123 @@
-
+ --> @@ -436,6 +539,7 @@ import { OnboardPage, registerSaveAndActivatePasskey, } from "../libs/util"; +// import { fa0 } from "@fortawesome/free-solid-svg-icons"; interface GiveRecordWithContactInfo extends GiveSummaryRecord { giver: { diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue index 70be78d04..d57262834 100644 --- a/src/views/ProjectViewView.vue +++ b/src/views/ProjectViewView.vue @@ -341,23 +341,37 @@
Totals - + {{ givenTotalHours() }} {{ libsUtil.UNIT_SHORT["HUR"] }} - {{ givesTotalsByUnit[0].amount }} {{ libsUtil.UNIT_SHORT[givesTotalsByUnit[0].unit] }} + {{ givesTotalsByUnit[0].amount }} + {{ libsUtil.UNIT_SHORT[givesTotalsByUnit[0].unit] }} ... - +
-
- +
+ {{ total.amount }} {{ libsUtil.UNIT_LONG[total.unit] }}
@@ -365,7 +379,9 @@
- {{ givesToThis.length }}{{ givesHitLimit ? "+" : "" }} record{{ givesToThis.length === 1 ? "" : "s" }} + {{ givesToThis.length }}{{ givesHitLimit ? "+" : "" }} record{{ + givesToThis.length === 1 ? "" : "s" + }}
@@ -374,62 +390,71 @@ @@ -594,7 +619,7 @@ export default class ProjectViewView extends Vue { givesHitLimit = false; givesProvidedByThis: Array = []; givesProvidedByHitLimit = false; - givesTotalsByUnit: Array<{unit: string, amount: number}> = []; + givesTotalsByUnit: Array<{ unit: string; amount: number }> = []; imageUrl = ""; isRegistered = false; issuer = ""; @@ -1254,14 +1279,17 @@ export default class ProjectViewView extends Vue { async loadTotals() { this.loadingTotals = true; - const url = this.apiServer + "/api/v2/report/givesToPlans?planIds=" + encodeURIComponent(JSON.stringify([this.projectId])); + const url = + this.apiServer + + "/api/v2/report/givesToPlans?planIds=" + + encodeURIComponent(JSON.stringify([this.projectId])); const headers = await serverUtil.getHeaders(this.activeDid); try { const resp = await this.axios.get(url, { headers }); if (resp.status === 200 && resp.data.data) { // Calculate totals by unit - const totals: {[key: string]: number} = {}; + const totals: { [key: string]: number } = {}; resp.data.data.forEach((give: GiveSummaryRecord) => { const amount = give.fullClaim.object?.amountOfThisGood; const unit = give.fullClaim.object?.unitCode; @@ -1269,12 +1297,14 @@ export default class ProjectViewView extends Vue { totals[unit] = (totals[unit] || 0) + amount; } }); - + // Convert totals object to array format - this.givesTotalsByUnit = Object.entries(totals).map(([unit, amount]) => ({ - unit, - amount - })); + this.givesTotalsByUnit = Object.entries(totals).map( + ([unit, amount]) => ({ + unit, + amount, + }), + ); } } catch (error) { console.error("Error loading totals:", error); @@ -1293,7 +1323,9 @@ export default class ProjectViewView extends Vue { } givenTotalHours(): number { - return this.givesTotalsByUnit.find(total => total.unit === "HUR")?.amount || 0; + return ( + this.givesTotalsByUnit.find((total) => total.unit === "HUR")?.amount || 0 + ); } } From e5d9c25ad4b64da9db09ca898b5e81244721fe89 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Thu, 27 Feb 2025 21:21:01 +0800 Subject: [PATCH 02/13] Comments --- src/views/HomeView.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 38578ae29..781c66d81 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -280,6 +280,7 @@ + @@ -310,6 +311,7 @@ + From cc1780bd01dca69c00ced2d1c2280958f5d8bd03 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Fri, 28 Feb 2025 09:34:59 +0000 Subject: [PATCH 03/13] refactor: extract ActivityListItem into separate component - Move activity list item markup from HomeView to new component - Improve code organization and reusability - Pass required props for claim handling and image viewing - Maintain existing functionality while reducing component complexity - Clean up unused commented code in HomeView This refactor improves code maintainability by extracting the activity feed item logic into its own component. --- src/components/ActivityListItem.vue | 185 +++++++++++++++++++++++ src/types/index.ts | 20 +++ src/views/HomeView.vue | 226 ++-------------------------- 3 files changed, 216 insertions(+), 215 deletions(-) create mode 100644 src/components/ActivityListItem.vue create mode 100644 src/types/index.ts diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue new file mode 100644 index 000000000..37b84a2e9 --- /dev/null +++ b/src/components/ActivityListItem.vue @@ -0,0 +1,185 @@ + + + \ No newline at end of file diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 000000000..fcb53b174 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,20 @@ +export interface GiveRecordWithContactInfo { + jwtId: string; + fullClaim: any; // Replace with proper type + giver: { + known: boolean; + displayName: string; + profileImageUrl?: string; + }; + receiver: { + known: boolean; + displayName: string; + profileImageUrl?: string; + }; + providerPlanName?: string; + recipientProjectName?: string; + description?: string; + subDescription?: string; + image?: string; + timestamp: string; +} \ No newline at end of file diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 781c66d81..a5eea857d 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -250,221 +250,15 @@
@@ -506,6 +300,7 @@ import TopMessage from "../components/TopMessage.vue"; import UserNameDialog from "../components/UserNameDialog.vue"; import ChoiceButtonDialog from "../components/ChoiceButtonDialog.vue"; import ImageViewer from "../components/ImageViewer.vue"; +import ActivityListItem from "../components/ActivityListItem.vue"; import { AppString, NotificationIface, @@ -572,6 +367,7 @@ interface GiveRecordWithContactInfo extends GiveSummaryRecord { TopMessage, UserNameDialog, ImageViewer, + ActivityListItem, }, }) export default class HomeView extends Vue { From aa098273174e4ad2b59b57664bd1b102bf22d359 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Fri, 28 Feb 2025 21:00:03 +0800 Subject: [PATCH 04/13] Type fixes --- src/components/ActivityListItem.vue | 102 +++++++++++++++++++--------- src/types/index.ts | 4 +- 2 files changed, 72 insertions(+), 34 deletions(-) diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue index 37b84a2e9..4163ee30c 100644 --- a/src/components/ActivityListItem.vue +++ b/src/components/ActivityListItem.vue @@ -13,7 +13,10 @@
-
- + -
+
- + {{ formattedTimestamp }}
@@ -87,37 +123,37 @@ \ No newline at end of file + diff --git a/src/types/index.ts b/src/types/index.ts index fcb53b174..4eb29df99 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,6 +1,6 @@ export interface GiveRecordWithContactInfo { jwtId: string; - fullClaim: any; // Replace with proper type + fullClaim: unknown; // Replace with proper type giver: { known: boolean; displayName: string; @@ -17,4 +17,4 @@ export interface GiveRecordWithContactInfo { subDescription?: string; image?: string; timestamp: string; -} \ No newline at end of file +} From 79fdb9e5708fbe105b992672352d29b3d5c28380 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Mon, 3 Mar 2025 19:34:09 +0800 Subject: [PATCH 05/13] Homeview design adjustments - Added markup for poster info (needs wiring) - Repositioned giver and receiver type icons to beside their labels - Added "Confirm" button to bottom right of item card (timestamp repositioned to poster info as a result) - Spacing tweaks --- src/components/ActivityListItem.vue | 50 ++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue index 4163ee30c..a1292849e 100644 --- a/src/components/ActivityListItem.vue +++ b/src/components/ActivityListItem.vue @@ -11,7 +11,25 @@
-
+
+ + +
+

[POSTER_NAME]

+

[TIMESTAMP]

+ +
+
+
+ {{ record.giver.displayName }}
@@ -64,6 +88,7 @@ :profile-image-url="record.receiver.profileImageUrl" :class="record.receiver.known ? 'rounded-full' : 'rounded'" /> +
+ {{ record.receiver.displayName }}
@@ -85,7 +115,7 @@ {{ description }}

-

{{ record.subDescription }}

+

{{ subDescription }}

@@ -112,12 +142,11 @@ - - {{ formattedTimestamp }} - + Confirm +
@@ -202,9 +231,14 @@ export default class ActivityListItem extends Vue { const claim = (this.record.fullClaim as unknown).claim || this.record.fullClaim; const amount = this.formatAmount(claim); + + return `${amount}`; + } + + get subDescription(): string { const participants = this.formatParticipantInfo(); - return `${participants}: ${amount}`; + return `${participants}`; } private displayAmount(code: string, amt: number) { From 4a75cdf20e74e1653dba31177177df3c9d366891 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Tue, 4 Mar 2025 20:38:14 +0800 Subject: [PATCH 06/13] Homeview changes - Moved activity image further up the frame - Added placeholder icon for projects - Minor fixes --- src/components/ActivityListItem.vue | 67 +++++++++++++++++++---------- src/main.ts | 2 + 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue index a1292849e..1992443b5 100644 --- a/src/components/ActivityListItem.vue +++ b/src/components/ActivityListItem.vue @@ -29,6 +29,25 @@

-->
+ + +
+ + + +
+
+ + - -
diff --git a/src/main.ts b/src/main.ts index 1e6af9608..04671f990 100644 --- a/src/main.ts +++ b/src/main.ts @@ -58,6 +58,7 @@ import { faHandHoldingDollar, faHandHoldingHeart, faHouseChimney, + faImage, faImagePortrait, faLeftRight, faLightbulb, @@ -137,6 +138,7 @@ library.add( faHandHoldingDollar, faHandHoldingHeart, faHouseChimney, + faImage, faImagePortrait, faLeftRight, faLightbulb, From fa7d6317b95ecf7d70f42042cbe2c09c18efa27a Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Fri, 7 Mar 2025 10:22:53 +0000 Subject: [PATCH 07/13] feat: add claim confirmation functionality to activity feed - Add confirm button functionality to ActivityListItem - Implement confirmation logic in HomeView - Add proper button state handling and validation Technical Changes: - Add canConfirm computed property to validate confirmation ability - Add handleConfirmClick method with proper error handling - Pass required props (isRegistered, activeDid, confirmerIdList) - Add confirmation dialog with user verification - Implement claim submission with proper cleanup - Add visual feedback for button states - Update feed after successful confirmation UI/UX Improvements: - Add disabled state styling for confirm button - Show proper error messages for invalid confirmation attempts - Add loading and success notifications - Improve button accessibility with proper states Bug Fixes: - Make apiServer optional in settings type - Fix settings update during registration - Add proper type checking for claim confirmation This adds the ability to confirm claims directly from the activity feed with proper validation, error handling, and user feedback. The confirmation flow matches the existing claim view confirmation functionality. --- src/components/ActivityListItem.vue | 170 ++++++++++++++++++---------- src/db/tables/settings.ts | 2 +- src/views/HomeView.vue | 62 ++++++++++ 3 files changed, 172 insertions(+), 62 deletions(-) diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue index 1992443b5..3291fc1fc 100644 --- a/src/components/ActivityListItem.vue +++ b/src/components/ActivityListItem.vue @@ -19,14 +19,14 @@ />
@@ -55,34 +55,35 @@ class="w-28 sm:w-48 text-center bg-white border border-slate-200 rounded p-2 sm:p-3" >
- - - - + Identicon + - - --> +
- - - - + Identicon + - - --> +
@@ -176,6 +185,8 @@ import { Component, Prop, Vue } from "vue-facing-decorator"; import { GiveRecordWithContactInfo } from "../types"; import EntityIcon from "./EntityIcon.vue"; +import { isGiveClaimType, notifyWhyCannotConfirm } from "../libs/util"; +import { containsHiddenDid } from "../libs/endorserServer"; @Component({ components: { @@ -185,6 +196,9 @@ import EntityIcon from "./EntityIcon.vue"; export default class ActivityListItem extends Vue { @Prop() record!: GiveRecordWithContactInfo; @Prop() lastViewedClaimId?: string; + @Prop() isRegistered!: boolean; + @Prop() activeDid!: string; + @Prop() confirmerIdList?: string[]; private formatAmount(claim: unknown): string { const amount = claim.object?.amountOfThisGood @@ -274,5 +288,39 @@ export default class ActivityListItem extends Vue { // Add your timestamp formatting logic here return this.record.timestamp; } + + get canConfirm(): boolean { + if (!this.isRegistered) return false; + if (!isGiveClaimType(this.record.fullClaim?.["@type"])) return false; + if (this.confirmerIdList?.includes(this.activeDid)) return false; + if (this.record.issuerDid === this.activeDid) return false; + if (containsHiddenDid(this.record.fullClaim)) return false; + return true; + } + + handleConfirmClick() { + if (!this.canConfirm) { + notifyWhyCannotConfirm( + this.$notify, + this.isRegistered, + this.record.fullClaim?.["@type"], + this.record, + this.activeDid, + this.confirmerIdList + ); + return; + } + + this.$emit('confirmClaim', this.record); + } + + get friendlyDate(): string { + const date = new Date(this.record.issuedAt); + return date.toLocaleDateString(undefined, { + year: 'numeric', + month: 'short', + day: 'numeric' + }); + } } diff --git a/src/db/tables/settings.ts b/src/db/tables/settings.ts index 69010cb74..726a41eec 100644 --- a/src/db/tables/settings.ts +++ b/src/db/tables/settings.ts @@ -20,7 +20,7 @@ export type Settings = { // active Decentralized ID activeDid?: string; // only used in the MASTER_SETTINGS_KEY entry - apiServer: string; // API server URL + apiServer?: string; // API server URL filterFeedByNearby?: boolean; // filter by nearby filterFeedByVisible?: boolean; // filter by visible users ie. anyone not hidden diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index a5eea857d..df14c1902 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -255,9 +255,13 @@ :key="record.jwtId" :record="record" :lastViewedClaimId="feedLastViewedClaimId" + :isRegistered="isRegistered" + :activeDid="activeDid" + :confirmerIdList="record.confirmerIdList" @loadClaim="onClickLoadClaim" @viewImage="openImageViewer" @cacheImage="cacheImageData" + @confirmClaim="confirmClaim" /> @@ -336,6 +340,7 @@ import { OnboardPage, registerSaveAndActivatePasskey, } from "../libs/util"; +import * as serverUtil from "../libs/endorserServer"; // import { fa0 } from "@fortawesome/free-solid-svg-icons"; interface GiveRecordWithContactInfo extends GiveSummaryRecord { @@ -461,6 +466,7 @@ export default class HomeView extends Vue { if (resp.status === 200) { await updateAccountSettings(this.activeDid, { isRegistered: true, + ...await retrieveSettingsForActiveAccount() }); this.isRegistered = true; } @@ -904,5 +910,61 @@ export default class HomeView extends Vue { this.selectedImage = imageUrl; this.isImageViewerOpen = true; } + + async confirmClaim(record: GiveRecordWithContactInfo) { + this.$notify( + { + group: "modal", + type: "confirm", + title: "Confirm", + text: "Do you personally confirm that this is true?", + onYes: async () => { + const goodClaim = serverUtil.removeSchemaContext( + serverUtil.removeVisibleToDids( + serverUtil.addLastClaimOrHandleAsIdIfMissing( + record.fullClaim, + record.jwtId, + record.handleId + ) + ) + ); + + const confirmationClaim = { + "@context": "https://schema.org", + "@type": "AgreeAction", + object: goodClaim + }; + + const result = await serverUtil.createAndSubmitClaim( + confirmationClaim, + this.activeDid, + this.apiServer, + this.axios + ); + + if (result.type === "success") { + this.$notify({ + group: "alert", + type: "success", + title: "Success", + text: "Confirmation submitted." + }, 3000); + + // Refresh the feed to show updated confirmation status + await this.updateAllFeed(); + } else { + console.error("Error submitting confirmation:", result); + this.$notify({ + group: "alert", + type: "danger", + title: "Error", + text: "There was a problem submitting the confirmation." + }, 5000); + } + } + }, + -1 + ); + } } From 8f7d794962517b9e9ee5c68e894883c55dcd61e8 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Fri, 7 Mar 2025 12:58:14 +0000 Subject: [PATCH 08/13] fix: improve image handling and icon support - Fix image load event handler signature - Add alt text for accessibility - Add building icon to FontAwesome library Technical Changes: - Update cacheImage event to pass only image URL - Add proper alt text for activity images - Add faBuilding icon to FontAwesome library This improves image handling and accessibility while adding needed icon support for the activity feed interface. --- src/components/ActivityListItem.vue | 89 +++++++++++++++++------------ src/main.ts | 2 + 2 files changed, 54 insertions(+), 37 deletions(-) diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue index 3291fc1fc..5de7482df 100644 --- a/src/components/ActivityListItem.vue +++ b/src/components/ActivityListItem.vue @@ -43,7 +43,8 @@ Activity image
@@ -59,35 +60,41 @@
{{ record.giver.displayName }} @@ -114,35 +121,41 @@
{{ record.receiver.displayName }} @@ -187,10 +200,12 @@ import { GiveRecordWithContactInfo } from "../types"; import EntityIcon from "./EntityIcon.vue"; import { isGiveClaimType, notifyWhyCannotConfirm } from "../libs/util"; import { containsHiddenDid } from "../libs/endorserServer"; +import ProjectIcon from "./ProjectIcon.vue"; @Component({ components: { EntityIcon, + ProjectIcon, }, }) export default class ActivityListItem extends Vue { diff --git a/src/main.ts b/src/main.ts index 04671f990..ee985b6f2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -88,6 +88,7 @@ import { faUser, faUsers, faXmark, + faBuilding, } from "@fortawesome/free-solid-svg-icons"; library.add( @@ -168,6 +169,7 @@ library.add( faUser, faUsers, faXmark, + faBuilding, ); import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; From 77b296b6062f6983417711d86e43210ff3c00d8d Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Mon, 17 Mar 2025 17:59:59 +0800 Subject: [PATCH 09/13] Identicon responsive size fix + lint-fix --- src/components/ActivityListItem.vue | 32 +++++++++-------- src/views/HomeView.vue | 54 ++++++++++++++++------------- 2 files changed, 48 insertions(+), 38 deletions(-) diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue index 5de7482df..82b4ddbe4 100644 --- a/src/components/ActivityListItem.vue +++ b/src/components/ActivityListItem.vue @@ -21,7 +21,11 @@

- {{ record.giver.known ? record.giver.displayName : 'Anonymous Giver' }} + {{ + record.giver.known + ? record.giver.displayName + : "Anonymous Giver" + }}

@@ -62,7 +66,7 @@ :class="[ !record.providerPlanName ? 'rounded-full size-12 sm:size-24 object-cover' - : 'rounded size-12 sm:size-24 object-cover' + : 'rounded size-12 sm:size-24 object-cover', ]" /> @@ -71,8 +75,8 @@ @@ -123,7 +127,7 @@ :class="[ !record.recipientProjectName ? 'rounded-full size-12 sm:size-24 object-cover' - : 'rounded size-12 sm:size-24 object-cover' + : 'rounded size-12 sm:size-24 object-cover', ]" /> @@ -132,8 +136,8 @@ @@ -183,9 +187,9 @@ :disabled="!canConfirm" class="text-sm text-white px-3 py-1.5 ms-auto rounded-md" :class="[ - canConfirm + canConfirm ? 'bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)]' - : 'bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] opacity-50' + : 'bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] opacity-50', ]" > Confirm @@ -321,20 +325,20 @@ export default class ActivityListItem extends Vue { this.record.fullClaim?.["@type"], this.record, this.activeDid, - this.confirmerIdList + this.confirmerIdList, ); return; } - this.$emit('confirmClaim', this.record); + this.$emit("confirmClaim", this.record); } get friendlyDate(): string { const date = new Date(this.record.issuedAt); return date.toLocaleDateString(undefined, { - year: 'numeric', - month: 'short', - day: 'numeric' + year: "numeric", + month: "short", + day: "numeric", }); } } diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index df14c1902..fc20db70d 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -466,7 +466,7 @@ export default class HomeView extends Vue { if (resp.status === 200) { await updateAccountSettings(this.activeDid, { isRegistered: true, - ...await retrieveSettingsForActiveAccount() + ...(await retrieveSettingsForActiveAccount()), }); this.isRegistered = true; } @@ -915,7 +915,7 @@ export default class HomeView extends Vue { this.$notify( { group: "modal", - type: "confirm", + type: "confirm", title: "Confirm", text: "Do you personally confirm that this is true?", onYes: async () => { @@ -924,46 +924,52 @@ export default class HomeView extends Vue { serverUtil.addLastClaimOrHandleAsIdIfMissing( record.fullClaim, record.jwtId, - record.handleId - ) - ) + record.handleId, + ), + ), ); - + const confirmationClaim = { "@context": "https://schema.org", - "@type": "AgreeAction", - object: goodClaim + "@type": "AgreeAction", + object: goodClaim, }; const result = await serverUtil.createAndSubmitClaim( confirmationClaim, this.activeDid, this.apiServer, - this.axios + this.axios, ); if (result.type === "success") { - this.$notify({ - group: "alert", - type: "success", - title: "Success", - text: "Confirmation submitted." - }, 3000); - + this.$notify( + { + group: "alert", + type: "success", + title: "Success", + text: "Confirmation submitted.", + }, + 3000, + ); + // Refresh the feed to show updated confirmation status await this.updateAllFeed(); } else { console.error("Error submitting confirmation:", result); - this.$notify({ - group: "alert", - type: "danger", - title: "Error", - text: "There was a problem submitting the confirmation." - }, 5000); + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "There was a problem submitting the confirmation.", + }, + 5000, + ); } - } + }, }, - -1 + -1, ); } } From 436f40813c397752f6ec3e516fd2b0db84125017 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Mon, 17 Mar 2025 21:03:58 +0800 Subject: [PATCH 10/13] Source-destination compacted - Narrower max-width - Element sizes adjusted - Switched to a more controllable unit for widths and heights --- src/components/ActivityListItem.vue | 38 +++++++++++++++-------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue index 82b4ddbe4..cccddfbe5 100644 --- a/src/components/ActivityListItem.vue +++ b/src/components/ActivityListItem.vue @@ -53,11 +53,11 @@

-
+
@@ -76,14 +76,14 @@ @@ -91,12 +91,12 @@
-
+
-
+
@@ -137,14 +139,14 @@ @@ -152,12 +154,12 @@
-
+
Date: Wed, 19 Mar 2025 20:47:10 +0800 Subject: [PATCH 11/13] Amount above arrow - Needs wiring up --- src/components/ActivityListItem.vue | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue index cccddfbe5..254795ec5 100644 --- a/src/components/ActivityListItem.vue +++ b/src/components/ActivityListItem.vue @@ -107,14 +107,21 @@
-
- +
+ 88 hours +
+ +
+
+ + +
From d024db2258f5d42845c9fd40c506ac1e88205469 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Fri, 21 Mar 2025 07:03:31 +0000 Subject: [PATCH 12/13] feature: move amount and wire it up --- src/components/ActivityListItem.vue | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue index 254795ec5..ae79e359c 100644 --- a/src/components/ActivityListItem.vue +++ b/src/components/ActivityListItem.vue @@ -110,7 +110,7 @@ class="absolute inset-x-28 sm:inset-x-40 mx-2 top-1/2 -translate-y-1/2" >
- 88 hours + {{ fetchAmount }}
@@ -228,19 +228,14 @@ export default class ActivityListItem extends Vue { @Prop() activeDid!: string; @Prop() confirmerIdList?: string[]; - private formatAmount(claim: unknown): string { + get fetchAmount(): string { + const claim = (this.record.fullClaim as unknown).claim || this.record.fullClaim; + const amount = claim.object?.amountOfThisGood ? this.displayAmount(claim.object.unitCode, claim.object.amountOfThisGood) : ""; - if (!claim.description && !amount) { - return "something not described"; - } - - if (!amount) return claim.description; - if (!claim.description) return amount; - - return `${claim.description} (and ${amount})`; + return amount; } private formatParticipantInfo(): string { @@ -293,9 +288,12 @@ export default class ActivityListItem extends Vue { get description(): string { const claim = (this.record.fullClaim as unknown).claim || this.record.fullClaim; - const amount = this.formatAmount(claim); + + if (!claim.description) { + return "something not described"; + } - return `${amount}`; + return `${claim.description}`; } get subDescription(): string { From f71c76fcd3ff13bf1bafa07204693aa77f753049 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Fri, 21 Mar 2025 15:52:45 +0800 Subject: [PATCH 13/13] Fix: removed links and elements - Removed links from icons and giver name - Removed confirm button - Lint fixes --- src/components/ActivityListItem.vue | 48 +++++++++-------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue index ae79e359c..73cb59b47 100644 --- a/src/components/ActivityListItem.vue +++ b/src/components/ActivityListItem.vue @@ -12,21 +12,16 @@
- + @@ -191,18 +184,6 @@ -
@@ -229,8 +210,9 @@ export default class ActivityListItem extends Vue { @Prop() confirmerIdList?: string[]; get fetchAmount(): string { - const claim = (this.record.fullClaim as unknown).claim || this.record.fullClaim; - + const claim = + (this.record.fullClaim as unknown).claim || this.record.fullClaim; + const amount = claim.object?.amountOfThisGood ? this.displayAmount(claim.object.unitCode, claim.object.amountOfThisGood) : ""; @@ -288,7 +270,7 @@ export default class ActivityListItem extends Vue { get description(): string { const claim = (this.record.fullClaim as unknown).claim || this.record.fullClaim; - + if (!claim.description) { return "something not described"; }