-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix past councils spending amounts (#4554)
* Fix-3225: used BudgetUpdatedEvent instead of BudgetSetEvent * Fix 3225 : updated test.tsx and mock server.ts * Fix 4121: migrated proposalExecutedEvent to Proposals * Fix 4121: updated the totalspent * Fix 4121 : Removed unnecessary line * Fix 4121 : Updated test.tsx * Fix 4121: Updated the code by Thesan's suggestion * added channelPayerMadeEvent
- Loading branch information
1 parent
bef916b
commit 022aadd
Showing
6 changed files
with
219 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,35 @@ | ||
import { useCouncilBlockRange } from '@/council/hooks/useCouncilBlockRange' | ||
import { useGetPastCouncilQuery } from '@/council/queries' | ||
import { useGetPastCouncilQuery, useGetPastCouncilWorkingGroupsQuery } from '@/council/queries' | ||
import { asPastCouncilWithDetails } from '@/council/types/PastCouncil' | ||
|
||
export const usePastCouncil = (id: string) => { | ||
const { loadingRange, fromBlock, toBlock } = useCouncilBlockRange(id) | ||
|
||
const { loading: loadingData, data: councilData } = useGetPastCouncilQuery({ variables: { id, fromBlock, toBlock } }) | ||
|
||
const { loading: loadingWorkingGroup, data: workingGroupData } = useGetPastCouncilWorkingGroupsQuery({ | ||
variables: { | ||
fromBlock: fromBlock, | ||
toBlock: toBlock, | ||
}, | ||
}) | ||
|
||
return { | ||
isLoading: loadingRange || loadingData, | ||
isLoading: loadingRange || loadingData || loadingWorkingGroup, | ||
council: | ||
councilData?.electedCouncilByUniqueInput && | ||
councilData?.budgetSpendingEvents && | ||
councilData?.fundingRequestsApproved && | ||
workingGroupData?.rewardPaidEvents && | ||
workingGroupData?.budgetUpdatedEvents && | ||
workingGroupData?.channelPaymentMadeEvents && | ||
asPastCouncilWithDetails( | ||
workingGroupData.rewardPaidEvents, | ||
workingGroupData.budgetUpdatedEvents, | ||
councilData.electedCouncilByUniqueInput, | ||
councilData.budgetSpendingEvents, | ||
councilData.fundingRequestsApproved | ||
councilData.fundingRequestsApproved, | ||
workingGroupData.channelPaymentMadeEvents | ||
), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
248 changes: 131 additions & 117 deletions
248
packages/ui/src/council/queries/__generated__/council.generated.tsx
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
022aadd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
pioneer-2-storybook – ./
pioneer-2-storybook-git-dev-joystream.vercel.app
pioneer-2-storybook-joystream.vercel.app
pioneer-2-storybook.vercel.app
022aadd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
pioneer-2 – ./
pioneer-2.vercel.app
pioneer-2-joystream.vercel.app
pioneer-2-git-dev-joystream.vercel.app