From ff6cc306aff6150a924f1a647387e498d050ea9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 18 May 2021 17:04:24 +0200 Subject: [PATCH 01/11] Refactor logos, first step --- README.md | 2 +- backend/src/config/links.js | 1 + backend/src/config/logos.js | 10 +++ backend/src/config/metadata.js | 2 + .../src/middleware/email/templateBuilder.js | 3 +- webapp/components/LoginForm/LoginForm.vue | 12 ++-- webapp/components/Logo/Logo.vue | 52 ++++++++++++--- .../Registration/RegistrationSlider.vue | 4 +- .../_new/generic/BaseCard/BaseCard.story.js | 5 +- webapp/constants/links.js | 1 + webapp/constants/logos.js | 10 +++ webapp/constants/metadata.js | 3 +- webapp/layouts/basic.vue | 2 +- webapp/layouts/default.vue | 2 +- webapp/maintenance/source/pages/index.vue | 12 +--- webapp/pages/logout.vue | 7 +- webapp/pages/password-reset.vue | 4 +- .../img/custom/Logo-Horizontal-Dark.svg | 48 -------------- webapp/static/img/custom/Logo-Horizontal.svg | 2 +- ...under-maintenance.svg => logo-squared.svg} | 4 +- webapp/static/img/custom/logout.svg | 65 ------------------- webapp/static/img/custom/password-reset.svg | 65 ------------------- webapp/static/img/custom/sign-up.svg | 65 ------------------- webapp/static/img/custom/welcome.svg | 65 ------------------- 24 files changed, 103 insertions(+), 343 deletions(-) create mode 100644 backend/src/config/logos.js create mode 100644 webapp/constants/logos.js delete mode 100644 webapp/static/img/custom/Logo-Horizontal-Dark.svg rename webapp/static/img/custom/{under-maintenance.svg => logo-squared.svg} (98%) delete mode 100644 webapp/static/img/custom/logout.svg delete mode 100644 webapp/static/img/custom/password-reset.svg delete mode 100644 webapp/static/img/custom/sign-up.svg delete mode 100644 webapp/static/img/custom/welcome.svg diff --git a/README.md b/README.md index 9c948e7fb..4e1777c25 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ ocelot.social is a nonprofit social, action and knowledge network that connects * **Action**: Don't just read about how to make the world a better place, but come into **Action** by following provided suggestions on the **Action** tab provided by other people or **Organisations**.

- Ocelot-Social + ocelot.social

## Live demo diff --git a/backend/src/config/links.js b/backend/src/config/links.js index 494e449ba..c6f932c82 100644 --- a/backend/src/config/links.js +++ b/backend/src/config/links.js @@ -1,3 +1,4 @@ +// this file is duplicated in `backend/src/config/links.js` and `webapp/constants/links.js` and replaced on rebranding export default { ORGANIZATION: 'https://ocelot.social', DONATE: 'https://ocelot-social.herokuapp.com/donations', diff --git a/backend/src/config/logos.js b/backend/src/config/logos.js new file mode 100644 index 000000000..d093c7b46 --- /dev/null +++ b/backend/src/config/logos.js @@ -0,0 +1,10 @@ +// this file is duplicated in `backend/src/config/logos.js` and `webapp/constants/logos.js` and replaced on rebranding +// this are the paths in the webapp +export default { + LOGO_HEADER_PATH: '/img/custom/logo-horizontal.svg', + LOGO_SIGNUP_PATH: '/img/custom/logo-squared.svg', + LOGO_WELCOME_PATH: '/img/custom/logo-squared.svg', + LOGO_LOGOUT_PATH: '/img/custom/logo-squared.svg', + LOGO_PASSWORD_RESET_PATH: '/img/custom/logo-squared.svg', + LOGO_MAINTENACE_RESET_PATH: '/img/custom/logo-squared.svg', +} diff --git a/backend/src/config/metadata.js b/backend/src/config/metadata.js index 68d353eea..d40308e80 100644 --- a/backend/src/config/metadata.js +++ b/backend/src/config/metadata.js @@ -1,7 +1,9 @@ +// this file is duplicated in `backend/src/config/metadata.js` and `webapp/constants/metadata.js` and replaced on rebranding export default { APPLICATION_NAME: 'ocelot.social', APPLICATION_SHORT_NAME: 'ocelot', APPLICATION_DESCRIPTION: 'ocelot.social Community Network', + COOKIE_NAME: 'ocelot-social-token', ORGANIZATION_NAME: 'ocelot.social Community', ORGANIZATION_JURISDICTION: 'City of Angels', } diff --git a/backend/src/middleware/email/templateBuilder.js b/backend/src/middleware/email/templateBuilder.js index 2c7038d27..872b86b29 100644 --- a/backend/src/middleware/email/templateBuilder.js +++ b/backend/src/middleware/email/templateBuilder.js @@ -1,10 +1,11 @@ import mustache from 'mustache' import CONFIG from '../../config' +import logosWebapp from '../../config/logos.js' import * as templates from './templates' const from = CONFIG.EMAIL_DEFAULT_SENDER -const welcomeImageUrl = new URL(`/img/custom/welcome.svg`, CONFIG.CLIENT_URI) +const welcomeImageUrl = new URL(logosWebapp.LOGO_WELCOME_PATH, CONFIG.CLIENT_URI) const defaultParams = { supportUrl: CONFIG.SUPPORT_URL, diff --git a/webapp/components/LoginForm/LoginForm.vue b/webapp/components/LoginForm/LoginForm.vue index 01c3c8661..0dc1b5e8a 100644 --- a/webapp/components/LoginForm/LoginForm.vue +++ b/webapp/components/LoginForm/LoginForm.vue @@ -7,7 +7,7 @@

