|
|
@@ -48,6 +48,7 @@ const Wrapper = styled.div``
|
|
|
|
|
|
type Props = {
|
|
|
match: any,
|
|
|
+ location: { search: string }
|
|
|
}
|
|
|
type WizardType = 'migration' | 'replica'
|
|
|
type State = {
|
|
|
@@ -72,11 +73,7 @@ class WizardPage extends React.Component<Props, State> {
|
|
|
}
|
|
|
|
|
|
componentWillMount() {
|
|
|
- wizardStore.getDataFromPermalink()
|
|
|
- let type = this.props.match && this.props.match.params.type
|
|
|
- if (type === 'migration' || type === 'replica') {
|
|
|
- this.setState({ type })
|
|
|
- }
|
|
|
+ this.initializeState()
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
@@ -85,6 +82,14 @@ class WizardPage extends React.Component<Props, State> {
|
|
|
KeyboardManager.onEsc('wizard', () => { this.handleEscKey() })
|
|
|
}
|
|
|
|
|
|
+ componentWillReceiveProps(newProps: Props) {
|
|
|
+ if (newProps.location.search === this.props.location.search) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ wizardStore.clearData()
|
|
|
+ this.initializeState()
|
|
|
+ }
|
|
|
+
|
|
|
componentWillUnmount() {
|
|
|
wizardStore.clearData()
|
|
|
KeyboardManager.removeKeyDown('wizard')
|
|
|
@@ -273,6 +278,14 @@ class WizardPage extends React.Component<Props, State> {
|
|
|
wizardStore.setPermalink(wizardStore.data)
|
|
|
}
|
|
|
|
|
|
+ initializeState() {
|
|
|
+ wizardStore.getDataFromPermalink()
|
|
|
+ let type = this.props.match && this.props.match.params.type
|
|
|
+ if (type === 'migration' || type === 'replica') {
|
|
|
+ this.setState({ type })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
loadEnvDestinationOptions(field?: Field) {
|
|
|
let provider = wizardStore.data.target && wizardStore.data.target.type
|
|
|
let providerWithExtraOptions = providersWithExtraOptions.find(p => typeof p !== 'string' && p.name === provider)
|