mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
misc fixes in dialogs (#1942)
* misc fixes in dialogs * removed unused import
This commit is contained in:
@@ -30,6 +30,7 @@ export class JobStepDialog {
|
|||||||
private readonly PreviousButtonText: string = localize('jobStepDialog.previous','Previous');
|
private readonly PreviousButtonText: string = localize('jobStepDialog.previous','Previous');
|
||||||
private readonly SuccessfulParseText: string = localize('jobStepDialog.successParse', 'The command was successfully parsed.');
|
private readonly SuccessfulParseText: string = localize('jobStepDialog.successParse', 'The command was successfully parsed.');
|
||||||
private readonly FailureParseText: string = localize('jobStepDialog.failParse', 'The command failed.');
|
private readonly FailureParseText: string = localize('jobStepDialog.failParse', 'The command failed.');
|
||||||
|
private readonly BlankStepNameErrorText: string = localize('jobStepDialog.blankStepName', 'The step name cannot be left blank');
|
||||||
|
|
||||||
// General Control Titles
|
// General Control Titles
|
||||||
private readonly StepNameLabelString: string = localize('jobStepDialog.stepNameLabel', 'Step Name');
|
private readonly StepNameLabelString: string = localize('jobStepDialog.stepNameLabel', 'Step Name');
|
||||||
@@ -139,12 +140,15 @@ export class JobStepDialog {
|
|||||||
this.openButton = view.modelBuilder.button()
|
this.openButton = view.modelBuilder.button()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
label: this.OpenCommandText,
|
label: this.OpenCommandText,
|
||||||
width: '80px'
|
width: '80px',
|
||||||
|
isFile: true
|
||||||
}).component();
|
}).component();
|
||||||
|
this.openButton.enabled = false;
|
||||||
this.parseButton = view.modelBuilder.button()
|
this.parseButton = view.modelBuilder.button()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
label: this.ParseCommandText,
|
label: this.ParseCommandText,
|
||||||
width: '80px'
|
width: '80px',
|
||||||
|
isFile: false
|
||||||
}).component();
|
}).component();
|
||||||
this.parseButton.onDidClick(e => {
|
this.parseButton.onDidClick(e => {
|
||||||
if (this.commandTextBox.value) {
|
if (this.commandTextBox.value) {
|
||||||
@@ -185,6 +189,12 @@ export class JobStepDialog {
|
|||||||
.withProperties({
|
.withProperties({
|
||||||
}).component();
|
}).component();
|
||||||
this.nameTextBox.required = true;
|
this.nameTextBox.required = true;
|
||||||
|
this.nameTextBox.onTextChanged(() => {
|
||||||
|
if (this.nameTextBox.value.length > 0) {
|
||||||
|
this.dialog.message = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.typeDropdown = view.modelBuilder.dropDown()
|
this.typeDropdown = view.modelBuilder.dropDown()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
value: this.TSQLScript,
|
value: this.TSQLScript,
|
||||||
@@ -465,7 +475,12 @@ export class JobStepDialog {
|
|||||||
return outputFileForm;
|
return outputFileForm;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async execute() {
|
protected execute() {
|
||||||
|
this.model.stepName = this.nameTextBox.value;
|
||||||
|
if (!this.model.stepName || this.model.stepName.length === 0) {
|
||||||
|
this.dialog.message = this.dialog.message = { text: this.BlankStepNameErrorText };
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.model.jobName = this.jobName;
|
this.model.jobName = this.jobName;
|
||||||
this.model.id = this.stepId;
|
this.model.id = this.stepId;
|
||||||
this.model.server = this.server;
|
this.model.server = this.server;
|
||||||
@@ -479,7 +494,6 @@ export class JobStepDialog {
|
|||||||
this.model.failureAction = this.failureActionDropdown.value as string;
|
this.model.failureAction = this.failureActionDropdown.value as string;
|
||||||
this.model.outputFileName = this.outputFileNameBox.value;
|
this.model.outputFileName = this.outputFileNameBox.value;
|
||||||
this.model.appendToLogFile = this.appendToExistingFileCheckbox.checked;
|
this.model.appendToLogFile = this.appendToExistingFileCheckbox.checked;
|
||||||
await this.model.save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async openNewStepDialog() {
|
public async openNewStepDialog() {
|
||||||
|
|||||||
@@ -658,7 +658,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#0.1.9",
|
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#0.2.0",
|
||||||
"opener": "^1.4.3",
|
"opener": "^1.4.3",
|
||||||
"service-downloader": "github:anthonydresser/service-downloader#0.1.2",
|
"service-downloader": "github:anthonydresser/service-downloader#0.1.2",
|
||||||
"vscode-extension-telemetry": "^0.0.15"
|
"vscode-extension-telemetry": "^0.0.15"
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
import 'vs/css!./button';
|
import 'vs/css!./button';
|
||||||
import {
|
import {
|
||||||
Component, Input, Inject, ChangeDetectorRef, forwardRef, ComponentFactoryResolver,
|
Component, Input, Inject, ChangeDetectorRef, forwardRef,
|
||||||
ViewChild, ViewChildren, ElementRef, Injector, OnDestroy, QueryList, AfterViewInit
|
ViewChild, ElementRef, OnDestroy, AfterViewInit
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
@@ -24,7 +24,13 @@ import { Color } from 'vs/base/common/color';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'modelview-button',
|
selector: 'modelview-button',
|
||||||
template: `
|
template: `
|
||||||
<div #input style="width: 100%"></div>
|
<div>
|
||||||
|
<label for={{this.label}}>
|
||||||
|
<div #input style="width: 100%">
|
||||||
|
<input *ngIf="this.isFile === true" id={{this.label}} type="file" style="display: none">
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export default class ButtonComponent extends ComponentWithIconBase implements IComponent, OnDestroy, AfterViewInit {
|
export default class ButtonComponent extends ComponentWithIconBase implements IComponent, OnDestroy, AfterViewInit {
|
||||||
@@ -119,9 +125,19 @@ export default class ButtonComponent extends ComponentWithIconBase implements IC
|
|||||||
this.setPropertyFromUI<sqlops.ButtonProperties, string>(this.setValueProperties, newValue);
|
this.setPropertyFromUI<sqlops.ButtonProperties, string>(this.setValueProperties, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private get isFile(): boolean {
|
||||||
|
return this.getPropertyOrDefault<sqlops.ButtonProperties, boolean>((props) => props.isFile, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private set isFile(newValue: boolean) {
|
||||||
|
this.setPropertyFromUI<sqlops.ButtonProperties, boolean>(this.setFileProperties, newValue);
|
||||||
|
}
|
||||||
|
|
||||||
private setValueProperties(properties: sqlops.ButtonProperties, label: string): void {
|
private setValueProperties(properties: sqlops.ButtonProperties, label: string): void {
|
||||||
properties.label = label;
|
properties.label = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private setFileProperties(properties: sqlops.ButtonProperties, isFile: boolean): void {
|
||||||
|
properties.isFile = isFile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
|
|||||||
template: `
|
template: `
|
||||||
|
|
||||||
<div [style.width]="getWidth()">
|
<div [style.width]="getWidth()">
|
||||||
<div [style.display]="getEditableDisplay()" #editableDropDown style="width: 100%;"></div>
|
<div [style.display]="getEditableDisplay()" #editableDropDown style="width: 100%;"></div>
|
||||||
<div [style.display]="getNotEditableDisplay()" #dropDown style="width: 100%;"></div>
|
<div [style.display]="getNotEditableDisplay()" #dropDown style="width: 100%;"></div>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
@@ -79,7 +79,6 @@ export default class DropDownComponent extends ComponentBase implements ICompone
|
|||||||
this._selectBox = new SelectBox(this.getValues(), this.getSelectedValue(), this.contextViewService, this._dropDownContainer.nativeElement);
|
this._selectBox = new SelectBox(this.getValues(), this.getSelectedValue(), this.contextViewService, this._dropDownContainer.nativeElement);
|
||||||
this._selectBox.render(this._dropDownContainer.nativeElement);
|
this._selectBox.render(this._dropDownContainer.nativeElement);
|
||||||
this._register(this._selectBox);
|
this._register(this._selectBox);
|
||||||
|
|
||||||
this._register(attachSelectBoxStyler(this._selectBox, this.themeService));
|
this._register(attachSelectBoxStyler(this._selectBox, this.themeService));
|
||||||
this._register(this._selectBox.onDidSelect(e => {
|
this._register(this._selectBox.onDidSelect(e => {
|
||||||
if (!this.editable) {
|
if (!this.editable) {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Component, Input, Inject, ChangeDetectorRef, forwardRef, ComponentFactoryResolver,
|
Component, Input, Inject, ChangeDetectorRef, forwardRef,
|
||||||
ViewChild, ViewChildren, ElementRef, Injector, OnDestroy, QueryList, AfterViewInit
|
ViewChild, ElementRef, OnDestroy, AfterViewInit
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
|
|||||||
1
src/sql/sqlops.proposed.d.ts
vendored
1
src/sql/sqlops.proposed.d.ts
vendored
@@ -436,6 +436,7 @@ declare module 'sqlops' {
|
|||||||
|
|
||||||
export interface ButtonProperties extends ComponentProperties, ComponentWithIcon {
|
export interface ButtonProperties extends ComponentProperties, ComponentWithIcon {
|
||||||
label?: string;
|
label?: string;
|
||||||
|
isFile?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LoadingComponentProperties {
|
export interface LoadingComponentProperties {
|
||||||
|
|||||||
Reference in New Issue
Block a user