-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for hibernated spaces (#4350)
* feat: disable proposal creation on hibernate spaces * fix: add button to reactivate space * fix: add link to hibernation doc * fix: add translations * chore: fix formatting * refactor: extract hibernation warning message to its own component * feat: reactivate space via sequencer * chore: formatting fix * fix: show success message on space reactivation * fix: add link to doc * chore: fix formatting * fix: use settings basic update to reactivate space * chore: fix formatting * fix: redirect reactivate space CTA to settings page * fix: update hibernated warning message * feat: add space reactivation message in space settings * Update src/components/MessageWarningHibernated.vue Co-authored-by: Sam <51686767+samuveth@users.noreply.github.com> * fix: increase warning level to red * fix: remove title and change layout * fix: "learn more" should only visible to admin/controller * refactor: extract message into its own components * Update src/locales/default.json * Fixes * Update src/locales/default.json --------- Co-authored-by: Sam <51686767+samuveth@users.noreply.github.com> Co-authored-by: Sam <samuv.eth@gmail.com> Co-authored-by: Chaitanya <yourchaitu@gmail.com>
- Loading branch information
1 parent
495fe60
commit 89c2314
Showing
10 changed files
with
130 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<script setup lang="ts"> | ||
import { ExtendedSpace } from '@/helpers/interfaces'; | ||
const props = defineProps<{ | ||
space: ExtendedSpace; | ||
}>(); | ||
const { web3Account } = useWeb3(); | ||
const { loadSpaceController, isSpaceController } = useSpaceController(); | ||
const isAuthorized = computed(() => { | ||
const admins = (props.space.admins || []).map(admin => admin.toLowerCase()); | ||
return ( | ||
admins.includes(web3Account.value?.toLowerCase()) || isSpaceController.value | ||
); | ||
}); | ||
onMounted(async () => { | ||
await loadSpaceController(); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<BaseMessageBlock v-if="space.hibernated" level="warning-red" is-responsive> | ||
{{ | ||
isAuthorized | ||
? $t('create.errorSpaceHibernatedAdmin') | ||
: $t('create.errorSpaceHibernatedUsers') | ||
}} | ||
<BaseLink | ||
v-if="isAuthorized" | ||
link="https://docs.snapshot.org/user-guides/spaces/space-hibernation" | ||
> | ||
{{ $t('learnMore') }} | ||
</BaseLink> | ||
|
||
<p v-if="isAuthorized" class="mt-3"> | ||
<router-link :to="{ name: 'spaceSettings' }"> | ||
<BaseButton> Go to Settings </BaseButton> | ||
</router-link> | ||
</p> | ||
</BaseMessageBlock> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script setup lang="ts"> | ||
import { ExtendedSpace } from '@/helpers/interfaces'; | ||
defineProps<{ | ||
space: ExtendedSpace; | ||
isSending: boolean; | ||
isValid: boolean; | ||
}>(); | ||
const emit = defineEmits(['showErrors', 'reactivateSpace']); | ||
onMounted(() => { | ||
emit('showErrors'); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<BaseMessageBlock level="warning-red" is-responsive> | ||
<div v-if="isValid"> | ||
{{ $t('settings.reactivatingHibernatedSpace.information') }} | ||
</div> | ||
|
||
<div v-else> | ||
{{ $t('settings.reactivatingHibernatedSpace.disabledInformation') }} | ||
</div> | ||
|
||
<BaseButton | ||
primary | ||
:loading="isSending" | ||
:disabled="!isValid" | ||
class="mt-3 whitespace-nowrap" | ||
@click="emit('reactivateSpace')" | ||
> | ||
{{ $t('reactivateSpace') }} | ||
</BaseButton> | ||
</BaseMessageBlock> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89c2314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
snapshot – ./
snapshot.org
snapshot-git-master-snapshot.vercel.app
snapshot-snapshot.vercel.app
vercel.snapshot.org
snapshot-tau.vercel.app