({
dialog: null,
data: undefined,
@@ -40,15 +44,15 @@ export const TaskRunConcurrencyView = () => {
{data.length === 0 ? (
-
+
) : (
-
)}
-
);
case "reset":
return (
- rootRoute,
-} as any);
+ id: '/work-pools',
+ path: '/work-pools',
+ getParentRoute: () => rootRoute,
+} as any)
const VariablesRoute = VariablesImport.update({
- id: "/variables",
- path: "/variables",
- getParentRoute: () => rootRoute,
-} as any);
+ id: '/variables',
+ path: '/variables',
+ getParentRoute: () => rootRoute,
+} as any)
const SettingsRoute = SettingsImport.update({
- id: "/settings",
- path: "/settings",
- getParentRoute: () => rootRoute,
-} as any);
+ id: '/settings',
+ path: '/settings',
+ getParentRoute: () => rootRoute,
+} as any)
const NotificationsRoute = NotificationsImport.update({
- id: "/notifications",
- path: "/notifications",
- getParentRoute: () => rootRoute,
-} as any);
+ id: '/notifications',
+ path: '/notifications',
+ getParentRoute: () => rootRoute,
+} as any)
const EventsRoute = EventsImport.update({
- id: "/events",
- path: "/events",
- getParentRoute: () => rootRoute,
-} as any);
+ id: '/events',
+ path: '/events',
+ getParentRoute: () => rootRoute,
+} as any)
const DashboardRoute = DashboardImport.update({
- id: "/dashboard",
- path: "/dashboard",
- getParentRoute: () => rootRoute,
-} as any);
-
-const ConcurrencyLimitsRoute = ConcurrencyLimitsImport.update({
- id: "/concurrency-limits",
- path: "/concurrency-limits",
- getParentRoute: () => rootRoute,
-} as any);
+ id: '/dashboard',
+ path: '/dashboard',
+ getParentRoute: () => rootRoute,
+} as any)
const BlocksRoute = BlocksImport.update({
- id: "/blocks",
- path: "/blocks",
- getParentRoute: () => rootRoute,
-} as any);
+ id: '/blocks',
+ path: '/blocks',
+ getParentRoute: () => rootRoute,
+} as any)
const AutomationsRoute = AutomationsImport.update({
- id: "/automations",
- path: "/automations",
- getParentRoute: () => rootRoute,
-} as any);
+ id: '/automations',
+ path: '/automations',
+ getParentRoute: () => rootRoute,
+} as any)
const IndexRoute = IndexImport.update({
- id: "/",
- path: "/",
- getParentRoute: () => rootRoute,
-} as any);
+ id: '/',
+ path: '/',
+ getParentRoute: () => rootRoute,
+} as any)
const RunsIndexRoute = RunsIndexImport.update({
id: '/runs/',
@@ -98,10 +93,10 @@ const RunsIndexRoute = RunsIndexImport.update({
} as any)
const FlowsIndexRoute = FlowsIndexImport.update({
- id: "/flows/",
- path: "/flows/",
- getParentRoute: () => rootRoute,
-} as any);
+ id: '/flows/',
+ path: '/flows/',
+ getParentRoute: () => rootRoute,
+} as any)
const DeploymentsIndexRoute = DeploymentsIndexImport.update({
id: '/deployments/',
@@ -109,6 +104,12 @@ const DeploymentsIndexRoute = DeploymentsIndexImport.update({
getParentRoute: () => rootRoute,
} as any)
+const ConcurrencyLimitsIndexRoute = ConcurrencyLimitsIndexImport.update({
+ id: '/concurrency-limits/',
+ path: '/concurrency-limits/',
+ getParentRoute: () => rootRoute,
+} as any)
+
const RunsTaskRunIdRoute = RunsTaskRunIdImport.update({
id: '/runs/task-run/$id',
path: '/runs/task-run/$id',
@@ -122,10 +123,10 @@ const RunsFlowRunIdRoute = RunsFlowRunIdImport.update({
} as any)
const FlowsFlowIdRoute = FlowsFlowIdImport.update({
- id: "/flows/flow/$id",
- path: "/flows/flow/$id",
- getParentRoute: () => rootRoute,
-} as any);
+ id: '/flows/flow/$id',
+ path: '/flows/flow/$id',
+ getParentRoute: () => rootRoute,
+} as any)
const DeploymentsDeploymentIdRoute = DeploymentsDeploymentIdImport.update({
id: '/deployments/deployment/$id',
@@ -133,6 +134,13 @@ const DeploymentsDeploymentIdRoute = DeploymentsDeploymentIdImport.update({
getParentRoute: () => rootRoute,
} as any)
+const ConcurrencyLimitsConcurrencyLimitIdRoute =
+ ConcurrencyLimitsConcurrencyLimitIdImport.update({
+ id: '/concurrency-limits/concurrency-limit/$id',
+ path: '/concurrency-limits/concurrency-limit/$id',
+ getParentRoute: () => rootRoute,
+ } as any)
+
// Populate the FileRoutesByPath interface
declare module '@tanstack/react-router' {
@@ -158,13 +166,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof BlocksImport
parentRoute: typeof rootRoute
}
- '/concurrency-limits': {
- id: '/concurrency-limits'
- path: '/concurrency-limits'
- fullPath: '/concurrency-limits'
- preLoaderRoute: typeof ConcurrencyLimitsImport
- parentRoute: typeof rootRoute
- }
'/dashboard': {
id: '/dashboard'
path: '/dashboard'
@@ -207,6 +208,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof WorkPoolsImport
parentRoute: typeof rootRoute
}
+ '/concurrency-limits/': {
+ id: '/concurrency-limits/'
+ path: '/concurrency-limits'
+ fullPath: '/concurrency-limits'
+ preLoaderRoute: typeof ConcurrencyLimitsIndexImport
+ parentRoute: typeof rootRoute
+ }
'/deployments/': {
id: '/deployments/'
path: '/deployments'
@@ -228,6 +236,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof RunsIndexImport
parentRoute: typeof rootRoute
}
+ '/concurrency-limits/concurrency-limit/$id': {
+ id: '/concurrency-limits/concurrency-limit/$id'
+ path: '/concurrency-limits/concurrency-limit/$id'
+ fullPath: '/concurrency-limits/concurrency-limit/$id'
+ preLoaderRoute: typeof ConcurrencyLimitsConcurrencyLimitIdImport
+ parentRoute: typeof rootRoute
+ }
'/deployments/deployment/$id': {
id: '/deployments/deployment/$id'
path: '/deployments/deployment/$id'
@@ -265,16 +280,17 @@ export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/automations': typeof AutomationsRoute
'/blocks': typeof BlocksRoute
- '/concurrency-limits': typeof ConcurrencyLimitsRoute
'/dashboard': typeof DashboardRoute
'/events': typeof EventsRoute
'/notifications': typeof NotificationsRoute
'/settings': typeof SettingsRoute
'/variables': typeof VariablesRoute
'/work-pools': typeof WorkPoolsRoute
+ '/concurrency-limits': typeof ConcurrencyLimitsIndexRoute
'/deployments': typeof DeploymentsIndexRoute
'/flows': typeof FlowsIndexRoute
'/runs': typeof RunsIndexRoute
+ '/concurrency-limits/concurrency-limit/$id': typeof ConcurrencyLimitsConcurrencyLimitIdRoute
'/deployments/deployment/$id': typeof DeploymentsDeploymentIdRoute
'/flows/flow/$id': typeof FlowsFlowIdRoute
'/runs/flow-run/$id': typeof RunsFlowRunIdRoute
@@ -285,16 +301,17 @@ export interface FileRoutesByTo {
'/': typeof IndexRoute
'/automations': typeof AutomationsRoute
'/blocks': typeof BlocksRoute
- '/concurrency-limits': typeof ConcurrencyLimitsRoute
'/dashboard': typeof DashboardRoute
'/events': typeof EventsRoute
'/notifications': typeof NotificationsRoute
'/settings': typeof SettingsRoute
'/variables': typeof VariablesRoute
'/work-pools': typeof WorkPoolsRoute
+ '/concurrency-limits': typeof ConcurrencyLimitsIndexRoute
'/deployments': typeof DeploymentsIndexRoute
'/flows': typeof FlowsIndexRoute
'/runs': typeof RunsIndexRoute
+ '/concurrency-limits/concurrency-limit/$id': typeof ConcurrencyLimitsConcurrencyLimitIdRoute
'/deployments/deployment/$id': typeof DeploymentsDeploymentIdRoute
'/flows/flow/$id': typeof FlowsFlowIdRoute
'/runs/flow-run/$id': typeof RunsFlowRunIdRoute
@@ -306,16 +323,17 @@ export interface FileRoutesById {
'/': typeof IndexRoute
'/automations': typeof AutomationsRoute
'/blocks': typeof BlocksRoute
- '/concurrency-limits': typeof ConcurrencyLimitsRoute
'/dashboard': typeof DashboardRoute
'/events': typeof EventsRoute
'/notifications': typeof NotificationsRoute
'/settings': typeof SettingsRoute
'/variables': typeof VariablesRoute
'/work-pools': typeof WorkPoolsRoute
+ '/concurrency-limits/': typeof ConcurrencyLimitsIndexRoute
'/deployments/': typeof DeploymentsIndexRoute
'/flows/': typeof FlowsIndexRoute
'/runs/': typeof RunsIndexRoute
+ '/concurrency-limits/concurrency-limit/$id': typeof ConcurrencyLimitsConcurrencyLimitIdRoute
'/deployments/deployment/$id': typeof DeploymentsDeploymentIdRoute
'/flows/flow/$id': typeof FlowsFlowIdRoute
'/runs/flow-run/$id': typeof RunsFlowRunIdRoute
@@ -328,16 +346,17 @@ export interface FileRouteTypes {
| '/'
| '/automations'
| '/blocks'
- | '/concurrency-limits'
| '/dashboard'
| '/events'
| '/notifications'
| '/settings'
| '/variables'
| '/work-pools'
+ | '/concurrency-limits'
| '/deployments'
| '/flows'
| '/runs'
+ | '/concurrency-limits/concurrency-limit/$id'
| '/deployments/deployment/$id'
| '/flows/flow/$id'
| '/runs/flow-run/$id'
@@ -347,16 +366,17 @@ export interface FileRouteTypes {
| '/'
| '/automations'
| '/blocks'
- | '/concurrency-limits'
| '/dashboard'
| '/events'
| '/notifications'
| '/settings'
| '/variables'
| '/work-pools'
+ | '/concurrency-limits'
| '/deployments'
| '/flows'
| '/runs'
+ | '/concurrency-limits/concurrency-limit/$id'
| '/deployments/deployment/$id'
| '/flows/flow/$id'
| '/runs/flow-run/$id'
@@ -366,16 +386,17 @@ export interface FileRouteTypes {
| '/'
| '/automations'
| '/blocks'
- | '/concurrency-limits'
| '/dashboard'
| '/events'
| '/notifications'
| '/settings'
| '/variables'
| '/work-pools'
+ | '/concurrency-limits/'
| '/deployments/'
| '/flows/'
| '/runs/'
+ | '/concurrency-limits/concurrency-limit/$id'
| '/deployments/deployment/$id'
| '/flows/flow/$id'
| '/runs/flow-run/$id'
@@ -387,16 +408,17 @@ export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
AutomationsRoute: typeof AutomationsRoute
BlocksRoute: typeof BlocksRoute
- ConcurrencyLimitsRoute: typeof ConcurrencyLimitsRoute
DashboardRoute: typeof DashboardRoute
EventsRoute: typeof EventsRoute
NotificationsRoute: typeof NotificationsRoute
SettingsRoute: typeof SettingsRoute
VariablesRoute: typeof VariablesRoute
WorkPoolsRoute: typeof WorkPoolsRoute
+ ConcurrencyLimitsIndexRoute: typeof ConcurrencyLimitsIndexRoute
DeploymentsIndexRoute: typeof DeploymentsIndexRoute
FlowsIndexRoute: typeof FlowsIndexRoute
RunsIndexRoute: typeof RunsIndexRoute
+ ConcurrencyLimitsConcurrencyLimitIdRoute: typeof ConcurrencyLimitsConcurrencyLimitIdRoute
DeploymentsDeploymentIdRoute: typeof DeploymentsDeploymentIdRoute
FlowsFlowIdRoute: typeof FlowsFlowIdRoute
RunsFlowRunIdRoute: typeof RunsFlowRunIdRoute
@@ -407,16 +429,18 @@ const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
AutomationsRoute: AutomationsRoute,
BlocksRoute: BlocksRoute,
- ConcurrencyLimitsRoute: ConcurrencyLimitsRoute,
DashboardRoute: DashboardRoute,
EventsRoute: EventsRoute,
NotificationsRoute: NotificationsRoute,
SettingsRoute: SettingsRoute,
VariablesRoute: VariablesRoute,
WorkPoolsRoute: WorkPoolsRoute,
+ ConcurrencyLimitsIndexRoute: ConcurrencyLimitsIndexRoute,
DeploymentsIndexRoute: DeploymentsIndexRoute,
FlowsIndexRoute: FlowsIndexRoute,
RunsIndexRoute: RunsIndexRoute,
+ ConcurrencyLimitsConcurrencyLimitIdRoute:
+ ConcurrencyLimitsConcurrencyLimitIdRoute,
DeploymentsDeploymentIdRoute: DeploymentsDeploymentIdRoute,
FlowsFlowIdRoute: FlowsFlowIdRoute,
RunsFlowRunIdRoute: RunsFlowRunIdRoute,
@@ -424,8 +448,8 @@ const rootRouteChildren: RootRouteChildren = {
}
export const routeTree = rootRoute
- ._addFileChildren(rootRouteChildren)
- ._addFileTypes();
+ ._addFileChildren(rootRouteChildren)
+ ._addFileTypes()
/* ROUTE_MANIFEST_START
{
@@ -436,16 +460,17 @@ export const routeTree = rootRoute
"/",
"/automations",
"/blocks",
- "/concurrency-limits",
"/dashboard",
"/events",
"/notifications",
"/settings",
"/variables",
"/work-pools",
+ "/concurrency-limits/",
"/deployments/",
"/flows/",
"/runs/",
+ "/concurrency-limits/concurrency-limit/$id",
"/deployments/deployment/$id",
"/flows/flow/$id",
"/runs/flow-run/$id",
@@ -461,9 +486,6 @@ export const routeTree = rootRoute
"/blocks": {
"filePath": "blocks.tsx"
},
- "/concurrency-limits": {
- "filePath": "concurrency-limits.tsx"
- },
"/dashboard": {
"filePath": "dashboard.tsx"
},
@@ -482,6 +504,9 @@ export const routeTree = rootRoute
"/work-pools": {
"filePath": "work-pools.tsx"
},
+ "/concurrency-limits/": {
+ "filePath": "concurrency-limits/index.tsx"
+ },
"/deployments/": {
"filePath": "deployments/index.tsx"
},
@@ -491,6 +516,9 @@ export const routeTree = rootRoute
"/runs/": {
"filePath": "runs/index.tsx"
},
+ "/concurrency-limits/concurrency-limit/$id": {
+ "filePath": "concurrency-limits/concurrency-limit.$id.tsx"
+ },
"/deployments/deployment/$id": {
"filePath": "deployments/deployment.$id.tsx"
},
diff --git a/ui-v2/src/routes/concurrency-limits/concurrency-limit.$id.tsx b/ui-v2/src/routes/concurrency-limits/concurrency-limit.$id.tsx
new file mode 100644
index 000000000000..a9b86a7e3c09
--- /dev/null
+++ b/ui-v2/src/routes/concurrency-limits/concurrency-limit.$id.tsx
@@ -0,0 +1,32 @@
+import { TaskRunConcurrencyLimitPage } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page";
+import { buildDetailTaskRunConcurrencyLimitsQuery } from "@/hooks/task-run-concurrency-limits";
+import { createFileRoute } from "@tanstack/react-router";
+import { zodSearchValidator } from "@tanstack/router-zod-adapter";
+import { z } from "zod";
+
+/**
+ * Schema for validating URL search parameters for the Task Run Concurrency Limit Details page.
+ * @property {'active-task-runs'} tab used designate which tab view to display
+ */
+const searchParams = z.object({
+ tab: z.enum(["active-task-runs"]).default("active-task-runs"),
+});
+
+export type TabOptions = z.infer["tab"];
+
+export const Route = createFileRoute(
+ "/concurrency-limits/concurrency-limit/$id",
+)({
+ validateSearch: zodSearchValidator(searchParams),
+ component: RouteComponent,
+ wrapInSuspense: true,
+ loader: ({ context, params }) =>
+ context.queryClient.ensureQueryData(
+ buildDetailTaskRunConcurrencyLimitsQuery(params.id),
+ ),
+});
+
+function RouteComponent() {
+ const { id } = Route.useParams();
+ return ;
+}
diff --git a/ui-v2/src/routes/concurrency-limits.tsx b/ui-v2/src/routes/concurrency-limits/index.tsx
similarity index 80%
rename from ui-v2/src/routes/concurrency-limits.tsx
rename to ui-v2/src/routes/concurrency-limits/index.tsx
index dd130e853cb3..16aa72dfae62 100644
--- a/ui-v2/src/routes/concurrency-limits.tsx
+++ b/ui-v2/src/routes/concurrency-limits/index.tsx
@@ -1,4 +1,4 @@
-import { ConcurrencyPage } from "@/components/concurrency/concurrency-page";
+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";
@@ -7,6 +7,7 @@ import { z } from "zod";
/**
* Schema for validating URL search parameters for the Concurrency Limits page.
+ * @property {string} search used to filter data table
* @property {'global' | 'task-run'} tab used designate which tab view to display
*/
const searchParams = z.object({
@@ -16,9 +17,9 @@ const searchParams = z.object({
export type TabOptions = z.infer["tab"];
-export const Route = createFileRoute("/concurrency-limits")({
+export const Route = createFileRoute("/concurrency-limits/")({
validateSearch: zodSearchValidator(searchParams),
- component: ConcurrencyPage,
+ component: ConcurrencyLimitsPage,
wrapInSuspense: true,
loader: ({ context }) =>
Promise.all([
diff --git a/ui-v2/src/storybook/utils/index.ts b/ui-v2/src/storybook/utils/index.ts
index e7c5c63260bc..5e4c21af28ae 100644
--- a/ui-v2/src/storybook/utils/index.ts
+++ b/ui-v2/src/storybook/utils/index.ts
@@ -5,3 +5,5 @@ export { createFakeFlow } from "./mocks/create-fake-flow";
export { createFakeFlowRun } from "./mocks/create-fake-flow-run";
export { createFakeTaskRun } from "./mocks/create-fake-task-run";
export { createFakeState } from "./mocks/create-fake-state";
+export { createFakeTaskRunConcurrencyLimit } from "./mocks/create-fake-take-run-concurrency-limit";
+export { createFakeGlobalConcurrencyLimit } from "./mocks/create-fake-global-concurrency-limit";
diff --git a/ui-v2/src/storybook/utils/mocks/create-fake-global-concurrency-limit.ts b/ui-v2/src/storybook/utils/mocks/create-fake-global-concurrency-limit.ts
new file mode 100644
index 000000000000..d32304a5f653
--- /dev/null
+++ b/ui-v2/src/storybook/utils/mocks/create-fake-global-concurrency-limit.ts
@@ -0,0 +1,19 @@
+import type { components } from "@/api/prefect";
+import { faker } from "@faker-js/faker";
+
+export const createFakeGlobalConcurrencyLimit = (
+ overrides?: Partial,
+): components["schemas"]["GlobalConcurrencyLimitResponse"] => {
+ return {
+ id: faker.string.uuid(),
+ created: faker.date.past().toISOString(),
+ updated: faker.date.past().toISOString(),
+ active: faker.datatype.boolean(),
+ name: faker.word.noun(),
+ limit: faker.number.int({ min: 0, max: 1000 }),
+ active_slots: faker.number.int({ min: 0, max: 1000 }),
+ slot_decay_per_second: faker.number.int({ min: 0, max: 1000 }),
+
+ ...overrides,
+ };
+};
diff --git a/ui-v2/src/storybook/utils/mocks/create-fake-take-run-concurrency-limit.ts b/ui-v2/src/storybook/utils/mocks/create-fake-take-run-concurrency-limit.ts
new file mode 100644
index 000000000000..043256faf356
--- /dev/null
+++ b/ui-v2/src/storybook/utils/mocks/create-fake-take-run-concurrency-limit.ts
@@ -0,0 +1,16 @@
+import type { components } from "@/api/prefect";
+import { faker } from "@faker-js/faker";
+
+export const createFakeTaskRunConcurrencyLimit = (
+ overrides?: Partial,
+): components["schemas"]["ConcurrencyLimit"] => {
+ return {
+ id: faker.string.uuid(),
+ created: faker.date.past().toISOString(),
+ updated: faker.date.past().toISOString(),
+ tag: faker.vehicle.bicycle(),
+ concurrency_limit: faker.number.int({ min: 0, max: 1000 }),
+ active_slots: [faker.string.uuid()],
+ ...overrides,
+ };
+};