From 45740d510e7356b3e2798379969daee6b0995593 Mon Sep 17 00:00:00 2001 From: wvffle Date: Sat, 30 Jul 2022 18:44:49 +0000 Subject: [PATCH] Migrate signup --- front/src/components/admin/SettingsGroup.vue | 2 +- front/src/components/audio/PlayButton.vue | 14 +- front/src/components/audio/podcast/Row.vue | 2 +- front/src/components/auth/ApplicationForm.vue | 2 +- front/src/components/auth/SignupForm.vue | 198 ++++++++---------- front/src/init/instance.ts | 3 +- front/src/store/instance.ts | 4 +- 7 files changed, 106 insertions(+), 119 deletions(-) diff --git a/front/src/components/admin/SettingsGroup.vue b/front/src/components/admin/SettingsGroup.vue index fc7df1802..b603afc4d 100644 --- a/front/src/components/admin/SettingsGroup.vue +++ b/front/src/components/admin/SettingsGroup.vue @@ -85,7 +85,7 @@ const save = async () => { values[setting.identifier] = setting.value } - store.dispatch('instance/fetchSettings') + await store.dispatch('instance/fetchSettings') } catch (error) { errors.value = (error as BackendError).backendErrors } diff --git a/front/src/components/audio/PlayButton.vue b/front/src/components/audio/PlayButton.vue index d2575cf6c..c6c6ae18e 100644 --- a/front/src/components/audio/PlayButton.vue +++ b/front/src/components/audio/PlayButton.vue @@ -33,13 +33,13 @@ interface Props extends PlayOptionsProps { const props = withDefaults(defineProps(), { tracks: () => [], - track: () => null, - artist: () => null, - playlist: () => null, - album: () => null, - library: () => null, - channel: () => null, - account: () => null, + track: null, + artist: null, + playlist: null, + album: null, + library: null, + channel: null, + account: null, dropdownIconClasses: () => ['dropdown'], playIconClass: () => 'play icon', buttonClasses: () => ['button'], diff --git a/front/src/components/audio/podcast/Row.vue b/front/src/components/audio/podcast/Row.vue index 9c46e2320..5bee67dc9 100644 --- a/front/src/components/audio/podcast/Row.vue +++ b/front/src/components/audio/podcast/Row.vue @@ -30,7 +30,7 @@ interface Props extends PlayOptionsProps { const props = withDefaults(defineProps(), { showArt: true, displayActions: true, - defaultCover: () => null + defaultCover: null }) const description = ref('') diff --git a/front/src/components/auth/ApplicationForm.vue b/front/src/components/auth/ApplicationForm.vue index 8cd8d48dd..fba4ea1d5 100644 --- a/front/src/components/auth/ApplicationForm.vue +++ b/front/src/components/auth/ApplicationForm.vue @@ -21,7 +21,7 @@ interface Props { const emit = defineEmits() const props = withDefaults(defineProps(), { - app: () => null, + app: null, defaults: () => ({}) }) diff --git a/front/src/components/auth/SignupForm.vue b/front/src/components/auth/SignupForm.vue index 6d69d6290..0886ea409 100644 --- a/front/src/components/auth/SignupForm.vue +++ b/front/src/components/auth/SignupForm.vue @@ -1,3 +1,88 @@ + + @@ -149,100 +234,3 @@ - - diff --git a/front/src/init/instance.ts b/front/src/init/instance.ts index 2282ec60b..2214bc2ca 100644 --- a/front/src/init/instance.ts +++ b/front/src/init/instance.ts @@ -22,7 +22,8 @@ export const install: InitModule = async ({ store, router }) => { const url = urlParams.get('_url') if (url) { - return router.replace(url) + router.replace(url) + return } if (!store.state.instance.instanceUrl) { diff --git a/front/src/store/instance.ts b/front/src/store/instance.ts index 1c163d7b0..c4fdb66c2 100644 --- a/front/src/store/instance.ts +++ b/front/src/store/instance.ts @@ -163,8 +163,7 @@ const store: Module = { commit(`${m}/reset`, null, { root: true }) }) }, - // Send a request to the login URL and save the returned JWT - async fetchSettings ({ commit }, payload) { + async fetchSettings ({ commit }) { const response = await axios.get('instance/settings/') .catch(err => logger.error('Error while fetching settings', err.response.data)) @@ -180,7 +179,6 @@ const store: Module = { }, {}) commit('settings', sections) - payload?.callback?.() }, async fetchFrontSettings ({ state }) { const response = await axios.get(`${import.meta.env.BASE_URL}settings.json`)