diff --git a/ui/src/reusable_ui/components/wizard/WizardCloak.scss b/ui/src/reusable_ui/components/wizard/WizardCloak.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/reusable_ui/components/wizard/WizardCloak.tsx b/ui/src/reusable_ui/components/wizard/WizardCloak.tsx new file mode 100644 index 000000000..006b475c6 --- /dev/null +++ b/ui/src/reusable_ui/components/wizard/WizardCloak.tsx @@ -0,0 +1,59 @@ +import React, {PureComponent, ReactNode} from 'react' +import WizardProgressBar from 'src/reusable_ui/components/wizard/WizardProgressBar' + +// import {} from 'src/types' + +enum StepStatus { + Incomplete = 'INCOMPLETE', + Complete = 'COMPLETE', + Error = 'ERROR', +} + +interface Step { + title: string + stepStatus: StepStatus +} + +interface State { + steps: Step[] + currentStepIndex: number +} + +interface Props { + children: ReactNode +} + +class WizardCloak extends PureComponent { + constructor(props) { + super(props) + + this.state = { + steps: [ + {title: 'First Step', stepStatus: StepStatus.Complete}, + {title: 'Second Step', stepStatus: StepStatus.Error}, + {title: 'Third Step', stepStatus: StepStatus.Incomplete}, + ], + currentStepIndex: 0, + } + } + + public render() { + const {steps, currentStepIndex} = this.state + + return ( +
+ + {this.CurrentChild} +
+ ) + } + + private get CurrentChild(): JSX.Element { + const {children} = this.props + const {currentStepIndex} = this.state + + return children[currentStepIndex] + } +} + +export default WizardCloak diff --git a/ui/src/reusable_ui/components/wizard/WizardFullScreen.scss b/ui/src/reusable_ui/components/wizard/WizardFullScreen.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/reusable_ui/components/wizard/WizardFullScreen.tsx b/ui/src/reusable_ui/components/wizard/WizardFullScreen.tsx new file mode 100644 index 000000000..01b35594d --- /dev/null +++ b/ui/src/reusable_ui/components/wizard/WizardFullScreen.tsx @@ -0,0 +1,17 @@ +import React, {PureComponent, ReactNode} from 'react' + +// import {} from 'src/types' + +interface Props { + children: ReactNode +} + +class WizardFullScreen extends PureComponent { + public render() { + const {children} = this.props + + return
Step: {children}
+ } +} + +export default WizardFullScreen diff --git a/ui/src/reusable_ui/components/wizard/WizardOverlay.scss b/ui/src/reusable_ui/components/wizard/WizardOverlay.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/reusable_ui/components/wizard/WizardOverlay.tsx b/ui/src/reusable_ui/components/wizard/WizardOverlay.tsx new file mode 100644 index 000000000..0bfd55a06 --- /dev/null +++ b/ui/src/reusable_ui/components/wizard/WizardOverlay.tsx @@ -0,0 +1,33 @@ +import React, {PureComponent, ReactNode} from 'react' +import OverlayBody from 'src/reusable_ui/components/overlays/OverlayBody' +import OverlayContainer from 'src/reusable_ui/components/overlays/OverlayContainer' +import OverlayTechnology from 'src/reusable_ui/components/overlays/OverlayTechnology' +import WizardCloak from 'src/reusable_ui/components/wizard/WizardCloak' +import OverlayHeading from 'src/reusable_ui/components/overlays/OverlayHeading' + +// import {} from 'src/types' + +interface Props { + children: ReactNode + visible: boolean + title: string +} + +class WizardOverlay extends PureComponent { + public render() { + const {children, visible, title} = this.props + + return ( + + + + + {children} + + + + ) + } +} + +export default WizardOverlay diff --git a/ui/src/reusable_ui/components/wizard/WizardProgressBar.scss b/ui/src/reusable_ui/components/wizard/WizardProgressBar.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/reusable_ui/components/wizard/WizardProgressBar.tsx b/ui/src/reusable_ui/components/wizard/WizardProgressBar.tsx new file mode 100644 index 000000000..0993ec6cd --- /dev/null +++ b/ui/src/reusable_ui/components/wizard/WizardProgressBar.tsx @@ -0,0 +1,29 @@ +import React, {PureComponent} from 'react' + +// import {} from 'src/types' + +enum StepStatus { + Incomplete = 'INCOMPLETE', + Complete = 'COMPLETE', + Error = 'ERROR', +} + +interface Step { + title: string + stepStatus: StepStatus +} + +interface Props { + steps: Step[] + currentStepIndex: number +} + +class WizardProgressBar extends PureComponent { + public render() { + const {steps, currentStepIndex} = this.props + + return
ProgressBar
+ } +} + +export default WizardProgressBar diff --git a/ui/src/reusable_ui/components/wizard/WizardStep.scss b/ui/src/reusable_ui/components/wizard/WizardStep.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/reusable_ui/components/wizard/WizardStep.tsx b/ui/src/reusable_ui/components/wizard/WizardStep.tsx new file mode 100644 index 000000000..258c87276 --- /dev/null +++ b/ui/src/reusable_ui/components/wizard/WizardStep.tsx @@ -0,0 +1,23 @@ +import React, {PureComponent, ReactNode} from 'react' + +// import {} from 'src/types' + +interface Props { + children: ReactNode + title: string +} + +class WizardStep extends PureComponent { + public render() { + const {children, title} = this.props + + return ( +
+

