Merge branch 'fixes' into 'master'

Fix welcome stepper after validating account

See merge request framasoft/mobilizon!1085
This commit is contained in:
Thomas Citharel 2021-10-20 16:09:57 +00:00
commit e227a75337

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="section container"> <div class="section container">
<h1 class="title">{{ $t("Let's define a few settings") }}</h1> <h1 class="title">{{ $t("Let's define a few settings") }}</h1>
<b-steps v-model="realActualStepIndex" :has-navigation="false"> <b-steps v-model="stepIndex" :has-navigation="false">
<b-step-item step="1" :label="$t('Settings')"> <b-step-item step="1" :label="$t('Settings')">
<settings-onboarding /> <settings-onboarding />
</b-step-item> </b-step-item>
@ -15,11 +15,11 @@
<section class="has-text-centered section buttons"> <section class="has-text-centered section buttons">
<b-button <b-button
outlined outlined
:disabled="realActualStepIndex < 1" :disabled="stepIndex < 1"
tag="router-link" tag="router-link"
:to="{ :to="{
name: RouteName.WELCOME_SCREEN, name: RouteName.WELCOME_SCREEN,
params: { step: actualStepIndex - 1 }, params: { step: stepIndex },
}" }"
> >
{{ $t("Previous") }} {{ $t("Previous") }}
@ -27,17 +27,17 @@
<b-button <b-button
outlined outlined
type="is-success" type="is-success"
v-if="realActualStepIndex < 2" v-if="stepIndex < 2"
tag="router-link" tag="router-link"
:to="{ :to="{
name: RouteName.WELCOME_SCREEN, name: RouteName.WELCOME_SCREEN,
params: { step: actualStepIndex + 1 }, params: { step: stepIndex + 2 },
}" }"
> >
{{ $t("Next") }} {{ $t("Next") }}
</b-button> </b-button>
<b-button <b-button
v-if="realActualStepIndex >= 2" v-if="stepIndex >= 2"
type="is-success" type="is-success"
size="is-big" size="is-big"
tag="router-link" tag="router-link"
@ -49,7 +49,7 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Prop, Vue, Watch } from "vue-property-decorator"; import { Component, Prop, Vue } from "vue-property-decorator";
import { TIMEZONES } from "../../graphql/config"; import { TIMEZONES } from "../../graphql/config";
import RouteName from "../../router/name"; import RouteName from "../../router/name";
import { IConfig } from "../../types/config.model"; import { IConfig } from "../../types/config.model";
@ -79,17 +79,8 @@ export default class SettingsOnboard extends Vue {
RouteName = RouteName; RouteName = RouteName;
actualStepIndex = this.step; get stepIndex(): number {
return this.step - 1;
@Watch("step")
updateActualStep(): void {
if (this.step) {
this.actualStepIndex = this.step;
}
}
get realActualStepIndex(): number {
return this.actualStepIndex - 1;
} }
} }
</script> </script>