diff --git a/src/frontend/src/components/core/GlobalVariableModal/GlobalVariableModal.tsx b/src/frontend/src/components/core/GlobalVariableModal/GlobalVariableModal.tsx index f71685bf1..42707ba0b 100644 --- a/src/frontend/src/components/core/GlobalVariableModal/GlobalVariableModal.tsx +++ b/src/frontend/src/components/core/GlobalVariableModal/GlobalVariableModal.tsx @@ -7,17 +7,10 @@ import getUnavailableFields from "@/stores/globalVariablesStore/utils/get-unavai import { GlobalVariable } from "@/types/global_variables"; import { useEffect, useState } from "react"; -import ForwardedIconComponent from "@/components/common/genericIconComponent"; +import { ForwardedIconComponent } from "@/components/common/genericIconComponent"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; -import { Textarea } from "@/components/ui/textarea"; +import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs-button"; import BaseModal from "@/modals/baseModal"; import useAlertStore from "@/stores/alertStore"; import { useTypesStore } from "@/stores/typesStore"; @@ -134,88 +127,89 @@ export default function GlobalVariableModal({ onSubmit={submitForm} disable={disabled} > - - - {" "} - {initialData ? "Update" : "Create"} Variable{" "} - + {children} -
- - { - setKey(e.target.value); - }} - placeholder="Insert a name for the variable..." - > - - - + + + Credential + + + Generic + + + +
- - {type === "Credential" ? ( +
+ + setKey(e.target.value)} + placeholder="Enter a name for the variable..." + /> +
+ +
+ + {type === "Credential" ? ( + setValue(e)} + placeholder="Enter a value for the variable..." + nodeStyle + /> + ) : ( + setValue(e.target.value)} + placeholder="Enter a value for the variable..." + /> + )} +
+ +
+ { - setValue(e); - }} - placeholder="Insert a value for the variable..." - nodeStyle + setSelectedOptions={(value) => setFields(value)} + selectedOptions={fields} + options={availableFields} + password={false} + placeholder="Choose a field for the variable..." + id="apply-to-fields" + popoverWidth="520px" + optionsPlaceholder="Fields" /> - ) : ( -