Skip to content

Commit 99d1c5d

Browse files
Don't show repo examples around prebuilds (#20050)
1 parent 8192444 commit 99d1c5d

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

components/dashboard/src/components/RepositoryFinder.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ export default function RepositoryFinder({
4747
hasMore,
4848
} = useUnifiedRepositorySearch({
4949
searchString,
50-
excludeConfigurations: excludeConfigurations,
51-
onlyConfigurations: onlyConfigurations,
52-
showExamples: showExamples,
50+
excludeConfigurations,
51+
onlyConfigurations,
52+
showExamples,
5353
});
5454

5555
const authProviders = useAuthProviderDescriptions();
@@ -193,7 +193,7 @@ export default function RepositoryFinder({
193193

194194
const getElements = useCallback(
195195
(searchString: string): ComboboxElement[] => {
196-
if (isShowingExamples && searchString.length === 0) {
196+
if (isShowingExamples && searchString.length === 0 && !onlyConfigurations) {
197197
return PREDEFINED_REPOS.map((repo) => ({
198198
id: repo.url,
199199
element: <PredefinedRepositoryOption repo={repo} />,
@@ -207,19 +207,21 @@ export default function RepositoryFinder({
207207
isSelectable: true,
208208
}));
209209

210-
// Add predefined repos to end of the list.
211-
PREDEFINED_REPOS.forEach((repo) => {
212-
if (
213-
repo.url.toLowerCase().includes(searchString.toLowerCase()) ||
214-
repo.repoName.toLowerCase().includes(searchString.toLowerCase())
215-
) {
216-
result.push({
217-
id: repo.url,
218-
element: <PredefinedRepositoryOption repo={repo} />,
219-
isSelectable: true,
220-
});
221-
}
222-
});
210+
if (!onlyConfigurations) {
211+
// Add predefined repos to end of the list.
212+
PREDEFINED_REPOS.forEach((repo) => {
213+
if (
214+
repo.url.toLowerCase().includes(searchString.toLowerCase()) ||
215+
repo.repoName.toLowerCase().includes(searchString.toLowerCase())
216+
) {
217+
result.push({
218+
id: repo.url,
219+
element: <PredefinedRepositoryOption repo={repo} />,
220+
isSelectable: true,
221+
});
222+
}
223+
});
224+
}
223225

224226
if (hasMore) {
225227
result.push({

0 commit comments

Comments
 (0)