workflowproducts / envelope

Publish web apps based on your PostgreSQL database fast!
https://workflowproducts.com/envelope.html
Apache License 2.0
53 stars 2 forks source link

GS-Wheel Is Inconsistent #115

Closed michaeltocci closed 6 years ago

michaeltocci commented 6 years ago

The gs-wheel element currently uses a "values" attribute to determine what list of values to display. To display a list of numbers from one to one hundred, you would do something like this:

<gs-wheel values="1-100"></gs-wheel>

This is inconsistent with how we do list controls. It is also extremely downwind of anything other than a list of numbers. To fix this, we need to convert the element to be in the same format as a gs-select element. For example:

<gs-wheel>
    <option value="mon">Monday</option>
    <option value="tue">Tuesday</option>
    <option value="wed">Wednesday</option>
    <option value="thu">Thursday</option>
    <option value="fri">Friday</option>
    <option value="sat">Saturday</option>
    <option value="sun">Sunday</option>
</gs-wheel>

This will give us all the freedom that we need, be extremely upwind and be consistent with our coding practices.

Now, how do we handle backwards compatibility? For the time being, we include some code in the "inserted" lifecycle function to convert the old attributes ("values", "min", "max", "type") into the correct option elements inside the control. After that, everything will proceed normally. The element will mine the list and create an array and then fill the element with the display html.

crosstocci commented 6 years ago

Fixed in next release.