From 2743e59a3893255e76991046d07e757e1f1313ca Mon Sep 17 00:00:00 2001 From: Joystream Stats Date: Sun, 11 Dec 2022 20:45:13 +0000 Subject: [PATCH 1/8] Reverse order of proposal discussion posts (#3236) --- packages/ui/src/proposals/components/ProposalDiscussions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/src/proposals/components/ProposalDiscussions.tsx b/packages/ui/src/proposals/components/ProposalDiscussions.tsx index cc0ae2b2a7..b2920009ab 100644 --- a/packages/ui/src/proposals/components/ProposalDiscussions.tsx +++ b/packages/ui/src/proposals/components/ProposalDiscussions.tsx @@ -88,7 +88,7 @@ export const ProposalDiscussions = ({ thread, proposalId }: Props) => { - {discussionPosts.sort(Comparator(true, 'createdAt').string).map((post, index) => { + {discussionPosts.sort(Comparator(false, 'createdAt').string).map((post, index) => { return ( Date: Sun, 11 Dec 2022 21:03:06 +0000 Subject: [PATCH 2/8] Proposal discussion mode tooltip text (#3900) --- packages/ui/src/proposals/components/ProposalDiscussions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/src/proposals/components/ProposalDiscussions.tsx b/packages/ui/src/proposals/components/ProposalDiscussions.tsx index b2920009ab..a397f677a1 100644 --- a/packages/ui/src/proposals/components/ProposalDiscussions.tsx +++ b/packages/ui/src/proposals/components/ProposalDiscussions.tsx @@ -83,7 +83,7 @@ export const ProposalDiscussions = ({ thread, proposalId }: Props) => {

Discussion

{`${thread.mode} `} - + From 375a07d69ba85b08df89d9da7b682e70d572bb11 Mon Sep 17 00:00:00 2001 From: Joystream Stats Date: Sun, 11 Dec 2022 23:50:46 +0000 Subject: [PATCH 3/8] Optimize hook order (#3970) --- .../ui/src/app/pages/Proposals/ProposalPreview.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx b/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx index 3c18b5afe8..fd35c038ad 100644 --- a/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx +++ b/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx @@ -40,20 +40,19 @@ import { VoteRationaleModalCall } from '@/proposals/modals/VoteRationale/types' import { proposalPastStatuses } from '@/proposals/model/proposalStatus' export const ProposalPreview = () => { - const { id } = useParams<{ id: string }>() const history = useHistory() + const { id } = useParams<{ id: string }>() const { isLoading, proposal } = useProposal(id) - const { council } = useElectedCouncil() const constants = useProposalConstants(proposal?.details.type) - const loc = useLocation() - const voteId = new URLSearchParams(loc.search).get('showVote') const blocksToProposalExecution = useBlocksToProposalExecution(proposal, constants) + useRefetchQueries({ interval: MILLISECONDS_PER_BLOCK, include: ['getProposal', 'GetProposalVotes'] }, [proposal]) + const { council } = useElectedCouncil() + const loc = useLocation() + const voteId = new URLSearchParams(loc.search).get('showVote') const votingRounds = useVotingRounds(proposal?.votes, proposal?.proposalStatusUpdates) const [currentVotingRound, setVotingRound] = useState(0) - const votes = votingRounds[currentVotingRound] ?? votingRounds[0] - useRefetchQueries({ interval: MILLISECONDS_PER_BLOCK, include: ['getProposal', 'GetProposalVotes'] }, [proposal]) const notVoted = useMemo(() => { if ( !proposal || From 14334ee0e074587e18ec6bacb792ab4954025d02 Mon Sep 17 00:00:00 2001 From: Joystream Stats Date: Sun, 11 Dec 2022 23:53:19 +0000 Subject: [PATCH 4/8] Show proposal stake (#3966) --- packages/ui/src/app/pages/Proposals/ProposalPreview.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx b/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx index fd35c038ad..ffd1984db5 100644 --- a/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx +++ b/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx @@ -14,6 +14,7 @@ import { PageTitle } from '@/common/components/page/PageTitle' import { PreviousPage } from '@/common/components/page/PreviousPage' import { SidePanel } from '@/common/components/page/SidePanel' import { Label, TextInlineMedium, TextMedium } from '@/common/components/typography' +import { TokenValue } from '@/common/components/typography/TokenValue' import { camelCaseToText } from '@/common/helpers' import { useModal } from '@/common/hooks/useModal' import { useRefetchQueries } from '@/common/hooks/useRefetchQueries' @@ -194,6 +195,8 @@ export const ProposalPreview = () => { + + {constants ? : 'Loading...'} From 4ad354f3abb422f5e1fed1e132f6eb20f096c5c5 Mon Sep 17 00:00:00 2001 From: Joystream Stats Date: Mon, 12 Dec 2022 17:09:23 +0000 Subject: [PATCH 5/8] ProposalHistory: Show block number (#3966) --- packages/ui/src/proposals/components/ProposalHistory.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/ui/src/proposals/components/ProposalHistory.tsx b/packages/ui/src/proposals/components/ProposalHistory.tsx index 1c0c509e08..f63368bee0 100644 --- a/packages/ui/src/proposals/components/ProposalHistory.tsx +++ b/packages/ui/src/proposals/components/ProposalHistory.tsx @@ -21,9 +21,8 @@ export const ProposalHistory = ({ proposal }: ProposalHistoryProps) => { const steps = [createdStatus, ...updates, ...(endStatus || [])] return steps.map(({ status, inBlock }, index) => ({ - title: status, + title: `${status} in block ${inBlock.number}`, type: index === steps.length - 1 ? 'active' : 'past', - details: , })) }, [proposal.id]) From 480247273a76c39033823ded0c03fba0a3ca49eb Mon Sep 17 00:00:00 2001 From: "l1.media" <31551045+traumschule@users.noreply.github.com> Date: Sat, 28 Jan 2023 09:54:17 +0000 Subject: [PATCH 6/8] fix tooltip text --- packages/ui/src/proposals/components/ProposalDiscussions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/src/proposals/components/ProposalDiscussions.tsx b/packages/ui/src/proposals/components/ProposalDiscussions.tsx index ede7dea9a4..0f98896d7f 100644 --- a/packages/ui/src/proposals/components/ProposalDiscussions.tsx +++ b/packages/ui/src/proposals/components/ProposalDiscussions.tsx @@ -26,7 +26,7 @@ interface Props { } const hints = { - open: 'This is an open discussion, everyone can comment.', + open: 'Open discussion is open for every member to comment on, while closed would only be available for council members, white-listed members and creator of the proposal.', closed: 'This discussion is closed. Only selected members and the council can comment.', } From 6ef31aca429bc89306973e496f50ac02fe7dead4 Mon Sep 17 00:00:00 2001 From: "l1.media" <31551045+traumschule@users.noreply.github.com> Date: Mon, 13 Feb 2023 19:07:53 +0000 Subject: [PATCH 7/8] spacing Co-authored-by: Theophile Sandoz --- packages/ui/src/app/pages/Proposals/ProposalPreview.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx b/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx index ffd1984db5..63e237896f 100644 --- a/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx +++ b/packages/ui/src/app/pages/Proposals/ProposalPreview.tsx @@ -195,6 +195,9 @@ export const ProposalPreview = () => { + + + {constants ? : 'Loading...'} From bc91735e8fbf80c7b5a2053e5535338d66d665f4 Mon Sep 17 00:00:00 2001 From: Joystream Stats Date: Wed, 29 Mar 2023 15:16:26 +0000 Subject: [PATCH 8/8] revert `ProposalHistory.tsx` --- packages/ui/src/proposals/components/ProposalHistory.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/proposals/components/ProposalHistory.tsx b/packages/ui/src/proposals/components/ProposalHistory.tsx index f63368bee0..1c0c509e08 100644 --- a/packages/ui/src/proposals/components/ProposalHistory.tsx +++ b/packages/ui/src/proposals/components/ProposalHistory.tsx @@ -21,8 +21,9 @@ export const ProposalHistory = ({ proposal }: ProposalHistoryProps) => { const steps = [createdStatus, ...updates, ...(endStatus || [])] return steps.map(({ status, inBlock }, index) => ({ - title: `${status} in block ${inBlock.number}`, + title: status, type: index === steps.length - 1 ? 'active' : 'past', + details: , })) }, [proposal.id])