Skip to content
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

Generalize options of languages for codeeditor #170

Closed
Tracked by #200 ...
luiztauffer opened this issue Nov 14, 2023 · 0 comments · Fixed by #202
Closed
Tracked by #200 ...

Generalize options of languages for codeeditor #170

luiztauffer opened this issue Nov 14, 2023 · 0 comments · Fixed by #202
Assignees
Labels
frontend Frontend related issues

Comments

@luiztauffer
Copy link
Member

We can probably generalize this to codeeditor-{language} and automatically dover for all language syntaxes available in React Textarea Code Editor

} else if (
("type" in schema &&
"widget" in schema &&
schema.type === "string" &&
(schema.widget === "codeeditor" ||
schema.widget === "codeeditor-python")) ||
("widget" in schema &&
(schema.widget === "codeeditor" ||
schema.widget === "codeeditor-python") &&
anyOfType === "string")
) {
inputElement = (
<CodeEditorInput<IWorkflowPieceData>
name={`inputs.${itemKey}.value`}
language="python"
placeholder="Enter Python code."
/>
);
} else if (
("type" in schema &&
"widget" in schema &&
schema.type === "string" &&
schema.widget === "codeeditor-json") ||
("widget" in schema &&
(schema.widget === "codeeditor" || schema.widget === "codeeditor-json") &&
anyOfType === "string")
) {
inputElement = (
<CodeEditorInput<IWorkflowPieceData>
name={`inputs.${itemKey}.value`}
language="json"
placeholder="Enter JSON code."
/>
);
} else if (
("type" in schema &&
"widget" in schema &&
schema.type === "string" &&
schema.widget === "codeeditor-sql") ||
("widget" in schema &&
(schema.widget === "codeeditor" || schema.widget === "codeeditor-sql") &&
anyOfType === "string")
) {
inputElement = (
<CodeEditorInput<IWorkflowPieceData>
name={`inputs.${itemKey}.value`}
language="sql"
placeholder="Enter SQL code."
/>
);

@luiztauffer luiztauffer added the frontend Frontend related issues label Nov 14, 2023
This was referenced Dec 4, 2023
Merged
@vinicvaz vinicvaz linked a pull request Dec 28, 2023 that will close this issue
Merged
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Frontend related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants