diff --git a/.circleci/config.yml b/.circleci/config.yml index abe65e8480..9a24c6244f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -231,14 +231,13 @@ workflows: branches: only: - develop - - auth0-hotfix-v3 # This is alternate dev env for parallel testing - "build-test": context : org-global filters: branches: only: - - apollo-site + - free # This is alternate dev env for parallel testing - "build-qa": context : org-global diff --git a/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap b/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap index c733309a43..9fe1f038fa 100644 --- a/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap +++ b/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap @@ -241,9 +241,6 @@ exports[`renders marathon 1`] = `

-

diff --git a/__tests__/shared/components/GUIKit/TextInput/__snapshots__/index.jsx.snap b/__tests__/shared/components/GUIKit/TextInput/__snapshots__/index.jsx.snap index 1d2c532062..f7c29a7f58 100644 --- a/__tests__/shared/components/GUIKit/TextInput/__snapshots__/index.jsx.snap +++ b/__tests__/shared/components/GUIKit/TextInput/__snapshots__/index.jsx.snap @@ -9,6 +9,7 @@ exports[`Default render 1`] = ` defaultValue="" onBlur={[Function]} onChange={[Function]} + onKeyPress={[Function]} placeholder="" type="text" /> diff --git a/__tests__/shared/components/SubmissionManagement/Submission.jsx b/__tests__/shared/components/SubmissionManagement/Submission.jsx index db738bc760..3f593267e3 100644 --- a/__tests__/shared/components/SubmissionManagement/Submission.jsx +++ b/__tests__/shared/components/SubmissionManagement/Submission.jsx @@ -4,6 +4,7 @@ import Submission from 'components/SubmissionManagement/Submission'; import TU from 'react-dom/test-utils'; const mockOnDelete = jest.fn(); +const mockOnDownload = jest.fn(); const mockOnShowDetails = jest.fn(); const rnd = new Rnd(); @@ -12,6 +13,7 @@ test('Snapshot match', () => { rnd.render(( { rnd.render((

- +
diff --git a/src/shared/components/Contentful/PasswordScreen/index.jsx b/src/shared/components/Contentful/PasswordScreen/index.jsx index a323ff6a46..c574520af5 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, content, } = this.props; return authorized ? ( this.onPasswordInput(val)} errorMsg={errorMsg} required + type="password" + onEnterKey={this.onSubmit} />
- +
+ { + content ? ( + + ) : null + } ); } @@ -78,6 +93,8 @@ PasswordScreen.defaultProps = { environment: null, baseUrl: '', title: 'GET ACCESS WITH PASSWORD', + btnText: 'SUBMIT', + content: null, }; PasswordScreen.propTypes = { @@ -88,4 +105,6 @@ PasswordScreen.propTypes = { environment: PT.string, 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 18c23943f8..78876bb229 100644 --- a/src/shared/components/Contentful/Route.jsx +++ b/src/shared/components/Contentful/Route.jsx @@ -71,6 +71,8 @@ function ChildRoutesLoader(props) { environment={environment} baseUrl={url} title={fields.passwordScreenTitle} + btnText={fields.passwordScreenButtonText} + content={fields.passwordScreenContent} /> ) ) : 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 ? (