Skip to content

Commit

Permalink
[UI v2] chore: Moves RQ data to @/api (#16592)
Browse files Browse the repository at this point in the history
  • Loading branch information
devinvillarosa authored Jan 3, 2025
1 parent 8de6e80 commit b558313
Show file tree
Hide file tree
Showing 33 changed files with 62 additions and 35 deletions.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions ui-v2/src/api/automations/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export {
type Automation,
buildGetAutomationQuery,
buildListAutomationsQuery,
useCreateAutomation,
useDeleteAutomation,
useUpdateAutomation,
} from "./automations";
8 changes: 8 additions & 0 deletions ui-v2/src/api/global-concurrency-limits/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export {
type GlobalConcurrencyLimit,
buildListGlobalConcurrencyLimitsQuery,
useCreateGlobalConcurrencyLimit,
useDeleteGlobalConcurrencyLimit,
useListGlobalConcurrencyLimits,
useUpdateGlobalConcurrencyLimit,
} from "./global-concurrency-limits";
11 changes: 11 additions & 0 deletions ui-v2/src/api/task-run-concurrency-limits/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export {
type TaskRunConcurrencyLimit,
buildDetailTaskRunConcurrencyLimitsQuery,
buildConcurrenyLimitDetailsActiveRunsQuery,
buildListTaskRunConcurrencyLimitsQuery,
useCreateTaskRunConcurrencyLimit,
useDeleteTaskRunConcurrencyLimit,
useGetTaskRunConcurrencyLimit,
useListTaskRunConcurrencyLimits,
useResetTaskRunConcurrencyLimitTag,
} from "./task-run-concurrency-limits";
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { GlobalConcurrencyLimit } from "@/api/global-concurrency-limits";
import { Button } from "@/components/ui/button";
import {
Dialog,
Expand All @@ -17,7 +18,6 @@ import {
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { Switch } from "@/components/ui/switch";
import type { GlobalConcurrencyLimit } from "@/hooks/global-concurrency-limits";

import { useCreateOrEditGlobalConcurrencyLimitForm } from "./use-create-or-edit-global-concurrency-limit-form";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
type GlobalConcurrencyLimit,
useCreateGlobalConcurrencyLimit,
useUpdateGlobalConcurrencyLimit,
} from "@/hooks/global-concurrency-limits";
} from "@/api/global-concurrency-limits";
import { useToast } from "@/hooks/use-toast";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { GlobalConcurrencyLimit } from "@/api/global-concurrency-limits";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
Expand All @@ -7,7 +8,6 @@ import {
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { Icon } from "@/components/ui/icons";
import type { GlobalConcurrencyLimit } from "@/hooks/global-concurrency-limits";
import { useToast } from "@/hooks/use-toast";
import type { CellContext } from "@tanstack/react-table";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useToast } from "@/hooks/use-toast";
import type { CellContext } from "@tanstack/react-table";

import { Switch } from "@/components/ui/switch";
import {
type GlobalConcurrencyLimit,
useUpdateGlobalConcurrencyLimit,
} from "@/hooks/global-concurrency-limits";
} from "@/api/global-concurrency-limits";
import { Switch } from "@/components/ui/switch";

