enable table designer for table script in sql database project (#19237)

* add 'open in designer' to context menu of tables in sql projects

* fix tests

* Address comments

* enable table designer for sql database proj

* update label and issues on init

* vbump sts

* use promisified fs

* pr comments

Co-authored-by: Alan Ren <alanren@microsoft.com>
This commit is contained in:
Kim Santiago
2022-06-02 10:27:47 -10:00
committed by GitHub
parent d3c474162d
commit 1bbf5a78c1
16 changed files with 219 additions and 118 deletions

View File

@@ -735,29 +735,21 @@ declare module 'azdata' {
*/
export interface TableInfo {
/**
* The server name.
* Used as the table designer editor's tab header text.
*/
server: string;
title: string;
/**
* The database name
* Used as the table designer editor's tab header hover text.
*/
database: string;
/**
* The schema name, only required for existing table.
*/
schema?: string;
/**
* The table name, only required for existing table.
*/
name?: string;
/**
* A boolean value indicates whether a new table is being designed.
*/
isNewTable: boolean;
tooltip: string;
/**
* Unique identifier of the table. Will be used to decide whether a designer is already opened for the table.
*/
id: string;
/**
* A boolean value indicates whether a new table is being designed.
*/
isNewTable: boolean;
/**
* Extension can store additional information that the provider needs to uniquely identify a table.
*/
@@ -781,6 +773,14 @@ declare module 'azdata' {
* The initial state of the designer.
*/
viewModel: DesignerViewModel;
/**
* The new table info after initialization.
*/
tableInfo: TableInfo;
/**
* The issues.
*/
issues?: DesignerIssue[];
}
/**
@@ -933,6 +933,10 @@ declare module 'azdata' {
* Additional primary key properties. Common primary key properties: primaryKeyName, primaryKeyDescription.
*/
additionalPrimaryKeyProperties?: DesignerDataPropertyInfo[];
/**
* Whether to use advanced save mode. for advanced save mode, a publish changes dialog will be opened with preview of changes.
*/
useAdvancedSaveMode: boolean;
}
export interface TableDesignerBuiltInTableViewOptions extends DesignerTablePropertiesBase {
@@ -1107,7 +1111,7 @@ declare module 'azdata' {
/**
* the path of the edit target.
*/
path: DesignerEditPath;
path: DesignerPropertyPath;
/**
* the new value.
*/
@@ -1115,7 +1119,7 @@ declare module 'azdata' {
}
/**
* The path of the edit target.
* The path of the property.
* 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
@@ -1129,7 +1133,7 @@ declare module 'azdata' {
* 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 DesignerEditPath = (string | number)[];
export type DesignerPropertyPath = (string | number)[];
/**
* Severity of the messages returned by the provider after processing an edit.
@@ -1139,6 +1143,28 @@ declare module 'azdata' {
*/
export type DesignerIssueSeverity = 'error' | 'warning' | 'information';
/**
* Represents the issue in the designer
*/
export interface DesignerIssue {
/**
* Severity of the issue.
*/
severity: DesignerIssueSeverity,
/**
* Path of the property that is associated with the issue.
*/
propertyPath?: DesignerPropertyPath,
/**
* Description of the issue.
*/
description: string,
/**
* Url to a web page that has the explaination of the issue.
*/
moreInfoLink?: string;
}
/**
* The result returned by the table designer provider after handling an edit request.
*/
@@ -1158,7 +1184,7 @@ declare module 'azdata' {
/**
* Issues of current state.
*/
issues?: { severity: DesignerIssueSeverity, description: string, propertyPath?: DesignerEditPath }[];
issues?: DesignerIssue[];
/**
* The input validation error.
*/