From f7eb1605092301921632d6df6996d5ee35e35661 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 28 Nov 2021 16:04:38 +0100 Subject: [PATCH 001/240] fix: move forgot password link next to password label In some languages, the texts on the "log in" and "register" buttons were so long they wrapped underneath each other. Moving the "forgot password" link next to the password label leaves these two buttons enough space to always stay next to each other. --- src/views/user/Login.vue | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 127e673a29..2a4ae3f475 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -20,11 +20,21 @@ autocomplete="username" v-focus @keyup.enter="submit" + tabindex="1" />
- +
@@ -52,6 +63,7 @@ type="text" v-focus @keyup.enter="submit" + tabindex="3" /> @@ -61,6 +73,7 @@ {{ $t('user.auth.login') }} @@ -68,15 +81,11 @@ :to="{ name: 'user.register' }" v-if="registrationEnabled" type="secondary" + tabindex="5" > {{ $t('user.auth.register') }} -
- - {{ $t('user.auth.forgotPassword') }} - -
@@ -227,6 +236,15 @@ export default { .reset-password-link { display: inline-block; - padding-top: 5px; +} + +.label-with-link { + display: flex; + justify-content: space-between; + margin-bottom: .5rem; + + .label { + margin-bottom: 0; + } } From 05e054f501be1a73d63788468a995f092d279e43 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 28 Nov 2021 16:33:03 +0100 Subject: [PATCH 002/240] feat: improve input validation for register form --- src/helpers/isEmail.ts | 6 +++++ src/i18n/lang/en.json | 6 +++-- src/icons.js | 4 +++ src/views/user/Register.vue | 49 +++++++++++++++++++++++++++++++++---- 4 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 src/helpers/isEmail.ts diff --git a/src/helpers/isEmail.ts b/src/helpers/isEmail.ts new file mode 100644 index 0000000000..08957d0f09 --- /dev/null +++ b/src/helpers/isEmail.ts @@ -0,0 +1,6 @@ +export function isEmail(email: string): Boolean { + const format = /^.+@.+$/ + const match = email.match(format) + + return match === null ? false : match.length > 0 +} diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 56a4bd113a..2aeea991e7 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -34,7 +34,6 @@ "email": "E-mail address", "emailPlaceholder": "e.g. frederic{'@'}vikunja.io", "password": "Password", - "passwordRepeat": "Retype your password", "passwordPlaceholder": "e.g. •••••••••••", "forgotPassword": "Forgot your password?", "resetPassword": "Reset your password", @@ -50,7 +49,10 @@ "authenticating": "Authenticating…", "openIdStateError": "State does not match, refusing to continue!", "openIdGeneralError": "An error occured while authenticating against the third party.", - "logout": "Logout" + "logout": "Logout", + "emailInvalid": "Please enter a valid email address.", + "usernameRequired": "Please provide a username.", + "passwordRequired": "Please provide a password." }, "settings": { "title": "Settings", diff --git a/src/icons.js b/src/icons.js index 48ef230c60..89e1d1a3e4 100644 --- a/src/icons.js +++ b/src/icons.js @@ -16,6 +16,8 @@ import { faCocktail, faCoffee, faCog, + faEye, + faEyeSlash, faEllipsisH, faEllipsisV, faExclamation, @@ -87,6 +89,8 @@ library.add(faCocktail) library.add(faCoffee) library.add(faCog) library.add(faComments) +library.add(faEye) +library.add(faEyeSlash) library.add(faEllipsisH) library.add(faEllipsisV) library.add(faExclamation) diff --git a/src/views/user/Register.vue b/src/views/user/Register.vue index ef9f4a153d..a3a74da74c 100644 --- a/src/views/user/Register.vue +++ b/src/views/user/Register.vue @@ -18,8 +18,12 @@ v-focus v-model="credentials.username" @keyup.enter="submit" + @focusout="validateUsername" /> +

+ {{ $t('user.auth.usernameRequired') }} +

@@ -33,12 +37,16 @@ type="email" v-model="credentials.email" @keyup.enter="submit" + @focusout="validateEmail" />
+

+ {{ $t('user.auth.emailInvalid') }} +

-
+
+

+ {{ $t('user.auth.passwordRequired') }} +

@@ -76,6 +88,7 @@ id="register-submit" @click="submit" class="mr-2" + :disabled="!everythingValid" > {{ $t('user.auth.register') }} @@ -89,12 +102,14 @@ + + From 1d916e7e03add8f8a4f8e809eed7600080bd3579 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 28 Nov 2021 16:35:59 +0100 Subject: [PATCH 004/240] feat: change wording --- src/i18n/lang/en.json | 6 +++--- src/router/index.ts | 2 +- src/views/user/Login.vue | 2 +- src/views/user/Register.vue | 5 +---- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 2aeea991e7..2c1fdf2610 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -31,7 +31,7 @@ "username": "Username", "usernameEmail": "Username Or Email Address", "usernamePlaceholder": "e.g. frederick", - "email": "E-mail address", + "email": "Email address", "emailPlaceholder": "e.g. frederic{'@'}vikunja.io", "password": "Password", "passwordPlaceholder": "e.g. •••••••••••", @@ -44,7 +44,7 @@ "totpTitle": "Two Factor Authentication Code", "totpPlaceholder": "e.g. 123456", "login": "Login", - "register": "Register", + "createAccount": "Create account", "loginWith": "Log in with {provider}", "authenticating": "Authenticating…", "openIdStateError": "State does not match, refusing to continue!", @@ -63,7 +63,7 @@ "currentPasswordPlaceholder": "Your current password", "passwordsDontMatch": "The new password and its confirmation don't match.", "passwordUpdateSuccess": "The password was successfully updated.", - "updateEmailTitle": "Update Your E-Mail Address", + "updateEmailTitle": "Update Your Email Address", "updateEmailNew": "New Email Address", "updateEmailSuccess": "Your email address was successfully updated. We've sent you a link to confirm it.", "general": { diff --git a/src/router/index.ts b/src/router/index.ts index 21e4a96a38..cf126b5abf 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -132,7 +132,7 @@ const router = createRouter({ name: 'user.register', component: RegisterComponent, meta: { - title: 'user.auth.register', + title: 'user.auth.createAccount', }, }, { diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 2a4ae3f475..b525cf02f9 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -83,7 +83,7 @@ type="secondary" tabindex="5" > - {{ $t('user.auth.register') }} + {{ $t('user.auth.createAccount') }}
diff --git a/src/views/user/Register.vue b/src/views/user/Register.vue index dbe5d48279..ea78f24b06 100644 --- a/src/views/user/Register.vue +++ b/src/views/user/Register.vue @@ -77,7 +77,7 @@ class="mr-2" :disabled="!everythingValid" > - {{ $t('user.auth.register') }} + {{ $t('user.auth.createAccount') }} {{ $t('user.auth.login') }} @@ -91,7 +91,6 @@ - - From fda0b81d9c653a1a93803a98582ebe9b10f3f433 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 11 Dec 2021 21:57:54 +0100 Subject: [PATCH 007/240] feat: add tooltip and aria-label --- src/i18n/lang/en.json | 4 +++- src/views/user/Login.vue | 6 +++++- src/views/user/Register.vue | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 2c1fdf2610..7fecb029d6 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -52,7 +52,9 @@ "logout": "Logout", "emailInvalid": "Please enter a valid email address.", "usernameRequired": "Please provide a username.", - "passwordRequired": "Please provide a password." + "passwordRequired": "Please provide a password.", + "showPassword": "Show the password", + "hidePassword": "Hide the password" }, "settings": { "title": "Settings", diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 145e2c6654..6be2e78393 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -53,7 +53,11 @@ tabindex="2" @focusout="validateField('password')" /> - + diff --git a/src/views/user/Register.vue b/src/views/user/Register.vue index ce99422017..29ebed5bf1 100644 --- a/src/views/user/Register.vue +++ b/src/views/user/Register.vue @@ -59,7 +59,11 @@ @keyup.enter="submit" @focusout="validatePassword" /> - + From a1814ea29d74631f7befb5d51d85b2a16d1741a3 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 11 Dec 2021 22:08:26 +0100 Subject: [PATCH 008/240] fix: message spacing --- src/views/user/Login.vue | 11 +++++++++-- src/views/user/PasswordReset.vue | 4 ++-- src/views/user/Register.vue | 2 +- src/views/user/RequestPasswordReset.vue | 4 ++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 6be2e78393..a59805f068 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -1,9 +1,9 @@ \ No newline at end of file diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue index d218b80170..b7bb4083fb 100644 --- a/src/components/modal/modal.vue +++ b/src/components/modal/modal.vue @@ -1,4 +1,5 @@ - + + \ No newline at end of file From f3358269e5346ec53652a7d9f3643f739ea21809 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Tue, 30 Nov 2021 20:48:48 +0100 Subject: [PATCH 030/240] fix task remove label test --- cypress/integration/task/task.spec.js | 6 ++--- src/components/tasks/partials/comments.vue | 4 +-- src/components/tasks/partials/description.vue | 4 +-- src/components/tasks/partials/editLabels.vue | 26 +++++++------------ src/views/tasks/TaskDetailView.vue | 2 ++ 5 files changed, 19 insertions(+), 23 deletions(-) diff --git a/cypress/integration/task/task.spec.js b/cypress/integration/task/task.spec.js index a6be818561..048455bcc2 100644 --- a/cypress/integration/task/task.spec.js +++ b/cypress/integration/task/task.spec.js @@ -373,13 +373,13 @@ describe('Task', () => { cy.visit(`/tasks/${tasks[0].id}`) - cy.get('.task-view .details.labels-list .multiselect .input-wrapper') + cy.getSettled('.task-view .details.labels-list .multiselect .input-wrapper') .should('be.visible') .should('contain', labels[0].title) - cy.get('.task-view .details.labels-list .multiselect .input-wrapper') + cy.getSettled('.task-view .details.labels-list .multiselect .input-wrapper') .children() .first() - .get('a.delete') + .get('[data-cy="taskDetail.removeLabel"]') .click() cy.get('.global-notification') diff --git a/src/components/tasks/partials/comments.vue b/src/components/tasks/partials/comments.vue index 6565960cc8..4aab009880 100644 --- a/src/components/tasks/partials/comments.vue +++ b/src/components/tasks/partials/comments.vue @@ -152,7 +152,7 @@ From e837621ef8e7770acbc7f0af1f13e5610328c27d Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Sat, 4 Dec 2021 18:15:21 +0100 Subject: [PATCH 032/240] Try to cache list views --- src/components/home/contentAuth.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/home/contentAuth.vue b/src/components/home/contentAuth.vue index d19d04878e..ba69adacb3 100644 --- a/src/components/home/contentAuth.vue +++ b/src/components/home/contentAuth.vue @@ -20,7 +20,12 @@ - + + + + + + From e54d95802bb961d7a9b507ca08fa952dde1e20cd Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Tue, 7 Dec 2021 19:23:27 +0100 Subject: [PATCH 033/240] fix: closing modal --- src/views/tasks/TaskDetailViewModal.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/views/tasks/TaskDetailViewModal.vue b/src/views/tasks/TaskDetailViewModal.vue index a240a2b091..913ed6593f 100644 --- a/src/views/tasks/TaskDetailViewModal.vue +++ b/src/views/tasks/TaskDetailViewModal.vue @@ -12,11 +12,22 @@ From 6d62ca1adaf4be5f94dac1a3840834e881b30aa3 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Tue, 7 Dec 2021 19:40:50 +0100 Subject: [PATCH 034/240] fix: check now just once --- src/views/list/ListGantt.vue | 17 +++++++++++------ src/views/tasks/ShowTasks.vue | 16 +++++++++------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/views/list/ListGantt.vue b/src/views/list/ListGantt.vue index f5278a3444..15b11747f8 100644 --- a/src/views/list/ListGantt.vue +++ b/src/views/list/ListGantt.vue @@ -68,21 +68,26 @@ import { ref, computed } from 'vue' import flatPickr from 'vue-flatpickr-component' -import { i18n } from '@/i18n' -import { store } from '@/store' +import { useI18n } from 'vue-i18n' +import { useStore } from 'vuex' import ListWrapper from './ListWrapper' import GanttChart from '@/components/tasks/gantt-component' import Fancycheckbox from '@/components/input/fancycheckbox' +const DEFAULT_DAY_COUNT = 35 + const showTaskswithoutDates = ref(false) -const dayWidth = ref(35) -const dateFrom = ref(new Date((new Date()).setDate((new Date()).getDate() - 15))) -const dateTo = ref(new Date((new Date()).setDate((new Date()).getDate() + 30))) +const dayWidth = ref(DEFAULT_DAY_COUNT) +const now = ref(new Date()) +const dateFrom = ref(new Date((new Date()).setDate(now.value.getDate() - 15))) +const dateTo = ref(new Date((new Date()).setDate(now.value.getDate() + 30))) +const {t} = useI18n() +const {store} = useStore() const flatPickerConfig = computed(() => ({ - altFormat: i18n.global.t('date.altFormatShort'), + altFormat: t('date.altFormatShort'), altInput: true, dateFormat: 'Y-m-d', enableTime: false, diff --git a/src/views/tasks/ShowTasks.vue b/src/views/tasks/ShowTasks.vue index d4f06ba33d..9b1399840c 100644 --- a/src/views/tasks/ShowTasks.vue +++ b/src/views/tasks/ShowTasks.vue @@ -231,23 +231,25 @@ export default { }, setDatesToNextWeek() { - this.cStartDate = new Date() - this.cEndDate = new Date((new Date()).getTime() + 7 * 24 * 60 * 60 * 1000) + const now = new Date() + this.cStartDate = now + this.cEndDate = new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000) this.showOverdue = false this.setDate() }, setDatesToNextMonth() { - this.cStartDate = new Date() - this.cEndDate = new Date((new Date()).setMonth((new Date()).getMonth() + 1)) + const now = new Date() + this.cStartDate = now + this.cEndDate = new Date((new Date()).setMonth(now.getMonth() + 1)) this.showOverdue = false this.setDate() }, showTodaysTasks() { - const d = new Date() - this.cStartDate = new Date() - this.cEndDate = new Date(d.setDate(d.getDate() + 1)) + const now = new Date() + this.cStartDate = now + this.cEndDate = new Date((new Date()).setDate(now.getDate() + 1)) this.showOverdue = true this.setDate() }, From 5916a44724ca237daf13e6ac396f27451bfb5887 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Fri, 10 Dec 2021 15:29:28 +0100 Subject: [PATCH 035/240] feat: provide listId prop via router --- src/components/home/contentAuth.vue | 29 +++- src/composables/taskList.js | 168 ++++++++++++------------ src/router/index.ts | 15 +++ src/views/list/ListGantt.vue | 21 ++- src/views/list/ListKanban.vue | 29 ++-- src/views/list/ListList.vue | 32 +++-- src/views/list/ListTable.vue | 138 +++++++------------ src/views/list/ListWrapper.vue | 39 +++--- src/views/tasks/TaskDetailView.vue | 12 +- src/views/tasks/TaskDetailViewModal.vue | 13 +- 10 files changed, 263 insertions(+), 233 deletions(-) diff --git a/src/components/home/contentAuth.vue b/src/components/home/contentAuth.vue index ba69adacb3..48f6a3e842 100644 --- a/src/components/home/contentAuth.vue +++ b/src/components/home/contentAuth.vue @@ -44,7 +44,7 @@ \ No newline at end of file From cc3fcdf1c3557885ae230f0a1d37cce8e292eb78 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 18 Jan 2022 21:33:10 +0100 Subject: [PATCH 099/240] fix: keyboard shortcut message bottom margin --- src/components/misc/keyboard-shortcuts/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/misc/keyboard-shortcuts/index.vue b/src/components/misc/keyboard-shortcuts/index.vue index 3164dade13..a5fae200b2 100644 --- a/src/components/misc/keyboard-shortcuts/index.vue +++ b/src/components/misc/keyboard-shortcuts/index.vue @@ -4,7 +4,7 @@ diff --git a/src/components/home/navigation.vue b/src/components/home/navigation.vue index adf0bff953..9780e4f78f 100644 --- a/src/components/home/navigation.vue +++ b/src/components/home/navigation.vue @@ -1,6 +1,6 @@ diff --git a/src/components/misc/subscription.vue b/src/components/misc/subscription.vue index a141d44b2e..c00d6271c3 100644 --- a/src/components/misc/subscription.vue +++ b/src/components/misc/subscription.vue @@ -1,19 +1,19 @@ From 6ff621ada174bdf0ce52272714e08283ef366230 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Sun, 30 Jan 2022 16:58:59 +0100 Subject: [PATCH 196/240] chore: ignore wrong second argument argument for cause see: https://github.com/tc39/proposal-error-cause --- src/helpers/auth.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/helpers/auth.ts b/src/helpers/auth.ts index b073a8cafc..81cd558064 100644 --- a/src/helpers/auth.ts +++ b/src/helpers/auth.ts @@ -53,6 +53,7 @@ export async function refreshToken(persist: boolean): Promise { return response } catch(e) { + // @ts-ignore throw new Error('Error renewing token: ', { cause: e }) } } From a325e4b721ddee156ae6c7ca9dca414b36f3fdaa Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Sun, 30 Jan 2022 16:35:03 +0100 Subject: [PATCH 197/240] feat: use es2022 for @typescript-eslint/parser --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5afb88de8e..06143399c9 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,7 @@ "parser": "vue-eslint-parser", "parserOptions": { "parser": "@typescript-eslint/parser", - "ecmaVersion": 2021 + "ecmaVersion": 2022 }, "ignorePatterns": [ "*.test.*", From 81cf8f2f299f045e24a0810ca23f0c231e6ae2a9 Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 30 Jan 2022 16:17:03 +0000 Subject: [PATCH 198/240] feat(tests): replace cypress-file-upload with .selectFile() (#1460) Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1460 Co-authored-by: konrad Co-committed-by: konrad --- cypress/integration/user/settings.spec.js | 8 +++++--- cypress/support/index.js | 1 - package.json | 3 +-- yarn.lock | 5 ----- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/cypress/integration/user/settings.spec.js b/cypress/integration/user/settings.spec.js index c6a645d597..21bd9c1d94 100644 --- a/cypress/integration/user/settings.spec.js +++ b/cypress/integration/user/settings.spec.js @@ -8,12 +8,14 @@ describe('User Settings', () => { }) it('Changes the user avatar', () => { + cy.intercept(`${Cypress.env('API_URL')}/user/settings/avatar/upload`).as('uploadAvatar') + cy.visit('/user/settings/avatar') cy.get('input[name=avatarProvider][value=upload]') .click() - cy.get('input[type=file]', { timeout: 1000 }) - .attachFile('image.jpg') + cy.get('input[type=file]', {timeout: 1000}) + .selectFile('cypress/fixtures/image.jpg', {force: true}) // The input is not visible, but on purpose cy.get('.vue-handler-wrapper.vue-handler-wrapper--south .vue-simple-handler.vue-simple-handler--south') .trigger('mousedown', {which: 1}) .trigger('mousemove', {clientY: 100}) @@ -22,7 +24,7 @@ describe('User Settings', () => { .contains('Upload Avatar') .click() - cy.wait(3000) // Wait for the request to finish + cy.wait('@uploadAvatar') cy.get('.global-notification') .should('contain', 'Success') }) diff --git a/cypress/support/index.js b/cypress/support/index.js index 0c885c6540..7b0c56d187 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -1,6 +1,5 @@ import './commands' -import 'cypress-file-upload' import '@4tw/cypress-drag-drop' // see https://github.com/cypress-io/cypress/issues/702#issuecomment-587127275 diff --git a/package.json b/package.json index 5afb88de8e..263a324d67 100644 --- a/package.json +++ b/package.json @@ -72,13 +72,12 @@ "browserslist": "4.19.1", "caniuse-lite": "1.0.30001304", "cypress": "9.3.1", - "cypress-file-upload": "5.0.8", "esbuild": "0.14.14", "eslint": "8.8.0", "eslint-plugin-vue": "8.4.0", "express": "4.17.2", - "netlify-cli": "8.13.0", "happy-dom": "2.30.1", + "netlify-cli": "8.13.0", "postcss": "8.4.5", "postcss-preset-env": "7.2.3", "rollup": "2.66.1", diff --git a/yarn.lock b/yarn.lock index 55188f78a5..a54c7dcaca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5215,11 +5215,6 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= -cypress-file-upload@5.0.8: - version "5.0.8" - resolved "https://registry.yarnpkg.com/cypress-file-upload/-/cypress-file-upload-5.0.8.tgz#d8824cbeaab798e44be8009769f9a6c9daa1b4a1" - integrity sha512-+8VzNabRk3zG6x8f8BWArF/xA/W0VK4IZNx3MV0jFWrJS/qKn8eHfa5nU73P9fOQAgwHFJx7zjg4lwOnljMO8g== - cypress@9.3.1: version "9.3.1" resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.3.1.tgz#8116f52d49d6daf90a91e88f3eafd940234d2958" From 0bd235cea37678aba52eb1d74d43d23d1f266dc2 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Sun, 30 Jan 2022 17:24:38 +0100 Subject: [PATCH 199/240] fix: expose configureCompat types see: https://github.com/vuejs/docs/pull/1475 --- src/types/shims-vue.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/types/shims-vue.d.ts b/src/types/shims-vue.d.ts index 4f0571df78..c04ff091d7 100644 --- a/src/types/shims-vue.d.ts +++ b/src/types/shims-vue.d.ts @@ -1,8 +1,11 @@ declare module 'vue' { import { CompatVue } from '@vue/runtime-dom' const Vue: CompatVue - export default Vue - export * from '@vue/runtime-dom' + export default Vue + export * from '@vue/runtime-dom' + + const { configureCompat } = Vue + export { configureCompat } } // https://next.vuex.vuejs.org/guide/migrating-to-4-0-from-3-x.html#typescript-support From ea710e227a4937ff0bc26ee95e76da083239596a Mon Sep 17 00:00:00 2001 From: renovate Date: Sun, 30 Jan 2022 18:13:34 +0000 Subject: [PATCH 200/240] chore(deps): update dependency happy-dom to v2.31.0 (#1461) Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1461 Co-authored-by: renovate Co-committed-by: renovate --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 263a324d67..2063c472a3 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "eslint": "8.8.0", "eslint-plugin-vue": "8.4.0", "express": "4.17.2", - "happy-dom": "2.30.1", + "happy-dom": "2.31.0", "netlify-cli": "8.13.0", "postcss": "8.4.5", "postcss-preset-env": "7.2.3", diff --git a/yarn.lock b/yarn.lock index a54c7dcaca..486767c86a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7380,10 +7380,10 @@ graphql@^16.1.0: resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.2.0.tgz#de3150e80f1fc009590b92a9d16ab1b46e12b656" integrity sha512-MuQd7XXrdOcmfwuLwC2jNvx0n3rxIuNYOxUtiee5XOmfrWo613ar2U8pE7aHAKh8VwfpifubpD9IP+EdEAEOsA== -happy-dom@2.30.1: - version "2.30.1" - resolved "https://registry.yarnpkg.com/happy-dom/-/happy-dom-2.30.1.tgz#afc77ed8969ad5d49de266ec1b3e2055a1eabe76" - integrity sha512-Qz3Z/zn/VeUCtVEGoSCDD+zzPcyOEdIYz4p1BvsXvrTSx6vXyGadMDAsxOKf8ZFCRfuyLpLKfqdRHFFPF77qPA== +happy-dom@2.31.0: + version "2.31.0" + resolved "https://registry.yarnpkg.com/happy-dom/-/happy-dom-2.31.0.tgz#1b858aabd9c33ba431f16f616a642a1461fd4295" + integrity sha512-xWMINbteuSF6hkmetrreuXK+r0vBBdRknqwaqDxrjIV6aQBlUcMBvTX/2dZ+KwP5vjrDrqCeop5dPOgQpebHgw== dependencies: he "^1.1.1" node-fetch "^2.6.1" From 8f04b10e089bd73bc2b98569fe3d353fb43f1851 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 30 Jan 2022 20:15:53 +0100 Subject: [PATCH 201/240] Revert "fix: improve ListModel typing" This reverts commit 98b41a22c6824b069f4b1d7e7609e128ba13d240. --- src/models/list.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/models/list.js b/src/models/list.js index 3f6b08734e..b5a08e814c 100644 --- a/src/models/list.js +++ b/src/models/list.js @@ -5,22 +5,6 @@ import {getSavedFilterIdFromListId} from '@/helpers/savedFilter' import SubscriptionModel from '@/models/subscription' export default class ListModel extends AbstractModel { - id = 0 - title = '' - description = '' - owner = UserModel - tasks = [] - namespaceId = 0 - isArchived = false - hexColor = '' - identifier = '' - backgroundInformation = null - isFavorite = false - subscription = null - position = 0 - - created = null - updated = null constructor(data) { super(data) From 2a819eccb48cc41bece2d9cadec31b8f56e72399 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 30 Jan 2022 20:18:34 +0100 Subject: [PATCH 202/240] revert: model properties partially reverts de3c47dc69fa0c80f83004eab1f6bd455cb4ea9e --- src/models/attachment.js | 6 ------ src/models/subscription.js | 6 ------ src/models/task.js | 7 ------- 3 files changed, 19 deletions(-) diff --git a/src/models/attachment.js b/src/models/attachment.js index 655ed3a301..e1ee9aa83b 100644 --- a/src/models/attachment.js +++ b/src/models/attachment.js @@ -3,12 +3,6 @@ import UserModel from './user' import FileModel from './file' export default class AttachmentModel extends AbstractModel { - id = 0 - taskId = 0 - file = FileModel - createdBy = UserModel - created = null - constructor(data) { super(data) this.createdBy = new UserModel(this.createdBy) diff --git a/src/models/subscription.js b/src/models/subscription.js index e580545e49..68d0be8552 100644 --- a/src/models/subscription.js +++ b/src/models/subscription.js @@ -2,12 +2,6 @@ import AbstractModel from '@/models/abstractModel' import UserModel from '@/models/user' export default class SubscriptionModel extends AbstractModel { - id = 0 - entity = '' - entityId = 0 - created = null - user = UserModel - constructor(data) { super(data) this.user = new UserModel(this.user) diff --git a/src/models/task.js b/src/models/task.js index 1f2e4b1305..6383968989 100644 --- a/src/models/task.js +++ b/src/models/task.js @@ -10,13 +10,6 @@ import {parseDateOrNull} from '@/helpers/parseDateOrNull' const SUPPORTS_TRIGGERED_NOTIFICATION = 'Notification' in window && 'showTrigger' in Notification.prototype export default class TaskModel extends AbstractModel { - index = 0 - done = false - priority = 0 - percentDone = 0 - - defaultColor = '198CFF' - constructor(data) { super(data) From 9995abf64cc5c69496d55308435c143d00356c1e Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 30 Jan 2022 22:11:21 +0100 Subject: [PATCH 204/240] fix: mark broken test as skipped --- cypress/integration/list/list-history.spec.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cypress/integration/list/list-history.spec.js b/cypress/integration/list/list-history.spec.js index ba8d69e065..f6ff5b034d 100644 --- a/cypress/integration/list/list-history.spec.js +++ b/cypress/integration/list/list-history.spec.js @@ -2,7 +2,10 @@ import {ListFactory} from '../../factories/list' import '../../support/authenticateUser' -describe('List History', () => { +// Skipped, because there is some kind of race condition which makes this test fail, but only in CI. +// We have tried to debug and fix it but with no luck. Since we have a unit test for this functionality +// anyway, it should be fine to mark this as skipped for now and fix it at some later point. +describe.skip('List History', () => { it('should show a list history on the home page', () => { cy.intercept(Cypress.env('API_URL') + '/namespaces*').as('loadNamespaces') cy.intercept(Cypress.env('API_URL') + '/lists/*').as('loadList') From c21f2362498f6e01c3cf6a37e5e5bedd7871adde Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 30 Jan 2022 21:33:27 +0000 Subject: [PATCH 205/240] feat: add cypress dashboard record (#1462) Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1462 Co-authored-by: konrad Co-committed-by: konrad --- .drone.yml | 6 ++++-- cypress.json | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4090e6a8f6..a85f44f5d7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -116,10 +116,12 @@ steps: YARN_CACHE_FOLDER: .cache/yarn/ CYPRESS_CACHE_FOLDER: .cache/cypress/ CYPRESS_DEFAULT_COMMAND_TIMEOUT: 60000 + CYPRESS_RECORD_KEY: + from_secret: cypress_project_key commands: - sed -i 's/localhost/api/g' dist/index.html - yarn serve:dist & npx wait-on http://localhost:5000 - - yarn test:frontend --browser chrome + - yarn test:frontend --browser chrome --record depends_on: - dependencies - build-prod @@ -665,6 +667,6 @@ steps: from_secret: crowdin_key --- kind: signature -hmac: 188ee90100c5fc5922a445e531e7a47453121edddb2a64a182eb23ed2bf602de +hmac: e8748058b09d57b4d9f53dc40fb163f1719a4177d392439a62b1c198ba1502a0 ... diff --git a/cypress.json b/cypress.json index 27f12495c5..28fd022c1e 100644 --- a/cypress.json +++ b/cypress.json @@ -7,5 +7,6 @@ "video": false, "retries": { "runMode": 2 - } + }, + "projectId": "181c7x" } From 92864fa5c18f95902668599ecce0dfb6b671e7ca Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 30 Jan 2022 22:35:17 +0100 Subject: [PATCH 206/240] chore(tests): remove test result upload to s3 since we now have cypress dashboard --- .drone.yml | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/.drone.yml b/.drone.yml index a85f44f5d7..a75220205a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -126,28 +126,6 @@ steps: - dependencies - build-prod - - name: upload-test-results - image: plugins/s3 - pull: true - settings: - bucket: drone-test-results - access_key: - from_secret: test_results_aws_access_key_id - secret_key: - from_secret: test_results_aws_secret_access_key - endpoint: https://s3.fr-par.scw.cloud - region: fr-par - path_style: true - source: cypress/screenshots/**/**/* - strip_prefix: cypress/screenshots/ - target: /${DRONE_REPO}/${DRONE_PULL_REQUEST}_${DRONE_BRANCH}/${DRONE_BUILD_NUMBER}/ - depends_on: - - test-frontend - when: - status: - - failure - - success - - name: deploy-preview image: node:16 pull: true @@ -667,6 +645,6 @@ steps: from_secret: crowdin_key --- kind: signature -hmac: e8748058b09d57b4d9f53dc40fb163f1719a4177d392439a62b1c198ba1502a0 +hmac: 997e1badebe484ac29557c4af356e63db4d3d57f3d32e92d482f117f8cec64da ... From b7c8138ad54382be2a35ba21bf94abfa9425b02b Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 30 Jan 2022 22:47:59 +0100 Subject: [PATCH 207/240] fix(tests): make sure to create all lists before doing anything --- cypress/integration/list/list-view-gantt.spec.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cypress/integration/list/list-view-gantt.spec.js b/cypress/integration/list/list-view-gantt.spec.js index ddfc5de4ff..69805a30df 100644 --- a/cypress/integration/list/list-view-gantt.spec.js +++ b/cypress/integration/list/list-view-gantt.spec.js @@ -1,9 +1,12 @@ import {formatISO, format} from 'date-fns' import {TaskFactory} from '../../factories/task' +import {prepareLists} from './prepareLists' import '../../support/authenticateUser' describe('List View Gantt', () => { + prepareLists() + it('Hides tasks with no dates', () => { const tasks = TaskFactory.create(1) cy.visit('/lists/1/gantt') From a5b0a834bc01147a5cd4ed3c04e799c833ef6a62 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 30 Jan 2022 22:51:29 +0100 Subject: [PATCH 208/240] fix(tests): make sure the namespace exists before trying to run the history tests If there's no namespace, there is no lists in state to show in the view. The CI runs all tests from a blank state which isn't the case when running the tests locally. Therefore, if the test doesn't create a new namespace, there won't be any to test for. --- cypress/integration/list/list-history.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/integration/list/list-history.spec.js b/cypress/integration/list/list-history.spec.js index f6ff5b034d..b7633cbda0 100644 --- a/cypress/integration/list/list-history.spec.js +++ b/cypress/integration/list/list-history.spec.js @@ -1,11 +1,11 @@ import {ListFactory} from '../../factories/list' import '../../support/authenticateUser' +import {prepareLists} from './prepareLists' -// Skipped, because there is some kind of race condition which makes this test fail, but only in CI. -// We have tried to debug and fix it but with no luck. Since we have a unit test for this functionality -// anyway, it should be fine to mark this as skipped for now and fix it at some later point. -describe.skip('List History', () => { +describe('List History', () => { + prepareLists() + it('should show a list history on the home page', () => { cy.intercept(Cypress.env('API_URL') + '/namespaces*').as('loadNamespaces') cy.intercept(Cypress.env('API_URL') + '/lists/*').as('loadList') From 00ffe17eb838981bdca013a7731e9f8e2056f705 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 30 Jan 2022 23:07:31 +0100 Subject: [PATCH 209/240] fix: related task with the same namespace --- src/components/tasks/partials/relatedTasks.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/tasks/partials/relatedTasks.vue b/src/components/tasks/partials/relatedTasks.vue index c22bfc43a7..80c04e0449 100644 --- a/src/components/tasks/partials/relatedTasks.vue +++ b/src/components/tasks/partials/relatedTasks.vue @@ -274,10 +274,11 @@ export default { return tasks .map(task => { // by doing this here once we can save a lot of duplicate calls in the template + const listAndNamespace = this.$store.getters['namespaces/getListAndNamespaceById'](task.listId, true) const { list, namespace, - } = this.$store.getters['namespaces/getListAndNamespaceById'](task.listId, true) + } = listAndNamespace === null ? {list: null, namespace: null} : listAndNamespace return { ...task, From 20a9ad2c9efea59a1752bae170744f500cba9092 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 30 Jan 2022 23:12:42 +0100 Subject: [PATCH 210/240] fix: related task within the same namespace --- src/components/tasks/partials/relatedTasks.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/tasks/partials/relatedTasks.vue b/src/components/tasks/partials/relatedTasks.vue index 0b2be060b9..9f65455b7c 100644 --- a/src/components/tasks/partials/relatedTasks.vue +++ b/src/components/tasks/partials/relatedTasks.vue @@ -274,10 +274,11 @@ export default { return tasks .map(task => { // by doing this here once we can save a lot of duplicate calls in the template + const listAndNamespace = this.$store.getters['namespaces/getListAndNamespaceById'](task.listId, true) const { list, namespace, - } = this.$store.getters['namespaces/getListAndNamespaceById'](task.listId, true) + } = listAndNamespace === null ? {list: null, namespace: null} : listAndNamespace return { ...task, From 3e311e07cdd603d970b834fa5de6b8c926c474dd Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 30 Jan 2022 23:18:13 +0100 Subject: [PATCH 211/240] fix: undefined prop subscription --- src/views/tasks/TaskDetailView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index 96ee95d9f0..ed1c0eb282 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -263,7 +263,7 @@ {{ task.done ? $t('task.detail.undone') : $t('task.detail.done') }} Date: Sun, 30 Jan 2022 23:27:22 +0100 Subject: [PATCH 212/240] fix: make isButton prop optional --- src/components/misc/subscription.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/misc/subscription.vue b/src/components/misc/subscription.vue index 8288bd038e..dbda373ea2 100644 --- a/src/components/misc/subscription.vue +++ b/src/components/misc/subscription.vue @@ -37,7 +37,7 @@ interface Props { entity: string entityId: number subscription: SubscriptionModel - isButton: boolean + isButton?: boolean } const props = withDefaults(defineProps(), { From de626eab31e092ad9364876996575071260e705d Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Wed, 19 Jan 2022 23:58:54 +0100 Subject: [PATCH 213/240] feat: don't open task detail in modal for list and table view --- src/components/home/contentAuth.vue | 34 ++++++++++++------- .../tasks/partials/singleTaskInList.vue | 3 +- src/router/index.ts | 4 +-- src/views/list/ListTable.vue | 6 ++-- src/views/tasks/TaskDetailViewModal.vue | 15 +++----- 5 files changed, 32 insertions(+), 30 deletions(-) diff --git a/src/components/home/contentAuth.vue b/src/components/home/contentAuth.vue index 276ddb6f01..d98b0fa97f 100644 --- a/src/components/home/contentAuth.vue +++ b/src/components/home/contentAuth.vue @@ -1,8 +1,12 @@