-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UI v2] feat: Starts page layout for concurrency page
- Loading branch information
1 parent
6308207
commit 037b4a9
Showing
13 changed files
with
130 additions
and
12 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
ui-v2/src/components/concurrency/concurrency-page-title.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { | ||
Breadcrumb, | ||
BreadcrumbItem, | ||
BreadcrumbList, | ||
} from "@/components/ui/breadcrumb"; | ||
|
||
export const ConcurrencyPageTitle = () => ( | ||
<Breadcrumb> | ||
<BreadcrumbList> | ||
<BreadcrumbItem className="text-xl font-semibold"> | ||
Concurrency | ||
</BreadcrumbItem> | ||
</BreadcrumbList> | ||
</Breadcrumb> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useState } from "react"; | ||
import { ConcurrencyPageTitle } from "./concurrency-page-title"; | ||
import { ConcurrencyTabs } from "./concurrency-tabs"; | ||
import { GlobalConcurrencyView } from "./global-concurrency-view"; | ||
import { TaskRunConcurrencyView } from "./task-run-concurrenct-view"; | ||
|
||
type Tab = "Global" | "Task Run"; | ||
|
||
export const ConcurrencyPage = (): JSX.Element => { | ||
// TODO: Use URL query instead | ||
const [tab, setTab] = useState<Tab>("Global"); | ||
|
||
return ( | ||
<div className="flex flex-col gap-4"> | ||
<ConcurrencyPageTitle /> | ||
<div className="flex flex-col gap-6"> | ||
<ConcurrencyTabs | ||
value={tab} | ||
onValueChange={setTab} | ||
globalView={<GlobalConcurrencyView />} | ||
taskRunView={<TaskRunConcurrencyView />} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; | ||
|
||
type Tabs = "Global" | "Task Run"; | ||
|
||
type Props = { | ||
globalView: React.ReactNode; | ||
onValueChange: (value: Tabs) => void; | ||
taskRunView: React.ReactNode; | ||
value: Tabs; | ||
}; | ||
|
||
// TODO: Move Tabs for navigation to a generic styled component | ||
|
||
export const ConcurrencyTabs = ({ | ||
globalView, | ||
onValueChange, | ||
taskRunView, | ||
value, | ||
}: Props): JSX.Element => { | ||
return ( | ||
<Tabs | ||
defaultValue="Global" | ||
className="w-[400px]" | ||
value={value} | ||
onValueChange={(value) => onValueChange(value as Tabs)} | ||
> | ||
<TabsList className="grid w-full grid-cols-2"> | ||
<TabsTrigger value="Global">Global</TabsTrigger> | ||
<TabsTrigger value="Task Run">Task Run</TabsTrigger> | ||
</TabsList> | ||
<TabsContent value="Global">{globalView}</TabsContent> | ||
<TabsContent value="Task Run">{taskRunView}</TabsContent> | ||
</Tabs> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...2/src/components/concurrency/global-concurrency-view/global-concurrency-limits-header.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Button } from "@/components/ui/button"; | ||
import { Icon } from "@/components/ui/icons"; | ||
|
||
type Props = { | ||
onAdd: () => void; | ||
}; | ||
|
||
export const GlobalConcurrencyLimitsHeader = ({ onAdd }: Props) => { | ||
return ( | ||
<div className="flex flex-row items-center gap-1"> | ||
<h2 className="text-2xl font-semibold tracking-tight"> | ||
Global Concurrency Limits | ||
</h2> | ||
<Button onClick={onAdd}> | ||
<Icon id="Plus" className="h-4 w-4" /> | ||
</Button> | ||
</div> | ||
); | ||
}; |
18 changes: 18 additions & 0 deletions
18
ui-v2/src/components/concurrency/global-concurrency-view/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { useState } from "react"; | ||
import { GlobalConcurrencyLimitsHeader } from "./global-concurrency-limits-header"; | ||
|
||
export const GlobalConcurrencyView = () => { | ||
const [showAddDialog, setShowAddDialog] = useState(false); | ||
|
||
const openAddDialog = () => setShowAddDialog(true); | ||
const closeAddDialog = () => setShowAddDialog(false); | ||
|
||
return ( | ||
<> | ||
<div className="flex flex-col gap-2"> | ||
<GlobalConcurrencyLimitsHeader onAdd={openAddDialog} /> | ||
</div> | ||
{showAddDialog && <div onClick={closeAddDialog}>TODO: DIALOG</div>} | ||
</> | ||
); | ||
}; |
3 changes: 3 additions & 0 deletions
3
ui-v2/src/components/concurrency/task-run-concurrenct-view/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const TaskRunConcurrencyView = () => { | ||
return <div>🚧🚧 Pardon our dust! 🚧🚧</div>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { createFileRoute } from "@tanstack/react-router"; | ||
|
||
import { ConcurrencyPage } from "@/components/concurrency/concurrency-page"; | ||
|
||
export const Route = createFileRoute("/concurrency-limits")({ | ||
component: RouteComponent, | ||
}); | ||
|
||
function RouteComponent() { | ||
return "🚧🚧 Pardon our dust! 🚧🚧"; | ||
return <ConcurrencyPage />; | ||
} |