added global tag to type selection

main
alex 2023-05-19 13:03:33 +02:00
parent 922a7bb85c
commit 8af2f09cfa
1 changed files with 40 additions and 19 deletions

View File

@ -7,6 +7,7 @@ import {
Modal, Modal,
Select, Select,
Space, Space,
Tag,
notification, notification,
} from "antd"; } from "antd";
import { WebSocketContext, SentMessagesCommands } from "../../utils"; import { WebSocketContext, SentMessagesCommands } from "../../utils";
@ -164,6 +165,24 @@ function GroupGlobalInputs({
currentSelectedModalGroupType, currentSelectedModalGroupType,
notificationApi, 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 = []; var elements = [];
if (currentSelectedModalGroupType !== undefined) { if (currentSelectedModalGroupType !== undefined) {
@ -176,31 +195,33 @@ function GroupGlobalInputs({
switch (globalInput.type) { switch (globalInput.type) {
case "text": case "text":
elements.push( elements.push(
<Form.Item <MyFormItem
key={"fitem-" + globalInput.parameterName} key={"fitem-" + globalInput.parameterName}
label={globalInput.displayName} displayName={globalInput.displayName}
required parameterName={globalInput.parameterName}
> children={
<Input <Input
key={"input-" + globalInput.parameterName} key={"input-" + globalInput.parameterName}
id={globalInput.parameterName} id={globalInput.parameterName}
/> />
</Form.Item> }
/>
); );
break; break;
case "number": case "number":
elements.push( elements.push(
<Form.Item <MyFormItem
key={"fitem-" + globalInput.parameterName} key={"fitem-" + globalInput.parameterName}
label={globalInput.displayName} displayName={globalInput.displayName}
required parameterName={globalInput.parameterName}
> children={
<InputNumber <InputNumber
key={"input-" + globalInput.parameterName} key={"input-" + globalInput.parameterName}
style={{ width: "100%" }} style={{ width: "100%" }}
id={globalInput.parameterName} id={globalInput.parameterName}
/> />
</Form.Item> }
/>
); );
break; break;
default: default: