wing icon indicating copy to clipboard operation
wing copied to clipboard

new ui.Input with struct schema

Open ekeren opened this issue 1 year ago • 4 comments

Use Case

You can now use bring ui for inputs for any Wing struct

Here is an example for something like bring congnito

bring ui;
struct User {
  email: str;
  password: str;
  email_confirmed: bool?
}
 
//.... 
 setUi() {
    // Existing capabilities
    new ui.Button("Toggle Auth", inflight () => {
      this.counter.inc();
    });
    
   // This is new
   new ui.Input("Add User", User.schema(),  inflight (u: User) => {
     this.addUser(u);
   });
 }

The console should have an nice input fields for the User Struct

Proposed Solution

No response

Implementation Notes

No response

Component

Wing Console

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
  • If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Slack.

ekeren avatar Mar 17 '24 09:03 ekeren

I need this too so that my implementation of the message fanout has a more interesting ui

marciocadev avatar Mar 17 '24 13:03 marciocadev

The API looks good to me! For the docs it will be helpful to note what kinds of types are allowed in the struct (for example, can the struct contain other structs? etc).

Chriscbr avatar Mar 18 '24 17:03 Chriscbr

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

github-actions[bot] avatar Jun 17 '24 06:06 github-actions[bot]

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

github-actions[bot] avatar Sep 17 '24 06:09 github-actions[bot]