From 2aceca54ca41fffa24214359492c38a67bd2e790 Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 17 Jan 2021 17:57:57 +0000 Subject: [PATCH] Move buttons to separate component (#380) Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/380 Co-authored-by: konrad Co-committed-by: konrad --- cypress/integration/list/list.spec.js | 2 +- cypress/integration/list/namespaces.spec.js | 2 +- cypress/integration/sharing/team.spec.js | 4 +- cypress/integration/task/task.spec.js | 8 +- cypress/integration/user/login.spec.js | 4 +- cypress/integration/user/registration.spec.js | 4 +- cypress/integration/user/settings.spec.js | 2 +- src/components/home/contentLinkShare.vue | 12 +- src/components/home/topNavigation.vue | 11 +- src/components/home/update.vue | 4 +- src/components/input/button.vue | 74 ++++ src/components/input/colorPicker.vue | 4 +- src/components/input/datepicker.vue | 7 +- src/components/input/editor.vue | 18 +- src/components/input/multiselect.vue | 4 +- .../list/partials/background-settings.vue | 121 +++--- src/components/list/partials/filters.vue | 316 +++++++------- src/components/migrator/migration.vue | 14 +- src/components/misc/api-config.vue | 71 ++- src/components/misc/card.vue | 39 ++ src/components/misc/keyboard-shortcuts.vue | 107 ++--- src/components/misc/notification.vue | 36 +- src/components/misc/shortcut.vue | 20 + src/components/modal/modal.vue | 32 +- src/components/sharing/linkSharing.vue | 140 +++--- src/components/sharing/userTeam.vue | 264 ++++++----- src/components/tasks/edit-task.vue | 85 ++-- src/components/tasks/gantt-component.vue | 248 +++++++---- src/components/tasks/partials/attachments.vue | 135 ++++-- src/components/tasks/partials/comments.vue | 170 ++++++-- src/components/tasks/partials/defer-task.vue | 38 +- .../tasks/partials/relatedTasks.vue | 20 +- src/components/tasks/partials/repeatAfter.vue | 6 +- src/components/user/avatar-settings.vue | 123 +++--- src/main.js | 6 + src/styles/components/base/multiselect.scss | 4 +- src/styles/components/task.scss | 2 +- src/styles/theme/form.scss | 8 - src/views/Home.vue | 6 +- src/views/filters/CreateSavedFilter.vue | 108 +++-- src/views/filters/EditSavedFilter.vue | 129 +++--- src/views/labels/ListLabels.vue | 131 +++--- src/views/labels/NewLabel.vue | 11 +- src/views/list/EditList.vue | 222 +++++----- src/views/list/NewList.vue | 12 +- src/views/list/views/Kanban.vue | 67 +-- src/views/list/views/List.vue | 66 ++- src/views/list/views/Table.vue | 59 ++- src/views/namespaces/EditNamespace.vue | 140 +++--- src/views/namespaces/ListNamespaces.vue | 28 +- src/views/namespaces/NewNamespace.vue | 12 +- src/views/tasks/ShowTasks.vue | 6 +- src/views/tasks/TaskDetailView.vue | 182 +++++--- src/views/teams/EditTeam.vue | 298 +++++++------ src/views/teams/ListTeams.vue | 11 +- src/views/teams/NewTeam.vue | 7 +- src/views/user/Login.vue | 25 +- src/views/user/PasswordReset.vue | 13 +- src/views/user/Register.vue | 17 +- src/views/user/RequestPasswordReset.vue | 14 +- src/views/user/Settings.vue | 411 ++++++++---------- 61 files changed, 2315 insertions(+), 1825 deletions(-) create mode 100644 src/components/input/button.vue create mode 100644 src/components/misc/card.vue create mode 100644 src/components/misc/shortcut.vue diff --git a/cypress/integration/list/list.spec.js b/cypress/integration/list/list.spec.js index 51627f0b..4231a0a2 100644 --- a/cypress/integration/list/list.spec.js +++ b/cypress/integration/list/list.spec.js @@ -29,7 +29,7 @@ describe('Lists', () => { .contains('Create a new list') cy.get('input.input') .type('New List') - cy.get('button') + cy.get('.button') .contains('Add') .click() diff --git a/cypress/integration/list/namespaces.spec.js b/cypress/integration/list/namespaces.spec.js index a2b2edd1..6d3b33d3 100644 --- a/cypress/integration/list/namespaces.spec.js +++ b/cypress/integration/list/namespaces.spec.js @@ -30,7 +30,7 @@ describe('Namepaces', () => { .should('contain', 'Create a new namespace') cy.get('input.input') .type('New Namespace') - cy.get('button') + cy.get('.button') .contains('Add') .click() cy.url() diff --git a/cypress/integration/sharing/team.spec.js b/cypress/integration/sharing/team.spec.js index 9a00a423..2f0a9d7c 100644 --- a/cypress/integration/sharing/team.spec.js +++ b/cypress/integration/sharing/team.spec.js @@ -17,7 +17,7 @@ describe('Team', () => { .contains('Create a new team') cy.get('input.input') .type('New Team') - cy.get('button') + cy.get('.button') .contains('Add') .click() @@ -113,7 +113,7 @@ describe('Team', () => { .click() cy.get('.card') .contains('Team Members') - .get('.card-content button.button') + .get('.card-content .button') .contains('Add To Team') .click() diff --git a/cypress/integration/task/task.spec.js b/cypress/integration/task/task.spec.js index bb43f474..ced98b60 100644 --- a/cypress/integration/task/task.spec.js +++ b/cypress/integration/task/task.spec.js @@ -28,7 +28,7 @@ describe('Task', () => { cy.visit('/lists/1/list') cy.get('input.input[placeholder="Add a new task..."') .type('New Task') - cy.get('button.button') + cy.get('.button') .contains('Add') .click() cy.get('.tasks .task .tasktext') @@ -44,7 +44,7 @@ describe('Task', () => { .should('not.exist') cy.get('input.input[placeholder="Add a new task..."') .type('New Task') - cy.get('button.button') + cy.get('.button') .contains('Add') .click() @@ -175,7 +175,7 @@ describe('Task', () => { .should('exist') }) - it('Can add a new comment', () => { + it.only('Can add a new comment', () => { const tasks = TaskFactory.create(1, { id: 1, }) @@ -183,7 +183,7 @@ describe('Task', () => { cy.get('.task-view .comments .media.comment .editor .vue-easymde .EasyMDEContainer .CodeMirror-scroll') .type('{selectall}New Comment') - cy.get('.task-view .comments .media.comment .button.is-primary') + cy.get('.task-view .comments .media.comment .button:not([disabled])') .contains('Comment') .click() diff --git a/cypress/integration/user/login.spec.js b/cypress/integration/user/login.spec.js index f89aa6cc..d1cde64e 100644 --- a/cypress/integration/user/login.spec.js +++ b/cypress/integration/user/login.spec.js @@ -4,7 +4,7 @@ const testAndAssertFailed = fixture => { cy.visit('/login') cy.get('input[id=username]').type(fixture.username) cy.get('input[id=password]').type(fixture.password) - cy.get('button').contains('Login').click() + cy.get('.button').contains('Login').click() cy.wait(5000) // It can take waaaayy too long to log the user in cy.url().should('include', '/') @@ -32,7 +32,7 @@ context('Login', () => { cy.visit('/login') cy.get('input[id=username]').type(fixture.username) cy.get('input[id=password]').type(fixture.password) - cy.get('button').contains('Login').click() + cy.get('.button').contains('Login').click() cy.url().should('include', '/') 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 b61b93c5..37c238e3 100644 --- a/cypress/integration/user/registration.spec.js +++ b/cypress/integration/user/registration.spec.js @@ -26,7 +26,7 @@ context('Registration', () => { cy.get('#email').type(fixture.email) cy.get('#password1').type(fixture.password) cy.get('#password2').type(fixture.password) - cy.get('button#register-submit').click() + cy.get('#register-submit').click() cy.url().should('include', '/') cy.get('h2').should('contain', `Hi ${fixture.username}!`) }) @@ -43,7 +43,7 @@ context('Registration', () => { cy.get('#email').type(fixture.email) cy.get('#password1').type(fixture.password) cy.get('#password2').type(fixture.password) - cy.get('button#register-submit').click() + cy.get('#register-submit').click() cy.get('div.notification.is-danger').contains('A user with this username already exists.') }) }) \ No newline at end of file diff --git a/cypress/integration/user/settings.spec.js b/cypress/integration/user/settings.spec.js index 761c1a26..c2d20d08 100644 --- a/cypress/integration/user/settings.spec.js +++ b/cypress/integration/user/settings.spec.js @@ -32,7 +32,7 @@ describe('User Settings', () => { cy.get('input#newName') .type('Lorem Ipsum') - cy.get('.card.update-name button.button.is-primary') + cy.get('.card.general-settings .button.is-primary') .contains('Save') .click() diff --git a/src/components/home/contentLinkShare.vue b/src/components/home/contentLinkShare.vue index 65b53ff8..14d85a3a 100644 --- a/src/components/home/contentLinkShare.vue +++ b/src/components/home/contentLinkShare.vue @@ -14,12 +14,12 @@
@@ -49,7 +49,3 @@ export default { }, } - - \ No newline at end of file diff --git a/src/components/home/topNavigation.vue b/src/components/home/topNavigation.vue index 5a083c12..7d796afa 100644 --- a/src/components/home/topNavigation.vue +++ b/src/components/home/topNavigation.vue @@ -44,12 +44,15 @@
diff --git a/src/components/input/editor.vue b/src/components/input/editor.vue index eafb5752..bdbeffc8 100644 --- a/src/components/input/editor.vue +++ b/src/components/input/editor.vue @@ -1,12 +1,22 @@ diff --git a/src/components/misc/keyboard-shortcuts.vue b/src/components/misc/keyboard-shortcuts.vue index 05659dc9..e9a3c12b 100644 --- a/src/components/misc/keyboard-shortcuts.vue +++ b/src/components/misc/keyboard-shortcuts.vue @@ -2,71 +2,50 @@