Skip to content

Commit

Permalink
feat: show warning message for flagged proposals (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e authored Nov 28, 2024
1 parent 0d81eef commit 4b45ddd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/ui/src/networks/common/graphqlApi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ function formatProposal(
state: getProposalState(proposal, current),
network: networkId,
privacy: null,
quorum: +proposal.quorum
quorum: +proposal.quorum,
flagged: false
};
}

Expand Down
3 changes: 2 additions & 1 deletion apps/ui/src/networks/offchain/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ function formatProposal(proposal: ApiProposal, networkId: NetworkID): Proposal {
tx: '',
execution_tx: null,
veto_tx: null,
privacy: proposal.privacy
privacy: proposal.privacy,
flagged: proposal.flagged
};
}

Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/networks/offchain/api/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ const PROPOSAL_FRAGMENT = gql`
votes
privacy
plugins
flagged
}
`;

Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/networks/offchain/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export type ApiProposal = {
votes: number;
privacy: Privacy;
plugins: Record<string, any>;
flagged: boolean;
};

export type ApiVote = {
Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ export type Proposal = {
cancelled: boolean;
state: ProposalState;
privacy: Privacy;
flagged: boolean;
};

export type UserProfile = {
Expand Down
5 changes: 5 additions & 0 deletions apps/ui/src/views/Proposal/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ onBeforeUnmount(() => destroyAudio());
<template>
<UiContainer class="pt-5 !max-w-[710px] mx-0 md:mx-auto">
<div>
<UiAlert v-if="proposal.flagged" type="error" class="mb-3">
This proposal might contain scams, offensive material, or be malicious
in nature. Please proceed with caution.
</UiAlert>

<h1 class="mb-3 text-[40px] leading-[1.1em] break-words">
{{ proposal.title || `Proposal #${proposal.proposal_id}` }}
</h1>
Expand Down

0 comments on commit 4b45ddd

Please sign in to comment.