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

All modals opened when one table button was clicked #3233

Open
fengye87 opened this issue Apr 1, 2022 · 0 comments
Open

All modals opened when one table button was clicked #3233

fengye87 opened this issue Apr 1, 2022 · 0 comments

Comments

@fengye87
Copy link

fengye87 commented Apr 1, 2022

What steps did you take and what happened:

  1. Create a table
  2. Add two button to the table, each would open a modal when clicked
  3. Click one of those buttons
  4. Both modals would be opened

Screen Shot 2022-04-01 at 3 18 26 PM

newPodWithNameModal := component.NewModal(component.TitleFromString("New Pod with Name"))
newPodWithNameForm := component.Form{
	Fields: []component.FormField{
		component.NewFormFieldText("Name", "name", ""),
		component.NewFormFieldText("Namespace", "namespace", ""),
		component.NewFormFieldCheckBox("Privileged", "privileged", []component.InputChoice{{
			Label:   "Privileged",
			Checked: false,
		}}),
	},
	Action: "example.org/pods/create",
}
newPodWithNameModal.AddForm(newPodWithNameForm)
newPodWithNameModal.SetSize(component.ModalSizeExtraLarge)
podTable.AddButton("New with Name", nil, component.WithModal(newPodWithNameModal))

newPodWithImageModal := component.NewModal(component.TitleFromString("New Pod with Image"))
newPodWithImageForm := component.Form{
	Fields: []component.FormField{
		component.NewFormFieldText("Image", "image", ""),
	},
	Action: "example.org/pods/create",
}
newPodWithImageModal.AddForm(newPodWithImageForm)
newPodWithImageModal.SetSize(component.ModalSizeExtraLarge)
podTable.AddButton("New with Image", nil, component.WithModal(newPodWithImageModal))

What did you expect to happen:
Clicking those buttons would open one modal respectively

Environment:

  • Octant version (use octant version): 0.25.1
  • Kubernetes version (use kubectl version): 1.23.5
  • OS (macOS 10.15, Windows 10, Ubuntu 19.10 etc): Fedora 35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant