Skip to content

Commit d86d480

Browse files
authored
fix/fix build and routes (#2331)
* fix build * add more routes * implement routes * fix the routes
1 parent 0d9a846 commit d86d480

File tree

21 files changed

+497
-85
lines changed

21 files changed

+497
-85
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { createServerFn } from "@tanstack/react-start"
2+
import { testSlackWebhook } from "./drift_slack"
3+
4+
export const testSlackWebhookFn = createServerFn({method: 'POST'})
5+
.inputValidator((data : {notification_url: string}) => data)
6+
.handler(async ({ data }) => {
7+
const response : any = await testSlackWebhook(data.notification_url)
8+
return response
9+
})
10+

ui/src/api/orchestrator_serverFunctions.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { createServerFn } from "@tanstack/react-start";
22
import { Job, OrgSettings, Project, Repo } from './orchestrator_types'
3-
import { fetchRepos, testSlackWebhook } from "./orchestrator_repos";
4-
import { fetchProject, fetchProjects, getOrgSettings, updateOrgSettings, updateProject } from "./orchestrator_orgs";
3+
import { fetchRepos } from "./orchestrator_repos";
4+
import { getOrgSettings, updateOrgSettings } from "./orchestrator_orgs";
5+
import { testSlackWebhook } from "./drift_slack";
6+
import { fetchProjects, updateProject, fetchProject } from "./orchestrator_projects";
57

68
export const getOrgSettingsFn = createServerFn({method: 'GET'})
79
.inputValidator((data : {userId: string, organisationId: string}) => data)
@@ -104,12 +106,3 @@ export const switchToOrganizationFn = createServerFn({method: 'POST'})
104106
return null
105107
})
106108

107-
108-
109-
export const testSlackWebhookFn = createServerFn({method: 'POST'})
110-
.inputValidator((data : {notification_url: string}) => data)
111-
.handler(async ({ data }) => {
112-
const response : any = await testSlackWebhook(data.notification_url)
113-
return response
114-
})
115-

ui/src/components/DiggerYmlButton.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { Button } from "@/components/ui/button"
44
import { FileText } from "lucide-react"
5-
import { trackDiggerYmlAdded } from "@/lib/analytics"
65

76
interface DiggerYmlButtonProps {
87
onClick: () => void

ui/src/components/GithubConnectButton.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { Button } from "@/components/ui/button"
44
import { Github } from "lucide-react"
55

6-
import { trackConnectWithGithub } from "@/lib/analytics"
76

87
interface GithubConnectButtonProps {
98
source: 'onboarding' | 'add_connection_dialog'

ui/src/components/PRCreatedButton.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { Button } from "@/components/ui/button"
44
import { GitPullRequest } from "lucide-react"
55

6-
import { trackPRCreated } from "@/lib/analytics"
76

87
interface PRCreatedButtonProps {
98
onClick: () => void

ui/src/components/WorkflowFileButton.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { Button } from "@/components/ui/button"
44
import { CheckCircle2 } from "lucide-react"
5-
import { trackWorkflowFileAdded } from "@/lib/analytics"
65

76
interface WorkflowFileButtonProps {
87
onClick: () => void

ui/src/routeTree.gen.ts

Lines changed: 222 additions & 50 deletions
Large diffs are not rendered by default.

ui/src/routes/_authenticated/_dashboard/dashboard/drift.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { CheckCircle, AlertCircle, Save, TestTube, Clock, ArrowLeft, Slack } fro
99
import { OrgSettings } from '@/api/orchestrator_types'
1010
import { useState } from 'react'
1111
import { useToast } from '@/hooks/use-toast'
12-
import { getOrgSettingsFn, updateOrgSettingsFn, testSlackWebhookFn } from '@/api/orchestrator_serverFunctions'
12+
import { getOrgSettingsFn, updateOrgSettingsFn } from '@/api/orchestrator_serverFunctions'
13+
import { testSlackWebhookFn } from '@/api/drift_serverFunctions'
1314
import { ToastAction } from '@/components/ui/toast'
1415

1516

ui/src/routes/_authenticated/_dashboard/dashboard/projects.index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { createFileRoute, Link, useLoaderData } from '@tanstack/react-router'
22
import { getProjectsFn } from '@/api/orchestrator_serverFunctions'
33
import { updateProjectFn } from '@/api/orchestrator_serverFunctions'
4-
import { trackProjectDriftToggled } from '@/lib/analytics'
54
import { useToast } from "@/hooks/use-toast"
65
import { useState } from 'react'
76
import { Project } from '@/api/orchestrator_types'
8-
import { Dialog } from '@/components/ui/dialog'
97
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card'
108
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'
119
import { Button } from '@/components/ui/button'
@@ -35,7 +33,7 @@ function RouteComponent() {
3533
const [projectList, setProjectList] = useState<Project[]>(projects)
3634

3735
const handleDriftToggle = async (project: Project) => {
38-
trackProjectDriftToggled(user, organisationId, project.id.toString(), !project.drift_enabled ? 'enabled' : 'disabled')
36+
// trackProjectDriftToggled(user, organisationId, project.id.toString(), !project.drift_enabled ? 'enabled' : 'disabled')
3937

4038
try {
4139
// Optimistically update UI

ui/src/routes/_authenticated/_dashboard/dashboard/units.index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const Route = createFileRoute(
3232
loader: async ({ context }) => {
3333
const { user, organisationId } = context;
3434
const unitsData = await listUnitsFn({data: {organisationId: organisationId || '', userId: user?.id || '', email: user?.email || ''}})
35-
return { unitsData: unitsData, user, organisationId }
35+
return { unitsData: unitsData, user, organisationId }
3636
}
3737
})
3838

@@ -105,7 +105,7 @@ function CreateUnitModal({ onUnitCreated }: { onUnitCreated: () => void }) {
105105
</DialogHeader>
106106
<div className="py-4">
107107
<Label htmlFor="name" className="text-right">
108-
Unit Name {unitName} {user.email} {user.id} {organisationId}
108+
Unit Name
109109
</Label>
110110
<Input
111111
id="name"
@@ -187,7 +187,7 @@ function RouteComponent() {
187187
<TableCell>{formatDate(unit.updatedAt || new Date())}</TableCell>
188188
<TableCell className="text-right">
189189
<Button variant="ghost" asChild className="justify-end">
190-
<Link to={`/dashboard/units/${unit.id}`}>
190+
<Link to={`/dashboard/units/$unitId`} params={{ unitId: unit.id }}>
191191
View Details <ExternalLink className="ml-2 h-4 w-4" />
192192
</Link>
193193
</Button>

0 commit comments

Comments
 (0)