Add https checking to SourceStep
parent
a510c77e98
commit
e1d06a718a
|
@ -14,6 +14,7 @@ import {
|
|||
notifySourceCreationFailed,
|
||||
notifySourceCreationSucceeded,
|
||||
} from 'src/shared/copy/notifications'
|
||||
import {insecureSkipVerifyText} from 'src/shared/copy/tooltipText'
|
||||
|
||||
import {Source} from 'src/types'
|
||||
import {DEFAULT_SOURCE} from 'src/shared/constants'
|
||||
|
@ -87,9 +88,16 @@ class SourceStep extends PureComponent<Props, State> {
|
|||
/>
|
||||
<WizardCheckbox
|
||||
isChecked={source.default}
|
||||
text="Make this the default connection"
|
||||
text={'Make this the default connection'}
|
||||
onChange={this.onChangeInput('default')}
|
||||
/>
|
||||
{this.isHTTPS && (
|
||||
<WizardCheckbox
|
||||
isChecked={source.insecureSkipVerify}
|
||||
text={`Unsafe SSL: ${insecureSkipVerifyText}`}
|
||||
onChange={this.onChangeInput('insecureSkipVerify')}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -110,6 +118,11 @@ class SourceStep extends PureComponent<Props, State> {
|
|||
const {source} = this.state
|
||||
this.setState({source: {...source, [key]: value}})
|
||||
}
|
||||
|
||||
private get isHTTPS(): boolean {
|
||||
const {source} = this.state
|
||||
return getDeep<string>(source, 'url', '').startsWith('https')
|
||||
}
|
||||
}
|
||||
|
||||
const mdtp = {
|
||||
|
|
Loading…
Reference in New Issue