From db8ded2876a981b259f2ccfc5b07133e6eec666b Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Thu, 23 Feb 2017 17:01:58 -0300 Subject: [#907] Normalizes scss file names with @thaissiqueira --- web-ui/src/common/input_field/input-field.scss | 73 ---------------------- web-ui/src/common/input_field/input_field.js | 2 +- web-ui/src/common/input_field/input_field.scss | 73 ++++++++++++++++++++++ web-ui/src/common/submit_button/submit-button.scss | 46 -------------- web-ui/src/common/submit_button/submit_button.js | 2 +- web-ui/src/common/submit_button/submit_button.scss | 46 ++++++++++++++ web-ui/src/login/about/pixelated-welcome.scss | 49 --------------- web-ui/src/login/about/pixelated_welcome.js | 2 +- web-ui/src/login/about/pixelated_welcome.scss | 49 +++++++++++++++ web-ui/src/login/error/auth-error.scss | 29 --------- web-ui/src/login/error/auth_error.js | 2 +- web-ui/src/login/error/auth_error.scss | 29 +++++++++ web-ui/src/login/error/generic-error.scss | 59 ----------------- web-ui/src/login/error/generic_error.js | 2 +- web-ui/src/login/error/generic_error.scss | 59 +++++++++++++++++ 15 files changed, 261 insertions(+), 261 deletions(-) delete mode 100644 web-ui/src/common/input_field/input-field.scss create mode 100644 web-ui/src/common/input_field/input_field.scss delete mode 100644 web-ui/src/common/submit_button/submit-button.scss create mode 100644 web-ui/src/common/submit_button/submit_button.scss delete mode 100644 web-ui/src/login/about/pixelated-welcome.scss create mode 100644 web-ui/src/login/about/pixelated_welcome.scss delete mode 100644 web-ui/src/login/error/auth-error.scss create mode 100644 web-ui/src/login/error/auth_error.scss delete mode 100644 web-ui/src/login/error/generic-error.scss create mode 100644 web-ui/src/login/error/generic_error.scss diff --git a/web-ui/src/common/input_field/input-field.scss b/web-ui/src/common/input_field/input-field.scss deleted file mode 100644 index dd8e8927..00000000 --- a/web-ui/src/common/input_field/input-field.scss +++ /dev/null @@ -1,73 +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"; - -.input-field-group { - position:relative; - margin: 1.5em 0; - width: 100%; -} - -.input-field-label { - font-size: 0.9em; - margin-bottom: 10px; - display: inline-block; - color:#999; - position:absolute; - pointer-events:none; - left: 6px; - top:10px; - transition:0.2s ease all; -} - -.input-field { - display: block; - border: none; - border-bottom: solid 1px $dark_blue; - width: 100%; - height: auto; - padding: 0.3em 0px; - - &:focus { - outline:none; - border-width: 2px; - } -} - -.input-field:focus ~ .input-field-label, .input-field:valid ~ .input-field-label { - top:-12px; - left: 0; - font-size:0.7em; - color: $dark_blue; -} - -@media only screen and (min-width : 500px) { - .input-field-group { - width: 70%; - align-self: center; - } -} - -@media only screen and (min-width : 960px) { - .input-field-group { - width: 300px; - align-self: flex-start; - margin-top: 3em; - font-size: 1em; - } -} diff --git a/web-ui/src/common/input_field/input_field.js b/web-ui/src/common/input_field/input_field.js index d4876d9f..a92faeb9 100644 --- a/web-ui/src/common/input_field/input_field.js +++ b/web-ui/src/common/input_field/input_field.js @@ -17,7 +17,7 @@ import React from 'react'; -import './input-field.scss'; +import './input_field.scss'; const InputField = ({ label, name, type = 'text' }) => (
diff --git a/web-ui/src/common/input_field/input_field.scss b/web-ui/src/common/input_field/input_field.scss new file mode 100644 index 00000000..dd8e8927 --- /dev/null +++ b/web-ui/src/common/input_field/input_field.scss @@ -0,0 +1,73 @@ +/* + * 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"; + +.input-field-group { + position:relative; + margin: 1.5em 0; + width: 100%; +} + +.input-field-label { + font-size: 0.9em; + margin-bottom: 10px; + display: inline-block; + color:#999; + position:absolute; + pointer-events:none; + left: 6px; + top:10px; + transition:0.2s ease all; +} + +.input-field { + display: block; + border: none; + border-bottom: solid 1px $dark_blue; + width: 100%; + height: auto; + padding: 0.3em 0px; + + &:focus { + outline:none; + border-width: 2px; + } +} + +.input-field:focus ~ .input-field-label, .input-field:valid ~ .input-field-label { + top:-12px; + left: 0; + font-size:0.7em; + color: $dark_blue; +} + +@media only screen and (min-width : 500px) { + .input-field-group { + width: 70%; + align-self: center; + } +} + +@media only screen and (min-width : 960px) { + .input-field-group { + width: 300px; + align-self: flex-start; + margin-top: 3em; + font-size: 1em; + } +} diff --git a/web-ui/src/common/submit_button/submit-button.scss b/web-ui/src/common/submit_button/submit-button.scss deleted file mode 100644 index 13cb7607..00000000 --- a/web-ui/src/common/submit_button/submit-button.scss +++ /dev/null @@ -1,46 +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"; - -.submit-button { - background: $dark_blue; - padding: 0.8em; - color: $white; - text-align: center; - border: none; - border-radius: 2px; - font-weight: 300; - width: 100%; - margin-bottom: 1em; -} - -@media only screen and (min-width : 500px) { - .submit-button { - width: 70%; - align-self: center; - } -} - -@media only screen and (min-width : 960px) { - .submit-button { - width: 300px; - align-self: flex-start; - font-size: 0.8em; - margin-bottom: 1em; - } -} diff --git a/web-ui/src/common/submit_button/submit_button.js b/web-ui/src/common/submit_button/submit_button.js index fb87bf7d..4754e042 100644 --- a/web-ui/src/common/submit_button/submit_button.js +++ b/web-ui/src/common/submit_button/submit_button.js @@ -17,7 +17,7 @@ import React from 'react'; -import './submit-button.scss'; +import './submit_button.scss'; const SubmitButton = ({ buttonText }) => ( diff --git a/web-ui/src/common/submit_button/submit_button.scss b/web-ui/src/common/submit_button/submit_button.scss new file mode 100644 index 00000000..13cb7607 --- /dev/null +++ b/web-ui/src/common/submit_button/submit_button.scss @@ -0,0 +1,46 @@ +/* + * 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"; + +.submit-button { + background: $dark_blue; + padding: 0.8em; + color: $white; + text-align: center; + border: none; + border-radius: 2px; + font-weight: 300; + width: 100%; + margin-bottom: 1em; +} + +@media only screen and (min-width : 500px) { + .submit-button { + width: 70%; + align-self: center; + } +} + +@media only screen and (min-width : 960px) { + .submit-button { + width: 300px; + align-self: flex-start; + font-size: 0.8em; + margin-bottom: 1em; + } +} 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/pixelated_welcome.js b/web-ui/src/login/about/pixelated_welcome.js index 82a7d7d0..7437ab72 100644 --- a/web-ui/src/login/about/pixelated_welcome.js +++ b/web-ui/src/login/about/pixelated_welcome.js @@ -18,7 +18,7 @@ import React from 'react'; import { translate } from 'react-i18next'; -import './pixelated-welcome.scss'; +import './pixelated_welcome.scss'; export const PixelatedWelcome = ({ t }) => (
diff --git a/web-ui/src/login/about/pixelated_welcome.scss b/web-ui/src/login/about/pixelated_welcome.scss new file mode 100644 index 00000000..17d05f13 --- /dev/null +++ b/web-ui/src/login/about/pixelated_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"; + +.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/error/auth-error.scss b/web-ui/src/login/error/auth-error.scss deleted file mode 100644 index f6256be4..00000000 --- a/web-ui/src/login/error/auth-error.scss +++ /dev/null @@ -1,29 +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"; - -.auth-error { - color: $error; - margin: -1em 0 1em 0; -} - -@media only screen and (min-width : 960px) { - .auth-error { - margin: -2em 0 1em 0; - } -} diff --git a/web-ui/src/login/error/auth_error.js b/web-ui/src/login/error/auth_error.js index ceeaf42b..5dbbc3e7 100644 --- a/web-ui/src/login/error/auth_error.js +++ b/web-ui/src/login/error/auth_error.js @@ -18,7 +18,7 @@ import React from 'react'; import { translate } from 'react-i18next'; -import './auth-error.scss'; +import './auth_error.scss'; export const AuthError = ({ t }) => (

{t('error.auth')}

diff --git a/web-ui/src/login/error/auth_error.scss b/web-ui/src/login/error/auth_error.scss new file mode 100644 index 00000000..f6256be4 --- /dev/null +++ b/web-ui/src/login/error/auth_error.scss @@ -0,0 +1,29 @@ +/* + * 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"; + +.auth-error { + color: $error; + margin: -1em 0 1em 0; +} + +@media only screen and (min-width : 960px) { + .auth-error { + margin: -2em 0 1em 0; + } +} diff --git a/web-ui/src/login/error/generic-error.scss b/web-ui/src/login/error/generic-error.scss deleted file mode 100644 index 5a077f32..00000000 --- a/web-ui/src/login/error/generic-error.scss +++ /dev/null @@ -1,59 +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"; - -.generic-error { - font-size: 0.9em; - color: $medium_grey; - display: flex; - padding: 0 1.5em; - font-weight: 300; - - h2 { - font-weight: normal; - font-size: 1.4em; - } -} - -.dead-mail { - width: 20%; - margin-right: 1.5em; - margin-top: 1.7em; - align-self: flex-start; -} - -@media only screen and (min-width : 960px) { - .generic-error { - flex-direction: column; - align-self: flex-end; - order: 2; - width: 34%; - margin-right: 8%; - margin-top: -19.5em; - padding: 0; - - h2 { - margin: 0; - } - } - - .dead-mail { - order: 1; - width: 30%; - } -} diff --git a/web-ui/src/login/error/generic_error.js b/web-ui/src/login/error/generic_error.js index 023e1bcf..b233d5bb 100644 --- a/web-ui/src/login/error/generic_error.js +++ b/web-ui/src/login/error/generic_error.js @@ -18,7 +18,7 @@ import React from 'react'; import { translate } from 'react-i18next'; -import './generic-error.scss'; +import './generic_error.scss'; export const GenericError = ({ t }) => (
diff --git a/web-ui/src/login/error/generic_error.scss b/web-ui/src/login/error/generic_error.scss new file mode 100644 index 00000000..5a077f32 --- /dev/null +++ b/web-ui/src/login/error/generic_error.scss @@ -0,0 +1,59 @@ +/* + * 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"; + +.generic-error { + font-size: 0.9em; + color: $medium_grey; + display: flex; + padding: 0 1.5em; + font-weight: 300; + + h2 { + font-weight: normal; + font-size: 1.4em; + } +} + +.dead-mail { + width: 20%; + margin-right: 1.5em; + margin-top: 1.7em; + align-self: flex-start; +} + +@media only screen and (min-width : 960px) { + .generic-error { + flex-direction: column; + align-self: flex-end; + order: 2; + width: 34%; + margin-right: 8%; + margin-top: -19.5em; + padding: 0; + + h2 { + margin: 0; + } + } + + .dead-mail { + order: 1; + width: 30%; + } +} -- cgit v1.2.3 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 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 From fb4630207d86d39ea05dd679b2724be87597c518 Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Thu, 23 Feb 2017 17:50:56 -0300 Subject: [#907] Moves i18n and util files to common directory with @thaissiqueira --- web-ui/src/common/app.js | 2 +- web-ui/src/common/i18n.js | 40 ++++++++++++++++++++++++++++++++++++ web-ui/src/common/util.js | 8 ++++++++ web-ui/src/i18n.js | 40 ------------------------------------ web-ui/src/login/login.js | 2 +- web-ui/src/util.js | 8 -------- web-ui/test/unit/common/util.spec.js | 20 ++++++++++++++++++ web-ui/test/unit/util.spec.js | 20 ------------------ 8 files changed, 70 insertions(+), 70 deletions(-) create mode 100644 web-ui/src/common/i18n.js create mode 100644 web-ui/src/common/util.js delete mode 100644 web-ui/src/i18n.js delete mode 100644 web-ui/src/util.js create mode 100644 web-ui/test/unit/common/util.spec.js delete mode 100644 web-ui/test/unit/util.spec.js diff --git a/web-ui/src/common/app.js b/web-ui/src/common/app.js index f6594557..03a69fc9 100644 --- a/web-ui/src/common/app.js +++ b/web-ui/src/common/app.js @@ -18,7 +18,7 @@ import React from 'react'; import { I18nextProvider } from 'react-i18next'; -import internationalization from '../i18n'; +import internationalization from 'src/common/i18n'; const App = ({ i18n = internationalization, child }) => ( diff --git a/web-ui/src/common/i18n.js b/web-ui/src/common/i18n.js new file mode 100644 index 00000000..db107dc7 --- /dev/null +++ b/web-ui/src/common/i18n.js @@ -0,0 +1,40 @@ +/* + * 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 i18n from 'i18next'; +import i18nBackend from 'i18nextXHRBackend'; +import I18nDetector from 'i18nextBrowserLanguageDetector'; + +const detector = new I18nDetector(); +const detect = detector.detect.bind(detector); + +detector.detect = (detectionOrder) => { + const result = detect(detectionOrder); + return result.replace('-', '_'); +}; + +i18n + .use(i18nBackend) + .use(detector) + .init({ + fallbackLng: 'en_US', + parseMissingKeyHandler: key => (`"${key} untranslated"`), + backend: { + loadPath: 'public/locales/{{lng}}/{{ns}}.json' + } + }); + +export default i18n; diff --git a/web-ui/src/common/util.js b/web-ui/src/common/util.js new file mode 100644 index 00000000..effb3d9c --- /dev/null +++ b/web-ui/src/common/util.js @@ -0,0 +1,8 @@ +export const hasQueryParameter = (param) => { + const decodedUri = decodeURIComponent(window.location.search.substring(1)); + return !(decodedUri.split('&').indexOf(param) < 0); +}; + +export default { + hasQueryParameter +}; diff --git a/web-ui/src/i18n.js b/web-ui/src/i18n.js deleted file mode 100644 index db107dc7..00000000 --- a/web-ui/src/i18n.js +++ /dev/null @@ -1,40 +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 i18n from 'i18next'; -import i18nBackend from 'i18nextXHRBackend'; -import I18nDetector from 'i18nextBrowserLanguageDetector'; - -const detector = new I18nDetector(); -const detect = detector.detect.bind(detector); - -detector.detect = (detectionOrder) => { - const result = detect(detectionOrder); - return result.replace('-', '_'); -}; - -i18n - .use(i18nBackend) - .use(detector) - .init({ - fallbackLng: 'en_US', - parseMissingKeyHandler: key => (`"${key} untranslated"`), - backend: { - loadPath: 'public/locales/{{lng}}/{{ns}}.json' - } - }); - -export default i18n; diff --git a/web-ui/src/login/login.js b/web-ui/src/login/login.js index c8e08762..39500b9d 100644 --- a/web-ui/src/login/login.js +++ b/web-ui/src/login/login.js @@ -19,9 +19,9 @@ import React from 'react'; import { render } from 'react-dom'; import a11y from 'react-a11y'; +import { hasQueryParameter } from 'src/common/util'; import App from 'src/common/app'; import PageWrapper from './page'; -import { hasQueryParameter } from '../util'; if (process.env.NODE_ENV === 'development') a11y(React); diff --git a/web-ui/src/util.js b/web-ui/src/util.js deleted file mode 100644 index effb3d9c..00000000 --- a/web-ui/src/util.js +++ /dev/null @@ -1,8 +0,0 @@ -export const hasQueryParameter = (param) => { - const decodedUri = decodeURIComponent(window.location.search.substring(1)); - return !(decodedUri.split('&').indexOf(param) < 0); -}; - -export default { - hasQueryParameter -}; diff --git a/web-ui/test/unit/common/util.spec.js b/web-ui/test/unit/common/util.spec.js new file mode 100644 index 00000000..805d9dd5 --- /dev/null +++ b/web-ui/test/unit/common/util.spec.js @@ -0,0 +1,20 @@ +import expect from 'expect'; +import Util from 'src/common/util'; + +describe('Utils', () => { + describe('.hasQueryParameter', () => { + global.window = { + location: { + search: '?auth-error&lng=pt-BR' + } + }; + + it('checks if param included in query parameters', () => { + expect(Util.hasQueryParameter('auth-error')).toBe(true); + }); + + it('checks if param not included in query parameters', () => { + expect(Util.hasQueryParameter('error')).toBe(false); + }); + }); +}); diff --git a/web-ui/test/unit/util.spec.js b/web-ui/test/unit/util.spec.js deleted file mode 100644 index 968b2d83..00000000 --- a/web-ui/test/unit/util.spec.js +++ /dev/null @@ -1,20 +0,0 @@ -import expect from 'expect'; -import Util from 'src/util'; - -describe('Utils', () => { - describe('.hasQueryParameter', () => { - global.window = { - location: { - search: '?auth-error&lng=pt-BR' - } - }; - - it('checks if param included in query parameters', () => { - expect(Util.hasQueryParameter('auth-error')).toBe(true); - }); - - it('checks if param not included in query parameters', () => { - expect(Util.hasQueryParameter('error')).toBe(false); - }); - }); -}); -- cgit v1.2.3 From fec26b211a42b068e677ac5b43080bd4bf59e47a Mon Sep 17 00:00:00 2001 From: Thais Siqueira Date: Fri, 24 Feb 2017 14:27:31 -0300 Subject: [#907] Moves tests to directories components --- web-ui/package.json | 2 +- web-ui/src/backup_account/page.spec.js | 25 ++++++++++ web-ui/src/common/footer/footer.spec.js | 17 +++++++ web-ui/src/common/header/header.spec.js | 17 +++++++ web-ui/src/common/input_field/input_field.spec.js | 20 ++++++++ .../src/common/submit_button/submit_button.spec.js | 16 +++++++ web-ui/src/common/util.spec.js | 20 ++++++++ web-ui/src/login/about/welcome.spec.js | 17 +++++++ web-ui/src/login/error/auth_error.spec.js | 17 +++++++ web-ui/src/login/error/generic_error.spec.js | 17 +++++++ web-ui/src/login/page.spec.js | 53 ++++++++++++++++++++++ web-ui/test/unit/backup_account/page.spec.js | 25 ---------- web-ui/test/unit/common/footer/footer.spec.js | 17 ------- web-ui/test/unit/common/header/header.spec.js | 17 ------- .../unit/common/input_field/input_field.spec.js | 20 -------- .../common/submit_button/submit_button.spec.js | 16 ------- web-ui/test/unit/common/util.spec.js | 20 -------- web-ui/test/unit/login/about/welcome.spec.js | 17 ------- web-ui/test/unit/login/error/auth_error.spec.js | 17 ------- web-ui/test/unit/login/error/generic_error.spec.js | 17 ------- web-ui/test/unit/login/page.spec.js | 53 ---------------------- 21 files changed, 220 insertions(+), 220 deletions(-) create mode 100644 web-ui/src/backup_account/page.spec.js create mode 100644 web-ui/src/common/footer/footer.spec.js create mode 100644 web-ui/src/common/header/header.spec.js create mode 100644 web-ui/src/common/input_field/input_field.spec.js create mode 100644 web-ui/src/common/submit_button/submit_button.spec.js create mode 100644 web-ui/src/common/util.spec.js create mode 100644 web-ui/src/login/about/welcome.spec.js create mode 100644 web-ui/src/login/error/auth_error.spec.js create mode 100644 web-ui/src/login/error/generic_error.spec.js create mode 100644 web-ui/src/login/page.spec.js delete mode 100644 web-ui/test/unit/backup_account/page.spec.js delete mode 100644 web-ui/test/unit/common/footer/footer.spec.js delete mode 100644 web-ui/test/unit/common/header/header.spec.js delete mode 100644 web-ui/test/unit/common/input_field/input_field.spec.js delete mode 100644 web-ui/test/unit/common/submit_button/submit_button.spec.js delete mode 100644 web-ui/test/unit/common/util.spec.js delete mode 100644 web-ui/test/unit/login/about/welcome.spec.js delete mode 100644 web-ui/test/unit/login/error/auth_error.spec.js delete mode 100644 web-ui/test/unit/login/error/generic_error.spec.js delete mode 100644 web-ui/test/unit/login/page.spec.js diff --git a/web-ui/package.json b/web-ui/package.json index 63272743..a9cb9604 100644 --- a/web-ui/package.json +++ b/web-ui/package.json @@ -80,7 +80,7 @@ "test:unit": "npm run test:coverage && npm run test:karma", "test:integration": "mocha-webpack --webpack-config webpack.test.config.js --require test/integration/setup.js \"test/integration/**/*.spec.js\"", "test:coverage": "NODE_ENV=test nyc --check-coverage npm run test:mocha", - "test:mocha": "mocha-webpack --webpack-config webpack.test.config.js \"test/unit/**/*.spec.js\"", + "test:mocha": "mocha-webpack --webpack-config webpack.test.config.js \"src/**/*.spec.js\"", "test:karma": "karma start --single-run $GRUNT_OPTS", "test:watch:mocha": "npm run test:mocha -- --watch", "test:watch:karma": "karma start", diff --git a/web-ui/src/backup_account/page.spec.js b/web-ui/src/backup_account/page.spec.js new file mode 100644 index 00000000..66d2dc78 --- /dev/null +++ b/web-ui/src/backup_account/page.spec.js @@ -0,0 +1,25 @@ +import { shallow } from 'enzyme'; +import expect from 'expect'; +import React from 'react'; +import { Page } from 'src/backup_account/page'; + +describe('Page', () => { + let page; + + beforeEach(() => { + const mockTranslations = key => key; + page = shallow(); + }); + + it('renders backup email page title', () => { + expect(page.find('h1').text()).toEqual('backup-account.title'); + }); + + it('renders backup account email input field', () => { + expect(page.find('InputField').props().name).toEqual('email'); + }); + + it('renders backup account submit button', () => { + expect(page.find('SubmitButton').props().buttonText).toEqual('backup-account.button'); + }); +}); diff --git a/web-ui/src/common/footer/footer.spec.js b/web-ui/src/common/footer/footer.spec.js new file mode 100644 index 00000000..f1247233 --- /dev/null +++ b/web-ui/src/common/footer/footer.spec.js @@ -0,0 +1,17 @@ +import { shallow } from 'enzyme'; +import expect from 'expect'; +import React from 'react'; +import { Footer } from 'src/common/footer/footer'; + +describe('Footer', () => { + let footer; + + beforeEach(() => { + const mockTranslations = key => key; + footer = shallow(