Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PROD] hotfix: add all reference codes to dashboard #935

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/graphql/queries/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export const QUERY_PROJECT_DASHBOARD_FUNDERS = gql`
}
fundingTxs {
email
paidAt
amount
uuid
}
rewards {
Expand Down
22 changes: 17 additions & 5 deletions src/pages/projectDashboard/sections/ProjectContributors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Text,
Th,
Thead,
Tooltip,
Tr,
VStack,
} from '@chakra-ui/react'
Expand Down Expand Up @@ -147,11 +148,21 @@ 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 (
<VStack alignItems="start">
{fundingTxs.map((tx) => (
<Tooltip
key={tx.uuid}
label={<SatoshiAmount>{tx.amount}</SatoshiAmount>}
>
<Text variant="caption">{tx.uuid}</Text>
</Tooltip>
))}
</VStack>
)
},
},
],
Expand Down Expand Up @@ -214,7 +225,8 @@ export const ProjectContributors = () => {
funder.amountFunded || '-',
rewardValue || '-',
dateString || '-',
funder.fundingTxs?.find((val) => val.email)?.email || '-',
funder.fundingTxs.find((val) => val.email)?.email || '-',
funder.fundingTxs.reduce((acc, tx) => `${acc} ${tx.uuid}`, ''),
]
csvData.push(funderData)
}
Expand Down
14 changes: 7 additions & 7 deletions src/types/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,6 @@ export type Entry = {
image?: Maybe<Scalars['String']>
/** Project within which the Entry was created. */
project?: Maybe<Project>
/** @deprecated This field was replaced by the status field and will eventually be removed. */
published: Scalars['Boolean']
publishedAt?: Maybe<Scalars['String']>
status: EntryStatus
/** Title of the Entry. */
Expand Down Expand Up @@ -467,7 +465,8 @@ export type FundingTx = {
source: Scalars['String']
sourceResource?: Maybe<SourceResource>
status: FundingStatus
uuid: Scalars['String']
/** Private reference code viewable only by the Funder and the ProjectOwner related to this FundingTx */
uuid?: Maybe<Scalars['String']>
}

export type FundingTxConfirmedSubscriptionResponse = {
Expand Down Expand Up @@ -2404,7 +2403,6 @@ export type EntryResolvers<
id?: Resolver<ResolversTypes['BigInt'], ParentType, ContextType>
image?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>
project?: Resolver<Maybe<ResolversTypes['Project']>, ParentType, ContextType>
published?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>
publishedAt?: Resolver<
Maybe<ResolversTypes['String']>,
ParentType,
Expand Down Expand Up @@ -2578,7 +2576,7 @@ export type FundingTxResolvers<
ContextType
>
status?: Resolver<ResolversTypes['FundingStatus'], ParentType, ContextType>
uuid?: Resolver<ResolversTypes['String'], ParentType, ContextType>
uuid?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -8937,6 +8936,7 @@ export const ProjectDashboardFundersDocument = gql`
}
fundingTxs {
email
amount
uuid
}
rewards {
Expand Down