Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 9.4.2 #535

Merged
merged 4 commits into from
Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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