diff --git a/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx b/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx index 1ea7142ab..f80755a46 100644 --- a/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx +++ b/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx @@ -5,13 +5,13 @@ import useAlertStore from "../../stores/alertStore"; import { useGlobalVariablesStore } from "../../stores/globalVariablesStore/globalVariables"; import { useTypesStore } from "../../stores/typesStore"; import { ResponseErrorDetailAPI } from "../../types/api"; -import { sortByName } from "../../utils/utils"; import ForwardedIconComponent from "../genericIconComponent"; import InputComponent from "../inputComponent"; import { Button } from "../ui/button"; import { Input } from "../ui/input"; import { Label } from "../ui/label"; import { Textarea } from "../ui/textarea"; +import sortByName from "./utils/sort-by-name"; //TODO IMPLEMENT FORM LOGIC diff --git a/src/frontend/src/components/addNewVariableButtonComponent/utils/sort-by-name.tsx b/src/frontend/src/components/addNewVariableButtonComponent/utils/sort-by-name.tsx new file mode 100644 index 000000000..96a1b6b68 --- /dev/null +++ b/src/frontend/src/components/addNewVariableButtonComponent/utils/sort-by-name.tsx @@ -0,0 +1,3 @@ +export default function sortByName(stringList: string[]): string[] { + return stringList.sort((a, b) => a.localeCompare(b)); +} \ No newline at end of file diff --git a/src/frontend/src/utils/utils.ts b/src/frontend/src/utils/utils.ts index 46495c942..487448665 100644 --- a/src/frontend/src/utils/utils.ts +++ b/src/frontend/src/utils/utils.ts @@ -1,21 +1,16 @@ import clsx, { ClassValue } from "clsx"; import { twMerge } from "tailwind-merge"; -import { priorityFields } from "../constants/constants"; -import { ADJECTIVES, DESCRIPTIONS, NOUNS } from "../flow_constants"; import { APIDataType, - APITemplateType, TemplateVariableType, } from "../types/api"; import { - IVarHighlightType, groupedObjType, nodeGroupedObjType, tweakType, } from "../types/components"; import { NodeType } from "../types/flow"; import { FlowState } from "../types/tabs"; -import { getRandomElement } from "./reactflowUtils"; export function classNames(...classes: Array): string { return classes.filter(Boolean).join(" "); @@ -350,7 +345,3 @@ export function freezeObject(obj: any) { if (!obj) return obj; return JSON.parse(JSON.stringify(obj)); } - -export function sortByName(stringList: string[]): string[] { - return stringList.sort((a, b) => a.localeCompare(b)); -}