remove sidebar on selection step (#11473)

pull/11483/head
Daniel Campbell 2019-01-22 17:51:21 -08:00 committed by GitHub
parent 6fdfd9341b
commit 74c21c8990
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 49 additions and 63 deletions

View File

@ -224,13 +224,14 @@ class DataLoadersWizard extends PureComponent<Props> {
} }
private get sideBarVisible() { private get sideBarVisible() {
const {dataLoaders} = this.props const {dataLoaders, currentStepIndex} = this.props
const {telegrafPlugins, type} = dataLoaders const {telegrafPlugins, type} = dataLoaders
const isStreaming = type === DataLoaderType.Streaming const isStreaming = type === DataLoaderType.Streaming
const isNotEmpty = telegrafPlugins.length > 0 const isNotEmpty = telegrafPlugins.length > 0
const isConfigStep = currentStepIndex > 0
return isStreaming && isNotEmpty return isStreaming && isNotEmpty && isConfigStep
} }
private handleClickSideBarTab = (telegrafPluginID: string) => { private handleClickSideBarTab = (telegrafPluginID: string) => {

View File

@ -63,7 +63,6 @@
padding: $ix-marg-c; padding: $ix-marg-c;
padding-bottom: 0; padding-bottom: 0;
flex: 1 0 100%; flex: 1 0 100%;
transition: flex 0.4s ease-in-out;
} }
.side-bar.show + .wizard-step--container { .side-bar.show + .wizard-step--container {
@ -85,7 +84,6 @@
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
transition: max-width .4s ease-in-out;
} }
.wizard-step--scroll-area { .wizard-step--scroll-area {

View File

@ -64,24 +64,22 @@ export class ConfigureDataSourceStep extends PureComponent<Props> {
} = this.props } = this.props
return ( return (
<div className="onboarding-step wizard--skippable"> <ConfigureDataSourceSwitcher
<ConfigureDataSourceSwitcher buckets={buckets}
buckets={buckets} bucket={bucket}
bucket={bucket} org={org}
org={org} username={username}
username={username} telegrafPlugins={telegrafPlugins}
telegrafPlugins={telegrafPlugins} onUpdateTelegrafPluginConfig={onUpdateTelegrafPluginConfig}
onUpdateTelegrafPluginConfig={onUpdateTelegrafPluginConfig} onAddConfigValue={onAddConfigValue}
onAddConfigValue={onAddConfigValue} onRemoveConfigValue={onRemoveConfigValue}
onRemoveConfigValue={onRemoveConfigValue} dataLoaderType={type}
dataLoaderType={type} currentIndex={+substep}
currentIndex={+substep} onSetConfigArrayValue={onSetConfigArrayValue}
onSetConfigArrayValue={onSetConfigArrayValue} onClickNext={this.handleNext}
onClickNext={this.handleNext} onClickPrevious={this.handlePrevious}
onClickPrevious={this.handlePrevious} onClickSkip={this.jumpToCompletionStep}
onClickSkip={this.jumpToCompletionStep} />
/>
</div>
) )
} }

View File

