feat(ui): use organization and token labels during InfluxDB v2 setup

pull/5619/head
Pavel Zavora 2020-11-24 19:57:27 +01:00
parent 90d1c6fd50
commit f4db32d8a1
1 changed files with 6 additions and 2 deletions

View File

@ -36,6 +36,8 @@ import {Source, Me} from 'src/types'
import {NextReturn} from 'src/types/wizard'
const isNewSource = (source: Partial<Source>) => !source.id
const isSourceV2 = (source: Partial<Source>) =>
!source.version || source.version.startsWith('2.')
interface Props {
notify: typeof notifyAction
@ -98,6 +100,8 @@ class SourceStep extends PureComponent<Props, State> {
public render() {
const {source} = this.state
const {isUsingAuth, onBoarding} = this.props
const sourceIsV2 = isSourceV2(source)
return (
<>
{isUsingAuth && onBoarding && this.authIndicator}
@ -115,12 +119,12 @@ class SourceStep extends PureComponent<Props, State> {
/>
<WizardTextInput
value={source.username}
label="Username"
label={sourceIsV2 ? 'Organization' : 'Username'}
onChange={this.onChangeInput('username')}
/>
<WizardTextInput
value={source.password}
label="Password"
label={sourceIsV2 ? 'Token' : 'Password'}
placeholder={this.passwordPlaceholder}
type="password"
onChange={this.onChangeInput('password')}