mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 01:25:36 -05:00
Strict nulls for contrib/restore and contrib/views (#12044)
* strict nulls for contrib/restore and contrib/views * remove unnecessary function * compile error
This commit is contained in:
@@ -19,7 +19,6 @@ import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser
|
||||
import { alert } from 'vs/base/browser/ui/aria/aria';
|
||||
import { IInputOptions, InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import { Delayer } from 'vs/base/common/async';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { isStringArray } from 'vs/base/common/types';
|
||||
import 'vs/css!./media/explorerWidget';
|
||||
import * as nls from 'vs/nls';
|
||||
@@ -104,7 +103,7 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
|
||||
this._register(subscriptionToDisposable(this._bootstrap.metadataService.metadata.subscribe(
|
||||
data => {
|
||||
if (data) {
|
||||
const objectData = ObjectMetadataWrapper.createFromObjectMetadata(data.objectMetadata);
|
||||
const objectData = data.objectMetadata.map(o => new ObjectMetadataWrapper(o));
|
||||
objectData.sort(ObjectMetadataWrapper.sort);
|
||||
this.updateTable(objectData);
|
||||
}
|
||||
@@ -155,7 +154,7 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
|
||||
|
||||
const currentProfile = this._bootstrap.connectionManagementService.connectionInfo.connectionProfile;
|
||||
this.updateTable(data.map(d => {
|
||||
const item = assign({}, d.options);
|
||||
const item = Object.assign({}, d.options);
|
||||
const profile = new ConnectionProfile(this.capabilitiesService, currentProfile);
|
||||
profile.databaseName = d.options[NameProperty];
|
||||
item[ConnectionProfilePropertyName] = profile;
|
||||
|
||||
@@ -17,14 +17,12 @@ export class ObjectMetadataWrapper implements ObjectMetadata {
|
||||
return `${this.schema}.${this.name}`;
|
||||
}
|
||||
|
||||
constructor(from?: ObjectMetadata) {
|
||||
if (from) {
|
||||
this.metadataType = from.metadataType;
|
||||
this.metadataTypeName = from.metadataTypeName;
|
||||
this.urn = from.urn;
|
||||
this.name = from.name;
|
||||
this.schema = from.schema;
|
||||
}
|
||||
constructor(from: ObjectMetadata) {
|
||||
this.metadataType = from.metadataType;
|
||||
this.metadataTypeName = from.metadataTypeName;
|
||||
this.urn = from.urn;
|
||||
this.name = from.name;
|
||||
this.schema = from.schema;
|
||||
}
|
||||
|
||||
public matches(other: ObjectMetadataWrapper): boolean {
|
||||
@@ -37,14 +35,6 @@ export class ObjectMetadataWrapper implements ObjectMetadata {
|
||||
&& this.name === other.name;
|
||||
}
|
||||
|
||||
public static createFromObjectMetadata(objectMetadata: ObjectMetadata[]): ObjectMetadataWrapper[] {
|
||||
if (!objectMetadata) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return objectMetadata.map(m => new ObjectMetadataWrapper(m));
|
||||
}
|
||||
|
||||
// custom sort : Table > View > Stored Procedures > Function
|
||||
public static sort(metadata1: ObjectMetadataWrapper, metadata2: ObjectMetadataWrapper): number {
|
||||
// compare the object type
|
||||
|
||||
Reference in New Issue
Block a user