Rename remote to variant analysis
This commit is contained in:
Родитель
611f6e39e0
Коммит
fe17f61b5e
|
@ -146,7 +146,7 @@ export class DbConfigStore extends DisposableObject {
|
|||
parentList?: string,
|
||||
): Promise<void> {
|
||||
if (!this.config) {
|
||||
throw Error("Cannot add remote repo if config is not loaded");
|
||||
throw Error("Cannot add variant analysis repo if config is not loaded");
|
||||
}
|
||||
|
||||
if (repoNwo === "") {
|
||||
|
@ -155,7 +155,7 @@ export class DbConfigStore extends DisposableObject {
|
|||
|
||||
if (this.doesRemoteDbExist(repoNwo)) {
|
||||
throw Error(
|
||||
`A remote repository with the name '${repoNwo}' already exists`,
|
||||
`A variant analysis repository with the name '${repoNwo}' already exists`,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ export class DbConfigStore extends DisposableObject {
|
|||
|
||||
public async addRemoteOwner(owner: string): Promise<void> {
|
||||
if (!this.config) {
|
||||
throw Error("Cannot add remote owner if config is not loaded");
|
||||
throw Error("Cannot add owner if config is not loaded");
|
||||
}
|
||||
|
||||
if (owner === "") {
|
||||
|
@ -185,7 +185,7 @@ export class DbConfigStore extends DisposableObject {
|
|||
}
|
||||
|
||||
if (this.doesRemoteOwnerExist(owner)) {
|
||||
throw Error(`A remote owner with the name '${owner}' already exists`);
|
||||
throw Error(`An owner with the name '${owner}' already exists`);
|
||||
}
|
||||
|
||||
const config = cloneDbConfig(this.config);
|
||||
|
@ -212,7 +212,7 @@ export class DbConfigStore extends DisposableObject {
|
|||
|
||||
public async addRemoteList(listName: string): Promise<void> {
|
||||
if (!this.config) {
|
||||
throw Error("Cannot add remote list if config is not loaded");
|
||||
throw Error("Cannot add variant analysis list if config is not loaded");
|
||||
}
|
||||
|
||||
this.validateRemoteListName(listName);
|
||||
|
@ -250,7 +250,9 @@ export class DbConfigStore extends DisposableObject {
|
|||
newName: string,
|
||||
) {
|
||||
if (!this.config) {
|
||||
throw Error("Cannot rename remote list if config is not loaded");
|
||||
throw Error(
|
||||
"Cannot rename variant analysis list if config is not loaded",
|
||||
);
|
||||
}
|
||||
|
||||
this.validateRemoteListName(newName);
|
||||
|
@ -287,7 +289,9 @@ export class DbConfigStore extends DisposableObject {
|
|||
|
||||
public doesRemoteListExist(listName: string): boolean {
|
||||
if (!this.config) {
|
||||
throw Error("Cannot check remote list existence if config is not loaded");
|
||||
throw Error(
|
||||
"Cannot check variant analysis list existence if config is not loaded",
|
||||
);
|
||||
}
|
||||
|
||||
return this.config.databases.variantAnalysis.repositoryLists.some(
|
||||
|
@ -306,7 +310,7 @@ export class DbConfigStore extends DisposableObject {
|
|||
public doesLocalDbExist(dbName: string, listName?: string): boolean {
|
||||
if (!this.config) {
|
||||
throw Error(
|
||||
"Cannot check remote database existence if config is not loaded",
|
||||
"Cannot check variant analysis repository existence if config is not loaded",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -323,7 +327,7 @@ export class DbConfigStore extends DisposableObject {
|
|||
public doesRemoteDbExist(dbName: string, listName?: string): boolean {
|
||||
if (!this.config) {
|
||||
throw Error(
|
||||
"Cannot check remote database existence if config is not loaded",
|
||||
"Cannot check variant analysis repository existence if config is not loaded",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -338,9 +342,7 @@ export class DbConfigStore extends DisposableObject {
|
|||
|
||||
public doesRemoteOwnerExist(owner: string): boolean {
|
||||
if (!this.config) {
|
||||
throw Error(
|
||||
"Cannot check remote owner existence if config is not loaded",
|
||||
);
|
||||
throw Error("Cannot check owner existence if config is not loaded");
|
||||
}
|
||||
|
||||
return this.config.databases.variantAnalysis.owners.includes(owner);
|
||||
|
@ -482,7 +484,9 @@ export class DbConfigStore extends DisposableObject {
|
|||
}
|
||||
|
||||
if (this.doesRemoteListExist(listName)) {
|
||||
throw Error(`A remote list with the name '${listName}' already exists`);
|
||||
throw Error(
|
||||
`A variant analysis list with the name '${listName}' already exists`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -381,7 +381,7 @@ function getRemoteList(
|
|||
);
|
||||
|
||||
if (!list) {
|
||||
throw Error(`Cannot find remote list '${listName}'`);
|
||||
throw Error(`Cannot find variant analysis list '${listName}'`);
|
||||
}
|
||||
|
||||
return list;
|
||||
|
|
|
@ -135,14 +135,14 @@ export class DbPanel extends DisposableObject {
|
|||
const quickPickItems = [
|
||||
{
|
||||
label: "$(repo) From a GitHub repository",
|
||||
detail: "Add a remote repository from GitHub",
|
||||
detail: "Add a variant analysis repository from GitHub",
|
||||
alwaysShow: true,
|
||||
kind: "repo",
|
||||
},
|
||||
{
|
||||
label: "$(organization) All repositories of a GitHub org or owner",
|
||||
detail:
|
||||
"Add a remote list of repositories from a GitHub organization/owner",
|
||||
"Add a variant analysis list of repositories from a GitHub organization/owner",
|
||||
alwaysShow: true,
|
||||
kind: "owner",
|
||||
},
|
||||
|
@ -151,7 +151,7 @@ export class DbPanel extends DisposableObject {
|
|||
await window.showQuickPick<RemoteDatabaseQuickPickItem>(
|
||||
quickPickItems,
|
||||
{
|
||||
title: "Add a remote repository",
|
||||
title: "Add a variant analysis repository",
|
||||
placeHolder: "Select an option",
|
||||
ignoreFocusOut: true,
|
||||
},
|
||||
|
@ -171,7 +171,7 @@ export class DbPanel extends DisposableObject {
|
|||
|
||||
private async addNewRemoteRepo(parentList?: string): Promise<void> {
|
||||
const repoName = await window.showInputBox({
|
||||
title: "Add a remote repository",
|
||||
title: "Add a repository",
|
||||
prompt: "Insert a GitHub repository URL or name with owner",
|
||||
placeHolder: "github.com/<owner>/<repo> or <owner>/<repo>",
|
||||
});
|
||||
|
@ -246,8 +246,8 @@ export class DbPanel extends DisposableObject {
|
|||
} else {
|
||||
const quickPickItems = [
|
||||
{
|
||||
label: "$(cloud) Remote",
|
||||
detail: "Add a remote database from GitHub",
|
||||
label: "$(cloud) Variant Analysis",
|
||||
detail: "Add a repository from GitHub",
|
||||
alwaysShow: true,
|
||||
kind: DbListKind.Remote,
|
||||
},
|
||||
|
@ -419,7 +419,7 @@ export class DbPanel extends DisposableObject {
|
|||
const githubUrl = getGitHubUrl(treeViewItem.dbItem);
|
||||
if (!githubUrl) {
|
||||
throw new Error(
|
||||
"Unable to open on GitHub. Please select a remote repository or owner.",
|
||||
"Unable to open on GitHub. Please select a variant analysis repository or owner.",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -482,7 +482,9 @@ describe("db config store", () => {
|
|||
});
|
||||
await expect(
|
||||
configStore.renameRemoteList(currentDbItem, "list2"),
|
||||
).rejects.toThrow(`A remote list with the name 'list2' already exists`);
|
||||
).rejects.toThrow(
|
||||
`A variant analysis list with the name 'list2' already exists`,
|
||||
);
|
||||
|
||||
configStore.dispose();
|
||||
});
|
||||
|
|
|
@ -715,7 +715,9 @@ describe("db panel", () => {
|
|||
await expect(
|
||||
dbManager.addNewList(DbListKind.Remote, "my-list-1"),
|
||||
).rejects.toThrow(
|
||||
new Error("A remote list with the name 'my-list-1' already exists"),
|
||||
new Error(
|
||||
"A variant analysis list with the name 'my-list-1' already exists",
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -738,7 +740,7 @@ describe("db panel", () => {
|
|||
|
||||
await expect(dbManager.addNewRemoteRepo("owner1/repo1")).rejects.toThrow(
|
||||
new Error(
|
||||
"A remote repository with the name 'owner1/repo1' already exists",
|
||||
"A variant analysis repository with the name 'owner1/repo1' already exists",
|
||||
),
|
||||
);
|
||||
});
|
||||
|
@ -761,7 +763,7 @@ describe("db panel", () => {
|
|||
await saveDbConfig(dbConfig);
|
||||
|
||||
await expect(dbManager.addNewRemoteOwner("owner1")).rejects.toThrow(
|
||||
new Error("A remote owner with the name 'owner1' already exists"),
|
||||
new Error("An owner with the name 'owner1' already exists"),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче