File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed
packages/web/src/components/ui Expand file tree Collapse file tree 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.
16{
27 "$schema" : " https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json" ,
38 "connections" : {
4- // https://docs.sourcebot.dev/docs/connections/github
9+ // Defines the GitHub repositories.
10+ // See: https://docs.sourcebot.dev/docs/connections/github
511 "github-repos" : {
612 "type" : " github" ,
713 "token" : {
221227 " envoyproxy/envoy"
222228 ]
223229 },
224- // https://docs.sourcebot.dev/docs/connections/gitlab
230+ // Defines the GitLab repositories.
231+ // See: https://docs.sourcebot.dev/docs/connections/gitlab
225232 "gitlab-repos" : {
226233 "type" : " gitlab" ,
227- "token" : {
228- "env" : " GITLAB_TOKEN"
229- },
230234 "projects" : [
231235 " gnachman/iterm2"
232236 ]
Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ import {
2222import { Button } from "@/components/ui/button"
2323import { Input } from "@/components/ui/input"
2424import * as React from "react"
25-
25+ import { PlusIcon } from "lucide-react"
26+ import { env } from "@/env.mjs"
2627
2728interface DataTableProps < TData , TValue > {
2829 columns : ColumnDef < TData , TValue > [ ]
@@ -60,7 +61,7 @@ export function DataTable<TData, TValue>({
6061
6162 return (
6263 < div >
63- < div className = "flex items-center py-4" >
64+ < div className = "flex items-center justify-between py-4" >
6465 < Input
6566 placeholder = { searchPlaceholder }
6667 value = { ( table . getColumn ( searchKey ) ?. getFilterValue ( ) as string ) ?? "" }
@@ -69,6 +70,22 @@ export function DataTable<TData, TValue>({
6970 }
7071 className = "max-w-sm"
7172 />
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+ ) }
7289 </ div >
7390 < div className = "rounded-md border" >
7491 < Table >
You can’t perform that action at this time.
0 commit comments