Support optional labels on logic-function input schema fields (#20471)
Adds an optional label field to logic-function input schema properties (InputSchemaProperty and InputJsonSchema). When set, the workflow builder renders the label in place of the raw property key for both leaf inputs and nested sections; when unset, it falls back to the key. jsonSchemaToInputSchema propagates the label so app authors can declare it in their JSON schema. Payload paths, the variable picker, and saved workflow inputs continue to use the property key — labels are display-only.
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
type InputSchema,
|
||||
type InputSchemaProperty,
|
||||
} from '@/workflow/types/InputSchema';
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
|
||||
const convertProperty = (jsonSchema: InputJsonSchema): InputSchemaProperty => {
|
||||
const property: InputSchemaProperty = { type: 'unknown' };
|
||||
@@ -50,6 +51,10 @@ const convertProperty = (jsonSchema: InputJsonSchema): InputSchemaProperty => {
|
||||
property.multiline = true;
|
||||
}
|
||||
|
||||
if (isNonEmptyString(jsonSchema.label)) {
|
||||
property.label = jsonSchema.label;
|
||||
}
|
||||
|
||||
return property;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user