From 3e45cd73ea07192a90a76a70b8d75823640711c6 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 9 Nov 2020 11:35:23 +0200 Subject: [PATCH 1/3] Fixes #5165 --- .../Contentful/PasswordScreen/index.jsx | 18 ++++++++++++------ src/shared/components/Contentful/Route.jsx | 1 + .../components/GUIKit/TextInput/index.jsx | 13 ++++++++++++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/shared/components/Contentful/PasswordScreen/index.jsx b/src/shared/components/Contentful/PasswordScreen/index.jsx index a323ff6a46..87a57e404f 100644 --- a/src/shared/components/Contentful/PasswordScreen/index.jsx +++ b/src/shared/components/Contentful/PasswordScreen/index.jsx @@ -21,10 +21,12 @@ export default class PasswordScreen extends React.Component { onSubmit() { const { password } = this.props; - const { inputVal } = this.state; - this.setState({ - authorized: password === inputVal, - errorMsg: password === inputVal ? '' : 'Password incorrect', + this.setState((state) => { + const { inputVal } = state; + return { + authorized: password === inputVal, + errorMsg: password === inputVal ? '' : 'Password incorrect', + }; }); } @@ -41,7 +43,7 @@ export default class PasswordScreen extends React.Component { authorized, errorMsg, inputVal, } = this.state; const { - viewPortId, preview, spaceName, environment, baseUrl, title, + viewPortId, preview, spaceName, environment, baseUrl, title, btnText, } = this.props; return authorized ? ( this.onPasswordInput(val)} errorMsg={errorMsg} required + type="password" + onEnterKey={this.onSubmit} />
- +
@@ -78,6 +82,7 @@ PasswordScreen.defaultProps = { environment: null, baseUrl: '', title: 'GET ACCESS WITH PASSWORD', + btnText: 'SUBMIT', }; PasswordScreen.propTypes = { @@ -88,4 +93,5 @@ PasswordScreen.propTypes = { environment: PT.string, baseUrl: PT.string, title: PT.string, + btnText: PT.string, }; diff --git a/src/shared/components/Contentful/Route.jsx b/src/shared/components/Contentful/Route.jsx index 18c23943f8..69aefe17a3 100644 --- a/src/shared/components/Contentful/Route.jsx +++ b/src/shared/components/Contentful/Route.jsx @@ -71,6 +71,7 @@ function ChildRoutesLoader(props) { environment={environment} baseUrl={url} title={fields.passwordScreenTitle} + btnText={fields.passwordScreenButtonText} /> ) ) : diff --git a/src/shared/components/GUIKit/TextInput/index.jsx b/src/shared/components/GUIKit/TextInput/index.jsx index a69881350c..519ea50dc6 100644 --- a/src/shared/components/GUIKit/TextInput/index.jsx +++ b/src/shared/components/GUIKit/TextInput/index.jsx @@ -17,6 +17,8 @@ function TextInput({ onChange, required, size, + type, + onEnterKey, }) { const [val, setVal] = useState(value); const delayedOnChange = useRef( @@ -28,7 +30,7 @@ function TextInput({
{ @@ -39,6 +41,11 @@ function TextInput({ delayedOnChange(e.target.value, onChange); setVal(e.target.value); }} + onKeyPress={(e) => { + if (e.key === 'Enter') { + onEnterKey(); + } + }} /> {label ? (
+ { + content ? ( + + ) : null + } ); } @@ -83,6 +94,7 @@ PasswordScreen.defaultProps = { baseUrl: '', title: 'GET ACCESS WITH PASSWORD', btnText: 'SUBMIT', + content: null, }; PasswordScreen.propTypes = { @@ -94,4 +106,5 @@ PasswordScreen.propTypes = { baseUrl: PT.string, title: PT.string, btnText: PT.string, + content: PT.shape(), }; diff --git a/src/shared/components/Contentful/Route.jsx b/src/shared/components/Contentful/Route.jsx index 69aefe17a3..78876bb229 100644 --- a/src/shared/components/Contentful/Route.jsx +++ b/src/shared/components/Contentful/Route.jsx @@ -72,6 +72,7 @@ function ChildRoutesLoader(props) { baseUrl={url} title={fields.passwordScreenTitle} btnText={fields.passwordScreenButtonText} + content={fields.passwordScreenContent} /> ) ) : From c833dcc17cc597f5a5ef566e8ec80eb07fa75874 Mon Sep 17 00:00:00 2001 From: Luiz Ricardo Rodrigues Date: Mon, 9 Nov 2020 07:23:48 -0300 Subject: [PATCH 3/3] ci: deploy pass-screen-updates to Stag env Issue: #5165 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index abe65e8480..856330daff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -260,7 +260,7 @@ workflows: filters: branches: only: - - develop + - pass-screen-updates # Production builds are exectuted # when PR is merged to the master # Don't change anything in this configuration