Skip to content

Commit

Permalink
fix: update proposal details page [web-desmos] (#1323)
Browse files Browse the repository at this point in the history
## Description

Closes: #XXXX
[BDU-1165](https://forbole.atlassian.net/browse/BDU-1165)
<!-- Add a description of the changes that this PR introduces and the
files that
are the most critical to review. -->

---

### Author Checklist

_All items are required. Please add a note to the item if the item is
not applicable and
please add links to any relevant follow up issues._

I have...

- [x] ran linting via `yarn lint`
- [ ] wrote tests where necessary
- [x] included the correct [type
prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json)
in the PR title
- [x] targeted the correct branch
- [x] provided a link to the relevant issue or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed
- [x] added a changeset via [`yarn && yarn
changeset`](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)


[BDU-1165]:
https://forbole.atlassian.net/browse/BDU-1165?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
MonikaCat authored Feb 7, 2024
1 parent 10bfd25 commit 9dedd5e
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-knives-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'web-desmos': major
---

update proposal details page
3 changes: 2 additions & 1 deletion apps/web-desmos/src/chain.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"title": "Desmos Block Explorer",
"extra": {
"profile": true,
"graphqlWs": false
"graphqlWs": false,
"votingPowerExponent": 6
},
"previewImage": "https://s3.bigdipper.live/desmos.png",
"themes": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ query ProposalDetails($proposalId: Int) {
content
proposalId: id
submitTime: submit_time
# proposalType: proposal_type
metadata
depositEndTime: deposit_end_time
votingStartTime: voting_start_time
votingEndTime: voting_end_time
Expand Down
37 changes: 19 additions & 18 deletions apps/web-desmos/src/graphql/types/general_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3257,7 +3257,7 @@ export type Messages_By_Address_Args = {
types?: InputMaybe<Scalars['_text']>;
};

export type Messages_By_Types_Args = {
export type Messages_By_Type_Args = {
limit?: InputMaybe<Scalars['bigint']>;
offset?: InputMaybe<Scalars['bigint']>;
types?: InputMaybe<Scalars['_text']>;
Expand Down Expand Up @@ -5553,10 +5553,10 @@ export type Query_Root = {
messages_by_address: Array<Message>;
/** execute function "messages_by_address" and query aggregates on result of table type "message" */
messages_by_address_aggregate: Message_Aggregate;
/** execute function "messages_by_types" which returns "message" */
messages_by_types: Array<Message>;
/** execute function "messages_by_types" and query aggregates on result of table type "message" */
messages_by_types_aggregate: Message_Aggregate;
/** execute function "messages_by_type" which returns "message" */
messages_by_type: Array<Message>;
/** execute function "messages_by_type" and query aggregates on result of table type "message" */
messages_by_type_aggregate: Message_Aggregate;
/** execute function "messages_types_by_address" which returns "message" */
messages_types_by_address: Array<Message>;
/** execute function "messages_types_by_address" and query aggregates on result of table type "message" */
Expand Down Expand Up @@ -6140,8 +6140,8 @@ export type Query_RootMessages_By_Address_AggregateArgs = {
};


export type Query_RootMessages_By_TypesArgs = {
args: Messages_By_Types_Args;
export type Query_RootMessages_By_TypeArgs = {
args: Messages_By_Type_Args;
distinct_on?: InputMaybe<Array<Message_Select_Column>>;
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
Expand All @@ -6150,8 +6150,8 @@ export type Query_RootMessages_By_TypesArgs = {
};


export type Query_RootMessages_By_Types_AggregateArgs = {
args: Messages_By_Types_Args;
export type Query_RootMessages_By_Type_AggregateArgs = {
args: Messages_By_Type_Args;
distinct_on?: InputMaybe<Array<Message_Select_Column>>;
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
Expand Down Expand Up @@ -7470,10 +7470,10 @@ export type Subscription_Root = {
messages_by_address: Array<Message>;
/** execute function "messages_by_address" and query aggregates on result of table type "message" */
messages_by_address_aggregate: Message_Aggregate;
/** execute function "messages_by_types" which returns "message" */
messages_by_types: Array<Message>;
/** execute function "messages_by_types" and query aggregates on result of table type "message" */
messages_by_types_aggregate: Message_Aggregate;
/** execute function "messages_by_type" which returns "message" */
messages_by_type: Array<Message>;
/** execute function "messages_by_type" and query aggregates on result of table type "message" */
messages_by_type_aggregate: Message_Aggregate;
/** execute function "messages_types_by_address" which returns "message" */
messages_types_by_address: Array<Message>;
/** execute function "messages_types_by_address" and query aggregates on result of table type "message" */
Expand Down Expand Up @@ -7971,8 +7971,8 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = {
};


export type Subscription_RootMessages_By_TypesArgs = {
args: Messages_By_Types_Args;
export type Subscription_RootMessages_By_TypeArgs = {
args: Messages_By_Type_Args;
distinct_on?: InputMaybe<Array<Message_Select_Column>>;
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
Expand All @@ -7981,8 +7981,8 @@ export type Subscription_RootMessages_By_TypesArgs = {
};


export type Subscription_RootMessages_By_Types_AggregateArgs = {
args: Messages_By_Types_Args;
export type Subscription_RootMessages_By_Type_AggregateArgs = {
args: Messages_By_Type_Args;
distinct_on?: InputMaybe<Array<Message_Select_Column>>;
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
Expand Down Expand Up @@ -12289,7 +12289,7 @@ export type ProposalDetailsQueryVariables = Exact<{
}>;


export type ProposalDetailsQuery = { proposal: Array<{ __typename?: 'proposal', title: string, description?: string | null, status?: string | null, content: any, proposer: string, proposalId: number, submitTime: any, depositEndTime?: any | null, votingStartTime?: any | null, votingEndTime?: any | null }> };
export type ProposalDetailsQuery = { proposal: Array<{ __typename?: 'proposal', title: string, description?: string | null, status?: string | null, content: any, metadata?: string | null, proposer: string, proposalId: number, submitTime: any, depositEndTime?: any | null, votingStartTime?: any | null, votingEndTime?: any | null }> };

export type ProposalDetailsTallyQueryVariables = Exact<{
proposalId?: InputMaybe<Scalars['Int']>;
Expand Down Expand Up @@ -13361,6 +13361,7 @@ export const ProposalDetailsDocument = gql`
content
proposalId: id
submitTime: submit_time
metadata
depositEndTime: deposit_end_time
votingStartTime: voting_start_time
votingEndTime: voting_end_time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,20 @@ const Overview: FC<{ className?: string; overview: OverviewType }> = ({ classNam
/>
<Divider />
<div className={classes.content}>
<Typography variant="body1" className="label">
{t('type')}
</Typography>
<Typography variant="body1">
{types.map((type: string) => (
<Typography variant="body1" className="value" key={type}>
{t(type)}
{types.length > 0 && (
<>
<Typography variant="body1" className="label">
{t('type')}
</Typography>
))}
</Typography>
<Typography variant="body1">
{types.map((type: string) => (
<Typography variant="body1" className="value" key={type}>
{t(type)}
</Typography>
))}
</Typography>
</>
)}
<Typography variant="body1" className="label">
{t('proposer')}
</Typography>
Expand Down Expand Up @@ -190,6 +194,14 @@ const Overview: FC<{ className?: string; overview: OverviewType }> = ({ classNam
{t('description')}
</Typography>
<Markdown markdown={overview.description} />
{!!overview.metadata && (
<>
<Typography variant="body1" className="label">
{t('metadata')}
</Typography>
<Markdown markdown={overview?.metadata} />
</>
)}
{extra}
</div>
</Box>
Expand Down
2 changes: 2 additions & 0 deletions apps/web-desmos/src/screens/proposal_details/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const formatOverview = (data: ProposalDetailsQuery) => {
title: data?.proposal?.[0]?.title ?? '',
id: data?.proposal?.[0]?.proposalId ?? '',
description: data?.proposal?.[0]?.description ?? '',
metadata: data?.proposal?.[0]?.metadata ?? '',
status: data?.proposal?.[0]?.status ?? '',
submitTime: data?.proposal?.[0]?.submitTime ?? '',
depositEndTime: data?.proposal?.[0]?.depositEndTime ?? '',
Expand Down Expand Up @@ -62,6 +63,7 @@ export const useProposalDetails = () => {
title: '',
id: 0,
description: '',
metadata: '',
status: '',
submitTime: '',
depositEndTime: '',
Expand Down
1 change: 1 addition & 0 deletions apps/web-desmos/src/screens/proposal_details/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface OverviewType {
id: number;
proposer: string;
description: string;
metadata: string;
status: string;
submitTime: string;
depositEndTime: string;
Expand Down
1 change: 1 addition & 0 deletions packages/ui/public/locales/en/proposals.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"votingEndTime": "Voting End Time",
"votingStartTime": "Voting Start Time",
"content": "Content",
"metadata": "Metadata",
"textProposal": "Text Proposal",
"parameterChangeProposal": "Parameter Change Proposal",
"communityPoolSpendProposal": "Community Pool Spend Proposal",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/public/locales/it/proposals.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"votingEndTime": "Ora di fine della votazione",
"votingStartTime": "Ora di inizio della votazione",
"content": "Contenuto",
"metadata": "Metadati",
"textProposal": "Proposal di testo",
"parameterChangeProposal": "Proposal di modifica dei parametri",
"communityPoolSpendProposal": "Proposal di spesa della community pool",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/public/locales/pl/proposals.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"votingEndTime": "Czas zakończenia głosowania",
"votingStartTime": "Czas rozpoczęcia głosowania",
"content": "Treść",
"metadata": "Metadata",
"textProposal": "Propozycja tekst",
"parameterChangeProposal": "Propozycja zmiany parametru",
"communityPoolSpendProposal": "Propozycja wydatkowania puli społeczności",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/public/locales/zhs/proposals.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"votingEndTime": "投票结束时间",
"votingStartTime": "投票开始时间",
"content": "内容",
"metadata": "元数据",
"textProposal": "文本提案",
"parameterChangeProposal": "参数变更提案",
"communityPoolSpendProposal": "社区资金池支出提案",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/public/locales/zht/proposals.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"votingEndTime": "投票結束時間",
"votingStartTime": "投票開始時間",
"content": "內容",
"metadata": "元資料",
"textProposal": "文本議案",
"parameterChangeProposal": "參數變更議案",
"communityPoolSpendProposal": "社群池支出議案",
Expand Down

0 comments on commit 9dedd5e

Please sign in to comment.