From de14bb0376d5b0ed511e52251a7c0e6cc38c39eb Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Thu, 23 Feb 2017 17:34:56 -0300 Subject: [#907] Renames welcome component with @thaissiqueira --- web-ui/src/login/about/pixelated_welcome.js | 36 ---------------- web-ui/src/login/about/pixelated_welcome.scss | 49 ---------------------- web-ui/src/login/about/welcome.js | 36 ++++++++++++++++ web-ui/src/login/about/welcome.scss | 49 ++++++++++++++++++++++ web-ui/src/login/page.js | 4 +- .../unit/login/about/pixelated_welcome.spec.js | 17 -------- web-ui/test/unit/login/about/welcome.spec.js | 17 ++++++++ web-ui/test/unit/login/page.spec.js | 6 +-- 8 files changed, 107 insertions(+), 107 deletions(-) delete mode 100644 web-ui/src/login/about/pixelated_welcome.js delete mode 100644 web-ui/src/login/about/pixelated_welcome.scss create mode 100644 web-ui/src/login/about/welcome.js create mode 100644 web-ui/src/login/about/welcome.scss delete mode 100644 web-ui/test/unit/login/about/pixelated_welcome.spec.js create mode 100644 web-ui/test/unit/login/about/welcome.spec.js (limited to 'web-ui') diff --git a/web-ui/src/login/about/pixelated_welcome.js b/web-ui/src/login/about/pixelated_welcome.js deleted file mode 100644 index 7437ab72..00000000 --- a/web-ui/src/login/about/pixelated_welcome.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2017 ThoughtWorks, Inc. - * - * Pixelated is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Pixelated is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Pixelated. If not, see . - */ - -import React from 'react'; -import { translate } from 'react-i18next'; - -import './pixelated_welcome.scss'; - -export const PixelatedWelcome = ({ t }) => ( -
- {t('login.welcome-image-alt')} -
-

{t('login.welcome-message')}

-
-
-); - -PixelatedWelcome.propTypes = { - t: React.PropTypes.func.isRequired -}; - -export default translate('', { wait: true })(PixelatedWelcome); diff --git a/web-ui/src/login/about/pixelated_welcome.scss b/web-ui/src/login/about/pixelated_welcome.scss deleted file mode 100644 index 17d05f13..00000000 --- a/web-ui/src/login/about/pixelated_welcome.scss +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2017 ThoughtWorks, Inc. - * - * Pixelated is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Pixelated is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Pixelated. If not, see . - */ - -@import "~scss/base/colors"; - -.pixelated-welcome { - display: none; -} - -@media only screen and (min-width : 960px) { - .pixelated-welcome { - font-size: 0.9em; - color: $medium_grey; - display: flex; - font-weight: 300; - flex-direction: column; - align-self: flex-end; - order: 2; - width: 34%; - margin-right: 8%; - margin-top: -20.5em; - - h3 { - font-weight: normal; - font-size: 1.2em; - margin-top: 0; - } - } - - .welcome-logo { - order: 1; - width: 90%; - height: 15em; - } -} diff --git a/web-ui/src/login/about/welcome.js b/web-ui/src/login/about/welcome.js new file mode 100644 index 00000000..93aae8e1 --- /dev/null +++ b/web-ui/src/login/about/welcome.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ + +import React from 'react'; +import { translate } from 'react-i18next'; + +import './welcome.scss'; + +export const Welcome = ({ t }) => ( +
+ {t('login.welcome-image-alt')} +
+

{t('login.welcome-message')}

+
+
+); + +Welcome.propTypes = { + t: React.PropTypes.func.isRequired +}; + +export default translate('', { wait: true })(Welcome); diff --git a/web-ui/src/login/about/welcome.scss b/web-ui/src/login/about/welcome.scss new file mode 100644 index 00000000..1492b154 --- /dev/null +++ b/web-ui/src/login/about/welcome.scss @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ + +@import "~scss/base/colors"; + +.welcome { + display: none; +} + +@media only screen and (min-width : 960px) { + .welcome { + font-size: 0.9em; + color: $medium_grey; + display: flex; + font-weight: 300; + flex-direction: column; + align-self: flex-end; + order: 2; + width: 34%; + margin-right: 8%; + margin-top: -20.5em; + + h3 { + font-weight: normal; + font-size: 1.2em; + margin-top: 0; + } + } + + .welcome-logo { + order: 1; + width: 90%; + height: 15em; + } +} diff --git a/web-ui/src/login/page.js b/web-ui/src/login/page.js index f0a7188b..6be240b2 100644 --- a/web-ui/src/login/page.js +++ b/web-ui/src/login/page.js @@ -21,7 +21,7 @@ import InputField from 'src/common/input_field/input_field'; import SubmitButton from 'src/common/submit_button/submit_button'; import AuthError from 'src/login/error/auth_error'; import GenericError from 'src/login/error/generic_error'; -import PixelatedWelcome from 'src/login/about/pixelated_welcome'; +import Welcome from 'src/login/about/welcome'; import './page.scss'; @@ -32,7 +32,7 @@ const errorMessage = (t, authError) => { const rightPanel = (t, error) => { if (error) return ; - return ; + return ; }; export const Page = ({ t, authError, error }) => ( diff --git a/web-ui/test/unit/login/about/pixelated_welcome.spec.js b/web-ui/test/unit/login/about/pixelated_welcome.spec.js deleted file mode 100644 index d03cb457..00000000 --- a/web-ui/test/unit/login/about/pixelated_welcome.spec.js +++ /dev/null @@ -1,17 +0,0 @@ -import { shallow } from 'enzyme'; -import expect from 'expect'; -import React from 'react'; -import { PixelatedWelcome } from 'src/login/about/pixelated_welcome'; - -describe('PixelatedWelcome', () => { - let pixelatedWelcome; - const mockTranslations = key => key; - - beforeEach(() => { - pixelatedWelcome = shallow(); - }); - - it('renders welcome component', () => { - expect(pixelatedWelcome.find('.pixelated-welcome').length).toEqual(1); - }); -}); diff --git a/web-ui/test/unit/login/about/welcome.spec.js b/web-ui/test/unit/login/about/welcome.spec.js new file mode 100644 index 00000000..3e190c0c --- /dev/null +++ b/web-ui/test/unit/login/about/welcome.spec.js @@ -0,0 +1,17 @@ +import { shallow } from 'enzyme'; +import expect from 'expect'; +import React from 'react'; +import { Welcome } from 'src/login/about/welcome'; + +describe('Welcome', () => { + let welcome; + const mockTranslations = key => key; + + beforeEach(() => { + welcome = shallow(); + }); + + it('renders welcome component', () => { + expect(welcome.find('.welcome').length).toEqual(1); + }); +}); diff --git a/web-ui/test/unit/login/page.spec.js b/web-ui/test/unit/login/page.spec.js index b4063222..0fe6f729 100644 --- a/web-ui/test/unit/login/page.spec.js +++ b/web-ui/test/unit/login/page.spec.js @@ -4,7 +4,7 @@ import React from 'react'; import { Page } from 'src/login/page'; import AuthError from 'src/login/error/auth_error'; import GenericError from 'src/login/error/generic_error'; -import PixelatedWelcome from 'src/login/about/pixelated_welcome'; +import Welcome from 'src/login/about/welcome'; describe('Page', () => { let page; @@ -17,7 +17,7 @@ describe('Page', () => { it('renders welcome message when no error', () => { page = shallow(); - expect(page.find(PixelatedWelcome).length).toEqual(1); + expect(page.find(Welcome).length).toEqual(1); }); it('renders auth error message', () => { @@ -32,7 +32,7 @@ describe('Page', () => { it('does not render welcome message when error', () => { page = shallow(); - expect(page.find(PixelatedWelcome).length).toEqual(0); + expect(page.find(Welcome).length).toEqual(0); }); it('does not render error message', () => { -- cgit v1.2.3