From 31b0bcaa673794024a71065be76681150ad4b9d6 Mon Sep 17 00:00:00 2001 From: Tayane Fernandes Date: Tue, 7 Feb 2017 18:51:08 -0200 Subject: [#922] Extract input field to a component with @anikarni --- web-ui/src/common/input_field/input-field.scss | 77 ++++++++++++++++++++++++++ web-ui/src/common/input_field/input_field.js | 29 ++++++++++ 2 files changed, 106 insertions(+) create mode 100644 web-ui/src/common/input_field/input-field.scss create mode 100644 web-ui/src/common/input_field/input_field.js (limited to 'web-ui/src/common/input_field') 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..ad5dda13 --- /dev/null +++ b/web-ui/src/common/input_field/input-field.scss @@ -0,0 +1,77 @@ +/* + * 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; + -moz-transition:0.2s ease all; + -webkit-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 { + flex-basis: 70%; + -webkit-align-self: center; + align-self: center; + } +} + +@media only screen and (min-width : 960px) { + .input-field-group { + width: 300px; + -webkit-align-self: flex-start; + 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 new file mode 100644 index 00000000..43899419 --- /dev/null +++ b/web-ui/src/common/input_field/input_field.js @@ -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 React from 'react' + +import './input-field.scss' + +const InputField = ({ label, name }) => ( +
+ + +
+) + +export default InputField -- cgit v1.2.3 From aa26a47abac48d817a04a4f2375f1378767fa83c Mon Sep 17 00:00:00 2001 From: Tayane Fernandes Date: Tue, 7 Feb 2017 19:02:47 -0200 Subject: [#922] Fix button and input width with @anikarni --- web-ui/src/common/input_field/input-field.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web-ui/src/common/input_field') diff --git a/web-ui/src/common/input_field/input-field.scss b/web-ui/src/common/input_field/input-field.scss index ad5dda13..6ec827ab 100644 --- a/web-ui/src/common/input_field/input-field.scss +++ b/web-ui/src/common/input_field/input-field.scss @@ -60,7 +60,7 @@ @media only screen and (min-width : 500px) { .input-field-group { - flex-basis: 70%; + width: 70%; -webkit-align-self: center; align-self: center; } -- cgit v1.2.3 From 7f76c79319bf0817222fc88011fd870d97648963 Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Tue, 7 Feb 2017 19:46:45 -0200 Subject: [#922] Adds eslint for react and es6 files --- web-ui/src/common/input_field/input_field.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'web-ui/src/common/input_field') diff --git a/web-ui/src/common/input_field/input_field.js b/web-ui/src/common/input_field/input_field.js index 43899419..70d18618 100644 --- a/web-ui/src/common/input_field/input_field.js +++ b/web-ui/src/common/input_field/input_field.js @@ -26,4 +26,9 @@ const InputField = ({ label, name }) => ( ) +InputField.propTypes = { + label: React.PropTypes.string.isRequired, + name: React.PropTypes.string.isRequired +} + export default InputField -- cgit v1.2.3 From 94fc7554995e4b6fcd95e74d082ed411239ea8e9 Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Wed, 8 Feb 2017 11:11:38 -0200 Subject: [#922] Add semincolon to lint and fix js code with @tayanefernandes --- web-ui/src/common/input_field/input_field.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'web-ui/src/common/input_field') diff --git a/web-ui/src/common/input_field/input_field.js b/web-ui/src/common/input_field/input_field.js index 70d18618..1378ba74 100644 --- a/web-ui/src/common/input_field/input_field.js +++ b/web-ui/src/common/input_field/input_field.js @@ -15,20 +15,20 @@ * along with Pixelated. If not, see . */ -import React from 'react' +import React from 'react'; -import './input-field.scss' +import './input-field.scss'; const InputField = ({ label, name }) => (
-) +); InputField.propTypes = { label: React.PropTypes.string.isRequired, name: React.PropTypes.string.isRequired -} +}; -export default InputField +export default InputField; -- cgit v1.2.3 From ea852b12e33b0e50ba7986c33ad68be5e38305ba Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Wed, 8 Feb 2017 13:49:54 -0200 Subject: [#922] Add css autoprefixer for compatibility with browsers with @tayanefernandes --- web-ui/src/common/input_field/input-field.scss | 4 ---- 1 file changed, 4 deletions(-) (limited to 'web-ui/src/common/input_field') diff --git a/web-ui/src/common/input_field/input-field.scss b/web-ui/src/common/input_field/input-field.scss index 6ec827ab..dd8e8927 100644 --- a/web-ui/src/common/input_field/input-field.scss +++ b/web-ui/src/common/input_field/input-field.scss @@ -33,8 +33,6 @@ left: 6px; top:10px; transition:0.2s ease all; - -moz-transition:0.2s ease all; - -webkit-transition:0.2s ease all; } .input-field { @@ -61,7 +59,6 @@ @media only screen and (min-width : 500px) { .input-field-group { width: 70%; - -webkit-align-self: center; align-self: center; } } @@ -69,7 +66,6 @@ @media only screen and (min-width : 960px) { .input-field-group { width: 300px; - -webkit-align-self: flex-start; align-self: flex-start; margin-top: 3em; font-size: 1em; -- cgit v1.2.3 From bfd85dff6b086abae1c16014e318c89cba929b66 Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Fri, 17 Feb 2017 09:57:19 -0200 Subject: [#907] Makes login page responsive --- web-ui/src/common/input_field/input_field.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'web-ui/src/common/input_field') diff --git a/web-ui/src/common/input_field/input_field.js b/web-ui/src/common/input_field/input_field.js index 1378ba74..d4876d9f 100644 --- a/web-ui/src/common/input_field/input_field.js +++ b/web-ui/src/common/input_field/input_field.js @@ -19,16 +19,24 @@ import React from 'react'; import './input-field.scss'; -const InputField = ({ label, name }) => ( +const InputField = ({ label, name, type = 'text' }) => (
- +
); InputField.propTypes = { label: React.PropTypes.string.isRequired, - name: React.PropTypes.string.isRequired + name: React.PropTypes.string.isRequired, + type: React.PropTypes.string +}; + +InputField.defaultProps = { + type: 'text' }; export default InputField; -- cgit v1.2.3 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 ++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 74 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 (limited to 'web-ui/src/common/input_field') 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; + } +} -- 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/src/common/input_field/input_field.spec.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 web-ui/src/common/input_field/input_field.spec.js (limited to 'web-ui/src/common/input_field') diff --git a/web-ui/src/common/input_field/input_field.spec.js b/web-ui/src/common/input_field/input_field.spec.js new file mode 100644 index 00000000..0c044ce1 --- /dev/null +++ b/web-ui/src/common/input_field/input_field.spec.js @@ -0,0 +1,20 @@ +import { shallow } from 'enzyme'; +import expect from 'expect'; +import React from 'react'; +import InputField from 'src/common/input_field/input_field'; + +describe('InputField', () => { + let inputField; + + beforeEach(() => { + inputField = shallow(); + }); + + it('renders an input of type text for email', () => { + expect(inputField.find('input[type="text"]').props().name).toEqual('email'); + }); + + it('renders a label for the email', () => { + expect(inputField.find('label').text()).toEqual('Email'); + }); +}); -- cgit v1.2.3 From 1a1999cc129fe4d9046a22146deca6838a6fb1d5 Mon Sep 17 00:00:00 2001 From: Thais Siqueira Date: Wed, 1 Mar 2017 11:39:36 -0300 Subject: [#907] Puts autofocus on username field. with @anikarni --- web-ui/src/common/input_field/input_field.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web-ui/src/common/input_field') diff --git a/web-ui/src/common/input_field/input_field.js b/web-ui/src/common/input_field/input_field.js index a92faeb9..332d5911 100644 --- a/web-ui/src/common/input_field/input_field.js +++ b/web-ui/src/common/input_field/input_field.js @@ -19,11 +19,11 @@ import React from 'react'; import './input_field.scss'; -const InputField = ({ label, name, type = 'text' }) => ( +const InputField = ({ label, name, type = 'text', ...other }) => (
-- cgit v1.2.3 From 99d03c1f4b2d4e10561fc4d0bef14ccd12ad0f9d Mon Sep 17 00:00:00 2001 From: Tayane Fernandes Date: Tue, 7 Mar 2017 14:22:49 -0300 Subject: [#923] Add material-ui framework Added material-ui framework (http://www.material-ui.com/#/) to facilitate the creation of UI components. I also adapted some colors to be compatible with our style guide. --- web-ui/src/common/input_field/input_field.js | 12 +++++--- web-ui/src/common/input_field/input_field.scss | 34 ++--------------------- web-ui/src/common/input_field/input_field.spec.js | 4 +-- 3 files changed, 12 insertions(+), 38 deletions(-) (limited to 'web-ui/src/common/input_field') diff --git a/web-ui/src/common/input_field/input_field.js b/web-ui/src/common/input_field/input_field.js index 332d5911..438241e1 100644 --- a/web-ui/src/common/input_field/input_field.js +++ b/web-ui/src/common/input_field/input_field.js @@ -16,16 +16,20 @@ */ import React from 'react'; +import TextField from 'material-ui/TextField'; import './input_field.scss'; const InputField = ({ label, name, type = 'text', ...other }) => (
- -
); diff --git a/web-ui/src/common/input_field/input_field.scss b/web-ui/src/common/input_field/input_field.scss index dd8e8927..d550a281 100644 --- a/web-ui/src/common/input_field/input_field.scss +++ b/web-ui/src/common/input_field/input_field.scss @@ -23,37 +23,8 @@ 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; +input:-webkit-autofill { + -webkit-box-shadow: 0 0 0px 1000px white inset; } @media only screen and (min-width : 500px) { @@ -67,7 +38,6 @@ .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.spec.js b/web-ui/src/common/input_field/input_field.spec.js index 0c044ce1..ae55653d 100644 --- a/web-ui/src/common/input_field/input_field.spec.js +++ b/web-ui/src/common/input_field/input_field.spec.js @@ -11,10 +11,10 @@ describe('InputField', () => { }); it('renders an input of type text for email', () => { - expect(inputField.find('input[type="text"]').props().name).toEqual('email'); + expect(inputField.find('TextField').props().name).toEqual('email'); }); it('renders a label for the email', () => { - expect(inputField.find('label').text()).toEqual('Email'); + expect(inputField.find('TextField').props().floatingLabelText).toEqual('Email'); }); }); -- cgit v1.2.3 From 471b58e945613956db951b3a7b87c9c528b152a4 Mon Sep 17 00:00:00 2001 From: Tayane Fernandes Date: Fri, 10 Mar 2017 18:25:54 -0300 Subject: [#923] Make the label for the input text always blue with @FrailWords --- web-ui/src/common/input_field/input_field.js | 1 + 1 file changed, 1 insertion(+) (limited to 'web-ui/src/common/input_field') diff --git a/web-ui/src/common/input_field/input_field.js b/web-ui/src/common/input_field/input_field.js index 438241e1..f50fc2b1 100644 --- a/web-ui/src/common/input_field/input_field.js +++ b/web-ui/src/common/input_field/input_field.js @@ -28,6 +28,7 @@ const InputField = ({ label, name, type = 'text', ...other }) => ( name={name} type={type} fullWidth + floatingLabelFocusStyle={{ color: '#178ca6' }} {...other} />
-- cgit v1.2.3