From 0c4c805f03d61760fd1685d22afbc545e67e96ed Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Mon, 27 Mar 2017 13:50:51 -0300 Subject: [#932] Creates account recovery resource --- web-ui/app/locales/en_US/translation.json | 3 + web-ui/config/protected-assets-webpack.js | 1 + web-ui/src/account_recovery/account_recovery.html | 14 ++++ web-ui/src/account_recovery/account_recovery.js | 32 +++++++++ web-ui/src/account_recovery/page.js | 42 +++++++++++ web-ui/src/account_recovery/page.scss | 85 +++++++++++++++++++++++ web-ui/src/account_recovery/page.spec.js | 17 +++++ web-ui/webpack.config.js | 1 + web-ui/webpack.production.config.js | 1 + 9 files changed, 196 insertions(+) create mode 100644 web-ui/src/account_recovery/account_recovery.html create mode 100644 web-ui/src/account_recovery/account_recovery.js create mode 100644 web-ui/src/account_recovery/page.js create mode 100644 web-ui/src/account_recovery/page.scss create mode 100644 web-ui/src/account_recovery/page.spec.js (limited to 'web-ui') diff --git a/web-ui/app/locales/en_US/translation.json b/web-ui/app/locales/en_US/translation.json index 5e23d39f..7d24a728 100644 --- a/web-ui/app/locales/en_US/translation.json +++ b/web-ui/app/locales/en_US/translation.json @@ -81,6 +81,9 @@ "all": "All", "tags": "Tags" }, + "account-recovery": { + "page-title": "Pixelated Account Recovery" + }, "backup-account": { "page-title": "Pixelated Backup Account", "backup-email": { diff --git a/web-ui/config/protected-assets-webpack.js b/web-ui/config/protected-assets-webpack.js index 85654cf0..032f6c31 100644 --- a/web-ui/config/protected-assets-webpack.js +++ b/web-ui/config/protected-assets-webpack.js @@ -5,6 +5,7 @@ module.exports = new CopyWebpackPlugin([ { context: 'app/', from: 'index.html' }, { context: 'app/', from: 'sandbox.html' }, { context: 'app/', from: 'css/*' }, + { context: 'src/account_recovery/', from: 'account_recovery.html' }, { context: 'src/backup_account/', from: 'backup_account.html' }, { context: 'app/bower_components/font-awesome/', from: 'fonts/*' }, { context: 'app/bower_components/font-awesome/', from: 'css/font-awesome.min.css', to: 'css' }, diff --git a/web-ui/src/account_recovery/account_recovery.html b/web-ui/src/account_recovery/account_recovery.html new file mode 100644 index 00000000..f4601239 --- /dev/null +++ b/web-ui/src/account_recovery/account_recovery.html @@ -0,0 +1,14 @@ + + + + + + + + Pixelated + + +
+ + + diff --git a/web-ui/src/account_recovery/account_recovery.js b/web-ui/src/account_recovery/account_recovery.js new file mode 100644 index 00000000..19b7c19c --- /dev/null +++ b/web-ui/src/account_recovery/account_recovery.js @@ -0,0 +1,32 @@ +/* + * 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 { render } from 'react-dom'; +import a11y from 'react-a11y'; + +import App from 'src/common/app'; +import PageWrapper from './page'; + +require('es6-promise').polyfill(); + +if (process.env.NODE_ENV === 'development') a11y(React); + +render( + } />, + document.getElementById('root') +); diff --git a/web-ui/src/account_recovery/page.js b/web-ui/src/account_recovery/page.js new file mode 100644 index 00000000..c77da0b6 --- /dev/null +++ b/web-ui/src/account_recovery/page.js @@ -0,0 +1,42 @@ +/* + * 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 DocumentTitle from 'react-document-title'; +import Footer from 'src/common/footer/footer'; +import Header from 'src/common/header/header'; + +import 'font-awesome/scss/font-awesome.scss'; +import './page.scss'; + + +export const Page = ({ t }) => ( + +
+
+
+
+
+
+); + +Page.propTypes = { + t: React.PropTypes.func.isRequired +}; + +export default translate('', { wait: true })(Page); diff --git a/web-ui/src/account_recovery/page.scss b/web-ui/src/account_recovery/page.scss new file mode 100644 index 00000000..71e3f074 --- /dev/null +++ b/web-ui/src/account_recovery/page.scss @@ -0,0 +1,85 @@ +/* + * 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/vendor/reset"; +@import "~scss/base/colors"; +@import "~scss/base/fonts"; + +html, body, #root { + height: 100%; +} + +body, #root { + min-height: 100%; +} + +a { + text-decoration: none; +} + +.container { + background: $white; + margin: 3% auto; + box-shadow: 0 2px 3px 0 $shadow; +} + +.page { + font-family: "Open Sans", "Microsoft YaHei", "Hiragino Sans GB", "Hiragino Sans GB W3", "微软雅黑", "Helvetica Neue", Arial, sans-serif; + background: $dark_blue; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(left top, $dark_blue, $middle_blue); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(bottom right, $dark_blue, $middle_blue); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(bottom right, $dark_blue, $middle_blue); /* For Firefox 3.6 to 15 */ + background: linear-gradient(to bottom right, $dark_blue, $middle_blue); /* Standard syntax */ + color: $dark_grey_text; + min-height: 100%; + display: flex; + flex-direction: column; +} + +section { + flex: 1 0 auto; +} + +h1 { + font-size: 1.3em; + font-weight: 600; +} + +p { + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +.link { + color: $dark_blue; + font-style: italic; + font-size: 0.8em; + + .fa { + font-size: 1.6em; + position: relative; + top: 3px; + margin-right: 0.3em; + } + +} + +@media only screen and (min-width : 500px) { + body { + font-size: 1.3em; + } +} diff --git a/web-ui/src/account_recovery/page.spec.js b/web-ui/src/account_recovery/page.spec.js new file mode 100644 index 00000000..b34f0f32 --- /dev/null +++ b/web-ui/src/account_recovery/page.spec.js @@ -0,0 +1,17 @@ +import { shallow } from 'enzyme'; +import expect from 'expect'; +import React from 'react'; +import { Page } from 'src/account_recovery/page'; + +describe('Account Recovery Page', () => { + let page; + + beforeEach(() => { + const mockTranslations = key => key; + page = shallow(); + }); + + it('renders account recovery page title', () => { + expect(page.props().title).toEqual('account-recovery.page-title'); + }); +}); diff --git a/web-ui/webpack.config.js b/web-ui/webpack.config.js index 6a44e4a1..0470b508 100644 --- a/web-ui/webpack.config.js +++ b/web-ui/webpack.config.js @@ -39,6 +39,7 @@ var publicAssets = Object.assign({}, commonConfiguration, { var protectedAssets = Object.assign({}, commonConfiguration, { entry: { 'app': './app/js/index.js', + 'account_recovery': './src/account_recovery/account_recovery.js', 'backup_account': './src/backup_account/backup_account.js', 'sandbox': './app/js/sandbox.js' }, diff --git a/web-ui/webpack.production.config.js b/web-ui/webpack.production.config.js index 92a4f12b..23be0565 100644 --- a/web-ui/webpack.production.config.js +++ b/web-ui/webpack.production.config.js @@ -43,6 +43,7 @@ var publicAssets = Object.assign({}, commonConfiguration, { var protectedAssets = Object.assign({}, commonConfiguration, { entry: { 'app': './app/js/index.js', + 'account_recovery': './src/account_recovery/account_recovery.js', 'backup_account': './src/backup_account/backup_account.js', 'sandbox': './app/js/sandbox.js' }, -- cgit v1.2.3 From b901ffde59378b447454fab054fa30228b43a56b Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Mon, 27 Mar 2017 13:52:01 -0300 Subject: [#932] Adds integration test for translations in acount recovery page --- web-ui/test/integration/translations.spec.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'web-ui') diff --git a/web-ui/test/integration/translations.spec.js b/web-ui/test/integration/translations.spec.js index fe17838b..f8cf6c52 100644 --- a/web-ui/test/integration/translations.spec.js +++ b/web-ui/test/integration/translations.spec.js @@ -2,11 +2,19 @@ import { mount } from 'enzyme'; import expect from 'expect'; import React from 'react'; import App from 'src/common/app'; +import AccountRecoveryPage from 'src/account_recovery/page'; import BackupAccountPage from 'src/backup_account/page'; import LoginPage from 'src/login/page'; import testI18n from './i18n'; describe('Translations', () => { + context('Account Recovery Page', () => { + it('translates all key', () => { + const app = mount(} />); + expect(app.text()).toNotContain('untranslated', 'Unstranslated message found in the text: ' + app.text()); + }); + }); + context('Backup Account Page', () => { it('translates all key', () => { const app = mount(} />); -- cgit v1.2.3 From be9388fad08a77b5ad6b69e44fa5ee3b5db9f86e Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Mon, 27 Mar 2017 13:57:32 -0300 Subject: [#932] Translates account recovery title to portuguese --- web-ui/app/locales/pt_BR/translation.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'web-ui') diff --git a/web-ui/app/locales/pt_BR/translation.json b/web-ui/app/locales/pt_BR/translation.json index dcf551af..ccc0fe5a 100644 --- a/web-ui/app/locales/pt_BR/translation.json +++ b/web-ui/app/locales/pt_BR/translation.json @@ -81,6 +81,9 @@ "all": "Todas", "tags": "Etiquetas" }, + "account-recovery": { + "page-title": "Pixelated Recuperação de Conta" + }, "backup-account": { "page-title": "Pixelated E-mail de Recuperação", "backup-email": { -- cgit v1.2.3 From 66129892c9e9c8f2f3c2ff230499dbe10d04ddd0 Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Mon, 27 Mar 2017 15:32:40 -0300 Subject: [#932] Upgrades eslint version --- web-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web-ui') diff --git a/web-ui/package.json b/web-ui/package.json index 08b24ceb..4115904b 100644 --- a/web-ui/package.json +++ b/web-ui/package.json @@ -20,7 +20,7 @@ "dompurify": "0.8.4", "enzyme": "2.7.1", "es6-promise": "4.1.0", - "eslint": "3.17.1", + "eslint": "3.18.0", "eslint-config-airbnb": "14.1.0", "eslint-plugin-import": "2.2.0", "eslint-plugin-jsx-a11y": "4.0.0", -- cgit v1.2.3