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

Add validator and action payload for stepper #1300

Merged
merged 1 commit into from Aug 27, 2020

Conversation

GuessWhoSamFoo
Copy link
Contributor

Validator and placeholder:
Screenshot_20200826_200716

		fft := component.NewFormFieldText("textFormLabel", "textFormName", "")
		fft.AddValidator("placeholder", "this is an error", []string{"required"})

		form := component.Form{
			Fields: []component.FormField{
				fft,
			},
		}

		stepper := component.NewStepper("Test", "testAction")
		stepper.AddStep("Step1", form, "title1", "description1")
		stepper.AddStep("Step2", form, "title2", "description2")

Example message on submit with inputs of "test" and "test2" for "Step1" and "Step2" respectively:
{"type":"action.octant.dev/performAction","payload":{"action":"testAction","formGroup":{"Step1":{"textFormName":"test"},"Step2":{"textFormName":"test2"}}}}

Which issue(s) this PR fixes

Signed-off-by: GuessWhoSamFoo <foos@vmware.com>
@GuessWhoSamFoo GuessWhoSamFoo merged commit ec7ea28 into vmware-archive:master Aug 27, 2020
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.

Support required form fields and error message
2 participants