Skip to content

[GPhL] Add possibility to handle textarea #1617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 57 additions & 17 deletions ui/src/containers/GphlWorkflowParametersDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,44 @@ function GphlWorkflowParametersDialog(props) {
} mb-5`}
>
<div className={`${styles.title} p-2`}>
{ui_schema[rowKey]['ui:title'] ||
schema.properties.indexing_solution?.title ||
null}
{rowKey === 'reffiles'
? schema.properties.reffiles?.title
: rowKey === 'indexing_solution'
? schema.properties.indexing_solution?.title
: ui_schema[rowKey]['ui:title']}
</div>
<Row>
{ui_schema[rowKey]['ui:order'] ? (
ui_schema[rowKey]['ui:order'].map((ColKey) => (
{rowKey === 'indexing_solution' ? (
ui_schema[rowKey]['ui:widget']?.includes('table') &&
renderIndexingTable(
ui_schema[rowKey][uiOptions],
selected,
onSelectRow,
)
) : rowKey === 'reffiles' ? (
// Specific textarea for "reffiles"
schema.properties.reffiles.type === 'textarea' && (
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This textarea case is here cause of it's future specificity
it will have some regex for multi-line url validation in the future by @rhfogh

<Form.Control
name="reffiles"
id="reffiles"
onChange={(e) => handleChange(e)}
data-highlight={
schema.properties.reffiles.highlight || undefined
}
type={schema.properties.reffiles.type}
as="textarea"
required
defaultValue={formState.reffiles}
readOnly={schema.properties.reffiles.readOnly}
disabled={schema.properties.reffiles.readOnly}
/>
)
) : rowKey === '_info' ? (
<pre className="p-2">
{schema.properties[rowKey].default}
</pre>
) : (
ui_schema[rowKey]['ui:order']?.map((ColKey) => (
<Col key={ColKey} sm>
{ui_schema[rowKey][ColKey]['ui:order'].map(
(fieldKey) => (
Expand Down Expand Up @@ -301,6 +332,27 @@ function GphlWorkflowParametersDialog(props) {
),
)}
</Form.Select>
) : // Generic any other textarea
schema.properties[fieldKey].type ===
'textarea' ? (
<Form.Control
name={fieldKey}
id={fieldKey}
onChange={(e) => handleChange(e)}
data-highlight={
schema.properties[fieldKey].highlight ||
undefined
}
type={schema.properties[fieldKey].type}
as="textarea"
defaultValue={formState[fieldKey]}
readOnly={
schema.properties[fieldKey].readOnly
}
disabled={
schema.properties[fieldKey].readOnly
}
/>
) : (
<Form.Control
name={fieldKey}
Expand Down Expand Up @@ -339,18 +391,6 @@ function GphlWorkflowParametersDialog(props) {
)}
</Col>
))
) : ui_schema[rowKey]['ui:widget'] ? (
ui_schema[rowKey]['ui:widget'].includes('table') ? (
renderIndexingTable(
ui_schema[rowKey][uiOptions],
selected,
onSelectRow,
)
) : null
) : (
<pre className="p-2">
{schema.properties[rowKey].default}
</pre>
)}
</Row>
</div>
Expand Down