{title}

+ {children} +
+ ) + } +} + +export default WizardStep diff --git a/ui/src/reusable_ui/components/wizard/test/WizardCloak.test.tsx b/ui/src/reusable_ui/components/wizard/test/WizardCloak.test.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/reusable_ui/components/wizard/test/WizardFullScreen.test.tsx b/ui/src/reusable_ui/components/wizard/test/WizardFullScreen.test.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/reusable_ui/components/wizard/test/WizardOverlay.test.tsx b/ui/src/reusable_ui/components/wizard/test/WizardOverlay.test.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/reusable_ui/components/wizard/test/WizardProgressBar.test.tsx b/ui/src/reusable_ui/components/wizard/test/WizardProgressBar.test.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/reusable_ui/components/wizard/test/WizardStep.test.tsx b/ui/src/reusable_ui/components/wizard/test/WizardStep.test.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/sources/components/GrandWizard.tsx b/ui/src/sources/components/GrandWizard.tsx new file mode 100644 index 000000000..3ee659b86 --- /dev/null +++ b/ui/src/sources/components/GrandWizard.tsx @@ -0,0 +1,25 @@ +import React, {PureComponent} from 'react' +import WizardOverlay from 'src/reusable_ui/components/wizard/WizardOverlay' +import WizardStep from 'src/reusable_ui/components/wizard/WizardStep' + +// import {} from 'src/types' + +interface Props { + wizardVisibility: boolean +} + +class WizardWithSteps extends PureComponent { + public render() { + const {wizardVisibility} = this.props + + return ( + + some first children + some second children + some third children + + ) + } +} + +export default WizardWithSteps diff --git a/ui/src/sources/components/InfluxTable.tsx b/ui/src/sources/components/InfluxTable.tsx index ca5d3a849..1f6107d4b 100644 --- a/ui/src/sources/components/InfluxTable.tsx +++ b/ui/src/sources/components/InfluxTable.tsx @@ -17,6 +17,7 @@ interface Props { deleteKapacitor: DeleteKapacitor setActiveKapacitor: SetActiveKapacitor onDeleteSource: (source: Source) => void + toggleVisibility: (isVisible: boolean) => () => void } class InfluxTable extends PureComponent { @@ -29,6 +30,7 @@ class InfluxTable extends PureComponent { deleteKapacitor, isUsingAuth, me, + toggleVisibility, } = this.props return ( @@ -39,6 +41,7 @@ class InfluxTable extends PureComponent { me={me} source={source} isUsingAuth={isUsingAuth} + toggleVisibility={toggleVisibility} />
diff --git a/ui/src/sources/components/InfluxTableHeader.tsx b/ui/src/sources/components/InfluxTableHeader.tsx index ede002de0..d65ae73fd 100644 --- a/ui/src/sources/components/InfluxTableHeader.tsx +++ b/ui/src/sources/components/InfluxTableHeader.tsx @@ -9,15 +9,19 @@ interface Props { me: Me source: Source isUsingAuth: boolean + toggleVisibility: (isVisible: boolean) => () => void } class InfluxTableHeader extends PureComponent { public render() { - const {source} = this.props + const {source, toggleVisibility} = this.props return (

{this.title}

+
+

show wiz

+
{ +class ManageSources extends PureComponent { + constructor(props) { + super(props) + + this.state = { + wizardVisibility: true, + } + } + public componentDidMount() { this.props.sources.forEach(source => { this.props.fetchKapacitors(source) @@ -46,6 +60,7 @@ class ManageSources extends PureComponent { public render() { const {sources, source, deleteKapacitor} = this.props + const {wizardVisibility} = this.state return (
@@ -58,14 +73,22 @@ class ManageSources extends PureComponent { deleteKapacitor={deleteKapacitor} onDeleteSource={this.handleDeleteSource} setActiveKapacitor={this.handleSetActiveKapacitor} + toggleVisibility={this.toggleVisibility} />

Chronograf Version: {VERSION}

+
) } + private toggleVisibility = isVisible => () => { + this.setState({ + wizardVisibility: isVisible, + }) + } + private handleDeleteSource = (source: Source) => { const {notify} = this.props