From 48e898db1ab4482fdd54c29545fe592e9bf4bacb Mon Sep 17 00:00:00 2001 From: Theophile Sandoz Date: Fri, 18 Aug 2023 11:36:50 +0200 Subject: [PATCH] Fix the story --- .../src/app/pages/Proposals/ProposalPreview.stories.tsx | 5 +---- packages/ui/src/mocks/data/proposals.ts | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/ui/src/app/pages/Proposals/ProposalPreview.stories.tsx b/packages/ui/src/app/pages/Proposals/ProposalPreview.stories.tsx index 088e7f98ab..f7fc5515b1 100644 --- a/packages/ui/src/app/pages/Proposals/ProposalPreview.stories.tsx +++ b/packages/ui/src/app/pages/Proposals/ProposalPreview.stories.tsx @@ -153,10 +153,7 @@ export default { title: PROPOSAL_DATA.title, description: PROPOSAL_DATA.description, status, - type: - args.type === 'FundingRequestMultipleRecipientsProposalDetails' - ? 'FundingRequestProposalDetails' - : args.type, + type: args.type, creator: args.isProposer ? alice : bob, discussionThread: { diff --git a/packages/ui/src/mocks/data/proposals.ts b/packages/ui/src/mocks/data/proposals.ts index f693b749e0..af545621a3 100644 --- a/packages/ui/src/mocks/data/proposals.ts +++ b/packages/ui/src/mocks/data/proposals.ts @@ -90,10 +90,10 @@ const proposalDetails = { VetoProposalDetails: { proposal: { __typename: 'Proposal', id: '0', title: random.words(4) } }, } as Record> -export const proposalDetailsMap = mapValues( - proposalDetails, - (value, __typename) => Object.assign(value, { __typename }) as Partial -) +export const proposalDetailsMap = mapValues(proposalDetails, (value, key) => { + const __typename = key === 'FundingRequestMultipleRecipientsProposalDetails' ? 'FundingRequestProposalDetails' : key + return Object.assign(value, { __typename }) as Partial +}) export const proposalTypes = Object.keys(proposalDetailsMap) as ProposalDetailsType[]