Skip to content

Commit e7dd35b

Browse files
committed
fix build errors round 2
1 parent 84968e4 commit e7dd35b

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

packages/web/src/app/[domain]/connections/components/connectionList/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ import { Search } from "lucide-react";
1212
import { Input } from "@/components/ui/input";
1313
import { useMemo, useState } from "react";
1414
import { MultiSelect } from "@/components/ui/multi-select";
15-
import { OrgRole } from "@sourcebot/db";
1615

1716
interface ConnectionListProps {
1817
className?: string;
19-
role: OrgRole;
18+
isDisabled: boolean;
2019
}
2120

2221
const convertSyncStatus = (status: ConnectionSyncStatus) => {
@@ -38,7 +37,7 @@ const convertSyncStatus = (status: ConnectionSyncStatus) => {
3837

3938
export const ConnectionList = ({
4039
className,
41-
role,
40+
isDisabled,
4241
}: ConnectionListProps) => {
4342
const domain = useDomain();
4443
const [searchQuery, setSearchQuery] = useState("");
@@ -131,7 +130,7 @@ export const ConnectionList = ({
131130
repoId: repo.id,
132131
repoName: repo.name,
133132
}))}
134-
disabled={role !== OrgRole.OWNER}
133+
disabled={isDisabled}
135134
/>
136135
))
137136
) : (

packages/web/src/app/[domain]/connections/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { NewConnectionCard } from "./components/newConnectionCard";
44
import { getConnections, getOrgMembership } from "@/actions";
55
import { isServiceError } from "@/lib/utils";
66
import { notFound, ServiceErrorException } from "@/lib/serviceError";
7+
import { OrgRole } from "@sourcebot/db";
78

89
export default async function ConnectionsPage({ params: { domain } }: { params: { domain: string } }) {
910
const connections = await getConnections(domain);
@@ -24,7 +25,7 @@ export default async function ConnectionsPage({ params: { domain } }: { params:
2425
<div className="flex flex-col md:flex-row gap-4">
2526
<ConnectionList
2627
className="md:w-3/4"
27-
role={membership.role}
28+
isDisabled={membership.role !== OrgRole.OWNER}
2829
/>
2930
<NewConnectionCard
3031
className="md:w-1/4"

packages/web/src/app/[domain]/repos/addRepoButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { ConnectionList } from "../connections/components/connectionList"
1616
import { useDomain } from "@/hooks/useDomain"
1717
import Link from "next/link";
1818

19-
export function AddRepoButton() {
19+
export function AddRepoButton({ isAddNewRepoButtonVisible }: { isAddNewRepoButtonVisible: boolean }) {
2020
const [isOpen, setIsOpen] = useState(false)
2121
const domain = useDomain()
2222

@@ -40,7 +40,7 @@ export function AddRepoButton() {
4040
</DialogDescription>
4141
</DialogHeader>
4242
<div className="flex-1 overflow-y-auto p-6">
43-
<ConnectionList className="w-full" />
43+
<ConnectionList className="w-full" isDisabled={!isAddNewRepoButtonVisible} />
4444
</div>
4545
<DialogFooter className="flex justify-between items-center border-t p-4 px-6">
4646
<Button asChild variant="default" className="bg-primary hover:bg-primary/90">

0 commit comments

Comments
 (0)