Skip to content

Commit

Permalink
Merge branch 'master' into samuv/edit-proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
samuveth committed Oct 2, 2023
2 parents c5b4aa2 + 6f8c844 commit e98929c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@shutter-network/shutter-crypto": "0.1.0-beta.3",
"@snapshot-labs/lock": "^0.2.0",
"@snapshot-labs/pineapple": "^1.1.0",
"@snapshot-labs/snapshot.js": "^0.6.4",
"@snapshot-labs/snapshot.js": "^0.7.0",
"@snapshot-labs/tune": "^0.1.33",
"@vue/apollo-composable": "4.0.0-beta.4",
"@vueuse/core": "^10.4.0",
Expand Down
2 changes: 1 addition & 1 deletion snapshot-spaces
17 changes: 15 additions & 2 deletions src/components/SpaceProposalHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ const threeDotItems = computed(() => {
if (isCreator.value) items.push({ text: t('edit'), action: 'edit' });
items.push({ text: t('duplicate'), action: 'duplicate' });
items.push({ text: t('report'), action: 'report' });
if ((props.isAdmin || props.isModerator) && !props.proposal.flagged) {
items.push({ text: t('flag'), action: 'flag' });
} else {
items.push({ text: t('report'), action: 'report' });
}
if (props.isAdmin || props.isModerator || isCreator.value)
items.push({ text: t('delete'), action: 'delete' });
return items;
Expand Down Expand Up @@ -51,10 +57,15 @@ const {
const { resetForm } = useFormSpaceProposal();
function handleSelect(e) {
async function handleSelect(e) {
if (!props.proposal) return;
if (e === 'delete') deleteProposal();
if (e === 'report') window.open('https://tally.so/r/mDBEGb', '_blank');
if (e === 'flag') {
await send(props.space, 'flag-proposal', {
proposal: props.proposal
});
}
if (e === 'duplicate' || e === 'edit') {
resetForm();
router.push({
Expand Down Expand Up @@ -152,7 +163,9 @@ watch(
<div class="flex items-center gap-2">
<i-ho-pencil v-if="item.action === 'edit'" />
<i-ho-document-duplicate v-if="item.action === 'duplicate'" />
<i-ho-flag v-if="item.action === 'report'" />
<i-ho-flag
v-if="item.action === 'report' || item.action === 'flag'"
/>
<i-ho-trash v-if="item.action === 'delete'" />
{{ item.text }}
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/composables/useClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ export function useClient() {
about: payload.about,
statement: payload.statement
});
} else if (type === 'flag-proposal') {
return client.flagProposal(auth.web3, web3.value.account, {
space: space.id,
proposal: payload.proposal.id
});
}
}

Expand Down
1 change: 1 addition & 0 deletions src/locales/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"copyLink": "Copy link",
"duplicate": "Duplicate",
"report": "Report",
"flag": "Flag",
"joinedSpaces": "Joined spaces",
"joinSpaces": "Join spaces",
"setDelegationToSpace": "Limit delegation to a specific space",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1853,10 +1853,10 @@
dependencies:
ofetch "^1.3.3"

"@snapshot-labs/snapshot.js@^0.6.4":
version "0.6.4"
resolved "https://registry.yarnpkg.com/@snapshot-labs/snapshot.js/-/snapshot.js-0.6.4.tgz#09f08ab8db0e16c172861438ffe8da3ffe5ac5ef"
integrity sha512-De8HWZrXhiV0D97Tp6CclZTXsQg4ePIu0grOym1sfvpHM/ILs4uoox634nDS4zE+/2/6SLp43fMo9dF5j6DXlw==
"@snapshot-labs/snapshot.js@^0.7.0":
version "0.7.0"
resolved "https://registry.yarnpkg.com/@snapshot-labs/snapshot.js/-/snapshot.js-0.7.0.tgz#50c16ada2bc7011a77edb02c38ddbc08e6331050"
integrity sha512-rmV4vlhEugnegHOUm7pq+p8OlzqiHv9JUMP5ZYc2vxAbLkibopk3x5o4ggaKxxNzDDzfOZMMCOZf3nzGMTMVCw==
dependencies:
"@ensdomains/eth-ens-namehash" "^2.0.15"
"@ethersproject/abi" "^5.6.4"
Expand Down

0 comments on commit e98929c

Please sign in to comment.