File tree Expand file tree Collapse file tree
packages/web/src/app/[domain]
components/connectionList Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,11 +12,10 @@ import { Search } from "lucide-react";
1212import { Input } from "@/components/ui/input" ;
1313import { useMemo , useState } from "react" ;
1414import { MultiSelect } from "@/components/ui/multi-select" ;
15- import { OrgRole } from "@sourcebot/db" ;
1615
1716interface ConnectionListProps {
1817 className ?: string ;
19- role : OrgRole ;
18+ isDisabled : boolean ;
2019}
2120
2221const convertSyncStatus = ( status : ConnectionSyncStatus ) => {
@@ -38,7 +37,7 @@ const convertSyncStatus = (status: ConnectionSyncStatus) => {
3837
3938export 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 ) : (
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { NewConnectionCard } from "./components/newConnectionCard";
44import { getConnections , getOrgMembership } from "@/actions" ;
55import { isServiceError } from "@/lib/utils" ;
66import { notFound , ServiceErrorException } from "@/lib/serviceError" ;
7+ import { OrgRole } from "@sourcebot/db" ;
78
89export 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"
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import { ConnectionList } from "../connections/components/connectionList"
1616import { useDomain } from "@/hooks/useDomain"
1717import 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" >
You can’t perform that action at this time.
0 commit comments