From e8db2c2b458bcae592609d5a5bc3f1b333651b25 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Tue, 24 Jan 2023 21:55:09 +0100 Subject: [PATCH] feat: header improvements --- cypress/e2e/list/list-view-list.spec.ts | 6 +- cypress/e2e/list/list.spec.ts | 10 +- cypress/e2e/list/prepareLists.ts | 2 +- cypress/e2e/user/logout.spec.ts | 4 +- cypress/e2e/user/settings.spec.ts | 2 +- src/components/home/TheNavigation.vue | 371 ++++++++---------- src/components/misc/dropdown.vue | 3 +- .../notifications/notifications.vue | 16 +- src/styles/common-imports.scss | 3 +- src/styles/custom-properties/colors.scss | 4 +- 10 files changed, 194 insertions(+), 227 deletions(-) diff --git a/cypress/e2e/list/list-view-list.spec.ts b/cypress/e2e/list/list-view-list.spec.ts index 0601894d4f..e2af1319f8 100644 --- a/cypress/e2e/list/list-view-list.spec.ts +++ b/cypress/e2e/list/list-view-list.spec.ts @@ -14,9 +14,9 @@ describe('List View List', () => { cy.visit('/lists/1') cy.url() .should('contain', '/lists/1/list') - cy.get('.list-title h1') + cy.get('.list-title') .should('contain', 'First List') - cy.get('.list-title .dropdown') + cy.get('.list-title-dropdown') .should('exist') cy.get('p') .contains('This list is currently empty.') @@ -62,7 +62,7 @@ describe('List View List', () => { }) cy.visit(`/lists/${lists[1].id}/`) - cy.get('.list-title .icon') + cy.get('.list-title-wrapper .icon') .should('not.exist') cy.get('input.input[placeholder="Add a new task..."') .should('not.exist') diff --git a/cypress/e2e/list/list.spec.ts b/cypress/e2e/list/list.spec.ts index 6f7c0b3a4d..5f92e2adfb 100644 --- a/cypress/e2e/list/list.spec.ts +++ b/cypress/e2e/list/list.spec.ts @@ -30,7 +30,7 @@ describe('Lists', () => { .should('contain', 'Success') cy.url() .should('contain', '/lists/') - cy.get('.list-title h1') + cy.get('.list-title') .should('contain', 'New List') }) @@ -51,7 +51,7 @@ describe('Lists', () => { const newListName = 'New list name' cy.visit('/lists/1') - cy.get('.list-title h1') + cy.get('.list-title') .should('contain', 'First List') cy.get('.namespace-container .menu.namespaces-lists .menu-list li:first-child .dropdown .menu-list-dropdown-trigger') @@ -67,7 +67,7 @@ describe('Lists', () => { cy.get('.global-notification') .should('contain', 'Success') - cy.get('.list-title h1') + cy.get('.list-title') .should('contain', newListName) .should('not.contain', lists[0].title) cy.get('.namespace-container .menu.namespaces-lists .menu-list li:first-child') @@ -104,9 +104,9 @@ describe('Lists', () => { it('Should archive a list', () => { cy.visit(`/lists/${lists[0].id}`) - cy.get('.list-title .dropdown') + cy.get('.list-title-dropdown') .click() - cy.get('.list-title .dropdown .dropdown-menu .dropdown-item') + cy.get('.list-title-dropdown .dropdown-menu .dropdown-item') .contains('Archive') .click() cy.get('.modal-content') diff --git a/cypress/e2e/list/prepareLists.ts b/cypress/e2e/list/prepareLists.ts index 8fa70e9c78..ac036625ec 100644 --- a/cypress/e2e/list/prepareLists.ts +++ b/cypress/e2e/list/prepareLists.ts @@ -11,7 +11,7 @@ export function createLists() { return lists } -export function prepareLists(setLists = () => {}) { +export function prepareLists(setLists = (...args: any[]) => {}) { beforeEach(() => { const lists = createLists() setLists(lists) diff --git a/cypress/e2e/user/logout.spec.ts b/cypress/e2e/user/logout.spec.ts index aeb07e5878..30a6d18d8a 100644 --- a/cypress/e2e/user/logout.spec.ts +++ b/cypress/e2e/user/logout.spec.ts @@ -2,9 +2,9 @@ import {createFakeUserAndLogin} from '../../support/authenticateUser' import {createLists} from '../list/prepareLists' function logout() { - cy.get('.navbar .user .username') + cy.get('.navbar .username-dropdown-trigger') .click() - cy.get('.navbar .user .dropdown-menu .dropdown-item') + cy.get('.navbar .dropdown-item') .contains('Logout') .click() } diff --git a/cypress/e2e/user/settings.spec.ts b/cypress/e2e/user/settings.spec.ts index ca4c3427a7..6e73188d47 100644 --- a/cypress/e2e/user/settings.spec.ts +++ b/cypress/e2e/user/settings.spec.ts @@ -37,7 +37,7 @@ describe('User Settings', () => { cy.get('.global-notification') .should('contain', 'Success') - cy.get('.navbar .user .username') + cy.get('.navbar .username-dropdown-trigger .username') .should('contain', 'Lorem Ipsum') }) }) diff --git a/src/components/home/TheNavigation.vue b/src/components/home/TheNavigation.vue index bed6764fa1..1bda78d3e8 100644 --- a/src/components/home/TheNavigation.vue +++ b/src/components/home/TheNavigation.vue @@ -2,95 +2,90 @@ \ No newline at end of file diff --git a/src/components/misc/dropdown.vue b/src/components/misc/dropdown.vue index 5b0fcdd697..6bc9eb6f85 100644 --- a/src/components/misc/dropdown.vue +++ b/src/components/misc/dropdown.vue @@ -1,6 +1,6 @@