rubenf
rubenf2y ago

We now have onSuccess actions for forms

We now have onSuccess actions for forms and buttons. The actions available are setting a tab, going to a url, sending a toast. It's a small change in appearance but it's a big change under the hood as we now support "oneOf" kind of configurations. Some typescript fun implementation details in thread
No description
1 Reply
rubenf
rubenfOP2y ago
The configuration for component is statically defined as typescript const: https://github.com/windmill-labs/windmill/blob/main/frontend/src/lib/components/apps/editor/component/components.ts#L266 To preserve the type including the name of each field across the dynamic values inside components but keep it statically typed, we have to use advanced typing such as the below image. This ensure we make no mistake when defining components instead of having to refer to string keys. oneOf kind of configuration made it a whole lot harder but it was fun to code and I will write a blog post about it
GitHub
windmill/components.ts at main · windmill-labs/windmill
Open-source developer platform to turn scripts into workflows and UIs. Open-source alternative to Airplane and Retool. - windmill/components.ts at main · windmill-labs/windmill
No description