multi-level table support (#17638)

* multi-level table support

* comments

* address comments

* add period to end of sentence.
This commit is contained in:
Alan Ren
2021-11-10 17:15:08 -08:00
committed by GitHub
parent e0ad23a559
commit 1a9f2a5903
7 changed files with 164 additions and 177 deletions

View File

@@ -1104,7 +1104,7 @@ declare module 'azdata' {
}
/**
* The table designer view definition
* The table designer view definition.
*/
export interface TableDesignerView {
/**
@@ -1141,11 +1141,11 @@ declare module 'azdata' {
}
/**
* The definition of a designer tab
* The definition of a designer tab.
*/
export interface DesignerTab {
/**
* The title of the tab
* The title of the tab.
*/
title: string;
/**
@@ -1159,22 +1159,25 @@ declare module 'azdata' {
*/
export interface DesignerDataPropertyInfo {
/**
* The property name
* The property name.
*/
propertyName: string;
/**
* The description of the property
* The description of the property.
*/
description?: string;
/**
* The component type
* The component type.
*/
componentType: DesignerComponentTypeName;
/**
* The group name, properties with the same group name will be displayed under the same group on the UI.
*/
group?: string;
/**
* Whether the property should be displayed in the properties view. The default value is true.
*/
showInPropertiesView?: boolean;
/**
* The properties of the component.
*/
@@ -1196,12 +1199,12 @@ declare module 'azdata' {
columns?: string[];
/**
* The display name of the object type
* The display name of the object type.
*/
objectTypeDisplayName: string;
/**
* the properties of the table data item
* the properties of the table data item.
*/
itemProperties?: DesignerDataPropertyInfo[];
@@ -1233,15 +1236,15 @@ declare module 'azdata' {
*/
export enum DesignerEditType {
/**
* Add a row to a table
* Add a row to a table.
*/
Add = 0,
/**
* Remove a row from a table
* Remove a row from a table.
*/
Remove = 1,
/**
* Update a property
* Update a property.
*/
Update = 2
}
@@ -1251,23 +1254,35 @@ declare module 'azdata' {
*/
export interface DesignerEdit {
/**
* The edit type
* The edit type.
*/
type: DesignerEditType;
/**
* the property that was edited
* the path of the edit target.
*/
property: DesignerEditIdentifier;
path: DesignerEditPath;
/**
* the new value
* the new value.
*/
value?: any;
}
/**
* The identifier of a property. The value is string typed if the property belongs to the root object, otherwise the type of the value is an object.
* The path of the edit target.
* Below are the 3 scenarios and their expected path.
* Note: 'index-{x}' in the description below are numbers represent the index of the object in the list.
* 1. 'Add' scenario
* a. ['propertyName1']. Example: add a column to the columns property: ['columns'].
* b. ['propertyName1',index-1,'propertyName2']. Example: add a column mapping to the first foreign key: ['foreignKeys',0,'mappings'].
* 2. 'Update' scenario
* a. ['propertyName1']. Example: update the name of the table: ['name'].
* b. ['propertyName1',index-1,'propertyName2']. Example: update the name of a column: ['columns',0,'name'].
* c. ['propertyName1',index-1,'propertyName2',index-2,'propertyName3']. Example: update the source column of an entry in a foreign key's column mapping table: ['foreignKeys',0,'mappings',0,'source'].
* 3. 'Remove' scenario
* a. ['propertyName1',index-1]. Example: remove a column from the columns property: ['columns',0'].
* b. ['propertyName1',index-1,'propertyName2',index-2]. Example: remove a column mapping from a foreign key's column mapping table: ['foreignKeys',0,'mappings',0].
*/
export type DesignerEditIdentifier = string | { parentProperty: string, index: number, property: string };
export type DesignerEditPath = (string | number)[];
/**
* The result returned by the table designer provider after handling an edit request.
@@ -1284,7 +1299,7 @@ declare module 'azdata' {
/**
* Error messages of current state, and the property the caused the error.
*/
errors?: { message: string, property?: DesignerEditIdentifier }[];
errors?: { message: string, property?: DesignerEditPath }[];
}
}
}