added checkbox

main
alex 2023-10-29 11:57:44 +01:00
parent 20afb9d415
commit b5b8480726
1 changed files with 27 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import {
Button,
Checkbox,
Divider,
Form,
Input,
@ -79,11 +80,19 @@ export default function GroupTypeSelectionModal({
if (userSpecifiedGlobalInputs.length > 0) {
for (let i = 0; i < userSpecifiedGlobalInputs.length; i++) {
if (userSpecifiedGlobalInputs[i].type !== "text") {
if (userSpecifiedGlobalInputs[i].type === "select") {
foundSelectInputs = foundSelectInputs + 1;
continue;
}
if (userSpecifiedGlobalInputs[i].type === "checkbox") {
globalInputs.push({
parameterName: userSpecifiedGlobalInputs[i].id,
value: userSpecifiedGlobalInputs[i].checked.toString(),
});
continue;
}
if (userSpecifiedGlobalInputs[i].value === "") {
canTaskBeStarted = false;
break;
@ -442,6 +451,23 @@ function GroupGlobalInputs({
</Form.Item>
);
break;
case "checkbox":
elements.push(
<Form.Item key={index} required>
<Checkbox
id={globalInput.parameterName}
defaultChecked={
globalInput.options !== null &&
globalInput.options.default !== null
? globalInput.options.default
: false
}
>
{getLabel(globalInput.displayName)}
</Checkbox>
</Form.Item>
);
break;
default:
notificationApi["error"]({