A few table designer improvements && bump STS to .227 (#18982)

* Add unified col for data type deit

* remove seperate type setting cols and rename unified col to 'type'

* remove advanced type from properties window

* add description to col, idx, constraints

* nit

* bump STS to .227
This commit is contained in:
Hai Cao
2022-04-08 15:00:56 -07:00
committed by GitHub
parent 4191ef8aa5
commit 0738c148ca
4 changed files with 66 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
{ {
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/v{#version#}/microsoft.sqltools.servicelayer-{#fileName#}", "downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/v{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
"version": "3.0.0-release.226", "version": "3.0.0-release.227",
"downloadFileNames": { "downloadFileNames": {
"Windows_86": "win-x86-net6.0.zip", "Windows_86": "win-x86-net6.0.zip",
"Windows_64": "win-x64-net6.0.zip", "Windows_64": "win-x64-net6.0.zip",

View File

@@ -807,6 +807,7 @@ declare module 'azdata' {
CheckConstraints = 'checkConstraints', CheckConstraints = 'checkConstraints',
Indexes = 'indexes', Indexes = 'indexes',
PrimaryKeyName = 'primaryKeyName', PrimaryKeyName = 'primaryKeyName',
PrimaryKeyDescription = 'primaryKeyDescription',
PrimaryKeyColumns = 'primaryKeyColumns' PrimaryKeyColumns = 'primaryKeyColumns'
} }
/** /**
@@ -818,7 +819,9 @@ declare module 'azdata' {
DefaultValue = 'defaultValue', DefaultValue = 'defaultValue',
Length = 'length', Length = 'length',
Name = 'name', Name = 'name',
Description = 'description',
Type = 'type', Type = 'type',
AdvancedType = 'advancedType',
IsPrimaryKey = 'isPrimaryKey', IsPrimaryKey = 'isPrimaryKey',
Precision = 'precision', Precision = 'precision',
Scale = 'scale' Scale = 'scale'
@@ -830,6 +833,7 @@ declare module 'azdata' {
*/ */
export enum TableForeignKeyProperty { export enum TableForeignKeyProperty {
Name = 'name', Name = 'name',
Description = 'description',
ForeignTable = 'foreignTable', ForeignTable = 'foreignTable',
OnDeleteAction = 'onDeleteAction', OnDeleteAction = 'onDeleteAction',
OnUpdateAction = 'onUpdateAction', OnUpdateAction = 'onUpdateAction',
@@ -850,6 +854,7 @@ declare module 'azdata' {
*/ */
export enum TableCheckConstraintProperty { export enum TableCheckConstraintProperty {
Name = 'name', Name = 'name',
Description = 'description',
Expression = 'expression' Expression = 'expression'
} }
@@ -859,6 +864,7 @@ declare module 'azdata' {
*/ */
export enum TableIndexProperty { export enum TableIndexProperty {
Name = 'name', Name = 'name',
Description = 'description',
Columns = 'columns' Columns = 'columns'
} }
@@ -924,7 +930,7 @@ declare module 'azdata' {
*/ */
primaryKeyColumnSpecificationTableOptions?: TableDesignerBuiltInTableViewOptions; primaryKeyColumnSpecificationTableOptions?: TableDesignerBuiltInTableViewOptions;
/** /**
* Additional primary key properties. Common primary key properties: primaryKeyName. * Additional primary key properties. Common primary key properties: primaryKeyName, primaryKeyDescription.
*/ */
additionalPrimaryKeyProperties?: DesignerDataPropertyInfo[]; additionalPrimaryKeyProperties?: DesignerDataPropertyInfo[];
} }

View File

@@ -971,11 +971,14 @@ export namespace designers {
CheckConstraints = 'checkConstraints', CheckConstraints = 'checkConstraints',
Indexes = 'indexes', Indexes = 'indexes',
PrimaryKeyName = 'primaryKeyName', PrimaryKeyName = 'primaryKeyName',
PrimaryKeyDescription = 'primaryKeyDescription',
PrimaryKeyColumns = 'primaryKeyColumns' PrimaryKeyColumns = 'primaryKeyColumns'
} }
export enum TableColumnProperty { export enum TableColumnProperty {
Name = 'name', Name = 'name',
Description = 'description',
AdvancedType = 'advancedType',
Type = 'type', Type = 'type',
AllowNulls = 'allowNulls', AllowNulls = 'allowNulls',
DefaultValue = 'defaultValue', DefaultValue = 'defaultValue',
@@ -987,6 +990,7 @@ export namespace designers {
export enum TableForeignKeyProperty { export enum TableForeignKeyProperty {
Name = 'name', Name = 'name',
Description = 'description',
ForeignTable = 'foreignTable', ForeignTable = 'foreignTable',
OnDeleteAction = 'onDeleteAction', OnDeleteAction = 'onDeleteAction',
OnUpdateAction = 'onUpdateAction', OnUpdateAction = 'onUpdateAction',
@@ -1000,11 +1004,13 @@ export namespace designers {
export enum TableCheckConstraintProperty { export enum TableCheckConstraintProperty {
Name = 'name', Name = 'name',
Description = 'description',
Expression = 'expression' Expression = 'expression'
} }
export enum TableIndexProperty { export enum TableIndexProperty {
Name = 'name', Name = 'name',
Description = 'description',
Columns = 'columns' Columns = 'columns'
} }

View File

@@ -197,7 +197,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
reportNotificationHandle.close(); reportNotificationHandle.close();
this.updateState(this.valid, this.dirty); this.updateState(this.valid, this.dirty);
} catch (error) { } catch (error) {
this._errorMessageService.showDialog(Severity.Error, ErrorDialogTitle, localize('tableDesigner.generatePreviewReportError', "An error occured while generating preview report: {0}", error?.message ?? error)); this._errorMessageService.showDialog(Severity.Error, ErrorDialogTitle, localize('tableDesigner.generatePreviewReportError', "An error occurred while generating preview report: {0}", error?.message ?? error));
this.updateState(this.valid, this.dirty); this.updateState(this.valid, this.dirty);
this._adsTelemetryService.createErrorEvent(TelemetryView.TableDesigner, TelemetryAction.GeneratePreviewReport).withAdditionalProperties(telemetryInfo).send(); this._adsTelemetryService.createErrorEvent(TelemetryView.TableDesigner, TelemetryAction.GeneratePreviewReport).withAdditionalProperties(telemetryInfo).send();
return; return;
@@ -253,7 +253,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
this.doInitialization(result); this.doInitialization(result);
this._onInitialized.fire(); this._onInitialized.fire();
}, error => { }, error => {
this._errorMessageService.showDialog(Severity.Error, ErrorDialogTitle, localize('tableDesigner.errorInitializingTableDesigner', "An error occured while initializing the table designer: {0}", error?.message ?? error)); this._errorMessageService.showDialog(Severity.Error, ErrorDialogTitle, localize('tableDesigner.errorInitializingTableDesigner', "An error occurred while initializing the table designer: {0}", error?.message ?? error));
}); });
} }
@@ -345,6 +345,23 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
title: localize('tableDesigner.columnNameTitle', "Name"), title: localize('tableDesigner.columnNameTitle', "Name"),
width: 150 width: 150
} }
}, {
componentType: 'input',
propertyName: designers.TableColumnProperty.Description,
description: localize('designer.column.description.description', "Displays the description of the column"),
componentProperties: {
title: localize('tableDesigner.columnDescriptionTitle', "Description"),
}
}, {
componentType: 'dropdown',
propertyName: designers.TableColumnProperty.AdvancedType,
showInPropertiesView: false,
description: localize('designer.column.description.advancedType', "Displays the unified data type (including length, scale and precision) for the column"),
componentProperties: {
title: localize('tableDesigner.columnAdvancedTypeTitle', "Type"),
width: 120,
isEditable: true
}
}, { }, {
componentType: 'dropdown', componentType: 'dropdown',
propertyName: designers.TableColumnProperty.Type, propertyName: designers.TableColumnProperty.Type,
@@ -406,10 +423,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
const displayProperties = this.getTableDisplayProperties(options, [ const displayProperties = this.getTableDisplayProperties(options, [
designers.TableColumnProperty.Name, designers.TableColumnProperty.Name,
designers.TableColumnProperty.Type, designers.TableColumnProperty.AdvancedType,
designers.TableColumnProperty.Length,
designers.TableColumnProperty.Precision,
designers.TableColumnProperty.Scale,
designers.TableColumnProperty.IsPrimaryKey, designers.TableColumnProperty.IsPrimaryKey,
designers.TableColumnProperty.AllowNulls, designers.TableColumnProperty.AllowNulls,
designers.TableColumnProperty.DefaultValue, designers.TableColumnProperty.DefaultValue,
@@ -469,6 +483,14 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
width: 300 width: 300
} }
}, },
{
componentType: 'input',
propertyName: designers.TableForeignKeyProperty.Description,
description: localize('designer.foreignkey.description.description', "The description of the foreign key."),
componentProperties: {
title: localize('tableDesigner.foreignKeyDescriptionTitle', "Description"),
}
},
{ {
componentType: 'dropdown', componentType: 'dropdown',
propertyName: designers.TableForeignKeyProperty.ForeignTable, propertyName: designers.TableForeignKeyProperty.ForeignTable,
@@ -559,6 +581,15 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
componentProperties: { componentProperties: {
title: localize('tableDesigner.primaryKeyNameTitle', "Name") title: localize('tableDesigner.primaryKeyNameTitle', "Name")
} }
},
{
componentType: 'input',
propertyName: designers.TableProperty.PrimaryKeyDescription,
showInPropertiesView: false,
description: localize('designer.table.primaryKeyDescription.description', "The description of the primary key."),
componentProperties: {
title: localize('tableDesigner.primaryKeyDescriptionTitle', "Description"),
}
}); });
if (view.additionalPrimaryKeyProperties) { if (view.additionalPrimaryKeyProperties) {
view.additionalPrimaryKeyProperties.forEach(component => { view.additionalPrimaryKeyProperties.forEach(component => {
@@ -602,6 +633,13 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
title: localize('tableDesigner.checkConstraintNameTitle', "Name"), title: localize('tableDesigner.checkConstraintNameTitle', "Name"),
width: 200 width: 200
} }
}, {
componentType: 'input',
propertyName: designers.TableCheckConstraintProperty.Description,
description: localize('designer.checkConstraint.description.description', "The description of the check constraint."),
componentProperties: {
title: localize('tableDesigner.checkConstraintDescriptionTitle', "Description"),
}
}, { }, {
componentType: 'input', componentType: 'input',
propertyName: designers.TableCheckConstraintProperty.Expression, propertyName: designers.TableCheckConstraintProperty.Expression,
@@ -656,6 +694,14 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
title: localize('tableDesigner.indexName', "Name"), title: localize('tableDesigner.indexName', "Name"),
width: 200 width: 200
} }
}, {
componentType: 'input',
propertyName: designers.TableIndexProperty.Description,
description: localize('designer.index.description.description', "The description of the index."),
componentProperties: {
title: localize('tableDesigner.indexDescription', "Description"),
width: 200
}
}, { }, {
componentType: 'table', componentType: 'table',
propertyName: designers.TableIndexProperty.Columns, propertyName: designers.TableIndexProperty.Columns,