Commit 75a37a08 authored by Viacheslav Pavlov's avatar Viacheslav Pavlov

Merge branch...

Merge branch '624-send-request-button-is-disabled-on-request-stepper-after-user-refreshes-page' into 'master'

Send request button is disabled on request stepper after user refreshes page

Closes #624

See merge request genesys-pgr/genesys-ui!608
parents fa46f89b 7d330734
......@@ -3,6 +3,8 @@ import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { WithTranslation, withTranslation } from 'react-i18next';
import { loadAccessionsByUUIDs } from 'list/actions/public';
// ui
import StepperTemplate from 'ui/common/stepper/StepperTemplate';
import Markdown from 'ui/common/markdown';
......@@ -11,14 +13,19 @@ import { Button } from '@material-ui/core';
interface IAccessionsListStep extends React.ClassAttributes<any>, WithTranslation {
myList: any;
requestInfo: any;
loadAccessionsByUUIDs: () => void;
}
class ConfirmStep extends StepperTemplate<IAccessionsListStep> {
public componentWillMount() {
const { myList: { accessionUuids }, requestInfo } = this.props;
const { myList: { accessionUuids, loaded }, requestInfo, loadAccessionsByUUIDs } = this.props;
this.setDisabledActions(!requestInfo || !accessionUuids || accessionUuids.length === 0 || (!requestInfo.internalRequest && requestInfo.preacceptSMTA !== 'true'));
if (accessionUuids.length !== 0 && loaded.length === 0) {
loadAccessionsByUUIDs();
}
}
public componentWillReceiveProps(nextProps) {
......@@ -62,7 +69,7 @@ const mapStateToProps = (state, ownProps) => ({
});
const mapDispatchToProps = (dispatch) => bindActionCreators({
// nope
loadAccessionsByUUIDs,
}, dispatch);
export default connect(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment