Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for hibernated spaces #4350

Merged
merged 28 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b869e58
feat: disable proposal creation on hibernate spaces
wa0x6e Nov 13, 2023
2d7e090
fix: add button to reactivate space
wa0x6e Nov 13, 2023
33daf5d
fix: add link to hibernation doc
wa0x6e Nov 14, 2023
03d1fd7
fix: add translations
wa0x6e Nov 14, 2023
e113506
chore: fix formatting
wa0x6e Nov 14, 2023
5a164e2
refactor: extract hibernation warning message to its own component
wa0x6e Nov 15, 2023
e5b7d79
Merge branch 'master' into add-hibernation
wa0x6e Nov 15, 2023
fbd6cd9
feat: reactivate space via sequencer
wa0x6e Nov 15, 2023
6853ac4
Merge branch 'add-hibernation' of https://github.com/snapshot-labs/sn…
wa0x6e Nov 15, 2023
87e7592
chore: formatting fix
wa0x6e Nov 15, 2023
4f086f8
fix: show success message on space reactivation
wa0x6e Nov 15, 2023
ced757f
fix: add link to doc
wa0x6e Nov 15, 2023
4329589
chore: fix formatting
wa0x6e Nov 15, 2023
da65260
fix: use settings basic update to reactivate space
wa0x6e Nov 15, 2023
87a9199
chore: fix formatting
wa0x6e Nov 16, 2023
fff1e54
fix: redirect reactivate space CTA to settings page
wa0x6e Nov 16, 2023
c79d0f6
fix: update hibernated warning message
wa0x6e Nov 16, 2023
1d2540c
feat: add space reactivation message in space settings
wa0x6e Nov 16, 2023
ceb245d
Merge branch 'master' into add-hibernation
wa0x6e Nov 16, 2023
4f0b614
Update src/components/MessageWarningHibernated.vue
wa0x6e Nov 16, 2023
c730194
fix: increase warning level to red
wa0x6e Nov 16, 2023
3a3ead2
fix: remove title and change layout
wa0x6e Nov 16, 2023
d38b422
fix: "learn more" should only visible to admin/controller
wa0x6e Nov 16, 2023
1b669b2
refactor: extract message into its own components
wa0x6e Nov 16, 2023
f99f05d
Update src/locales/default.json
samuveth Nov 17, 2023
a5eb1dc
Fixes
samuveth Nov 17, 2023
d88e3b7
Update src/locales/default.json
samuveth Nov 17, 2023
b7f868e
Merge branch 'master' into add-hibernation
ChaituVR Nov 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion src/components/SpaceCreateWarnings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const { web3, web3Account } = useWeb3();
const { isGnosisAndNotSpaceNetwork } = useGnosis(props.space);
const { errorFetchingSnapshot } = useSnapshot();

function handleReactivateSpace() {
wa0x6e marked this conversation as resolved.
Show resolved Hide resolved
window.open('https://tally.so', '_blank')
}

const minScore = computed(
() =>
props.space?.validation?.params?.minScore ||
Expand All @@ -37,12 +41,30 @@ const strategySymbolsString = computed(() => {

return `(${symbols.join(', ')})`;
});

const isAdmin = computed(() => {
wa0x6e marked this conversation as resolved.
Show resolved Hide resolved
const admins = (props.space.admins || []).map(admin => admin.toLowerCase());
return admins.includes(web3Account.value?.toLowerCase());
});
</script>

<template>
<div class="mb-4 space-y-2">
<BaseMessageBlock
v-if="space.hibernated"
level="warning"
is-responsive
>
This space has been hibernated, and proposals creation has been disabled until the space is reactivated by an admin.
<p v-if="isAdmin" class="mt-3">
<BaseButton @click="handleReactivateSpace">
samuveth marked this conversation as resolved.
Show resolved Hide resolved
Reactivate this space
</BaseButton>
</p>
</BaseMessageBlock>

<MessageWarningGnosisNetwork
v-if="isGnosisAndNotSpaceNetwork"
v-else-if="isGnosisAndNotSpaceNetwork"
:space="space"
action="create"
is-responsive
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export interface Space {
activeProposals: number;
followersCount: number;
flagged: boolean;
hibernated: boolean;
terms: string;
}

Expand Down Expand Up @@ -165,6 +166,7 @@ export interface ExtendedSpace {
guidelines: string;
verified: boolean;
flagged: boolean;
hibernated: boolean;
voting: {
delay: number | null;
hideAbstain: boolean;
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ export const SPACES_QUERY = gql`
followersCount
terms
flagged
hibernated
}
}
`;
Expand Down Expand Up @@ -452,6 +453,7 @@ export const SPACE_QUERY = gql`
guidelines
verified
flagged
hibernated
parent {
id
name
Expand Down
3 changes: 2 additions & 1 deletion src/views/SpaceCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ onBeforeRouteLeave(async () => {
web3.authLoading ||
hasAuthorValidationFailed ||
validationLoading ||
isGnosisAndNotSpaceNetwork
isGnosisAndNotSpaceNetwork ||
space.hibernated
wa0x6e marked this conversation as resolved.
Show resolved Hide resolved
"
primary
:data-testid="
Expand Down