Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Add timeline component #2130

Merged
merged 3 commits into from
Mar 11, 2021
Merged

Conversation

GuessWhoSamFoo
Copy link
Contributor

What this PR does / why we need it:
Adds a timeline component with support for actions via button group

Which issue(s) this PR fixes

Special notes for your reviewer:
Helpful boilerplate for setting up a button + timeline:

	bg := component.NewButtonGroup()
	bg.AddButton(component.Button{
		Name:         "testing",
		Payload:      action.Payload{"hello": "world"},
		Confirmation: nil,
		Modal:        component.NewModal(component.Title(component.NewText("test"))),
	})
	steps := []component.TimelineStep{
		{
			State:       component.TimelineStepNotStarted,
			Header:      "Header test",
			Title:       "Title test",
			Description: "Title description",
		},
	}
	timeline := component.NewTimeline(steps, false)
	timeline.Add(component.TimelineStep{
		State:       component.TimelineStepCurrent,
		Header:      "current test",
		Title:       "current title",
		Description: "current description",
		ButtonGroup: bg,
	}, component.TimelineStep{
		State:       component.TimelineStepProcessing,
		Header:      "loading",
		Title:       "loading title",
		Description: "loading description",
	})

@GuessWhoSamFoo GuessWhoSamFoo changed the title Timeline Add timeline component Mar 10, 2021
Sam Foo added 2 commits March 9, 2021 17:56
@GuessWhoSamFoo GuessWhoSamFoo force-pushed the timeline branch 2 times, most recently from 983dd6e to 1098c19 Compare March 10, 2021 02:05
@wwitzel3
Copy link
Contributor

We have suggested this before, wondering how you feel about starting with the components we are adding this release.

Add a useful example of using this component to the example plugin? It could be nice show using an action handler to retrigger a specific part of the timeline and having that change the plugin state so that the timeline update starts again...

I'm thinking we can use Sleep calls to simulate the waiting states and an action handler to retry a step.

On first render, the step fails, on retry, set a pass flag, and render the successful timeline.

Copy link
Contributor

@wwitzel3 wwitzel3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mklanjsek
Copy link
Contributor

Works well, looks good - nicely done Sam!

@GuessWhoSamFoo
Copy link
Contributor Author

https://github.com/vmware-tanzu/octant-example-plugins just got an update and will continue to grow in examples moving forward.

@GuessWhoSamFoo GuessWhoSamFoo merged commit 0cc85d6 into vmware-archive:master Mar 11, 2021
@GuessWhoSamFoo GuessWhoSamFoo deleted the timeline branch March 30, 2021 06:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Timeline component
3 participants