Merge pull request #1696 from influxdata/dataloader/complete-step-progress-bar
Add completion step to progress bar in onboarding wizardpull/10616/head
commit
48f921d83a
|
@ -30,11 +30,10 @@ class ProgressBar extends PureComponent<Props, null> {
|
||||||
const {stepStatuses, stepTitles, currentStepIndex} = this.props
|
const {stepStatuses, stepTitles, currentStepIndex} = this.props
|
||||||
|
|
||||||
const lastIndex = stepStatuses.length - 1
|
const lastIndex = stepStatuses.length - 1
|
||||||
const lastEleIndex = stepStatuses.length - 2
|
|
||||||
|
|
||||||
const progressBar: JSX.Element[] = stepStatuses.reduce(
|
const progressBar: JSX.Element[] = stepStatuses.reduce(
|
||||||
(acc, stepStatus, i) => {
|
(acc, stepStatus, i) => {
|
||||||
if (i === 0 || i === lastIndex) {
|
if (i === 0) {
|
||||||
return [...acc]
|
return [...acc]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +63,7 @@ class ProgressBar extends PureComponent<Props, null> {
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
if (i === lastEleIndex) {
|
if (i === lastIndex) {
|
||||||
return [...acc, stepEle]
|
return [...acc, stepEle]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +73,7 @@ class ProgressBar extends PureComponent<Props, null> {
|
||||||
if (i === currentStepIndex && stepStatus !== StepStatus.Error) {
|
if (i === currentStepIndex && stepStatus !== StepStatus.Error) {
|
||||||
connectorStatus = ConnectorState.Some
|
connectorStatus = ConnectorState.Some
|
||||||
}
|
}
|
||||||
if (i === lastEleIndex || stepStatus === StepStatus.Complete) {
|
if (i === lastIndex || stepStatus === StepStatus.Complete) {
|
||||||
connectorStatus = ConnectorState.Full
|
connectorStatus = ConnectorState.Full
|
||||||
}
|
}
|
||||||
const connectorEle = (
|
const connectorEle = (
|
||||||
|
|
|
@ -13,11 +13,14 @@ class CompletionStep extends PureComponent<OnboardingStepProps> {
|
||||||
public componentDidMount() {
|
public componentDidMount() {
|
||||||
window.addEventListener('keydown', this.handleKeydown)
|
window.addEventListener('keydown', this.handleKeydown)
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
window.removeEventListener('keydown', this.handleKeydown)
|
window.removeEventListener('keydown', this.handleKeydown)
|
||||||
}
|
}
|
||||||
|
|
||||||
public render() {
|
public render() {
|
||||||
const {onExit} = this.props
|
const {onExit, onDecrementCurrentStepIndex} = this.props
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="onboarding-step">
|
<div className="onboarding-step">
|
||||||
<div className="splash-logo secondary" />
|
<div className="splash-logo secondary" />
|
||||||
|
@ -28,7 +31,7 @@ class CompletionStep extends PureComponent<OnboardingStepProps> {
|
||||||
color={ComponentColor.Default}
|
color={ComponentColor.Default}
|
||||||
text="Back"
|
text="Back"
|
||||||
size={ComponentSize.Medium}
|
size={ComponentSize.Medium}
|
||||||
onClick={this.props.onDecrementCurrentStepIndex}
|
onClick={onDecrementCurrentStepIndex}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
color={ComponentColor.Success}
|
color={ComponentColor.Success}
|
||||||
|
|
|
@ -156,10 +156,7 @@ class OnboardingWizard extends PureComponent<Props> {
|
||||||
onSetCurrentStepIndex,
|
onSetCurrentStepIndex,
|
||||||
} = this.props
|
} = this.props
|
||||||
|
|
||||||
if (
|
if (currentStepIndex === 0) {
|
||||||
currentStepIndex === 0 ||
|
|
||||||
currentStepIndex === stepStatuses.length - 1
|
|
||||||
) {
|
|
||||||
return <div className="wizard--progress-header hidden" />
|
return <div className="wizard--progress-header hidden" />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue