diff --git a/.drone.yml b/.drone.yml index c4e9e67e0..325d66533 100644 --- a/.drone.yml +++ b/.drone.yml @@ -530,7 +530,7 @@ steps: - failure --- kind: pipeline -name: ping-weblate +name: update-translations depends_on: - build @@ -542,20 +542,40 @@ trigger: - push steps: - - name: update-translation-base - image: appleboy/drone-git-push - failure: ignore +# - name: download +# pull: always +# image: jonasfranz/crowdin +# settings: +# download: true +# export_dir: src/i18n/lang/ +# ignore_branch: true +# project_identifier: vikunja +# environment: +# CROWDIN_KEY: +# from_secret: crowdin_key +# +# - name: push +# pull: always +# image: appleboy/drone-git-push +# settings: +# author_email: "frederik@vikunja.io" +# author_name: Frederick [Bot] +# branch: main +# commit: true +# commit_message: "[skip ci] Updated translations via Crowdin" +# remote: "git@kolaente.dev:9022/vikunja/frontend.git" +# environment: +# GIT_PUSH_SSH_KEY: +# from_secret: git_push_ssh_key + + - name: upload + pull: always + image: jonasfranz/crowdin settings: - branch: translations - remote: ssh://git@kolaente.dev:9022/vikunja/frontend.git - ssh_key: - from_secret: translations_branch_update_ssh_key - - name: notify-weblate - image: curlimages/curl - depends_on: - - update-translation-base + files: + en.json: src/i18n/lang/en.json + ignore_branch: true + project_identifier: vikunja environment: - WEBLATE_TOKEN: - from_secret: weblate_token - commands: - - ./ping-weblate.sh + CROWDIN_KEY: + from_secret: crowdin_key diff --git a/Dockerfile b/Dockerfile index b29baf8db..d73a4fe80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Stage 1: Build application -FROM node:16.3.0 AS compile-image +FROM node:16 AS compile-image WORKDIR /build diff --git a/cypress/factories/task.js b/cypress/factories/task.js index 8e0d7b59d..6fa8d5b67 100644 --- a/cypress/factories/task.js +++ b/cypress/factories/task.js @@ -14,7 +14,6 @@ export class TaskFactory extends Factory { done: false, list_id: 1, created_by_id: 1, - is_favorite: false, index: '{increment}', created: formatISO(now), updated: formatISO(now) diff --git a/cypress/factories/user.js b/cypress/factories/user.js index ca8bb896e..37fcaaab4 100644 --- a/cypress/factories/user.js +++ b/cypress/factories/user.js @@ -13,7 +13,7 @@ export class UserFactory extends Factory { id: '{increment}', username: faker.lorem.word(10) + faker.random.uuid(), password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.', // 1234 - is_active: true, + status: 0, created: formatISO(now), updated: formatISO(now) } diff --git a/cypress/integration/list/list.spec.js b/cypress/integration/list/list.spec.js index 843d82913..57e98b15d 100644 --- a/cypress/integration/list/list.spec.js +++ b/cypress/integration/list/list.spec.js @@ -511,4 +511,34 @@ describe('Lists', () => { .should('not.contain', task.title) }) }) + + describe('List history', () => { + it('should show a list history on the home page', () => { + const lists = ListFactory.create(6) + + cy.visit('/') + cy.get('h3') + .contains('Last viewed') + .should('not.exist') + + cy.visit(`/lists/${lists[0].id}`) + cy.visit(`/lists/${lists[1].id}`) + cy.visit(`/lists/${lists[2].id}`) + cy.visit(`/lists/${lists[3].id}`) + cy.visit(`/lists/${lists[4].id}`) + cy.visit(`/lists/${lists[5].id}`) + + cy.visit('/') + cy.get('h3') + .contains('Last viewed') + .should('exist') + cy.get('.list-cards-wrapper-2-rows') + .should('not.contain', lists[0].title) + .should('contain', lists[1].title) + .should('contain', lists[2].title) + .should('contain', lists[3].title) + .should('contain', lists[4].title) + .should('contain', lists[5].title) + }) + }) }) diff --git a/cypress/integration/misc/home.spec.js b/cypress/integration/misc/home.spec.js new file mode 100644 index 000000000..82cbeed22 --- /dev/null +++ b/cypress/integration/misc/home.spec.js @@ -0,0 +1,35 @@ +import '../../support/authenticateUser' + +const setHours = hours => { + const date = new Date() + date.setHours(hours) + cy.clock(+date) +} + +describe('Home Page', () => { + it('shows the right salutation in the night', () => { + setHours(4) + cy.visit('/') + cy.get('h2').should('contain', 'Good Night') + }) + it('shows the right salutation in the morning', () => { + setHours(8) + cy.visit('/') + cy.get('h2').should('contain', 'Good Morning') + }) + it('shows the right salutation in the day', () => { + setHours(13) + cy.visit('/') + cy.get('h2').should('contain', 'Hi') + }) + it('shows the right salutation in the night', () => { + setHours(20) + cy.visit('/') + cy.get('h2').should('contain', 'Good Evening') + }) + it('shows the right salutation in the night again', () => { + setHours(23) + cy.visit('/') + cy.get('h2').should('contain', 'Good Night') + }) +}) \ No newline at end of file diff --git a/cypress/integration/user/login.spec.js b/cypress/integration/user/login.spec.js index d1cde64ef..ce6086ce0 100644 --- a/cypress/integration/user/login.spec.js +++ b/cypress/integration/user/login.spec.js @@ -34,6 +34,7 @@ context('Login', () => { cy.get('input[id=password]').type(fixture.password) cy.get('.button').contains('Login').click() cy.url().should('include', '/') + cy.clock(1625656161057) // 13:00 cy.get('h2').should('contain', `Hi ${fixture.username}!`) }) diff --git a/cypress/integration/user/registration.spec.js b/cypress/integration/user/registration.spec.js index 37c238e34..3e7cf1f54 100644 --- a/cypress/integration/user/registration.spec.js +++ b/cypress/integration/user/registration.spec.js @@ -28,6 +28,7 @@ context('Registration', () => { cy.get('#password2').type(fixture.password) cy.get('#register-submit').click() cy.url().should('include', '/') + cy.clock(1625656161057) // 13:00 cy.get('h2').should('contain', `Hi ${fixture.username}!`) }) diff --git a/package.json b/package.json index 9de45083d..2e0dbb667 100644 --- a/package.json +++ b/package.json @@ -18,19 +18,19 @@ "camel-case": "4.1.2", "copy-to-clipboard": "3.3.1", "date-fns": "2.22.1", - "dompurify": "2.2.9", - "highlight.js": "11.0.1", + "dompurify": "2.3.0", + "highlight.js": "11.1.0", "lodash": "4.17.21", "marked": "2.1.3", "register-service-worker": "1.7.2", - "sass": "1.35.1", + "sass": "1.35.2", "snake-case": "3.0.4", "verte": "0.0.12", "vue": "2.6.14", "vue-advanced-cropper": "1.7.0", "vue-drag-resize": "1.5.4", "vue-easymde": "1.4.0", - "vue-i18n": "8.24.5", + "vue-i18n": "8.25.0", "vue-shortkey": "3.1.7", "vue-smooth-dnd": "0.8.1", "vuex": "3.6.2" @@ -47,14 +47,14 @@ "@vue/cli-service": "4.5.13", "axios": "0.21.1", "babel-eslint": "10.1.0", - "cypress": "7.6.0", + "cypress": "7.7.0", "cypress-file-upload": "5.0.8", - "eslint": "7.29.0", - "eslint-plugin-vue": "7.12.1", + "eslint": "7.30.0", + "eslint-plugin-vue": "7.13.0", "faker": "5.5.3", "jest": "27.0.6", "sass-loader": "10.2.0", - "vue-flatpickr-component": "8.1.6", + "vue-flatpickr-component": "8.1.7", "vue-notification": "1.3.20", "vue-router": "3.5.2", "vue-template-compiler": "2.6.14", @@ -109,6 +109,7 @@ "jest": { "testPathIgnorePatterns": [ "cypress" - ] + ], + "testEnvironment": "jsdom" } } \ No newline at end of file diff --git a/src/components/home/contentLinkShare.vue b/src/components/home/contentLinkShare.vue index e3602c561..601f17d87 100644 --- a/src/components/home/contentLinkShare.vue +++ b/src/components/home/contentLinkShare.vue @@ -13,14 +13,6 @@ {{ currentList.title === '' ? $t('misc.loading') : currentList.title }}
-
- - {{ $t('user.auth.logout') }} - - - - -
{{ $t('misc.poweredBy') }} diff --git a/src/components/home/navigation.vue b/src/components/home/navigation.vue index 65b045088..ed91c1771 100644 --- a/src/components/home/navigation.vue +++ b/src/components/home/navigation.vue @@ -54,14 +54,14 @@ + v-tooltip="getNamespaceTitle(n) + ' (' + n.lists.filter(l => !l.isArchived).length + ')'"> - {{ n.title }} ({{ n.lists.filter(l => !l.isArchived).length }}) + {{ getNamespaceTitle(n) }} ({{ n.lists.filter(l => !l.isArchived).length }}) - {{ l.title }} + {{ getListTitle(l) }} - {{ currentList.title === '' ? $t('misc.loading') : currentList.title }} + {{ currentList.title === '' ? $t('misc.loading') : getListTitle(currentList) }} @@ -82,6 +82,9 @@ {{ $t('keyboardShortcuts.title') }} + + {{ $t('about.title') }} + {{ $t('user.auth.logout') }} diff --git a/src/components/input/editor.vue b/src/components/input/editor.vue index 803434bc2..16702ce6a 100644 --- a/src/components/input/editor.vue +++ b/src/components/input/editor.vue @@ -1,7 +1,7 @@ + + diff --git a/src/components/misc/keyboard-shortcuts.vue b/src/components/misc/keyboard-shortcuts.vue index d0fb9d447..d87a005df 100644 --- a/src/components/misc/keyboard-shortcuts.vue +++ b/src/components/misc/keyboard-shortcuts.vue @@ -1,5 +1,5 @@