From db2dde33c96b403c8b5848890c9711da4bcbeadd Mon Sep 17 00:00:00 2001 From: Wan <495709+wa0x6e@users.noreply.github.com> Date: Fri, 25 Oct 2024 00:30:00 +0400 Subject: [PATCH 01/59] fix: enable offchain proposal update (#935) * fix: enable edit menu for offchain proposal * fix: redirect to offchain proposal page after update * fix: more compact code --------- Co-authored-by: Chaitanya --- apps/ui/src/views/Proposal/Overview.vue | 9 +++++++-- apps/ui/src/views/Space/Editor.vue | 17 ++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/apps/ui/src/views/Proposal/Overview.vue b/apps/ui/src/views/Proposal/Overview.vue index eb59ffc40..ab08f9595 100644 --- a/apps/ui/src/views/Proposal/Overview.vue +++ b/apps/ui/src/views/Proposal/Overview.vue @@ -46,11 +46,15 @@ const cancelling = ref(false); const aiSummaryOpen = ref(false); const editable = computed(() => { - // HACK: here we need to use snapshot instead of start because start is artifically + // HACK: here we need to use snapshot instead of start because start is artificially // shifted for Starknet's proposals with ERC20Votes strategies. + const pivotName = offchainNetworks.includes(props.proposal.network) + ? 'start' + : 'snapshot'; + return ( compareAddresses(props.proposal.author.id, web3.value.account) && - props.proposal.snapshot > + props.proposal[pivotName] > (getCurrent(props.proposal.network) || Number.POSITIVE_INFINITY) ); }); @@ -123,6 +127,7 @@ async function handleEditClick() { discussion: props.proposal.discussion, type: props.proposal.type, choices: props.proposal.choices, + labels: props.proposal.labels, executions }); diff --git a/apps/ui/src/views/Space/Editor.vue b/apps/ui/src/views/Space/Editor.vue index 77751c5be..af5b8e5ed 100644 --- a/apps/ui/src/views/Space/Editor.vue +++ b/apps/ui/src/views/Space/Editor.vue @@ -216,9 +216,20 @@ async function handleProposeClick() { } if (result) { proposalsStore.reset(props.space.id, props.space.network); - router.push({ - name: 'space-proposals' - }); + + if ( + proposal.value.proposalId && + offchainNetworks.includes(props.space.network) + ) { + router.push({ + name: 'space-proposal-overview', + params: { + proposal: proposal.value.proposalId + } + }); + } else { + router.push({ name: 'space-proposals' }); + } } } finally { sending.value = false; From a1555a97a7deb0818c7f94c8638cba8b9a20d6e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Tkaczy=C5=84ski?= Date: Fri, 25 Oct 2024 13:42:32 +0200 Subject: [PATCH 02/59] chore: bump subgraph-api to 0.0.43 (#930) --- apps/subgraph-api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/subgraph-api/package.json b/apps/subgraph-api/package.json index 4235bd966..6e68dcfc8 100644 --- a/apps/subgraph-api/package.json +++ b/apps/subgraph-api/package.json @@ -1,7 +1,7 @@ { "name": "api-subgraph", "private": true, - "version": "0.0.42", + "version": "0.0.43", "scripts": { "test": "graph test", "codegen": "graph codegen", From 8114aa11409fd44611544e60b90d88b2a969179a Mon Sep 17 00:00:00 2001 From: Less Date: Fri, 25 Oct 2024 18:50:13 +0700 Subject: [PATCH 03/59] feat: support custom label for basic voting (#868) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support custom label for basic voting * feat: display custom choice labels * feat: use custom choices in vote modal * feat: show choice icon on proposal edit * feat: use custom choices for onchain proposals * feat: prevent deleting non-optional choices * feat: prevent adding more choices * feat: show delete button when possible * feat: use custom plcaeholder for basic choices * feat: handle proposals without abstain --------- Co-authored-by: Wiktor Tkaczyński --- apps/ui/src/components/EditorChoices.vue | 56 ++++++++++++++++--- apps/ui/src/components/ProposalResults.vue | 8 +-- apps/ui/src/components/ProposalVote.vue | 31 ++++++++-- apps/ui/src/components/ProposalVoteBasic.vue | 7 ++- apps/ui/src/components/ProposalsListItem.vue | 1 + apps/ui/src/composables/useEditor.ts | 6 +- apps/ui/src/helpers/utils.ts | 10 +++- .../src/networks/common/graphqlApi/index.ts | 4 +- .../src/networks/common/graphqlApi/queries.ts | 1 + .../src/networks/common/graphqlApi/types.ts | 1 + apps/ui/src/views/Proposal.vue | 1 + apps/ui/src/views/Space/Editor.vue | 7 ++- 12 files changed, 101 insertions(+), 32 deletions(-) diff --git a/apps/ui/src/components/EditorChoices.vue b/apps/ui/src/components/EditorChoices.vue index 594c8b1a8..109435a0c 100644 --- a/apps/ui/src/components/EditorChoices.vue +++ b/apps/ui/src/components/EditorChoices.vue @@ -1,10 +1,12 @@