From f8d009a6aafddf7492cd1361f8c9ef2b6c1503cb Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 28 Nov 2021 14:18:27 +0000 Subject: [PATCH] feat: add message component (#1082) This PR adds a simple message component that replaces bulma's default message. Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1082 Reviewed-by: dpschen Co-authored-by: konrad Co-committed-by: konrad --- cypress/integration/user/login.spec.js | 2 +- cypress/integration/user/registration.spec.js | 4 +- package.json | 5 +- src/components/misc/api-config.vue | 18 ++++--- src/components/misc/error.vue | 7 ++- .../misc/keyboard-shortcuts/index.vue | 18 +++---- src/components/misc/message.vue | 41 ++++++++++++++++ src/components/misc/no-auth-wrapper.vue | 12 ++--- src/components/misc/ready.vue | 6 ++- src/components/modal/modal.vue | 4 -- src/styles/global.scss | 4 +- src/styles/theme/_index.scss | 1 - src/styles/theme/notification.scss | 12 ----- src/views/Home.vue | 8 ++-- src/views/list/ShowList.vue | 6 ++- src/views/migrator/MigrateService.vue | 48 ++++++++++--------- src/views/namespaces/NewNamespace.vue | 10 ++-- src/views/sharing/LinkSharingAuth.vue | 12 +++-- src/views/user/Login.vue | 14 +++--- src/views/user/OpenIdAuth.vue | 10 ++-- src/views/user/PasswordReset.vue | 26 +++++----- src/views/user/Register.vue | 20 ++++---- src/views/user/RequestPasswordReset.vue | 9 ++-- 23 files changed, 170 insertions(+), 127 deletions(-) create mode 100644 src/components/misc/message.vue delete mode 100644 src/styles/theme/notification.scss diff --git a/cypress/integration/user/login.spec.js b/cypress/integration/user/login.spec.js index ce6086ce..238ec77f 100644 --- a/cypress/integration/user/login.spec.js +++ b/cypress/integration/user/login.spec.js @@ -8,7 +8,7 @@ const testAndAssertFailed = fixture => { cy.wait(5000) // It can take waaaayy too long to log the user in cy.url().should('include', '/') - cy.get('div.notification.is-danger').contains('Wrong username or password.') + cy.get('div.message.danger').contains('Wrong username or password.') } context('Login', () => { diff --git a/cypress/integration/user/registration.spec.js b/cypress/integration/user/registration.spec.js index fc1b0fbd..fd940aa7 100644 --- a/cypress/integration/user/registration.spec.js +++ b/cypress/integration/user/registration.spec.js @@ -32,7 +32,7 @@ context('Registration', () => { cy.get('h2').should('contain', `Hi ${fixture.username}!`) }) - it('Should fail', () => { + it.only('Should fail', () => { const fixture = { username: 'test', password: '123456', @@ -45,6 +45,6 @@ context('Registration', () => { cy.get('#password').type(fixture.password) cy.get('#passwordValidation').type(fixture.password) cy.get('#register-submit').click() - cy.get('div.notification.is-danger').contains('A user with this username already exists.') + cy.get('div.message.danger').contains('A user with this username already exists.') }) }) \ No newline at end of file diff --git a/package.json b/package.json index dc599995..626840aa 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,10 @@ "ignorePatterns": [ "*.test.*", "cypress/*" - ] + ], + "globals": { + "defineProps": "readonly" + } }, "postcss": { "plugins": { diff --git a/src/components/misc/api-config.vue b/src/components/misc/api-config.vue index 07ca857b..c0e542f3 100644 --- a/src/components/misc/api-config.vue +++ b/src/components/misc/api-config.vue @@ -30,27 +30,25 @@ {{ $t('apiConfig.change') }} -
+ {{ successMsg }} -
-
+ + {{ errorMsg }} -
+ + + diff --git a/src/components/misc/no-auth-wrapper.vue b/src/components/misc/no-auth-wrapper.vue index fe4a5700..01ab5681 100644 --- a/src/components/misc/no-auth-wrapper.vue +++ b/src/components/misc/no-auth-wrapper.vue @@ -2,14 +2,9 @@
@@ -17,6 +12,7 @@