redhat-developer / redhat-developer/vscode-wizard
Manage binding between model and UI
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
Today wizard accept only Map as data model. It should be nice that wizard accept any object and bind the UI with the object without extra code (without coding initialValue or without coding populate of data map).
When perform finish or validate is processed, the idea is to work with the object (that we can cast it) and not with data parameters array.
Here some databinding that I would liek to manage in vscode-kafka:
Checkbox with cluster#ssl
I have cluster instance with ssl property which is a boolean (which can be undefined), today I write that:
{
id: "ssl",
label: "Enable SSL",
initialValue: !(cluster?.ssl === undefined || cluster?.ssl === false) ? 'true' : undefined,
type: "checkbox"
}
I would like just to write:
{
id: "ssl",
label: "Enable SSL",
type: "checkbox"
}
and in validate instead of writing
function isSSLEnabled(data: any) {
return (data[CLUSTER_SSL_FIELD] === true || data[CLUSTER_SSL_FIELD] === 'true');
}
I would like to write:
function isSSLEnabled(data: Cluster) {
return data.ssl;
}
Nested properties
I have cluster instance with saslOption.username nested property which is a boolean (which can be undefined), today I write that:
{
id: "saslOption.username",
label: "Username:",
initialValue: `${cluster?.saslOption?.username || ''}`,
type: "textbox"
}
I would like just to write:
{
id: "saslOption.username",
label: "Username:",
type: "textbox"
}
And validator and perform finish should populuate the nested property saslOption.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the binding and validation behavior described in the issue, using the referenced src/wizards/clusters.ts examples for current checkbox and nested-property handling. Define how an arbitrary object is supplied, updated, validated, and returned, including undefined values and saslOption.username. Done means wizard users no longer need initialValue or manual data-map conversion for these cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100