diff --git a/cypress/integration/user/registration.spec.js b/cypress/integration/user/registration.spec.js index 3e7cf1f5..fc1b0fbd 100644 --- a/cypress/integration/user/registration.spec.js +++ b/cypress/integration/user/registration.spec.js @@ -24,8 +24,8 @@ context('Registration', () => { cy.visit('/register') cy.get('#username').type(fixture.username) cy.get('#email').type(fixture.email) - cy.get('#password1').type(fixture.password) - cy.get('#password2').type(fixture.password) + cy.get('#password').type(fixture.password) + cy.get('#passwordValidation').type(fixture.password) cy.get('#register-submit').click() cy.url().should('include', '/') cy.clock(1625656161057) // 13:00 @@ -42,8 +42,8 @@ context('Registration', () => { cy.visit('/register') cy.get('#username').type(fixture.username) cy.get('#email').type(fixture.email) - cy.get('#password1').type(fixture.password) - cy.get('#password2').type(fixture.password) + cy.get('#password').type(fixture.password) + cy.get('#passwordValidation').type(fixture.password) cy.get('#register-submit').click() cy.get('div.notification.is-danger').contains('A user with this username already exists.') }) diff --git a/src/composables/useTitle.ts b/src/composables/useTitle.ts new file mode 100644 index 00000000..e3544829 --- /dev/null +++ b/src/composables/useTitle.ts @@ -0,0 +1,12 @@ +import { computed, watchEffect } from 'vue' +import { setTitle } from '@/helpers/setTitle' + +import { ComputedGetter, ComputedRef } from '@vue/reactivity' + +export function useTitle(titleGetter: ComputedGetter) : ComputedRef { + const titleRef = computed(titleGetter) + + watchEffect(() => setTitle(titleRef.value)) + + return titleRef +} \ No newline at end of file diff --git a/src/helpers/setTitle.js b/src/helpers/setTitle.js index c8151fae..a2f31a45 100644 --- a/src/helpers/setTitle.js +++ b/src/helpers/setTitle.js @@ -1,8 +1,5 @@ -export const setTitle = title => { - if (typeof title === 'undefined' || title === '') { - document.title = 'Vikunja' - return - } - - document.title = `${title} | Vikunja` +export function setTitle(title) { + document.title = (typeof title === 'undefined' || title === '') + ? 'Vikunja' + : `${title} | Vikunja` } \ No newline at end of file diff --git a/src/views/About.vue b/src/views/About.vue index 769eaa3e..e1570c30 100644 --- a/src/views/About.vue +++ b/src/views/About.vue @@ -13,10 +13,10 @@ >

- {{ $t('about.frontendVersion', {version: this.frontendVersion}) }} + {{ $t('about.frontendVersion', {version: frontendVersion}) }}

- {{ $t('about.apiVersion', {version: this.apiVersion}) }} + {{ $t('about.apiVersion', {version: apiVersion}) }}