joyent / conch-ui

Web UI for Conch (https://github.com/joyent/conch-api)
2 stars 5 forks source link

hardware_product view, edit pages need revisions #293

Open karenetheridge opened 3 years ago

karenetheridge commented 3 years ago

The pages for viewing and editing hardware products have some issues.

This table and its associated values will be undergoing revisions soon, and the "specification" field within it will become dynamic, so it is impractical to hardcode the field names and their titles. I have added 'title' annotations to the request and response schema to provide the field labels; I also added 'readOnly' annotations to the response to make it clear which fields are not editable via POST /hardware_product/:id or POST /hardware_product (see https://github.com/joyent/conch-api/pull/1069)

You can obtain these schemas dynamically via GET /json_schema/<type>/<name> (see https://joyent.github.io/conch-api/modules/Conch::Route::JSONSchema), from which the page can be dynamically rendered. The content of these responses will not change between conch-api version number bumps, but the specification field's content can be determined via GET /json_schema/hardware_product/specification/latest and its content can be expected to change at any time. In all cases, GET /json_schema/* requests will respect caching headers (Last-Modified, If-Modified-Since, ETag etc).

bdelano commented 3 years ago

would something like this help @dustinryerson https://github.com/crickford/vue-json-schema-form

karenetheridge commented 3 years ago

I am not familiar with the details of the framework he is using. There are many implementations listed at https://json-schema.org/implementations.html but I kept the schema simple enough that a tool may not even be needed.

karenetheridge commented 3 years ago

there is also https://github.com/ncform/ncform -- if it is any good, please add it to the implementations page on json-schema.org.