mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 05:25:26 +02:00
feat: First Time Setup Wizard (#3204)
* extract user registration form into a composable * added base wizard component * added partial setup implementation * removed unused attrs * added setup bypass * made setup page more readable * add checkbox hints to autoform * added common settings pages and initial submit logic * bypass setup in demo * add full name to user registration * added fullname and pw handling to setup * fixed wizard indentation * added post-setup suggestions * added tests for backend changes * renamed Wizard to BaseWizard * lint fixes * pass hardcoded default password instead of backend nonsense * removed old test * fix e2e * added setup skip to e2e testing for all admin users --------- Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
parent
430e1d7d4e
commit
403038a5b2
25 changed files with 1103 additions and 141 deletions
|
@ -3,8 +3,9 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, useContext, useRouter } from "@nuxtjs/composition-api";
|
||||
import { AppInfo } from "~/lib/api/types/admin";
|
||||
import { computed, defineComponent, useAsync, useContext, useRouter } from "@nuxtjs/composition-api";
|
||||
import { useAsyncKey } from "~/composables/use-utils";
|
||||
import { AppInfo, AppStartupInfo } from "~/lib/api/types/admin";
|
||||
|
||||
export default defineComponent({
|
||||
layout: "blank",
|
||||
|
@ -22,11 +23,20 @@ export default defineComponent({
|
|||
}
|
||||
}
|
||||
|
||||
if (groupSlug.value) {
|
||||
router.push(`/g/${groupSlug.value}`);
|
||||
} else {
|
||||
redirectPublicUserToDefaultGroup();
|
||||
}
|
||||
useAsync(async () => {
|
||||
if (groupSlug.value) {
|
||||
const data = await $axios.get<AppStartupInfo>("/api/app/about/startup-info");
|
||||
const isDemo = data.data.isDemo;
|
||||
const isFirstLogin = data.data.isFirstLogin;
|
||||
if (!isDemo && isFirstLogin && $auth.user?.admin) {
|
||||
router.push("/admin/setup");
|
||||
} else {
|
||||
router.push(`/g/${groupSlug.value}`);
|
||||
}
|
||||
} else {
|
||||
redirectPublicUserToDefaultGroup();
|
||||
}
|
||||
}, useAsyncKey());
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue