mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
deployment extensibility (#7394)
* rename button and update dialog button width * make deployment resource type contributable * conflicts * fix card width hight issue * comments
This commit is contained in:
@@ -8,14 +8,14 @@ import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { DialogBase } from './dialogBase';
|
||||
import { INotebookService } from '../services/notebookService';
|
||||
import { DialogInfo } from '../interfaces';
|
||||
import { DialogInfo, instanceOfNotebookBasedDialogInfo } from '../interfaces';
|
||||
import { Validator, initializeDialog, InputComponents, setModelValues } from './modelViewUtils';
|
||||
import { Model } from './model';
|
||||
import { EOL } from 'os';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class NotebookInputDialog extends DialogBase {
|
||||
export class DeploymentInputDialog extends DialogBase {
|
||||
|
||||
private inputComponents: InputComponents = {};
|
||||
|
||||
@@ -62,10 +62,14 @@ export class NotebookInputDialog extends DialogBase {
|
||||
private onComplete(): void {
|
||||
const model: Model = new Model();
|
||||
setModelValues(this.inputComponents, model);
|
||||
model.setEnvironmentVariables();
|
||||
this.notebookService.launchNotebook(this.dialogInfo.notebook).then(() => { }, (error) => {
|
||||
vscode.window.showErrorMessage(error);
|
||||
});
|
||||
if (instanceOfNotebookBasedDialogInfo(this.dialogInfo)) {
|
||||
model.setEnvironmentVariables();
|
||||
this.notebookService.launchNotebook(this.dialogInfo.notebook).then(() => { }, (error) => {
|
||||
vscode.window.showErrorMessage(error);
|
||||
});
|
||||
} else {
|
||||
vscode.commands.executeCommand(this.dialogInfo.command, model);
|
||||
}
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { DialogInfo, FieldType, FieldInfo, SectionInfo, LabelPosition } from '../interfaces';
|
||||
import { DialogInfoBase, FieldType, FieldInfo, SectionInfo, LabelPosition } from '../interfaces';
|
||||
import { Model } from './model';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
@@ -30,7 +30,7 @@ export const DefaultInputComponentWidth = '400px';
|
||||
export const DefaultLabelComponentWidth = '200px';
|
||||
|
||||
export interface DialogContext extends CreateContext {
|
||||
dialogInfo: DialogInfo;
|
||||
dialogInfo: DialogInfoBase;
|
||||
container: azdata.window.Dialog;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { DialogBase } from './dialogBase';
|
||||
import { ResourceType, DeploymentProvider, AgreementInfo } from '../interfaces';
|
||||
import { ResourceType, AgreementInfo, DeploymentProvider } from '../interfaces';
|
||||
import { IResourceTypeService } from '../services/resourceTypeService';
|
||||
import { IToolsService } from '../services/toolsService';
|
||||
import { EOL } from 'os';
|
||||
@@ -29,7 +28,7 @@ export class ResourceTypePickerDialog extends DialogBase {
|
||||
private _agreementContainer!: azdata.DivContainer;
|
||||
private _agreementCheckboxChecked: boolean = false;
|
||||
|
||||
constructor(private extensionContext: vscode.ExtensionContext,
|
||||
constructor(
|
||||
private toolsService: IToolsService,
|
||||
private resourceTypeService: IResourceTypeService,
|
||||
resourceType: ResourceType) {
|
||||
@@ -125,13 +124,16 @@ export class ResourceTypePickerDialog extends DialogBase {
|
||||
const card = this._view.modelBuilder.card().withProperties<azdata.CardProperties>({
|
||||
cardType: azdata.CardType.VerticalButton,
|
||||
iconPath: {
|
||||
dark: this.extensionContext.asAbsolutePath(resourceType.icon.dark),
|
||||
light: this.extensionContext.asAbsolutePath(resourceType.icon.light)
|
||||
dark: resourceType.icon.dark,
|
||||
light: resourceType.icon.light
|
||||
},
|
||||
label: resourceType.displayName,
|
||||
selected: (this._selectedResourceType && this._selectedResourceType.name === resourceType.name)
|
||||
selected: (this._selectedResourceType && this._selectedResourceType.name === resourceType.name),
|
||||
width: '220px',
|
||||
height: '180px',
|
||||
iconWidth: '50px',
|
||||
iconHeight: '50px'
|
||||
}).component();
|
||||
|
||||
this._resourceTypeCards.push(card);
|
||||
this._cardResourceTypeMap.set(resourceType.name, card);
|
||||
this._toDispose.push(card.onCardSelectedChanged(() => this.selectResourceType(resourceType)));
|
||||
|
||||
Reference in New Issue
Block a user