Add support for const types in metadata editor
The runtime types PR (#2263) introduces a runtime_type property to each schema within the Runtimes schemaspace. This property denotes the type of runtime to which instances of the schema correspond and uses a const meta-property to hold this value - since the hosting schema is one-to-one with a runtime processor implementation (and, therefore, a type). Here's the schema entry relative to the kfp schema:
"runtime_type": {
"title": "Runtime Type",
"description": "The runtime associated with this instance",
"type": "string",
"const": "KUBEFLOW_PIPELINES"
},
Left unaddressed, this will present a Runtime Type property with an empty edit control. If any value other than the constant value is entered, the validation for that instance will fail. Since runtime_type is not required, the only "working" approach would be to never enter any value (or know the constant value to enter). Because this is a constant, the user should not need to enter a value or update previously persisted constant values.
For const types, the metadata editor should unconditionally set the value of the property to the value stored in the const meta-property treat the property as read-only.
The idea that constant-based values should perhaps be hidden is also applicable here. As a result, it might be good to offer a uihints "style" that denotes a particular property be completely hidden from the end-user.
How about introducing a UI property that identifies special attributes, such as 'hidden' (immutable and not rendered) or 'read-only' (immutable)?
I think this makes a lot of sense and is used in other metadata-based systems I've worked on in the past.
Based on the conversation above, do we still need this?
Yes, the discussion above is essentially regarding the two forms for how we want to display constant-based properties. We should still transfer the value reflected in the const field to the metadata instance. That transfer isn't really necessary if the uihint were to indicate a 'hidden attribute, but is for 'read-only' and 'visible'.
See: https://github.com/elyra-ai/elyra/pull/2263#pullrequestreview-803006967
@marthacryan - check to see if this has been resolved earlier release