Skip to content

Commit

Permalink
UIU-2569: fix error message appearing (#2085)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislau-Snapok authored and zburke committed Apr 4, 2022
1 parent a234481 commit 61c8fd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change history for ui-users

## 8.0.2 IN PROGRESS

* Error message "Enter comment" appears erroneously when entering New Staff Info on Fee/Fine Details. Refs UIU-2569.

## [8.0.1](https://github.com/folio-org/ui-users/tree/v8.0.1) (2022-03-25)
[Full Changelog](https://github.com/folio-org/ui-users/compare/v8.0.0...v8.0.1)

Expand Down
17 changes: 2 additions & 15 deletions src/components/Accounts/Actions/CommentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ import {

import css from './modal.css';

const validate = (values) => {
const errors = {};
if (!values.comment) {
errors.comment = <FormattedMessage id="ui-users.accounts.comment.error.enterComment" />;
}
return errors;
};

class CommentModal extends React.Component {
static propTypes = {
open: PropTypes.bool,
Expand All @@ -30,27 +22,22 @@ class CommentModal extends React.Component {
invalid: PropTypes.bool,
onClose: PropTypes.func,
handleSubmit: PropTypes.func,
form: PropTypes.object.isRequired,
};

onSubmit = () => {
const {
handleSubmit,
form: { reset },
} = this.props;

handleSubmit();
reset();
}

handleClose = () => {
const {
onClose,
form: { reset },
} = this.props;

onClose();
reset();
}

render() {
Expand All @@ -59,7 +46,7 @@ class CommentModal extends React.Component {
submitting,
invalid,
open,
onClose
onClose,
} = this.props;

const submitButtonDisabled = pristine || submitting || invalid;
Expand Down Expand Up @@ -112,7 +99,7 @@ class CommentModal extends React.Component {
}

export default stripesFinalForm({
destroyOnUnregister: true,
navigationCheck: true,
subscription: { values: true },
validate,
})(CommentModal);

0 comments on commit 61c8fd3

Please sign in to comment.