From ddf67676bbf830868d8c21f3e4fbf5163bfce300 Mon Sep 17 00:00:00 2001 From: J Francisco Rader Date: Wed, 7 Jun 2023 16:27:58 -0300 Subject: [PATCH 1/3] fix: add all reference codes to dashboard --- src/graphql/queries/project.ts | 1 + .../sections/ProjectContributors.tsx | 21 +++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/graphql/queries/project.ts b/src/graphql/queries/project.ts index f4ad42e00..500ff9b61 100644 --- a/src/graphql/queries/project.ts +++ b/src/graphql/queries/project.ts @@ -175,6 +175,7 @@ export const QUERY_PROJECT_DASHBOARD_FUNDERS = gql` fundingTxs { email paidAt + amount uuid } rewards { diff --git a/src/pages/projectDashboard/sections/ProjectContributors.tsx b/src/pages/projectDashboard/sections/ProjectContributors.tsx index 7bef65e00..ebce51ff6 100644 --- a/src/pages/projectDashboard/sections/ProjectContributors.tsx +++ b/src/pages/projectDashboard/sections/ProjectContributors.tsx @@ -10,6 +10,7 @@ import { Text, Th, Thead, + Tooltip, Tr, VStack, } from '@chakra-ui/react' @@ -147,11 +148,23 @@ export const ProjectContributors = () => { }, }, { - header: 'Reference code', + header: 'Reference codes', key: 'reference', - value(val: Funder) { - const tx = val.fundingTxs.find((tx) => tx.paidAt) - return tx?.uuid || '-' + render({ fundingTxs }: Funder) { + return ( + + {fundingTxs + .filter((tx) => Boolean(tx.paidAt)) + .map((tx) => ( + {tx.amount}} + > + {tx.uuid} + + ))} + + ) }, }, ], From be1af0bc4721b0fc98ccaddfeff1e0edc336c1f9 Mon Sep 17 00:00:00 2001 From: J Francisco Rader Date: Wed, 7 Jun 2023 20:08:53 -0300 Subject: [PATCH 2/3] fix: add reference codes to copy and download actions --- src/pages/projectDashboard/sections/ProjectContributors.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/projectDashboard/sections/ProjectContributors.tsx b/src/pages/projectDashboard/sections/ProjectContributors.tsx index ebce51ff6..dd30f3e82 100644 --- a/src/pages/projectDashboard/sections/ProjectContributors.tsx +++ b/src/pages/projectDashboard/sections/ProjectContributors.tsx @@ -228,6 +228,9 @@ export const ProjectContributors = () => { rewardValue || '-', dateString || '-', funder.fundingTxs?.find((val) => val.email)?.email || '-', + funder.fundingTxs + .filter((tx) => Boolean(tx.paidAt)) + .reduce((acc, tx) => `${acc} ${tx.uuid}`, ''), ] csvData.push(funderData) } From 7efd5666ca31d94d8deb8b0ab02e1802bbb98fa4 Mon Sep 17 00:00:00 2001 From: J Francisco Rader Date: Thu, 8 Jun 2023 14:34:57 -0300 Subject: [PATCH 3/3] fix: remove unnecessary filters --- src/graphql/queries/project.ts | 1 - .../sections/ProjectContributors.tsx | 24 ++++++++----------- src/types/generated/graphql.ts | 14 +++++------ 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/graphql/queries/project.ts b/src/graphql/queries/project.ts index 500ff9b61..b32c108e0 100644 --- a/src/graphql/queries/project.ts +++ b/src/graphql/queries/project.ts @@ -174,7 +174,6 @@ export const QUERY_PROJECT_DASHBOARD_FUNDERS = gql` } fundingTxs { email - paidAt amount uuid } diff --git a/src/pages/projectDashboard/sections/ProjectContributors.tsx b/src/pages/projectDashboard/sections/ProjectContributors.tsx index dd30f3e82..63535855b 100644 --- a/src/pages/projectDashboard/sections/ProjectContributors.tsx +++ b/src/pages/projectDashboard/sections/ProjectContributors.tsx @@ -153,16 +153,14 @@ export const ProjectContributors = () => { render({ fundingTxs }: Funder) { return ( - {fundingTxs - .filter((tx) => Boolean(tx.paidAt)) - .map((tx) => ( - {tx.amount}} - > - {tx.uuid} - - ))} + {fundingTxs.map((tx) => ( + {tx.amount}} + > + {tx.uuid} + + ))} ) }, @@ -227,10 +225,8 @@ export const ProjectContributors = () => { funder.amountFunded || '-', rewardValue || '-', dateString || '-', - funder.fundingTxs?.find((val) => val.email)?.email || '-', - funder.fundingTxs - .filter((tx) => Boolean(tx.paidAt)) - .reduce((acc, tx) => `${acc} ${tx.uuid}`, ''), + funder.fundingTxs.find((val) => val.email)?.email || '-', + funder.fundingTxs.reduce((acc, tx) => `${acc} ${tx.uuid}`, ''), ] csvData.push(funderData) } diff --git a/src/types/generated/graphql.ts b/src/types/generated/graphql.ts index 04cb14417..eab019ace 100644 --- a/src/types/generated/graphql.ts +++ b/src/types/generated/graphql.ts @@ -254,8 +254,6 @@ export type Entry = { image?: Maybe /** Project within which the Entry was created. */ project?: Maybe - /** @deprecated This field was replaced by the status field and will eventually be removed. */ - published: Scalars['Boolean'] publishedAt?: Maybe status: EntryStatus /** Title of the Entry. */ @@ -467,7 +465,8 @@ export type FundingTx = { source: Scalars['String'] sourceResource?: Maybe status: FundingStatus - uuid: Scalars['String'] + /** Private reference code viewable only by the Funder and the ProjectOwner related to this FundingTx */ + uuid?: Maybe } export type FundingTxConfirmedSubscriptionResponse = { @@ -2404,7 +2403,6 @@ export type EntryResolvers< id?: Resolver image?: Resolver, ParentType, ContextType> project?: Resolver, ParentType, ContextType> - published?: Resolver publishedAt?: Resolver< Maybe, ParentType, @@ -2578,7 +2576,7 @@ export type FundingTxResolvers< ContextType > status?: Resolver - uuid?: Resolver + uuid?: Resolver, ParentType, ContextType> __isTypeOf?: IsTypeOfResolverFn } @@ -4102,7 +4100,7 @@ export type FundingTxWithInvoiceStatusFragment = { export type FundingTxFragment = { __typename?: 'FundingTx' id: any - uuid: string + uuid?: string | null invoiceId: string paymentRequest?: string | null amount: number @@ -5311,7 +5309,8 @@ export type ProjectDashboardFundersQuery = { fundingTxs: Array<{ __typename?: 'FundingTx' email?: string | null - uuid: string + amount: number + uuid?: string | null }> rewards: Array<{ __typename?: 'FunderReward' @@ -8937,6 +8936,7 @@ export const ProjectDashboardFundersDocument = gql` } fundingTxs { email + amount uuid } rewards {