File tree 2 files changed +28
-7
lines changed
packages/web/src/components/ui 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change
1
+ // This is the config file for https://demo.sourcebot.dev.
2
+ // To add a new repository, edit this file and open a PR.
3
+ // After the PR is merged, the deploy demo workflow will
4
+ // run (see: https://github.com/sourcebot-dev/sourcebot/actions/workflows/deploy-demo.yml),
5
+ // after which the changes will be reflected on the demo site.
1
6
{
2
7
"$schema" : " https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json" ,
3
8
"connections" : {
4
- // https://docs.sourcebot.dev/docs/connections/github
9
+ // Defines the GitHub repositories.
10
+ // See: https://docs.sourcebot.dev/docs/connections/github
5
11
"github-repos" : {
6
12
"type" : " github" ,
7
13
"token" : {
221
227
" envoyproxy/envoy"
222
228
]
223
229
},
224
- // https://docs.sourcebot.dev/docs/connections/gitlab
230
+ // Defines the GitLab repositories.
231
+ // See: https://docs.sourcebot.dev/docs/connections/gitlab
225
232
"gitlab-repos" : {
226
233
"type" : " gitlab" ,
227
- "token" : {
228
- "env" : " GITLAB_TOKEN"
229
- },
230
234
"projects" : [
231
235
" gnachman/iterm2"
232
236
]
Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ import {
22
22
import { Button } from "@/components/ui/button"
23
23
import { Input } from "@/components/ui/input"
24
24
import * as React from "react"
25
-
25
+ import { PlusIcon } from "lucide-react"
26
+ import { env } from "@/env.mjs"
26
27
27
28
interface DataTableProps < TData , TValue > {
28
29
columns : ColumnDef < TData , TValue > [ ]
@@ -60,7 +61,7 @@ export function DataTable<TData, TValue>({
60
61
61
62
return (
62
63
< div >
63
- < div className = "flex items-center py-4" >
64
+ < div className = "flex items-center justify-between py-4" >
64
65
< Input
65
66
placeholder = { searchPlaceholder }
66
67
value = { ( table . getColumn ( searchKey ) ?. getFilterValue ( ) as string ) ?? "" }
@@ -69,6 +70,22 @@ export function DataTable<TData, TValue>({
69
70
}
70
71
className = "max-w-sm"
71
72
/>
73
+ { /*
74
+ Show a button on the demo site that allows users to add new repositories
75
+ by updating the demo-site-config.json file and opening a PR.
76
+ */ }
77
+ { env . NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT === "demo" && (
78
+ < Button
79
+ variant = "default"
80
+ size = "default"
81
+ onClick = { ( ) => {
82
+ window . open ( "https://github.com/sourcebot-dev/sourcebot/edit/main/demo-site-config.json" , "_blank" ) ;
83
+ } }
84
+ >
85
+ < PlusIcon className = "w-4 h-4" />
86
+ Add repository
87
+ </ Button >
88
+ ) }
72
89
</ div >
73
90
< div className = "rounded-md border" >
74
91
< Table >
You can’t perform that action at this time.
0 commit comments