Move protocol client out (#643)

* close

* connection is working

* formatting

* adds all

* formatting

* formatting and changing how features are initialized

* formatting

* changed named of typings file

* update

* updated to use dataprotocol npm

* formatting

* removed unneeded logging

* readd npm shrinkwrap

* still not working

* removed unnecessary codfe

* addressed comments

* readded azure resource provider

* fix capabilities cacheing

* added backwards capat for older protocol

* update shrinkwrap

* update shrinkwrap

* updated shrinkwrap

* fixed tests

* removed dead code

* remove dead code

* fix compile

* remove backcompat stuff

* change location of npm

* vbump sqltools

* merge master

* fix imports

* fix build breaks

* update for sqlops

* update yarn dependencies
This commit is contained in:
Anthony Dresser
2018-02-20 13:38:16 -08:00
committed by GitHub
parent 8a9ee40524
commit 8570910a43
159 changed files with 4421 additions and 7180 deletions

View File

@@ -11,18 +11,18 @@ import { ConnectionManagementInfo } from 'sql/parts/connection/common/connection
import { IAdminService } from 'sql/parts/admin/common/adminService';
import { ITaskDialogComponent } from 'sql/parts/tasks/common/tasks';
import data = require('data');
import * as sqlops from 'sqlops';
import * as nls from 'vs/nls';
export const CREATEDATABASE_SELECTOR: string = 'createdatabase-component';
export interface DatabaseFile {
logicalName: string;
fileType: string;
filegroup: string;
initialSize: string;
autogrow: string;
path: string;
logicalName: string;
fileType: string;
filegroup: string;
initialSize: string;
autogrow: string;
path: string;
}
@Component({
@@ -31,43 +31,43 @@ export interface DatabaseFile {
})
export class CreateDatabaseComponent implements ITaskDialogComponent {
private _adminService: IAdminService;
private _adminService: IAdminService;
public formSubmitted: boolean = false;
public formSubmitted: boolean = false;
public ownerUri: string;
public connection: ConnectionManagementInfo;
public databaseFiles: DatabaseFile[] = [];
public databaseFiles: DatabaseFile[] = [];
// tslint:disable:no-unused-variable
private readonly databaseFilesLabel: string = nls.localize('createDatabase.databaseFiles', 'Database files:');
private readonly noRecordsFoundLabel: string = nls.localize('createDatabase.noRecordsFound', 'No records found');
// tslint:enable:no-unused-variable
// tslint:disable:no-unused-variable
private readonly databaseFilesLabel: string = nls.localize('createDatabase.databaseFiles', 'Database files:');
private readonly noRecordsFoundLabel: string = nls.localize('createDatabase.noRecordsFound', 'No records found');
// tslint:enable:no-unused-variable
constructor(
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeDetectorRef: ChangeDetectorRef,
@Inject(BOOTSTRAP_SERVICE_ID) private _bootstrapService: IBootstrapService
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeDetectorRef: ChangeDetectorRef,
@Inject(BOOTSTRAP_SERVICE_ID) private _bootstrapService: IBootstrapService
) {
this._adminService = this._bootstrapService.adminService;
this._adminService = this._bootstrapService.adminService;
}
private getDatabaseInfo(form: NgForm): data.DatabaseInfo {
return <data.DatabaseInfo>{
options: {
name: form.value.databaseName,
owner: form.value.databaseOwner
}
};
}
private getDatabaseInfo(form: NgForm): sqlops.DatabaseInfo {
return <sqlops.DatabaseInfo>{
options: {
name: form.value.databaseName,
owner: form.value.databaseOwner
}
};
}
public onSubmit(form: NgForm): void {
this._adminService.createDatabase(this.ownerUri, this.getDatabaseInfo(form));
this.formSubmitted = true;
this._changeDetectorRef.detectChanges();
}
public onSubmit(form: NgForm): void {
this._adminService.createDatabase(this.ownerUri, this.getDatabaseInfo(form));
this.formSubmitted = true;
this._changeDetectorRef.detectChanges();
}
public onOk(): void { }
@@ -75,24 +75,24 @@ export class CreateDatabaseComponent implements ITaskDialogComponent {
public onCancel(): void { }
public onSelectOwner(): void { }
public onSelectOwner(): void { }
public injectBootstapper(parameters: TaskDialogComponentParams ): void {
let self = this;
this.ownerUri = parameters.ownerUri;
this._adminService.getDefaultDatabaseInfo(this.ownerUri).then(dbInfo => {
let databaseFilesCount = dbInfo.options['databaseFilesCount'];
for (let i = 0; i < databaseFilesCount; ++i) {
self.databaseFiles[i] = {
logicalName: dbInfo.options['databaseFiles.' + i + '.name'],
fileType: dbInfo.options['databaseFiles.' + i + '.databaseFileType'],
filegroup: dbInfo.options['databaseFiles.' + i + '.fileGroup'],
initialSize: dbInfo.options['databaseFiles.' + i + '.initialSize'],
autogrow: dbInfo.options['databaseFiles.' + i + '.autogrowth'],
path: dbInfo.options['databaseFiles.' + i + '.folder']
};
}
self._changeDetectorRef.detectChanges();
public injectBootstapper(parameters: TaskDialogComponentParams): void {
let self = this;
this.ownerUri = parameters.ownerUri;
this._adminService.getDefaultDatabaseInfo(this.ownerUri).then(dbInfo => {
let databaseFilesCount = dbInfo.options['databaseFilesCount'];
for (let i = 0; i < databaseFilesCount; ++i) {
self.databaseFiles[i] = {
logicalName: dbInfo.options['databaseFiles.' + i + '.name'],
fileType: dbInfo.options['databaseFiles.' + i + '.databaseFileType'],
filegroup: dbInfo.options['databaseFiles.' + i + '.fileGroup'],
initialSize: dbInfo.options['databaseFiles.' + i + '.initialSize'],
autogrow: dbInfo.options['databaseFiles.' + i + '.autogrowth'],
path: dbInfo.options['databaseFiles.' + i + '.folder']
};
}
self._changeDetectorRef.detectChanges();
});
}
}
}