Skip to content

Commit 6f87a7a

Browse files
Repository finder & context parsing improvements (#20296)
1 parent 3e62b4e commit 6f87a7a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

components/dashboard/src/components/podkit/combobox/Combobox.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,14 @@ export const Combobox: FunctionComponent<ComboboxProps> = ({
8484

8585
const setActiveElement = useCallback(
8686
(element: string) => {
87+
if (!filteredOptions.find((el) => element === el.id)?.isSelectable) {
88+
return;
89+
}
8790
setSelectedElementTemp(element);
8891
const el = document.getElementById(element);
8992
el?.scrollIntoView({ block: "nearest" });
9093
},
91-
[setSelectedElementTemp],
94+
[filteredOptions],
9295
);
9396

9497
const handleOpenChange = useCallback(

components/server/src/workspace/context-parser-service.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { IPrefixContextParser, IContextParser } from "./context-parser";
1111
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing";
1212
import { ConfigProvider } from "./config-provider";
1313
import { InvalidGitpodYMLError } from "@gitpod/public-api-common/lib/public-api-errors";
14+
import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error";
1415

1516
@injectable()
1617
export class ContextParser {
@@ -83,7 +84,10 @@ export class ContextParser {
8384
}
8485
}
8586
if (!result) {
86-
throw new Error(`Couldn't parse context '${nonPrefixedContextURL}'.`);
87+
throw new ApplicationError(
88+
ErrorCodes.BAD_REQUEST,
89+
`Couldn't parse context '${nonPrefixedContextURL}'.`,
90+
);
8791
}
8892

8993
// TODO: Make the parsers return the context with normalizedContextURL set

0 commit comments

Comments
 (0)