Skip to content

Commit

Permalink
fix(ui): add missing argument for repositoryGrep (#3226)
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung authored Sep 30, 2024
1 parent aa6b933 commit 87ba2e3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ee/tabby-ui/app/files/components/source-code-browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ type TFileMap = Record<string, TFileMapItem>
type RepositoryItem = RepositoryListQuery['repositoryList'][0]

const repositoryGrepQuery = graphql(/* GraphQL */ `
query RepositoryGrep($id: ID!, $kind: RepositoryKind!, $query: String!) {
repositoryGrep(kind: $kind, id: $id, query: $query) {
query RepositoryGrep(
$id: ID!
$kind: RepositoryKind!
$rev: String
$query: String!
) {
repositoryGrep(kind: $kind, id: $id, rev: $rev, query: $query) {
files {
path
lines {
Expand Down Expand Up @@ -461,7 +466,8 @@ const SourceCodeBrowserRenderer: React.FC<SourceCodeBrowserProps> = ({
const { repositorySpecifier } = resolveRepositoryInfoFromPath(activePath)
return fetchRepositoryGrep(
searchQuery,
repositorySpecifier ? repoMap?.[repositorySpecifier] : undefined
repositorySpecifier ? repoMap?.[repositorySpecifier] : undefined,
activeEntryInfo.rev
)
},
{
Expand Down Expand Up @@ -843,7 +849,8 @@ async function fetchEntriesFromPath(

async function fetchRepositoryGrep(
query: string,
repository: RepositoryListQuery['repositoryList'][0] | undefined
repository: RepositoryListQuery['repositoryList'][0] | undefined,
rev: string | undefined
) {
if (!repository) {
throw new Error(CodeBrowserError.REPOSITORY_NOT_FOUND)
Expand All @@ -853,6 +860,7 @@ async function fetchRepositoryGrep(
id: repository.id,
kind: repository.kind,
query,
rev,
pause: !repository
})
.toPromise()
Expand Down

0 comments on commit 87ba2e3

Please sign in to comment.