<commit_before>import React from 'react'
import PropTypes from 'prop-types'
import { Form } from 'react-redux-form'
import PageAlert from '@gov.au/page-alerts'
import ErrorBox from '../../../shared/form/ErrorBox'
import Textfield from '../../../shared/form/Textfield'
import { passwordLength } from '../../../shared/validators'
import { rootPath } from '../../routes'

import styles from './ResetPassword.scss'

const ResetPasswordForm = props => {
  const { model, user, submitClicked, handleSubmit } = props
  const { resetPasswordSuccess } = user

  let hasFocused = false
  const setFocus = e => {
    if (!hasFocused) {
      hasFocused = true
      e.focus()
    }
  }

  return (
    <main>
      <div className="row">
        <div className="col-sm-push-2 col-sm-8 col-xs-12">
          <article role="main">
            {resetPasswordSuccess
              ? <PageAlert as="success">
                  <h4>You have successfully changed your password</h4>
                  <span>
                    <p>
                      Please <a href={`${rootPath}/login`}> login </a> to continue.
                    </p>
                  </span>
                </PageAlert>
              : <ErrorBox
                  title="There was a problem resetting your password"
                  model={model}
                  submitClicked={submitClicked}
                  setFocus={setFocus}
                />}
            <header className="page-heading page-heading-without-breadcrumb">
              <h1 className="uikit-display-5">Reset password</h1>
            </header>
            <Form
              model={model}
              id="resetPassword"
              validators={{
                '': {
                  // Form-level validator
                  passwordsMatch: vals => vals.password === vals.confirmPassword
                }
              }}
              validateOn="submit"
              onSubmit={data => handleSubmit(data)}
            >
              <Textfield
                model={`${model}.password`}
                name="password"
                id="password"
                htmlFor="password"
                label="Password"
                type="password"
                description="Your password should be at least 10 characters"
                validators={{ passwordLength }}
                messages={{
                  passwordLength: 'Your password should be at least 10 characters'
                }}
              />
              <br />
              <Textfield
                model={`${model}.confirmPassword`}
                name="confirmPassword"
                id="confirmPassword"
                htmlFor="confirmPassword"
                label="Password"
                type="password"
                description="Repeat password used above"
                validators={{
                  passwordLength
                }}
                messages={{
                  passwordLength: 'Your password confirmation should be at least 10 characters. ',
                  passwordsMatch: 'Passwords do not match.'
                }}
              />
              <p className={styles.buttonWrapper}>
                <input className="uikit-btn" type="submit" value="Reset password" onClick={submitClicked} />
              </p>
            </Form>
          </article><commit_msg>Remove unecessary br<commit_after>import React from 'react'
import PropTypes from 'prop-types'
import { Form } from 'react-redux-form'
import PageAlert from '@gov.au/page-alerts'
import ErrorBox from '../../../shared/form/ErrorBox'
import Textfield from '../../../shared/form/Textfield'
import { passwordLength } from '../../../shared/validators'
import { rootPath } from '../../routes'

import styles from './ResetPassword.scss'

const ResetPasswordForm = props => {
  const { model, user, submitClicked, handleSubmit } = props
  const { resetPasswordSuccess } = user

  let hasFocused = false
  const setFocus = e => {
    if (!hasFocused) {
      hasFocused = true
      e.focus()
    }
  }

  return (
    <main>
      <div className="row">
        <div className="col-sm-push-2 col-sm-8 col-xs-12">
          <article role="main">
            {resetPasswordSuccess
              ? <PageAlert as="success">
                  <h4>You have successfully changed your password</h4>
                  <span>
                    <p>
                      Please <a href={`${rootPath}/login`}> login </a> to continue.
                    </p>
                  </span>
                </PageAlert>
              : <ErrorBox
                  title="There was a problem resetting your password"
                  model={model}
                  submitClicked={submitClicked}
                  setFocus={setFocus}
                />}
            <header className="page-heading page-heading-without-breadcrumb">
              <h1 className="uikit-display-5">Reset password</h1>
            </header>
            <Form
              model={model}
              id="resetPassword"
              validators={{
                '': {
                  // Form-level validator
                  passwordsMatch: vals => vals.password === vals.confirmPassword
                }
              }}
              validateOn="submit"
              onSubmit={data => handleSubmit(data)}
            >
              <Textfield
                model={`${model}.password`}
                name="password"
                id="password"
                htmlFor="password"
                label="Password"
                type="password"
                description="Your password should be at least 10 characters"
                validators={{ passwordLength }}
                messages={{
                  passwordLength: 'Your password should be at least 10 characters'
                }}
              />
              <Textfield
                model={`${model}.confirmPassword`}
                name="confirmPassword"
                id="confirmPassword"
                htmlFor="confirmPassword"
                label="Password"
                type="password"
                description="Repeat password used above"
                validators={{
                  passwordLength
                }}
                messages={{
                  passwordLength: 'Your password confirmation should be at least 10 characters. ',
                  passwordsMatch: 'Passwords do not match.'
                }}
              />
              <p className={styles.buttonWrapper}>
                <input className="uikit-btn" type="submit" value="Reset password" onClick={submitClicked} />
              </p>
            </Form>
          </article>
{'fraction_non_alphanumeric': 0.11119447779111645, 'fraction_numerical': 0.004501800720288115, 'mean_word_length': 1.3854688618468145, 'pattern_counts': {'":': 0, '<': 58, '<?xml version=': 0, '>': 66, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '933096', 'n_tokens_mistral': 1633, 'n_tokens_neox': 1552, 'n_words': 378}