{{ $t('login.login') }}

@@ -56,13 +56,15 @@ diff --git a/webapp/components/Registration/RegistrationSlider.vue b/webapp/components/Registration/RegistrationSlider.vue index 0e3ae17a4..64b8d9a3f 100644 --- a/webapp/components/Registration/RegistrationSlider.vue +++ b/webapp/components/Registration/RegistrationSlider.vue @@ -3,7 +3,7 @@ @@ -47,6 +47,7 @@ import links from '~/constants/links.js' import metadata from '~/constants/metadata.js' import ComponentSlider from '~/components/ComponentSlider/ComponentSlider' import LocaleSwitch from '~/components/LocaleSwitch/LocaleSwitch' +import Logo from '~/components/Logo/Logo' import RegistrationSlideCreate from './RegistrationSlideCreate' import RegistrationSlideEmail from './RegistrationSlideEmail' import RegistrationSlideInvite from './RegistrationSlideInvite' @@ -58,6 +59,7 @@ export default { components: { ComponentSlider, LocaleSwitch, + Logo, RegistrationSlideCreate, RegistrationSlideEmail, RegistrationSlideInvite, diff --git a/webapp/components/_new/generic/BaseCard/BaseCard.story.js b/webapp/components/_new/generic/BaseCard/BaseCard.story.js index 3b9e60813..928aba5e6 100644 --- a/webapp/components/_new/generic/BaseCard/BaseCard.story.js +++ b/webapp/components/_new/generic/BaseCard/BaseCard.story.js @@ -1,5 +1,6 @@ import { storiesOf } from '@storybook/vue' import helpers from '~/storybook/helpers' +import logos from '~/constants/logos.js' import BaseCard from './BaseCard.vue' storiesOf('Generic/BaseCard', module) @@ -33,7 +34,7 @@ storiesOf('Generic/BaseCard', module) template: `

I am a card heading

And I am a paragraph.

@@ -46,7 +47,7 @@ storiesOf('Generic/BaseCard', module) template: `

I am a card heading

And I am a paragraph.

diff --git a/webapp/constants/links.js b/webapp/constants/links.js index 494e449ba..c6f932c82 100644 --- a/webapp/constants/links.js +++ b/webapp/constants/links.js @@ -1,3 +1,4 @@ +// this file is duplicated in `backend/src/config/links.js` and `webapp/constants/links.js` and replaced on rebranding export default { ORGANIZATION: 'https://ocelot.social', DONATE: 'https://ocelot-social.herokuapp.com/donations', diff --git a/webapp/constants/logos.js b/webapp/constants/logos.js new file mode 100644 index 000000000..d093c7b46 --- /dev/null +++ b/webapp/constants/logos.js @@ -0,0 +1,10 @@ +// this file is duplicated in `backend/src/config/logos.js` and `webapp/constants/logos.js` and replaced on rebranding +// this are the paths in the webapp +export default { + LOGO_HEADER_PATH: '/img/custom/logo-horizontal.svg', + LOGO_SIGNUP_PATH: '/img/custom/logo-squared.svg', + LOGO_WELCOME_PATH: '/img/custom/logo-squared.svg', + LOGO_LOGOUT_PATH: '/img/custom/logo-squared.svg', + LOGO_PASSWORD_RESET_PATH: '/img/custom/logo-squared.svg', + LOGO_MAINTENACE_RESET_PATH: '/img/custom/logo-squared.svg', +} diff --git a/webapp/constants/metadata.js b/webapp/constants/metadata.js index 20b9a5896..d40308e80 100644 --- a/webapp/constants/metadata.js +++ b/webapp/constants/metadata.js @@ -1,8 +1,9 @@ +// this file is duplicated in `backend/src/config/metadata.js` and `webapp/constants/metadata.js` and replaced on rebranding export default { APPLICATION_NAME: 'ocelot.social', APPLICATION_SHORT_NAME: 'ocelot', APPLICATION_DESCRIPTION: 'ocelot.social Community Network', + COOKIE_NAME: 'ocelot-social-token', ORGANIZATION_NAME: 'ocelot.social Community', ORGANIZATION_JURISDICTION: 'City of Angels', - COOKIE_NAME: 'ocelot-social-token', } diff --git a/webapp/layouts/basic.vue b/webapp/layouts/basic.vue index 527d5239c..9dd008c88 100644 --- a/webapp/layouts/basic.vue +++ b/webapp/layouts/basic.vue @@ -6,7 +6,7 @@ - + diff --git a/webapp/layouts/default.vue b/webapp/layouts/default.vue index 0b682f3d5..8b5e6302d 100644 --- a/webapp/layouts/default.vue +++ b/webapp/layouts/default.vue @@ -6,7 +6,7 @@ - + - Under maintenance + @@ -42,11 +38,13 @@ import emails from '~/constants/emails.js' import links from '~/constants/links.js' import metadata from '~/constants/metadata.js' import LocaleSwitch from '~/components/LocaleSwitch/LocaleSwitch' +import Logo from '~/components/Logo/Logo' export default { layout: 'blank', components: { LocaleSwitch, + Logo, }, data() { return { links, metadata, supportEmail: emails.SUPPORT } @@ -55,8 +53,4 @@ export default { diff --git a/webapp/pages/logout.vue b/webapp/pages/logout.vue index 279eec511..392b66d72 100644 --- a/webapp/pages/logout.vue +++ b/webapp/pages/logout.vue @@ -3,7 +3,7 @@ - Logging out + Logging out... @@ -14,8 +14,13 @@ - + From 29be05e7ffda935df182c1c1654e2dea60f6a234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 18 May 2021 19:37:34 +0200 Subject: [PATCH 03/11] Fix test of logo component --- webapp/components/Logo/Logo.spec.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webapp/components/Logo/Logo.spec.js b/webapp/components/Logo/Logo.spec.js index a712a529b..5a94fe538 100644 --- a/webapp/components/Logo/Logo.spec.js +++ b/webapp/components/Logo/Logo.spec.js @@ -4,18 +4,20 @@ import Logo from './Logo.vue' const localVue = global.localVue describe('Logo.vue', () => { - let wrapper - let mocks + let mocks, propsData, wrapper beforeEach(() => { mocks = { $t: jest.fn(), } + propsData = { + type: 'header', + } }) describe('mount', () => { const Wrapper = () => { - return mount(Logo, { mocks, localVue }) + return mount(Logo, { mocks, localVue, propsData }) } beforeEach(() => { From 9a736100df208b3862732e9898f3a2e17a2f7f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 18 May 2021 19:38:39 +0200 Subject: [PATCH 04/11] Remove comment --- webapp/components/LoginForm/LoginForm.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/webapp/components/LoginForm/LoginForm.vue b/webapp/components/LoginForm/LoginForm.vue index 0dc1b5e8a..0f2b248c9 100644 --- a/webapp/components/LoginForm/LoginForm.vue +++ b/webapp/components/LoginForm/LoginForm.vue @@ -124,9 +124,6 @@ export default { margin-top: $space-large; margin-bottom: $space-small; } - // .image { - // width: 100%; - // } } .password-wrapper { From eaf35d1bfdbe900d19b739df40160d679bf1dfbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 18 May 2021 19:55:32 +0200 Subject: [PATCH 05/11] Revert refactoring of maintenance page --- webapp/maintenance/source/pages/index.vue | 15 +++-- .../static/img/custom/under-maintenance.svg | 65 +++++++++++++++++++ 2 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 webapp/static/img/custom/under-maintenance.svg diff --git a/webapp/maintenance/source/pages/index.vue b/webapp/maintenance/source/pages/index.vue index e2a5fd683..59c7d4027 100644 --- a/webapp/maintenance/source/pages/index.vue +++ b/webapp/maintenance/source/pages/index.vue @@ -9,7 +9,11 @@ - + Under maintenance @@ -38,13 +42,11 @@ import emails from '~/constants/emails.js' import links from '~/constants/links.js' import metadata from '~/constants/metadata.js' import LocaleSwitch from '~/components/LocaleSwitch/LocaleSwitch' -import Logo from '~/components/Logo/Logo' export default { layout: 'blank', components: { LocaleSwitch, - Logo, }, data() { return { links, metadata, supportEmail: emails.SUPPORT } @@ -52,4 +54,9 @@ export default { } - + diff --git a/webapp/static/img/custom/under-maintenance.svg b/webapp/static/img/custom/under-maintenance.svg new file mode 100644 index 000000000..f2ace345e --- /dev/null +++ b/webapp/static/img/custom/under-maintenance.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 1f22995db63ad7962d9ec70457ad0093881c1a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 18 May 2021 20:13:03 +0200 Subject: [PATCH 06/11] Delete 'under-maintenance.svg' and replace by 'logo-squared.svg' --- webapp/maintenance/source/pages/index.vue | 2 +- .../static/img/custom/under-maintenance.svg | 65 ------------------- 2 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 webapp/static/img/custom/under-maintenance.svg diff --git a/webapp/maintenance/source/pages/index.vue b/webapp/maintenance/source/pages/index.vue index 59c7d4027..08592084e 100644 --- a/webapp/maintenance/source/pages/index.vue +++ b/webapp/maintenance/source/pages/index.vue @@ -12,7 +12,7 @@ Under maintenance diff --git a/webapp/static/img/custom/under-maintenance.svg b/webapp/static/img/custom/under-maintenance.svg deleted file mode 100644 index f2ace345e..000000000 --- a/webapp/static/img/custom/under-maintenance.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From a9a0d1c380feb28b5326391fb15adada1130d282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 18 May 2021 20:51:01 +0200 Subject: [PATCH 07/11] Fix linting --- webapp/maintenance/source/pages/index.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/webapp/maintenance/source/pages/index.vue b/webapp/maintenance/source/pages/index.vue index 08592084e..2e2cdfe3b 100644 --- a/webapp/maintenance/source/pages/index.vue +++ b/webapp/maintenance/source/pages/index.vue @@ -9,11 +9,7 @@ - Under maintenance + Under maintenance From 2f72e4eba34495a514dcc5c814636086d2425261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 18 May 2021 22:09:56 +0200 Subject: [PATCH 08/11] Follow @Mogge suggestions --- webapp/components/LoginForm/LoginForm.vue | 2 +- webapp/components/Logo/Logo.vue | 18 +++++++++--------- .../Registration/RegistrationSlider.vue | 2 +- webapp/layouts/basic.vue | 2 +- webapp/layouts/default.vue | 2 +- webapp/pages/logout.vue | 2 +- webapp/pages/password-reset.vue | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/webapp/components/LoginForm/LoginForm.vue b/webapp/components/LoginForm/LoginForm.vue index 0f2b248c9..bbc63e93a 100644 --- a/webapp/components/LoginForm/LoginForm.vue +++ b/webapp/components/LoginForm/LoginForm.vue @@ -7,7 +7,7 @@

{{ $t('login.login') }}

diff --git a/webapp/components/Logo/Logo.vue b/webapp/components/Logo/Logo.vue index 1714888d7..c93d74f81 100644 --- a/webapp/components/Logo/Logo.vue +++ b/webapp/components/Logo/Logo.vue @@ -5,14 +5,14 @@ class="ds-logo-svg" :alt="metadata.APPLICATION_NAME + ' ' + logo.alt" :src="logo.path" - :style="logoWidth" + :style="logoWidthStyle" /> @@ -31,14 +31,14 @@ export default { /** * Logo type */ - type: { + logoType: { type: String, required: true, }, /** - * Logo type + * Logo width */ - width: { + logoWidth: { type: String, default: null, }, @@ -75,17 +75,17 @@ export default { }, } return { - logo: logosObject[this.type], + logo: logosObject[this.logoType], metadata, } }, computed: { - logoWidth() { + logoWidthStyle() { let width = '' - if (this.width === null) { + if (this.logoWidth === null) { width = this.logo.widthDefault } else { - width = this.width + width = this.logoWidth } return `width: ${width};` }, diff --git a/webapp/components/Registration/RegistrationSlider.vue b/webapp/components/Registration/RegistrationSlider.vue index 64b8d9a3f..2e297bc86 100644 --- a/webapp/components/Registration/RegistrationSlider.vue +++ b/webapp/components/Registration/RegistrationSlider.vue @@ -3,7 +3,7 @@ diff --git a/webapp/layouts/basic.vue b/webapp/layouts/basic.vue index 9dd008c88..01872868e 100644 --- a/webapp/layouts/basic.vue +++ b/webapp/layouts/basic.vue @@ -6,7 +6,7 @@ - + diff --git a/webapp/layouts/default.vue b/webapp/layouts/default.vue index 8b5e6302d..0dfd752bf 100644 --- a/webapp/layouts/default.vue +++ b/webapp/layouts/default.vue @@ -6,7 +6,7 @@ - + - + Logging out... diff --git a/webapp/pages/password-reset.vue b/webapp/pages/password-reset.vue index a3f8c7bd5..caa7c3455 100644 --- a/webapp/pages/password-reset.vue +++ b/webapp/pages/password-reset.vue @@ -3,7 +3,7 @@ From 5ab01e9cd47e44c1ef52552de3ab0ece5fc02f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 18 May 2021 22:13:06 +0200 Subject: [PATCH 09/11] Fix test --- webapp/components/Logo/Logo.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/components/Logo/Logo.spec.js b/webapp/components/Logo/Logo.spec.js index 5a94fe538..103158780 100644 --- a/webapp/components/Logo/Logo.spec.js +++ b/webapp/components/Logo/Logo.spec.js @@ -11,7 +11,7 @@ describe('Logo.vue', () => { $t: jest.fn(), } propsData = { - type: 'header', + logoType: 'header', } }) From 0df0c19c7360db7c6e268ed97a1fcffa79b065b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 19 May 2021 07:08:49 +0200 Subject: [PATCH 10/11] Rename logo as dummy for following just small caps --- .../custom/{Logo-Horizontal.svg => logo-horizontal--dummy.svg} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename webapp/static/img/custom/{Logo-Horizontal.svg => logo-horizontal--dummy.svg} (100%) diff --git a/webapp/static/img/custom/Logo-Horizontal.svg b/webapp/static/img/custom/logo-horizontal--dummy.svg similarity index 100% rename from webapp/static/img/custom/Logo-Horizontal.svg rename to webapp/static/img/custom/logo-horizontal--dummy.svg From 8a51c8cb1d18f2c9ac1e204c0ba2da4db1f87cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 19 May 2021 07:09:38 +0200 Subject: [PATCH 11/11] Rename logo to just small caps --- .../custom/{logo-horizontal--dummy.svg => logo-horizontal.svg} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename webapp/static/img/custom/{logo-horizontal--dummy.svg => logo-horizontal.svg} (100%) diff --git a/webapp/static/img/custom/logo-horizontal--dummy.svg b/webapp/static/img/custom/logo-horizontal.svg similarity index 100% rename from webapp/static/img/custom/logo-horizontal--dummy.svg rename to webapp/static/img/custom/logo-horizontal.svg