@ -60,34 +60,40 @@ class ConfigureDataSourceSwitcher extends PureComponent<Props> {
switch (dataLoaderType) { switch (dataLoaderType) {
case DataLoaderType.Streaming: case DataLoaderType.Streaming:
return ( return (
<PluginConfigSwitcher <div className="onboarding-step wizard--skippable">
onUpdateTelegrafPluginConfig={onUpdateTelegrafPluginConfig} <PluginConfigSwitcher
onRemoveConfigValue={onRemoveConfigValue} onUpdateTelegrafPluginConfig={onUpdateTelegrafPluginConfig}
telegrafPlugins={telegrafPlugins} onRemoveConfigValue={onRemoveConfigValue}
currentIndex={currentIndex} telegrafPlugins={telegrafPlugins}
onAddConfigValue={onAddConfigValue} currentIndex={currentIndex}
onSetConfigArrayValue={onSetConfigArrayValue} onAddConfigValue={onAddConfigValue}
onClickNext={onClickNext} onSetConfigArrayValue={onSetConfigArrayValue}
onClickPrevious={onClickPrevious} onClickNext={onClickNext}
onClickSkip={onClickSkip} onClickPrevious={onClickPrevious}
/> onClickSkip={onClickSkip}
/>
</div>
) )
case DataLoaderType.LineProtocol: case DataLoaderType.LineProtocol:
return ( return (
<LineProtocol <div className="onboarding-step">
bucket={bucket} <LineProtocol
org={org} bucket={bucket}
onClickNext={onClickNext} org={org}
onClickBack={onClickPrevious} onClickNext={onClickNext}
/> onClickBack={onClickPrevious}
/>
</div>
) )
case DataLoaderType.Scraping: case DataLoaderType.Scraping:
return ( return (
<Scraping <div className="onboarding-step">
onClickNext={onClickNext} <Scraping
onClickBack={onClickPrevious} onClickNext={onClickNext}
buckets={buckets} onClickBack={onClickPrevious}
/> buckets={buckets}
/>
</div>
) )
case DataLoaderType.CSV: case DataLoaderType.CSV:
return <div>{DataLoaderType.CSV}</div> return <div>{DataLoaderType.CSV}</div>

View File

@ -1,7 +1,6 @@
// Libraries // Libraries
import React, {PureComponent} from 'react' import React, {PureComponent} from 'react'
import _ from 'lodash' import _ from 'lodash'
import classnames from 'classnames'
// Components // Components
import {ErrorHandling} from 'src/shared/decorators/errors' import {ErrorHandling} from 'src/shared/decorators/errors'
@ -52,7 +51,7 @@ export class SelectDataSourceStep extends PureComponent<Props> {
public render() { public render() {
return ( return (
<div className={this.skippableClassName}> <div className="onboarding-step">
<Form onSubmit={this.handleClickNext}> <Form onSubmit={this.handleClickNext}>
<div className="wizard-step--scroll-area"> <div className="wizard-step--scroll-area">
<FancyScrollbar autoHide={false}> <FancyScrollbar autoHide={false}>
@ -189,18 +188,6 @@ export class SelectDataSourceStep extends PureComponent<Props> {
private get isStreaming(): boolean { private get isStreaming(): boolean {
return this.props.substep === 'streaming' return this.props.substep === 'streaming'
} }
private get skippableClassName(): string {
const {telegrafPlugins} = this.props
const pluginsSelected = telegrafPlugins.length > 0
const allConfigured = telegrafPlugins.every(
plugin => plugin.configured === 'configured'
)
return classnames('onboarding-step', {
'wizard--skippable': pluginsSelected && allConfigured,
})
}
} }
export default SelectDataSourceStep export default SelectDataSourceStep

View File

@ -13,7 +13,6 @@ $sidebar-width-md: 240px;
overflow: hidden; overflow: hidden;
transform: translate3d(0,0,0); transform: translate3d(0,0,0);
flex: 1 0 0; flex: 1 0 0;
transition: flex 0.4s ease-in-out;
&.show { &.show {
flex: 1 0 $sidebar-width-sm; flex: 1 0 $sidebar-width-sm;
@ -23,7 +22,6 @@ $sidebar-width-md: 240px;
.side-bar--container { .side-bar--container {
box-sizing: border-box; box-sizing: border-box;
opacity: 0; opacity: 0;
transition: opacity 0.5s ease;
height: 100%; height: 100%;
width: 100%; width: 100%;
display: inline-flex; display: inline-flex;
@ -63,7 +61,6 @@ $sidebar-width-md: 240px;
color: $g10-wolf; color: $g10-wolf;
background-color: transparent; background-color: transparent;
white-space: nowrap; white-space: nowrap;
transition: color 0.25s ease-in-out, background-color 0.25s ease-in-out;
&:hover { &:hover {
color: $g15-platinum; color: $g15-platinum;
@ -83,7 +80,6 @@ $sidebar-width-md: 240px;
display: inline-block; display: inline-block;
font-size: 16px; font-size: 16px;
margin: 0 13px; margin: 0 13px;
transition: color 0.25s ease-in-out;
.side-bar--tab:hover & { .side-bar--tab:hover & {
color: $g11-sidewalk; color: $g11-sidewalk;

View File

@ -69,7 +69,7 @@ export class VerifyDataStep extends PureComponent<Props> {
} = this.props } = this.props
return ( return (
<div className="onboarding-step wizard--skippable"> <div className="onboarding-step">
<Form onSubmit={this.handleIncrementStep}> <Form onSubmit={this.handleIncrementStep}>
<div className="wizard-step--scroll-area"> <div className="wizard-step--scroll-area">
<FancyScrollbar autoHide={false}> <FancyScrollbar autoHide={false}>