fixing issue with cancel button on revert to basic license modal (#18718) (#18727)

This commit is contained in:
Bill McConaghy 2018-05-02 12:57:06 -04:00 committed by GitHub
parent 895249f1d9
commit eab030b9f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 4 deletions

View file

@ -13,7 +13,7 @@ import {
shouldShowRevertToBasicLicense,
getStartBasicMessages
} from '../../../store/reducers/licenseManagement';
import { startBasicLicense } from '../../../store/actions/start_basic';
import { startBasicLicense, cancelStartBasicLicense } from '../../../store/actions/start_basic';
const mapStateToProps = state => {
return {
@ -25,7 +25,8 @@ const mapStateToProps = state => {
};
const mapDispatchToProps = {
startBasicLicense
startBasicLicense,
cancelStartBasicLicense
};
export const RevertToBasic = connect(mapStateToProps, mapDispatchToProps)(

View file

@ -26,6 +26,7 @@ export class RevertToBasic extends React.PureComponent {
needsAcknowledgement,
messages: [firstLine, ...messages] = [],
startBasicLicense,
cancelStartBasicLicense,
licenseType
} = this.props;
if (!needsAcknowledgement) {
@ -35,7 +36,7 @@ export class RevertToBasic extends React.PureComponent {
<EuiOverlayMask>
<EuiConfirmModal
title="Confirm Revert to Basic License"
onCancel={this.cancel}
onCancel={cancelStartBasicLicense}
onConfirm={() => startBasicLicense(licenseType, HTMLMarqueeElement)}
cancelButtonText="Cancel"
confirmButtonText="Confirm"

View file

@ -12,6 +12,10 @@ export const startBasicLicenseStatus = createAction(
'LICENSE_MANAGEMENT_START_BASIC_LICENSE_STATUS'
);
export const cancelStartBasicLicense = createAction(
'LICENSE_MANAGEMENT_CANCEL_START_BASIC_LICENSE'
);
export const startBasicLicense = (currentLicenseType, ack) => async (
dispatch,
getState,

View file

@ -6,11 +6,14 @@
import { handleActions } from 'redux-actions';
import { startBasicLicenseStatus } from '../actions/start_basic';
import { startBasicLicenseStatus, cancelStartBasicLicense } from '../actions/start_basic';
export const startBasicStatus = handleActions({
[startBasicLicenseStatus](state, { payload }) {
return payload;
},
[cancelStartBasicLicense]() {
return {};
}
}, {});