Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions extensions/ql-vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extensions/ql-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@
"@types/through2": "^2.0.36",
"@types/tmp": "^0.1.0",
"@types/unzipper": "~0.10.1",
"@types/vscode": "^1.59.0",
"@types/vscode": "^1.67.0",
"@types/webpack": "^5.28.0",
"@types/webpack-env": "^1.18.0",
"@types/xml2js": "~0.4.4",
Expand Down
14 changes: 7 additions & 7 deletions extensions/ql-vscode/src/databases/ui/db-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ import { DatabasePanelCommands } from "../../common/commands";
import { App } from "../../common/app";

export interface RemoteDatabaseQuickPickItem extends QuickPickItem {
kind: string;
remoteDatabaseKind: string;
}

export interface AddListQuickPickItem extends QuickPickItem {
kind: DbListKind;
databaseKind: DbListKind;
}

export class DbPanel extends DisposableObject {
Expand Down Expand Up @@ -113,19 +113,19 @@ export class DbPanel extends DisposableObject {
) {
await this.addNewRemoteRepo(highlightedItem.parentListName);
} else {
const quickPickItems = [
const quickPickItems: RemoteDatabaseQuickPickItem[] = [
{
label: "$(repo) From a GitHub repository",
detail: "Add a variant analysis repository from GitHub",
alwaysShow: true,
kind: "repo",
remoteDatabaseKind: "repo",
},
{
label: "$(organization) All repositories of a GitHub org or owner",
detail:
"Add a variant analysis list of repositories from a GitHub organization/owner",
alwaysShow: true,
kind: "owner",
remoteDatabaseKind: "owner",
},
];
const databaseKind =
Expand All @@ -142,9 +142,9 @@ export class DbPanel extends DisposableObject {
// We set 'true' to make this a silent exception.
throw new UserCancellationException("No repository selected", true);
}
if (databaseKind.kind === "repo") {
if (databaseKind.remoteDatabaseKind === "repo") {
await this.addNewRemoteRepo();
} else if (databaseKind.kind === "owner") {
} else if (databaseKind.remoteDatabaseKind === "owner") {
await this.addNewRemoteOwner();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe("Db panel UI commands", () => {
it.skip("should add new local db list", async () => {
// Add db list
jest.spyOn(window, "showQuickPick").mockResolvedValue({
kind: DbListKind.Local,
databaseKind: DbListKind.Local,
} as AddListQuickPickItem);
jest.spyOn(window, "showInputBox").mockResolvedValue("my-list-1");
await commandManager.execute(
Expand All @@ -73,7 +73,7 @@ describe("Db panel UI commands", () => {
it("should add new remote repository", async () => {
// Add db
jest.spyOn(window, "showQuickPick").mockResolvedValue({
kind: "repo",
remoteDatabaseKind: "repo",
} as RemoteDatabaseQuickPickItem);

jest.spyOn(window, "showInputBox").mockResolvedValue("owner1/repo1");
Expand All @@ -96,7 +96,7 @@ describe("Db panel UI commands", () => {
it("should add new remote owner", async () => {
// Add owner
jest.spyOn(window, "showQuickPick").mockResolvedValue({
kind: "owner",
remoteDatabaseKind: "owner",
} as RemoteDatabaseQuickPickItem);

jest.spyOn(window, "showInputBox").mockResolvedValue("owner1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ describe("helpers", () => {
class MockEnvironmentVariableCollection
implements EnvironmentVariableCollection
{
[Symbol.iterator](): Iterator<
[variable: string, mutator: EnvironmentVariableMutator],
any,
undefined
> {
throw new Error("Method not implemented.");
}
persistent = false;
replace(_variable: string, _value: string): void {
throw new Error("Method not implemented.");
Expand Down