From ebb39aab63e81e64a51127d0ff6a57f8ad6d2d05 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 17 Dec 2019 19:32:48 +0100 Subject: [PATCH] Fix an issue on My Account page Signed-off-by: Thomas Citharel --- js/src/mixins/identityEdition.ts | 4 +- js/src/router/actor.ts | 4 +- js/src/views/Account/MyAccount.vue | 12 +++-- .../views/Account/children/EditIdentity.vue | 53 ++++++++----------- 4 files changed, 32 insertions(+), 41 deletions(-) diff --git a/js/src/mixins/identityEdition.ts b/js/src/mixins/identityEdition.ts index d4f54f862..05b20edc9 100644 --- a/js/src/mixins/identityEdition.ts +++ b/js/src/mixins/identityEdition.ts @@ -1,10 +1,10 @@ import { Component, Mixins, Vue } from 'vue-property-decorator'; import { Person } from '@/types/actor'; -@Component +@Component({}) export default class IdentityEditionMixin extends Mixins(Vue) { - identity = new Person(); + identity: Person = new Person(); oldDisplayName: string | null = null; autoUpdateUsername(newDisplayName: string | null) { diff --git a/js/src/router/actor.ts b/js/src/router/actor.ts index 51a0d25fa..01815efd2 100644 --- a/js/src/router/actor.ts +++ b/js/src/router/actor.ts @@ -55,13 +55,13 @@ export const actorRoutes: RouteConfig[] = [ path: 'create', name: MyAccountRouteName.CREATE_IDENTITY, component: EditIdentity, - props: { isUpdate: false }, + props: (route) => ({ identityName: route.params.identityName, isUpdate: false }), }, { path: 'update/:identityName?', name: MyAccountRouteName.UPDATE_IDENTITY, component: EditIdentity, - props: { isUpdate: true }, + props: (route) => ({ identityName: route.params.identityName, isUpdate: true }), }, ], }, diff --git a/js/src/views/Account/MyAccount.vue b/js/src/views/Account/MyAccount.vue index 922c97283..b2e9d3c28 100644 --- a/js/src/views/Account/MyAccount.vue +++ b/js/src/views/Account/MyAccount.vue @@ -2,7 +2,9 @@
@@ -14,13 +16,13 @@
- +
{{ $t('Change password') }}
- +
@@ -68,13 +70,13 @@ export default class MyAccount extends Vue { RouteName = RouteName; @Watch('$route.params.identityName', { immediate: true }) - async onIdentityParamChanged (val: string) { + async onIdentityParamChanged(val: string) { await this.redirectIfNoIdentitySelected(val); this.currentIdentityName = val; } - private async redirectIfNoIdentitySelected (identityParam?: string) { + private async redirectIfNoIdentitySelected(identityParam?: string) { if (!!identityParam) return; if (!!this.currentActor) { diff --git a/js/src/views/Account/children/EditIdentity.vue b/js/src/views/Account/children/EditIdentity.vue index 2bb8df295..58407f52f 100644 --- a/js/src/views/Account/children/EditIdentity.vue +++ b/js/src/views/Account/children/EditIdentity.vue @@ -1,11 +1,11 @@