From d1a2eefca663ca10a2ad50878523a56124e6bfee Mon Sep 17 00:00:00 2001 From: konrad Date: Sat, 23 Jan 2021 17:18:09 +0000 Subject: [PATCH] Improve consistency of the layout (#386) Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/386 Co-authored-by: konrad Co-committed-by: konrad --- cypress/integration/list/list.spec.js | 5 +- cypress/integration/sharing/team.spec.js | 2 - cypress/support/commands.js | 17 ++++ cypress/support/index.js | 1 + src/components/input/editor.vue | 6 +- src/components/misc/notification.vue | 2 +- src/components/misc/user.vue | 4 +- src/components/tasks/edit-task.vue | 2 +- .../tasks/partials/priorityLabel.vue | 4 +- .../tasks/partials/relatedTasks.vue | 2 +- src/styles/components/_all.scss | 3 +- src/styles/components/attachments.scss | 16 ++-- src/styles/components/base/card.scss | 8 +- src/styles/components/base/fancycheckbox.scss | 6 +- src/styles/components/base/multiselect.scss | 10 +-- src/styles/components/base/scrollbars.scss | 10 +-- src/styles/components/base/tooltip.scss | 90 +------------------ src/styles/components/color-picker.scss | 2 +- src/styles/components/comments.scss | 2 +- src/styles/components/fullpage.scss | 57 ------------ src/styles/components/gantt.scss | 47 +++++----- src/styles/components/kanban.scss | 51 ++++++----- src/styles/components/keyboard-shortcuts.scss | 6 +- src/styles/components/labels.scss | 2 +- src/styles/components/legal.scss | 2 +- src/styles/components/list-backgrounds.scss | 18 ++-- src/styles/components/list.scss | 18 ++-- src/styles/components/migrator.scss | 8 +- src/styles/components/modal.scss | 2 +- src/styles/components/namespaces.scss | 16 ++-- src/styles/components/switch-view.scss | 20 ++--- src/styles/components/table-view.scss | 2 +- src/styles/components/task.scss | 36 ++++---- src/styles/components/taskRelations.scss | 13 +-- src/styles/components/tasks.scss | 47 +++++----- src/styles/components/teams.scss | 3 +- src/styles/theme/_all.scss | 2 +- src/styles/theme/background.scss | 2 +- src/styles/theme/content.scss | 6 +- src/styles/theme/form.scss | 16 ++-- src/styles/theme/link-share.scss | 2 +- src/styles/theme/loading.scss | 20 ++--- src/styles/theme/navigation.scss | 59 ++++++------ src/styles/theme/notification.scss | 14 +-- src/styles/theme/offline.scss | 6 +- src/styles/theme/theme.scss | 2 +- src/styles/theme/update-notification.scss | 18 ++-- src/styles/theme/variables/_all.scss | 3 + src/styles/theme/variables/colors.scss | 17 ++++ src/styles/theme/variables/shadows.scss | 5 ++ .../theme/{ => variables}/variables.scss | 35 ++++---- src/views/user/Login.vue | 2 +- src/views/user/PasswordReset.vue | 2 +- src/views/user/RequestPasswordReset.vue | 2 +- 54 files changed, 307 insertions(+), 446 deletions(-) create mode 100644 cypress/support/commands.js delete mode 100644 src/styles/components/fullpage.scss create mode 100644 src/styles/theme/variables/_all.scss create mode 100644 src/styles/theme/variables/colors.scss create mode 100644 src/styles/theme/variables/shadows.scss rename src/styles/theme/{ => variables}/variables.scss (59%) diff --git a/cypress/integration/list/list.spec.js b/cypress/integration/list/list.spec.js index 011b489ec..3d85375a3 100644 --- a/cypress/integration/list/list.spec.js +++ b/cypress/integration/list/list.spec.js @@ -361,10 +361,7 @@ describe('Lists', () => { }) cy.visit('/lists/1/kanban') - cy.get('.kanban .bucket .tasks') - .should('contain', tasks[0].title) - - cy.get('.kanban .bucket .tasks .task') + cy.getAttached('.kanban .bucket .tasks .task') .contains(tasks[0].title) .click() diff --git a/cypress/integration/sharing/team.spec.js b/cypress/integration/sharing/team.spec.js index 0359af91a..094556355 100644 --- a/cypress/integration/sharing/team.spec.js +++ b/cypress/integration/sharing/team.spec.js @@ -23,8 +23,6 @@ describe('Team', () => { .contains('Create') .click() - cy.get('.fullpage') - .should('not.exist') cy.url() .should('contain', '/edit') cy.get('input#teamtext') diff --git a/cypress/support/commands.js b/cypress/support/commands.js new file mode 100644 index 000000000..ccdc6f366 --- /dev/null +++ b/cypress/support/commands.js @@ -0,0 +1,17 @@ +/** + * getAttached(selector) + * getAttached(selectorFn) + * + * Waits until the selector finds an attached element, then yields it (wrapped). + * selectorFn, if provided, is passed $(document). Don't use cy methods inside selectorFn. + * + * Source: https://github.com/cypress-io/cypress/issues/5743#issuecomment-650421731 + */ +Cypress.Commands.add('getAttached', selector => { + const getElement = typeof selector === 'function' ? selector : $d => $d.find(selector); + let $el = null; + return cy.document().should($d => { + $el = getElement(Cypress.$($d)); + expect(Cypress.dom.isDetached($el)).to.be.false; + }).then(() => cy.wrap($el)); +}); diff --git a/cypress/support/index.js b/cypress/support/index.js index a51369df0..74c1400d7 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -1,2 +1,3 @@ +import './commands' import 'cypress-file-upload' diff --git a/src/components/input/editor.vue b/src/components/input/editor.vue index d5ccf95b2..6df9de8b4 100644 --- a/src/components/input/editor.vue +++ b/src/components/input/editor.vue @@ -442,7 +442,7 @@ export default { \ No newline at end of file diff --git a/src/components/misc/user.vue b/src/components/misc/user.vue index 4e9c8e63f..bcd76e078 100644 --- a/src/components/misc/user.vue +++ b/src/components/misc/user.vue @@ -40,7 +40,7 @@ export default { diff --git a/src/components/tasks/edit-task.vue b/src/components/tasks/edit-task.vue index 1904c4300..c259f74d0 100644 --- a/src/components/tasks/edit-task.vue +++ b/src/components/tasks/edit-task.vue @@ -284,6 +284,6 @@ export default { \ No newline at end of file diff --git a/src/components/tasks/partials/priorityLabel.vue b/src/components/tasks/partials/priorityLabel.vue index d47ae0457..d9d9eb4a2 100644 --- a/src/components/tasks/partials/priorityLabel.vue +++ b/src/components/tasks/partials/priorityLabel.vue @@ -44,7 +44,7 @@ export default { diff --git a/src/views/user/RequestPasswordReset.vue b/src/views/user/RequestPasswordReset.vue index b6c17d9ad..72e1bc716 100644 --- a/src/views/user/RequestPasswordReset.vue +++ b/src/views/user/RequestPasswordReset.vue @@ -85,6 +85,6 @@ export default {