Comp-490-SeniorProject / site

MIT License
0 stars 1 forks source link

Create a form for adding a new device #29

Open MarkKoz opened 2 years ago

MarkKoz commented 2 years ago

Based on this model, the form should have a mandatory name field and an optional description field. When we figure out how to connect with the hardware, we may need to add more stuff to the form. For now, just these two fields is fine.

There are two parts to this:

  1. Making the form UI
  2. Hooking it up to our backend API

For the latter part, the form will need to respect any errors that the API returns and potentially display that as some sort of form validation error (e.g. missing required field).

Depending on what we figure out with #28, this form may also need to prompt the user to map each supported sensor to a new parameter. However, that could be considered out of scope for now and implemented later.

MarkKoz commented 2 years ago

As I commented in #28, it can be assumed upon registration that the device will have 4 predefined sensors. Thus, we can probably add some code in the backend to automatically create corresponding parameters for those 4 sensors and associate it with each new device.

If you want, you can still show a form for adding custom parameters during registration. However, that could be saved for another issue, or just not be possible during registration (it'd instead be available later, after registration).