export const ActiveCell = (
props: CellContext<GlobalConcurrencyLimit, boolean>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { GlobalConcurrencyLimit } from "@/api/global-concurrency-limits";
import { DataTable } from "@/components/ui/data-table";
import type { GlobalConcurrencyLimit } from "@/hooks/global-concurrency-limits";
import { getRouteApi } from "@tanstack/react-router";
import {
createColumnHelper,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
type GlobalConcurrencyLimit,
useDeleteGlobalConcurrencyLimit,
} from "@/api/global-concurrency-limits";
import { Button } from "@/components/ui/button";
import {
Dialog,
Expand All @@ -8,10 +12,6 @@ import {
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import {
type GlobalConcurrencyLimit,
useDeleteGlobalConcurrencyLimit,
} from "@/hooks/global-concurrency-limits";
import { useToast } from "@/hooks/use-toast";

type GlobalConcurrencyLimitsDeleteDialogProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { GlobalConcurrencyLimit } from "@/hooks/global-concurrency-limits";
import type { GlobalConcurrencyLimit } from "@/api/global-concurrency-limits";

import { GlobalConcurrencyLimitsCreateOrEditDialog } from "@/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog";
import { GlobalConcurrencyLimitsDeleteDialog } from "@/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type GlobalConcurrencyLimit,
useListGlobalConcurrencyLimits,
} from "@/hooks/global-concurrency-limits";
} from "@/api/global-concurrency-limits";
import { useState } from "react";

import { GlobalConcurrencyLimitsDataTable } from "@/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cn } from "@/lib/utils";

import type { TaskRunConcurrencyLimit } from "@/hooks/task-run-concurrency-limits";
import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits";
import { format, parseISO } from "date-fns";
import React from "react";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits";
import { TaskRunConcurrencyLimitsActionsMenu } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu";
import type { TaskRunConcurrencyLimit } from "@/hooks/task-run-concurrency-limits";

import { NavHeader } from "./nav-header";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { buildConcurrenyLimitDetailsActiveRunsQuery } from "@/api/task-run-concurrency-limits";
import { TaskRunConcurrencyLimitHeader } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-header";
import { buildConcurrenyLimitDetailsActiveRunsQuery } from "@/hooks/task-run-concurrency-limits";
import { useState } from "react";

import { TaskRunConcurrencyLimitActiveTaskRuns } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-active-task-runs";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits";
import { TaskRunConcurrencyLimitsDeleteDialog } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog";
import { TaskRunConcurrencyLimitsResetDialog } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog";
import type { TaskRunConcurrencyLimit } from "@/hooks/task-run-concurrency-limits";
import { getRouteApi } from "@tanstack/react-router";

export type Dialogs = null | "delete" | "reset";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useCreateTaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits";
import { Button } from "@/components/ui/button";
import {
Dialog,
Expand All @@ -16,7 +17,6 @@ import {
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { useCreateTaskRunConcurrencyLimit } from "@/hooks/task-run-concurrency-limits";
import { useToast } from "@/hooks/use-toast";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TaskRunConcurrencyLimit } from "@/hooks/task-run-concurrency-limits";
import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits";
import type { CellContext } from "@tanstack/react-table";

type ActiveTaskRunCellsProps = CellContext<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TaskRunConcurrencyLimit } from "@/hooks/task-run-concurrency-limits";
import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits";
import { Link } from "@tanstack/react-router";
import type { CellContext } from "@tanstack/react-table";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits";
import { TaskRunConcurrencyLimitsActionsMenu } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu";
import { DataTable } from "@/components/ui/data-table";
import { SearchInput } from "@/components/ui/input";
import type { TaskRunConcurrencyLimit } from "@/hooks/task-run-concurrency-limits";
import { getRouteApi } from "@tanstack/react-router";
import {
createColumnHelper,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
type TaskRunConcurrencyLimit,
useDeleteTaskRunConcurrencyLimit,
} from "@/api/task-run-concurrency-limits";
import { Button } from "@/components/ui/button";
import {
Dialog,
Expand All @@ -8,10 +12,6 @@ import {
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import {
type TaskRunConcurrencyLimit,
useDeleteTaskRunConcurrencyLimit,
} from "@/hooks/task-run-concurrency-limits";
import { useToast } from "@/hooks/use-toast";

type TaskRunConcurrencyLimitsDeleteDialogProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
type TaskRunConcurrencyLimit,
useResetTaskRunConcurrencyLimitTag,
} from "@/api/task-run-concurrency-limits";
import { Button } from "@/components/ui/button";
import {
Dialog,
Expand All @@ -8,10 +12,6 @@ import {
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import {
type TaskRunConcurrencyLimit,
useResetTaskRunConcurrencyLimitTag,
} from "@/hooks/task-run-concurrency-limits";
import { useToast } from "@/hooks/use-toast";

type TaskRunConcurrencyLimitsResetDialogProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type TaskRunConcurrencyLimit,
useListTaskRunConcurrencyLimits,
} from "@/hooks/task-run-concurrency-limits";
} from "@/api/task-run-concurrency-limits";
import { useState } from "react";

import { TaskRunConcurrencyLimitsDataTable } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits";
import { TaskRunConcurrencyLimitsCreateDialog } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog";
import { TaskRunConcurrencyLimitsDeleteDialog } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog";
import { TaskRunConcurrencyLimitsResetDialog } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog";
import type { TaskRunConcurrencyLimit } from "@/hooks/task-run-concurrency-limits";

export type DialogState =
| { dialog: null | "create"; data: undefined }
Expand Down
2 changes: 1 addition & 1 deletion ui-v2/src/routes/automations/automation.$id.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createFileRoute } from "@tanstack/react-router";

import { buildGetAutomationQuery } from "@/hooks/automations";
import { buildGetAutomationQuery } from "@/api/automations";

export const Route = createFileRoute("/automations/automation/$id")({
component: RouteComponent,
Expand Down
2 changes: 1 addition & 1 deletion ui-v2/src/routes/automations/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildListAutomationsQuery } from "@/hooks/automations";
import { buildListAutomationsQuery } from "@/api/automations";
import { createFileRoute } from "@tanstack/react-router";

// nb: Currently there is no filtering or search params used on this page
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { buildConcurrenyLimitDetailsActiveRunsQuery } from "@/api/task-run-concurrency-limits";
import { TaskRunConcurrencyLimitPage } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page";
import { buildConcurrenyLimitDetailsActiveRunsQuery } from "@/hooks/task-run-concurrency-limits";
import { createFileRoute } from "@tanstack/react-router";
import { zodValidator } from "@tanstack/zod-adapter";
import { z } from "zod";
Expand Down
4 changes: 2 additions & 2 deletions ui-v2/src/routes/concurrency-limits/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { buildListGlobalConcurrencyLimitsQuery } from "@/api/global-concurrency-limits";
import { buildListTaskRunConcurrencyLimitsQuery } from "@/api/task-run-concurrency-limits";
import { ConcurrencyLimitsPage } from "@/components/concurrency/concurrency-limits-page";
import { buildListGlobalConcurrencyLimitsQuery } from "@/hooks/global-concurrency-limits";
import { buildListTaskRunConcurrencyLimitsQuery } from "@/hooks/task-run-concurrency-limits";
import { createFileRoute } from "@tanstack/react-router";
import { zodValidator } from "@tanstack/zod-adapter";
import { z } from "zod";
Expand Down

0 comments on commit b558313

Please sign in to comment.