table designer new features (#18682)

* support graph tables

* ignore script compare

* ability to refresh view after edit

* reserve focus after refresh view

* primary key and default constraint

* bug fixes

* vbump sts

* comments

* update type

* fix issue
This commit is contained in:
Alan Ren
2022-03-09 14:17:01 -08:00
committed by GitHub
parent 27763c860c
commit e50bded5d1
19 changed files with 352 additions and 153 deletions

View File

@@ -1081,7 +1081,7 @@ declare module 'azdata' {
* @param table the table information
* @param tableChangeInfo the information about the change user made through the UI.
*/
processTableEdit(table: TableInfo, tableChangeInfo: DesignerEdit): Thenable<DesignerEditResult>;
processTableEdit(table: TableInfo, tableChangeInfo: DesignerEdit): Thenable<DesignerEditResult<TableDesignerView>>;
/**
* Publish the changes.
@@ -1154,14 +1154,6 @@ declare module 'azdata' {
* The initial state of the designer.
*/
viewModel: DesignerViewModel;
/**
* The supported column types
*/
columnTypes: string[];
/**
* The list of schemas in the database.
*/
schemas: string[];
}
/**
@@ -1176,7 +1168,9 @@ declare module 'azdata' {
Script = 'script',
ForeignKeys = 'foreignKeys',
CheckConstraints = 'checkConstraints',
Indexes = 'indexes'
Indexes = 'indexes',
PrimaryKeyName = 'primaryKeyName',
PrimaryKeyColumns = 'primaryKeyColumns'
}
/**
* Name of the common table column properties.
@@ -1262,6 +1256,12 @@ declare module 'azdata' {
* Default columns to display values are: Name, PrimaryKeyTable.
*/
foreignKeyTableOptions?: TableDesignerBuiltInTableViewOptions;
/**
* Foreign key column mapping table options.
* Common foreign key column mapping properties are handled by Azure Data Studio. see {@link ForeignKeyColumnMappingProperty}.
* Default columns to display values are: Column, ForeignColumn.
*/
foreignKeyColumnMappingTableOptions?: TableDesignerBuiltInTableViewOptions;
/**
* Check constraints table options.
* Common check constraint properties are handled by Azure Data Studio. see {@link TableCheckConstraintProperty}
@@ -1274,13 +1274,22 @@ declare module 'azdata' {
* Default columns to display values are: Name.
*/
indexTableOptions?: TableDesignerBuiltInTableViewOptions;
/**
* Index column specification table options.
* Common index properties are handled by Azure Data Studio. see {@link TableIndexColumnSpecificationProperty}
* Default columns to display values are: Column.
*/
indexColumnSpecificationTableOptions?: TableDesignerBuiltInTableViewOptions;
/**
* Primary column specification table options.
* Common index properties are handled by Azure Data Studio. see {@link TableIndexColumnSpecificationProperty}
* Default columns to display values are: Column.
*/
primaryKeyColumnSpecificationTableOptions?: TableDesignerBuiltInTableViewOptions;
/**
* Additional primary key properties. Common primary key properties: primaryKeyName.
*/
additionalPrimaryKeyProperties?: DesignerDataPropertyInfo[];
}
export interface TableDesignerBuiltInTableViewOptions extends DesignerTablePropertiesBase {
@@ -1371,6 +1380,14 @@ declare module 'azdata' {
* The confirmation message to be displayed when user removes a row.
*/
removeRowConfirmationMessage?: string;
/**
* Whether to show the item detail in properties view. The default value is true.
*/
showItemDetailInPropertiesView?: boolean;
/**
* The label of the add new button. The default value is 'Add New'.
*/
labelForAddNewButton?: string;
}
/**
@@ -1399,7 +1416,11 @@ declare module 'azdata' {
* The data item of the designer's table component.
*/
export interface DesignerTableComponentDataItem {
[key: string]: InputBoxProperties | CheckBoxProperties | DropDownProperties | DesignerTableProperties;
[key: string]: InputBoxProperties | CheckBoxProperties | DropDownProperties | DesignerTableProperties | boolean;
/**
* Whether the row can be deleted. The default value is true.
*/
canBeDeleted?: boolean;
}
/**
@@ -1458,7 +1479,11 @@ declare module 'azdata' {
/**
* The result returned by the table designer provider after handling an edit request.
*/
export interface DesignerEditResult {
export interface DesignerEditResult<T> {
/**
* The new view information if the view needs to be refreshed.
*/
view?: T;
/**
* The view model object.
*/
@@ -1485,6 +1510,10 @@ declare module 'azdata' {
* The new view model.
*/
viewModel: DesignerViewModel;
/**
* The new view.
*/
view: TableDesignerView;
}
}