Skip to content

Commit

Permalink
Merge pull request #84 from alleslabs/feat/proposal-table
Browse files Browse the repository at this point in the history
feat: proposal table ui and wireup
  • Loading branch information
poomthiti authored Jan 13, 2023
2 parents 470edf0 + 2ccb825 commit 2694213
Show file tree
Hide file tree
Showing 16 changed files with 784 additions and 64 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- [#84](https://github.com/alleslabs/celatone-frontend/pull/84) Contract proposals table ui and wireup
- [#82](https://github.com/alleslabs/celatone-frontend/pull/82) Add all codes page
- [#83](https://github.com/alleslabs/celatone-frontend/pull/83) Add invalid code state
- [#73](https://github.com/alleslabs/celatone-frontend/pull/73) Wireup migration table
Expand Down
40 changes: 40 additions & 0 deletions src/lib/data/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,46 @@ export const getMigrationHistoriesCountByContractAddress = graphql(`
}
`);

export const getRelatedProposalsByContractAddress = graphql(`
query getRelatedProposalsByContractAddress(
$contractAddress: String!
$offset: Int!
$pageSize: Int!
) {
contract_proposals(
where: { contract: { address: { _eq: $contractAddress } } }
order_by: { proposal_id: desc }
offset: $offset
limit: $pageSize
) {
proposal {
title
status
voting_end_time
deposit_end_time
type
account {
address
}
}
proposal_id
resolved_height
}
}
`);

export const getRelatedProposalsCountByContractAddress = graphql(`
query getRelatedProposalsCountByContractAddress($contractAddress: String!) {
contract_proposals_aggregate(
where: { contract: { address: { _eq: $contractAddress } } }
) {
aggregate {
count
}
}
}
`);

export const getContractListByCodeId = graphql(`
query getContractListByCodeId($codeId: Int!, $offset: Int!, $pageSize: Int!) {
contracts(
Expand Down
10 changes: 10 additions & 0 deletions src/lib/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ const documents = {
types.GetMigrationHistoriesByContractAddressDocument,
"\n query getMigrationHistoriesCountByContractAddress($contractAddress: String!) {\n contract_histories_aggregate(\n where: { contract: { address: { _eq: $contractAddress } } }\n ) {\n aggregate {\n count\n }\n }\n }\n":
types.GetMigrationHistoriesCountByContractAddressDocument,
"\n query getRelatedProposalsByContractAddress(\n $contractAddress: String!\n $offset: Int!\n $pageSize: Int!\n ) {\n contract_proposals(\n where: { contract: { address: { _eq: $contractAddress } } }\n order_by: { proposal_id: desc }\n offset: $offset\n limit: $pageSize\n ) {\n proposal {\n title\n status\n voting_end_time\n deposit_end_time\n type\n account {\n address\n }\n }\n proposal_id\n resolved_height\n }\n }\n":
types.GetRelatedProposalsByContractAddressDocument,
"\n query getRelatedProposalsCountByContractAddress($contractAddress: String!) {\n contract_proposals_aggregate(\n where: { contract: { address: { _eq: $contractAddress } } }\n ) {\n aggregate {\n count\n }\n }\n }\n":
types.GetRelatedProposalsCountByContractAddressDocument,
"\n query getContractListByCodeId($codeId: Int!, $offset: Int!, $pageSize: Int!) {\n contracts(\n where: { code_id: { _eq: $codeId } }\n order_by: { transaction: { block: { timestamp: desc } } }\n offset: $offset\n limit: $pageSize\n ) {\n address\n label\n transaction {\n block {\n timestamp\n }\n account {\n address\n }\n }\n }\n }\n":
types.GetContractListByCodeIdDocument,
"\n query getContractListCountByCodeId($codeId: Int!) {\n contracts_aggregate(where: { code_id: { _eq: $codeId } }) {\n aggregate {\n count\n }\n }\n }\n":
Expand Down Expand Up @@ -61,6 +65,12 @@ export function graphql(
export function graphql(
source: "\n query getMigrationHistoriesCountByContractAddress($contractAddress: String!) {\n contract_histories_aggregate(\n where: { contract: { address: { _eq: $contractAddress } } }\n ) {\n aggregate {\n count\n }\n }\n }\n"
): typeof documents["\n query getMigrationHistoriesCountByContractAddress($contractAddress: String!) {\n contract_histories_aggregate(\n where: { contract: { address: { _eq: $contractAddress } } }\n ) {\n aggregate {\n count\n }\n }\n }\n"];
export function graphql(
source: "\n query getRelatedProposalsByContractAddress(\n $contractAddress: String!\n $offset: Int!\n $pageSize: Int!\n ) {\n contract_proposals(\n where: { contract: { address: { _eq: $contractAddress } } }\n order_by: { proposal_id: desc }\n offset: $offset\n limit: $pageSize\n ) {\n proposal {\n title\n status\n voting_end_time\n deposit_end_time\n type\n account {\n address\n }\n }\n proposal_id\n resolved_height\n }\n }\n"
): typeof documents["\n query getRelatedProposalsByContractAddress(\n $contractAddress: String!\n $offset: Int!\n $pageSize: Int!\n ) {\n contract_proposals(\n where: { contract: { address: { _eq: $contractAddress } } }\n order_by: { proposal_id: desc }\n offset: $offset\n limit: $pageSize\n ) {\n proposal {\n title\n status\n voting_end_time\n deposit_end_time\n type\n account {\n address\n }\n }\n proposal_id\n resolved_height\n }\n }\n"];
export function graphql(
source: "\n query getRelatedProposalsCountByContractAddress($contractAddress: String!) {\n contract_proposals_aggregate(\n where: { contract: { address: { _eq: $contractAddress } } }\n ) {\n aggregate {\n count\n }\n }\n }\n"
): typeof documents["\n query getRelatedProposalsCountByContractAddress($contractAddress: String!) {\n contract_proposals_aggregate(\n where: { contract: { address: { _eq: $contractAddress } } }\n ) {\n aggregate {\n count\n }\n }\n }\n"];
export function graphql(
source: "\n query getContractListByCodeId($codeId: Int!, $offset: Int!, $pageSize: Int!) {\n contracts(\n where: { code_id: { _eq: $codeId } }\n order_by: { transaction: { block: { timestamp: desc } } }\n offset: $offset\n limit: $pageSize\n ) {\n address\n label\n transaction {\n block {\n timestamp\n }\n account {\n address\n }\n }\n }\n }\n"
): typeof documents["\n query getContractListByCodeId($codeId: Int!, $offset: Int!, $pageSize: Int!) {\n contracts(\n where: { code_id: { _eq: $codeId } }\n order_by: { transaction: { block: { timestamp: desc } } }\n offset: $offset\n limit: $pageSize\n ) {\n address\n label\n transaction {\n block {\n timestamp\n }\n account {\n address\n }\n }\n }\n }\n"];
Expand Down
Loading

1 comment on commit 2694213

@vercel
Copy link

@vercel vercel bot commented on 2694213 Jan 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.