Refactor: move sort-by-name to addNewVariableButton folder
This commit is contained in:
parent
aef52637f6
commit
e2ca4b79f8
3 changed files with 4 additions and 10 deletions
|
|
@ -5,13 +5,13 @@ import useAlertStore from "../../stores/alertStore";
|
||||||
import { useGlobalVariablesStore } from "../../stores/globalVariablesStore/globalVariables";
|
import { useGlobalVariablesStore } from "../../stores/globalVariablesStore/globalVariables";
|
||||||
import { useTypesStore } from "../../stores/typesStore";
|
import { useTypesStore } from "../../stores/typesStore";
|
||||||
import { ResponseErrorDetailAPI } from "../../types/api";
|
import { ResponseErrorDetailAPI } from "../../types/api";
|
||||||
import { sortByName } from "../../utils/utils";
|
|
||||||
import ForwardedIconComponent from "../genericIconComponent";
|
import ForwardedIconComponent from "../genericIconComponent";
|
||||||
import InputComponent from "../inputComponent";
|
import InputComponent from "../inputComponent";
|
||||||
import { Button } from "../ui/button";
|
import { Button } from "../ui/button";
|
||||||
import { Input } from "../ui/input";
|
import { Input } from "../ui/input";
|
||||||
import { Label } from "../ui/label";
|
import { Label } from "../ui/label";
|
||||||
import { Textarea } from "../ui/textarea";
|
import { Textarea } from "../ui/textarea";
|
||||||
|
import sortByName from "./utils/sort-by-name";
|
||||||
|
|
||||||
//TODO IMPLEMENT FORM LOGIC
|
//TODO IMPLEMENT FORM LOGIC
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default function sortByName(stringList: string[]): string[] {
|
||||||
|
return stringList.sort((a, b) => a.localeCompare(b));
|
||||||
|
}
|
||||||
|
|
@ -1,21 +1,16 @@
|
||||||
import clsx, { ClassValue } from "clsx";
|
import clsx, { ClassValue } from "clsx";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
import { priorityFields } from "../constants/constants";
|
|
||||||
import { ADJECTIVES, DESCRIPTIONS, NOUNS } from "../flow_constants";
|
|
||||||
import {
|
import {
|
||||||
APIDataType,
|
APIDataType,
|
||||||
APITemplateType,
|
|
||||||
TemplateVariableType,
|
TemplateVariableType,
|
||||||
} from "../types/api";
|
} from "../types/api";
|
||||||
import {
|
import {
|
||||||
IVarHighlightType,
|
|
||||||
groupedObjType,
|
groupedObjType,
|
||||||
nodeGroupedObjType,
|
nodeGroupedObjType,
|
||||||
tweakType,
|
tweakType,
|
||||||
} from "../types/components";
|
} from "../types/components";
|
||||||
import { NodeType } from "../types/flow";
|
import { NodeType } from "../types/flow";
|
||||||
import { FlowState } from "../types/tabs";
|
import { FlowState } from "../types/tabs";
|
||||||
import { getRandomElement } from "./reactflowUtils";
|
|
||||||
|
|
||||||
export function classNames(...classes: Array<string>): string {
|
export function classNames(...classes: Array<string>): string {
|
||||||
return classes.filter(Boolean).join(" ");
|
return classes.filter(Boolean).join(" ");
|
||||||
|
|
@ -350,7 +345,3 @@ export function freezeObject(obj: any) {
|
||||||
if (!obj) return obj;
|
if (!obj) return obj;
|
||||||
return JSON.parse(JSON.stringify(obj));
|
return JSON.parse(JSON.stringify(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function sortByName(stringList: string[]): string[] {
|
|
||||||
return stringList.sort((a, b) => a.localeCompare(b));
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue