Update attach database prompt - naming changes of API options (#1610)

This commit is contained in:
Neelima Potharaj 2020-07-10 17:25:59 -07:00 коммит произвёл GitHub
Родитель 55fee635e8
Коммит 1a9a30051e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -81,8 +81,12 @@ export function getExperienceQuickPicks(): IAzureQuickPickItem<Experience>[] {
return experiencesArray.map(exp => getExperienceQuickPick(exp.api));
}
export function getCosmosExperienceQuickPicks(): IAzureQuickPickItem<Experience>[] {
return cosmosExperiencesArray.map(exp => getExperienceQuickPick(exp.api));
export function getCosmosExperienceQuickPicks(attached?: boolean): IAzureQuickPickItem<Experience>[] {
if (attached) {
return cosmosExperiencesArray.map(exp => getExperienceQuickPickForAttached(exp.api));
} else {
return cosmosExperiencesArray.map(exp => getExperienceQuickPick(exp.api));
}
}
export function getExperienceQuickPick(api: API): IAzureQuickPickItem<Experience> {
@ -90,6 +94,11 @@ export function getExperienceQuickPick(api: API): IAzureQuickPickItem<Experience
return { label: exp.longName, description: exp.description, data: exp };
}
export function getExperienceQuickPickForAttached(api: API): IAzureQuickPickItem<Experience> {
const exp = getExperienceFromApi(api);
return { label: exp.shortName, description: exp.description, data: exp };
}
// Mongo is distinguished by having kind="MongoDB". All others have kind="GlobalDocumentDB"
// Table and Gremlin are distinguished from SQL by their capabilities
const CoreExperience: Experience = { api: API.Core, longName: "Core", description: "(SQL)", shortName: "SQL", kind: DBAccountKind.GlobalDocumentDB, tag: "Core (SQL)" };

Просмотреть файл

@ -118,7 +118,7 @@ export class AttachedAccountsTreeItem extends AzureParentTreeItem {
}
public async attachNewAccount(): Promise<void> {
const defaultExperiencePick = await vscode.window.showQuickPick(getCosmosExperienceQuickPicks(), { placeHolder: "Select a Database Account API...", ignoreFocusOut: true });
const defaultExperiencePick = await vscode.window.showQuickPick(getCosmosExperienceQuickPicks(true), { placeHolder: "Select a Database type...", ignoreFocusOut: true });
if (defaultExperiencePick) {
const defaultExperience = defaultExperiencePick.data;
let placeholder: string;