added global tag to type selection
parent
922a7bb85c
commit
8af2f09cfa
|
@ -7,6 +7,7 @@ import {
|
|||
Modal,
|
||||
Select,
|
||||
Space,
|
||||
Tag,
|
||||
notification,
|
||||
} from "antd";
|
||||
import { WebSocketContext, SentMessagesCommands } from "../../utils";
|
||||
|
@ -164,6 +165,24 @@ function GroupGlobalInputs({
|
|||
currentSelectedModalGroupType,
|
||||
notificationApi,
|
||||
}) {
|
||||
const MyFormItem = ({ children, displayName, parameterName }) => {
|
||||
return (
|
||||
<Form.Item
|
||||
label={
|
||||
<>
|
||||
{displayName}
|
||||
<Tag style={{ marginLeft: 6 }} color="purple">
|
||||
Global
|
||||
</Tag>
|
||||
</>
|
||||
}
|
||||
required
|
||||
>
|
||||
{children}
|
||||
</Form.Item>
|
||||
);
|
||||
};
|
||||
|
||||
var elements = [];
|
||||
|
||||
if (currentSelectedModalGroupType !== undefined) {
|
||||
|
@ -176,31 +195,33 @@ function GroupGlobalInputs({
|
|||
switch (globalInput.type) {
|
||||
case "text":
|
||||
elements.push(
|
||||
<Form.Item
|
||||
<MyFormItem
|
||||
key={"fitem-" + globalInput.parameterName}
|
||||
label={globalInput.displayName}
|
||||
required
|
||||
>
|
||||
<Input
|
||||
key={"input-" + globalInput.parameterName}
|
||||
id={globalInput.parameterName}
|
||||
/>
|
||||
</Form.Item>
|
||||
displayName={globalInput.displayName}
|
||||
parameterName={globalInput.parameterName}
|
||||
children={
|
||||
<Input
|
||||
key={"input-" + globalInput.parameterName}
|
||||
id={globalInput.parameterName}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
case "number":
|
||||
elements.push(
|
||||
<Form.Item
|
||||
<MyFormItem
|
||||
key={"fitem-" + globalInput.parameterName}
|
||||
label={globalInput.displayName}
|
||||
required
|
||||
>
|
||||
<InputNumber
|
||||
key={"input-" + globalInput.parameterName}
|
||||
style={{ width: "100%" }}
|
||||
id={globalInput.parameterName}
|
||||
/>
|
||||
</Form.Item>
|
||||
displayName={globalInput.displayName}
|
||||
parameterName={globalInput.parameterName}
|
||||
children={
|
||||
<InputNumber
|
||||
key={"input-" + globalInput.parameterName}
|
||||
style={{ width: "100%" }}
|
||||
id={globalInput.parameterName}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue