Skip to content

Commit

Permalink
STCOR-728 - Forgot password and Forgot username : add placeholder to …
Browse files Browse the repository at this point in the history
…input box. (#1336)

* STCOR-728 - Forgot password and Forgot username : input box requires a label

* STCOR-728 - update changelog md file

* STCOR-728 - add translations for placeholders

* STCOR-728 - correct typo in translation key
  • Loading branch information
Terala-Priyanka authored Aug 21, 2023
1 parent 7d6ce56 commit 73ab683
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* *BREAKING* bump `react` to `v18`, and dev-deps accordingly. Refs STCOR-729.
* Added `consortiaServices` utils to hold common consortia helpers. Refs STCOR-733.
* Bump `@formatjs/cli` to `^6.1.3`.
* Forgot password and Forgot username : add placeholder to input box. Refs STCOR-728.

## [9.0.0](https://github.com/folio-org/stripes-core/tree/v9.0.0) (2023-01-30)
[Full Changelog](https://github.com/folio-org/stripes-core/compare/v8.3.0...v9.0.0)
Expand Down
11 changes: 8 additions & 3 deletions src/components/ForgotPassword/ForgotPasswordForm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Field, Form } from 'react-final-form';
import { FormattedMessage } from 'react-intl';
import { FormattedMessage, injectIntl } from 'react-intl';

import {
TextField,
Expand All @@ -20,6 +20,9 @@ class ForgotPasswordForm extends Component {
static propTypes = {
onSubmit: PropTypes.func.isRequired,
errors: PropTypes.arrayOf(PropTypes.object),
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
}),
};

static defaultProps = {
Expand All @@ -29,7 +32,8 @@ class ForgotPasswordForm extends Component {
render() {
const {
errors,
onSubmit
onSubmit,
intl: { formatMessage }
} = this.props;

return (
Expand Down Expand Up @@ -74,6 +78,7 @@ class ForgotPasswordForm extends Component {
autoComplete="on"
autoCapitalize="none"
autoFocus
placeholder={formatMessage({ id: 'stripes-core.placeholder.forgotPassword' })}
/>
</div>
<Button
Expand Down Expand Up @@ -111,4 +116,4 @@ class ForgotPasswordForm extends Component {
}
}

export default ForgotPasswordForm;
export default injectIntl(ForgotPasswordForm);
11 changes: 8 additions & 3 deletions src/components/ForgotUserName/ForgotUserNameForm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Field, Form } from 'react-final-form';
import { FormattedMessage } from 'react-intl';
import { FormattedMessage, injectIntl } from 'react-intl';

import {
TextField,
Expand All @@ -22,6 +22,9 @@ class ForgotUserNameForm extends Component {
isValid: PropTypes.bool.isRequired,
onSubmit: PropTypes.func.isRequired,
errors: PropTypes.arrayOf(PropTypes.object),
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
}),
};

static defaultProps = {
Expand All @@ -32,7 +35,8 @@ class ForgotUserNameForm extends Component {
const {
onSubmit,
isValid,
errors
errors,
intl: { formatMessage },
} = this.props;

return (
Expand Down Expand Up @@ -77,6 +81,7 @@ class ForgotUserNameForm extends Component {
autoComplete="on"
autoCapitalize="none"
autoFocus
placeholder={formatMessage({ id: 'stripes-core.placeholder.forgotUsername' })}
/>
</div>
<Button
Expand Down Expand Up @@ -117,4 +122,4 @@ class ForgotUserNameForm extends Component {
}
}

export default ForgotUserNameForm;
export default injectIntl(ForgotUserNameForm);
3 changes: 3 additions & 0 deletions translations/stripes-core/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@
"createResetPassword.confirmPassword": "Confirm Password",
"createResetPassword.ruleTemplate": "Must {description}",

"placeholder.forgotPassword": "Enter email or phone",
"placeholder.forgotUsername": "Enter email or phone",

"routeErrorBoundary.sub": "An error occurred on this page and it could not be loaded.",
"routeErrorBoundary.goToAppHomeLabel": "Return to home",
"routeErrorBoundary.goToModuleHomeLabel": "Return to {name} landing page",
Expand Down

0 comments on commit 73ab683

Please sign in to comment.