From cdbd1c2ac47d2c74585175f9fae2fc940347fb81 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Tue, 4 Jan 2022 18:58:06 +0000 Subject: [PATCH] feat: create BaseButton component (#1123) Co-authored-by: Dominik Pschenitschni Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1123 Reviewed-by: konrad Co-authored-by: Dominik Pschenitschni Co-committed-by: Dominik Pschenitschni --- cypress/integration/list/list.spec.js | 4 +- cypress/integration/list/namespaces.spec.js | 2 +- cypress/integration/task/task.spec.js | 4 +- cypress/integration/user/settings.spec.js | 4 +- src/App.vue | 4 +- src/components/base/BaseButton.vue | 118 ++++++++++++++++++ src/components/home/topNavigation.vue | 2 +- src/components/input/button.vue | 118 ++++++++---------- src/components/input/colorPicker.vue | 2 +- src/components/input/datepicker.vue | 1 + src/components/input/editor.vue | 2 +- src/components/list/partials/filter-popup.vue | 4 +- src/components/misc/create-edit.vue | 18 +-- src/components/misc/notification.vue | 2 +- src/components/misc/subscription.vue | 2 +- src/components/modal/modal.vue | 5 +- src/components/tasks/partials/attachments.vue | 2 +- src/components/tasks/partials/defer-task.vue | 6 +- .../tasks/partials/relatedTasks.vue | 2 +- src/components/tasks/partials/repeatAfter.vue | 6 +- src/main.ts | 7 +- src/views/About.vue | 2 +- src/views/filters/FilterEdit.vue | 4 +- src/views/list/settings/background.vue | 8 +- src/views/list/settings/edit.vue | 4 +- src/views/list/views/Kanban.vue | 5 +- src/views/list/views/List.vue | 2 +- src/views/list/views/Table.vue | 2 +- src/views/migrator/MigrateService.vue | 2 +- src/views/namespaces/ListNamespaces.vue | 4 +- src/views/namespaces/settings/edit.vue | 4 +- src/views/tasks/ShowTasks.vue | 6 +- src/views/tasks/TaskDetailView.vue | 30 ++--- src/views/user/Login.vue | 4 +- src/views/user/Register.vue | 2 +- src/views/user/RequestPasswordReset.vue | 2 +- src/views/user/settings/Avatar.vue | 1 + src/views/user/settings/General.vue | 1 + src/views/user/settings/TOTP.vue | 2 +- 39 files changed, 254 insertions(+), 146 deletions(-) create mode 100644 src/components/base/BaseButton.vue diff --git a/cypress/integration/list/list.spec.js b/cypress/integration/list/list.spec.js index 864b533b..43939197 100644 --- a/cypress/integration/list/list.spec.js +++ b/cypress/integration/list/list.spec.js @@ -101,7 +101,7 @@ describe('Lists', () => { .click() cy.url() .should('contain', '/settings/delete') - cy.get('.modal-mask .modal-container .modal-content .actions a.button') + cy.get('[data-cy="modalPrimary"]') .contains('Do it') .click() @@ -392,7 +392,7 @@ describe('Lists', () => { cy.get('.kanban .bucket .bucket-header .dropdown.options .dropdown-menu .dropdown-item .field input.input') .first() .type(3) - cy.get('.kanban .bucket .bucket-header .dropdown.options .dropdown-menu .dropdown-item .field a.button.is-primary') + cy.get('[data-cy="setBucketLimit"]') .first() .click() diff --git a/cypress/integration/list/namespaces.spec.js b/cypress/integration/list/namespaces.spec.js index 7d092113..12a3b27e 100644 --- a/cypress/integration/list/namespaces.spec.js +++ b/cypress/integration/list/namespaces.spec.js @@ -89,7 +89,7 @@ describe('Namepaces', () => { .click() cy.url() .should('contain', '/settings/delete') - cy.get('.modal-mask .modal-container .modal-content .actions a.button') + cy.get('[data-cy="modalPrimary"]') .contains('Do it') .click() diff --git a/cypress/integration/task/task.spec.js b/cypress/integration/task/task.spec.js index 68027e3d..63df5651 100644 --- a/cypress/integration/task/task.spec.js +++ b/cypress/integration/task/task.spec.js @@ -168,7 +168,7 @@ describe('Task', () => { .click() cy.get('.task-view .details.content.description .editor .vue-easymde .EasyMDEContainer .CodeMirror-scroll') .type('{selectall}New Description') - cy.get('.task-view .details.content.description .editor a') + cy.get('[data-cy="saveEditor"]') .contains('Save') .click() @@ -404,7 +404,7 @@ describe('Task', () => { cy.get('.datepicker .datepicker-popup a') .contains('Tomorrow') .click() - cy.get('.datepicker .datepicker-popup a.button') + cy.get('[data-cy="closeDatepicker"]') .contains('Confirm') .click() diff --git a/cypress/integration/user/settings.spec.js b/cypress/integration/user/settings.spec.js index 29cb1ad0..c6a645d5 100644 --- a/cypress/integration/user/settings.spec.js +++ b/cypress/integration/user/settings.spec.js @@ -18,7 +18,7 @@ describe('User Settings', () => { .trigger('mousedown', {which: 1}) .trigger('mousemove', {clientY: 100}) .trigger('mouseup') - cy.get('a.button.is-primary') + cy.get('[data-cy="uploadAvatar"]') .contains('Upload Avatar') .click() @@ -33,7 +33,7 @@ describe('User Settings', () => { cy.get('.general-settings .control input.input') .first() .type('Lorem Ipsum') - cy.get('.card.general-settings .button.is-primary') + cy.get('[data-cy="saveGeneralSettings"]') .contains('Save') .click() diff --git a/src/App.vue b/src/App.vue index e0b53d24..2d7fe65f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,6 @@