Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into add-osnap-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
daywiss committed Nov 28, 2023
2 parents 6c0a1fd + f83c1c1 commit 994f55f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/SettingsVotingBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const { form } = useFormSpaceSettings(props.context);
:label="$t('settings.quorum.label')"
:hint="$t('settings.quorum.information')"
:disabled="isViewOnly"
placeholder="1000"
placeholder="0"
type="number"
@update:model-value="value => (form.voting.quorum = Number(value))"
/>
Expand Down
7 changes: 7 additions & 0 deletions src/components/SpaceCreateWarnings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const props = defineProps<{
space: ExtendedSpace;
validationFailed: boolean;
isValidAuthor: boolean;
isValidSpace: boolean;
validationName: string;
containsShortUrl: boolean;
}>();
Expand Down Expand Up @@ -43,6 +44,12 @@ const strategySymbolsString = computed(() => {
<div class="mb-4 space-y-2">
<MessageWarningHibernated v-if="space.hibernated" :space="space" />

<BaseMessageBlock v-else-if="!isValidSpace" level="warning">
Proposal creation is blocked due to invalid space settings. Please contact
a space admin or if you are an admin head over to the settings page and
save them again.
</BaseMessageBlock>

<MessageWarningGnosisNetwork
v-else-if="isGnosisAndNotSpaceNetwork"
:space="space"
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useProposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function useProposals() {

const { apolloQuery } = useApolloQuery();
async function getUserVotedProposalIds(voter: string, proposals: string[]) {
if (!voter || !proposals) return;
if (!voter || !proposals?.length) return;
const votes = await apolloQuery(
{
query: USER_VOTED_PROPOSAL_IDS_QUERY,
Expand Down
8 changes: 7 additions & 1 deletion src/views/SpaceCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const { isGnosisAndNotSpaceNetwork } = useGnosis(props.space);
const { isSnapshotLoading } = useSnapshot();
const { apolloQuery, queryLoading } = useApolloQuery();
const { containsShortUrl } = useShortUrls();
const { isValid: isValidSpaceSettings, populateForm } =
useFormSpaceSettings('settings');
const {
form,
Expand Down Expand Up @@ -413,6 +415,8 @@ onBeforeRouteLeave(async () => {
resetForm();
}
});
onMounted(() => populateForm(props.space));
</script>

<template>
Expand All @@ -433,6 +437,7 @@ onBeforeRouteLeave(async () => {
:space="space"
:validation-failed="hasAuthorValidationFailed"
:is-valid-author="isValidAuthor"
:is-valid-space="isValidSpaceSettings"
:validation-name="validationName"
:contains-short-url="formContainsShortUrl"
data-testid="create-proposal-connect-wallet-warning"
Expand Down Expand Up @@ -505,7 +510,8 @@ onBeforeRouteLeave(async () => {
hasAuthorValidationFailed ||
validationLoading ||
isGnosisAndNotSpaceNetwork ||
space.hibernated
space.hibernated ||
!isValidSpaceSettings
"
primary
:data-testid="
Expand Down

0 comments on commit 994f55f

Please sign in to comment.