Skip to content

Commit

Permalink
Merge pull request #535 from massgov/release-9.4.2
Browse files Browse the repository at this point in the history
Release 9.4.2
  • Loading branch information
clairesunstudio authored Apr 11, 2019
2 parents cbf6c5e + 04ba40b commit 21bc216
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
**For example**
- DP-1234: The short description text on a [service detail](http://mayflower.digital.mass.gov/?p=pages-detail-for-service-howto-location) page banner ([@organisms/by-template/page-banner](http://mayflower.digital.mass.gov/?p=organisms-page-banner)) should now render ([PR #493](https://github.com/massgov/mayflower/pull/493))

## 9.4.2 (04/10/2019)

### Fixed
- (React) [InputCurrency] DP-13450: Fixed bug relating to error handling on blur in InputCurrency. #533

## 9.4.1 (04/10/2019)

### Fixed
Expand Down
10 changes: 8 additions & 2 deletions react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ For a guide and information on the components included in mayflower-react and th
* `npm install`
* `npm start`: This will run the demo application.

Please note that we are currently relying on symlink for pulling in shared assets into react source code. For Windows users, you need to manually create the symlink before running `npm start`.
e.g. In cmd prompt:
- $ `cd src` - make sure you are in the `src` folder in `mayflower/react`
- $ `rm assets`
- $ `ln -s ../../assets assets`

#### System Requirements

- node.js, currently standardized on version 8.9.4
- npm, currently standardized on version 5.6.0
- node.js, currently standardized on version 10.15.1
- npm, currently standardized on version 6.4.1
- That's it! All other dependencies should be included when you run ``npm i``.

#### Useful commands
Expand Down
12 changes: 4 additions & 8 deletions react/src/components/atoms/forms/InputCurrency/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const Currency = (props) => {
'ma__input-currency__control': true,
'js-is-required': props.required
});
let errorMsg = '';
const toCurrency = (number, decimal) => {
if (is.number(number)) {
if (props.language) {
Expand Down Expand Up @@ -146,17 +145,14 @@ const Currency = (props) => {
inputEl.setAttribute('placeholder', props.placeholder);
}
let newValue = isNotNumber ? '' : Number(numbro.unformat(stringValue));
if (props.required && is.empty(stringValue)) {
errorMsg = 'Please enter a value.';
context.updateState({ showError: true, errorMsg });
} else if (!is.empty(stringValue)) {
if (!hasNumberProperty(props, 'max') || newValue > props.max) {
if (!is.empty(newValue)) {
if (hasNumberProperty(props, 'max') && newValue > props.max) {
newValue = props.max;
}
if (!hasNumberProperty(props, 'min') || newValue < props.min) {
if (hasNumberProperty(props, 'min') && newValue < props.min) {
newValue = props.min;
}
const updateError = displayErrorMessage(!is.empty(stringValue) ? newValue : '');
const updateError = displayErrorMessage(newValue);
context.updateState({ value: toCurrency(newValue, countDecimals(props.step)), ...updateError }, () => {
if (is.fn(props.onBlur)) {
props.onBlur(newValue);
Expand Down

0 comments on commit 21bc216

Please sign in to comment.