Tauffer-Consulting/domino

Generalize options of languages for codeeditor

Closed this issue · 0 comments

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."
/>
);