diff --git a/src/components/SettingsStrategiesBlock.vue b/src/components/SettingsStrategiesBlock.vue index c2874821845e..7fc7da27ea27 100644 --- a/src/components/SettingsStrategiesBlock.vue +++ b/src/components/SettingsStrategiesBlock.vue @@ -71,6 +71,7 @@ function handleSubmitStrategy(strategy) { :error="validationErrors?.symbol" :max-length="schemas.space.properties.symbol.maxLength" :disabled="isViewOnly" + autofocus /> diff --git a/src/components/SetupStrategyAdvanced.vue b/src/components/SetupStrategyAdvanced.vue index 7d60058f7654..e6bc154258a3 100644 --- a/src/components/SetupStrategyAdvanced.vue +++ b/src/components/SetupStrategyAdvanced.vue @@ -4,7 +4,8 @@ const { validationErrors } = useFormSpaceSettings('setup'); const emit = defineEmits(['next']); function nextStep() { - if (validationErrors.value.strategies) return; + if (validationErrors.value.strategies || validationErrors.value.symbol) + return; emit('next'); } diff --git a/src/components/SetupStrategyVote.vue b/src/components/SetupStrategyVote.vue index f21ac072e1e8..f362745051e8 100644 --- a/src/components/SetupStrategyVote.vue +++ b/src/components/SetupStrategyVote.vue @@ -45,28 +45,30 @@ const votingItems = computed(() => { })); }); -const isNotValidTicket = computed( - () => - strategyName.value === 'ticket' && - (validation.value.name === 'any' || validation.value.name === 'basic') +const isValidTicket = computed( + () => !(strategyName.value === 'ticket' && validation.value.name === 'any') ); -const isNotValidWhitelist = computed( - () => strategyName.value === 'whitelist' && whitelist.value.length === 0 +const isValidWhitelist = computed( + () => !(strategyName.value === 'whitelist' && whitelist.value.length === 0) ); +const isValidSymbol = computed(() => symbol.value.length > 0); + const whitelistRef = ref(); +const symbolRef = ref(); function forceShowError() { whitelistRef?.value?.forceShowError(); + symbolRef?.value?.forceShowError(); } function nextStep() { - if (isNotValidWhitelist.value) { + if (!isValidWhitelist.value || !isValidSymbol.value) { forceShowError(); return; } - if (isNotValidTicket.value) { + if (!isValidTicket.value) { showError.value = true; return; } @@ -120,7 +122,12 @@ function nextStep() { - +