Add icons for some quickpick items (#16939)

This commit is contained in:
Charles Gagnon
2021-08-30 15:32:20 -07:00
committed by GitHub
parent 05d8ad4811
commit 00da5fdcb3
6 changed files with 90 additions and 33 deletions

View File

@@ -115,6 +115,7 @@ export const selectProfileToUse = localize('selectProfileToUse', "Select publish
export const selectProfile = localize('selectProfile', "Select Profile");
export const dontUseProfile = localize('dontUseProfile', "Don't use profile");
export const browseForProfile = localize('browseForProfile', "Browse for profile");
export const browseForProfileWithIcon = `$(folder) ${browseForProfile}`;
export const chooseAction = localize('chooseAction', "Choose action");
export const chooseSqlcmdVarsToModify = localize('chooseSqlcmdVarsToModify', "Choose SQLCMD variables to modify");
export const enterNewValueForVar = (varName: string) => localize('enterNewValueForVar', "Enter new value for variable '{0}'", varName);

View File

@@ -616,8 +616,9 @@ export class AddDatabaseReferenceDialog {
}
export function getSystemDbOptions(project: Project): string[] {
const projectTargetVersion = project.getProjectTargetVersion().toLowerCase();
// only master is a valid system db reference for projects targeting Azure and DW
if (project.getProjectTargetVersion().toLowerCase().includes('azure') || project.getProjectTargetVersion().toLowerCase().includes('dw')) {
if (projectTargetVersion.includes('azure') || projectTargetVersion.includes('dw')) {
return [constants.master];
}
return [constants.master, constants.msdb];

View File

@@ -21,7 +21,7 @@ export async function getPublishDatabaseSettings(project: Project, promptForConn
// 1. Select publish settings file (optional)
// Create custom quickpick so we can control stuff like displaying the loading indicator
const quickPick = vscode.window.createQuickPick();
quickPick.items = [{ label: constants.dontUseProfile }, { label: constants.browseForProfile }];
quickPick.items = [{ label: constants.dontUseProfile }, { label: constants.browseForProfileWithIcon }];
quickPick.ignoreFocusOut = true;
quickPick.title = constants.selectProfileToUse;
const profilePicked = new Promise<PublishProfile | undefined>((resolve, reject) => {
@@ -160,8 +160,8 @@ export async function getPublishDatabaseSettings(project: Project, promptForConn
key: key
} as vscode.QuickPickItem & { key?: string, isResetAllVars?: boolean, isDone?: boolean };
});
quickPickItems.push({ label: constants.resetAllVars, isResetAllVars: true });
quickPickItems.unshift({ label: constants.done, isDone: true });
quickPickItems.push({ label: `$(refresh) ${constants.resetAllVars}`, isResetAllVars: true });
quickPickItems.unshift({ label: `$(check) ${constants.done}`, isDone: true });
const sqlCmd = await vscode.window.showQuickPick(
quickPickItems,
{ title: constants.chooseSqlcmdVarsToModify, ignoreFocusOut: true }