Update dacpac wizard to use folder icon (#14290)

* change dacpac extension to use folder icon instead of ... on buttons

* make folder icon more centered

* fix tests
This commit is contained in:
Kim Santiago
2021-02-16 12:57:13 -08:00
committed by GitHub
parent 21fae18a13
commit c84e092473
5 changed files with 11 additions and 9 deletions

View File

@@ -0,0 +1,3 @@
<svg width="17" height="17" viewBox="0 -5 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.8457 3V11C16.8457 11.1406 16.8197 11.2708 16.7676 11.3906C16.7155 11.5104 16.6426 11.6172 16.5488 11.7109C16.4603 11.7995 16.3561 11.8698 16.2363 11.9219C16.1165 11.974 15.9863 12 15.8457 12H1.8457C1.70508 12 1.57487 11.974 1.45508 11.9219C1.33529 11.8698 1.22852 11.7995 1.13477 11.7109C1.04622 11.6172 0.975911 11.5104 0.923828 11.3906C0.871745 11.2708 0.845703 11.1406 0.845703 11V1C0.845703 0.859375 0.871745 0.729167 0.923828 0.609375C0.975911 0.489583 1.04622 0.385417 1.13477 0.296875C1.22852 0.203125 1.33529 0.130208 1.45508 0.078125C1.57487 0.0260417 1.70508 0 1.8457 0H7.5957C7.78841 0 7.9681 0.0364583 8.13477 0.109375C8.30143 0.177083 8.45247 0.270833 8.58789 0.390625C8.72852 0.505208 8.85352 0.638021 8.96289 0.789062C9.07747 0.934896 9.18164 1.08594 9.27539 1.24219C9.3431 1.36198 9.4082 1.46875 9.4707 1.5625C9.53841 1.65625 9.61133 1.73698 9.68945 1.80469C9.77279 1.86719 9.86393 1.91667 9.96289 1.95312C10.0671 1.98438 10.1947 2 10.3457 2H15.8457C15.9863 2 16.1165 2.02604 16.2363 2.07812C16.3561 2.13021 16.4603 2.20312 16.5488 2.29688C16.6426 2.38542 16.7155 2.48958 16.7676 2.60938C16.8197 2.72917 16.8457 2.85938 16.8457 3ZM7.5957 1H1.8457V3H7.5957C7.73633 3 7.85352 2.97656 7.94727 2.92969C8.04622 2.88281 8.13737 2.82552 8.2207 2.75781C8.30924 2.6901 8.39779 2.61719 8.48633 2.53906C8.57487 2.45573 8.67643 2.38281 8.79102 2.32031C8.71289 2.23177 8.62956 2.11458 8.54102 1.96875C8.45768 1.81771 8.36654 1.67188 8.26758 1.53125C8.16862 1.38542 8.06185 1.26042 7.94727 1.15625C7.83789 1.05208 7.7207 1 7.5957 1ZM15.8457 11V3H10.3457C10.054 3 9.81706 3.02604 9.63477 3.07812C9.45768 3.125 9.30664 3.1849 9.18164 3.25781C9.06185 3.33073 8.95768 3.41146 8.86914 3.5C8.7806 3.58854 8.68164 3.66927 8.57227 3.74219C8.4681 3.8151 8.34049 3.8776 8.18945 3.92969C8.03841 3.97656 7.84049 4 7.5957 4H1.8457V11H15.8457Z" fill="#0078D4"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -8,7 +8,7 @@ import * as vscode from 'vscode';
import { DataTierApplicationWizard } from './wizard/dataTierApplicationWizard';
export async function activate(context: vscode.ExtensionContext) {
vscode.commands.registerCommand('dacFx.start', (profile: azdata.IConnectionProfile, ...args: any[]) => new DataTierApplicationWizard().start(profile, args));
vscode.commands.registerCommand('dacFx.start', (profile: azdata.IConnectionProfile) => new DataTierApplicationWizard(undefined, context).start(profile));
}
export function deactivate(): void {

View File

@@ -118,15 +118,13 @@ export function createViewContext(): ViewTestContext {
let buttonBuilder: azdata.ComponentBuilder<azdata.ButtonComponent, azdata.ButtonProperties> = {
component: () => button,
withProperties: (properties: any) => {
if ((properties as any).label === '•••') {
button.label = '•••';
if ((properties as any).title === loc.selectFile) {
button.onDidClick = fileButtonOnClick.event;
}
return buttonBuilder;
},
withProps: (properties) => {
if ((properties as any).label === '•••') {
button.label = '•••';
if ((properties as any).title === loc.selectFile) {
button.onDidClick = fileButtonOnClick.event;
}
return buttonBuilder;

View File

@@ -182,10 +182,9 @@ export abstract class DacFxConfigPage extends BasePage {
this.fileTextBox.ariaLabel = loc.fileLocation;
this.fileButton = this.view.modelBuilder.button().withProps({
label: '•••',
title: loc.selectFile,
ariaLabel: loc.selectFile,
secondary: true
iconPath: path.join(this.instance.extensionContextExtensionPath, 'images', 'folder.svg'),
}).component();
}

View File

@@ -85,13 +85,15 @@ export class DataTierApplicationWizard {
public model: DacFxDataModel;
public pages: Map<string, Page> = new Map<string, Page>();
public selectedOperation: Operation;
public extensionContextExtensionPath: string;
constructor(dacfxInputService?: mssql.IDacFxService) {
constructor(dacfxInputService?: mssql.IDacFxService, extensionContext?: vscode.ExtensionContext) {
this.wizard = azdata.window.createWizard(loc.wizardTitle, 'Data Tier Application Wizard');
this.dacfxService = dacfxInputService;
this.extensionContextExtensionPath = extensionContext?.extensionPath ?? '';
}
public async start(p: any, ...args: any[]): Promise<boolean> {
public async start(p: any): Promise<boolean> {
this.model = <DacFxDataModel>{};
let profile = p ? <azdata.IConnectionProfile>p.connectionProfile : undefined;