mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
save/generate script for table designer (#17972)
* save changes
* refactoring
* update height
* Register undo redo command (#17948)
* register undo redo command
* sql-migration vbump 0.1.12 (#17955)
* fix pre/post deploy scripts getting double counted in the files for sdk style projects (#17954)
* fix pre/post deploy scripts getting double counted in the files for sdk style projects
* add test
* update comment
* vbump sql database projects to 0.15.0 (#17956)
* LEGO: check in for main to temporary branch. (#17957)
* null check before calling isDisposable (#17959)
* Updated credentials system (#17888)
* linting
* added flags
* remove testing values
* format
* format doc
* tested in linux
* remove unused interface
* comments
* review comments
* clean imports
* pr comments
* format doc
* changed promise location
* insiders december
* pr comments
* test ado change
* fix test
* comment out code for hygiene
* remove unused imports
* test creds from client only
* remove unused import
* trying enabling keytar
* trying enabling keytar
* disable in correct script
* print statements
* remove print statements
* check mock output
* add linux check
* remove print statements
* Consolidate INotebookEditOperation interfaces (#17944)
* Add redo action for split cells (#17947)
* add redo action for split cells
* Handle delete folder for SDK style sql projects (#17961)
* handle delete folder for sdk style projects
* cleanup
* compare original sqlproj contents
* remove redundant checks
* enable find in cell output when output is a data stream (#17759)
* initial changes
* add isCodeOutput and apply decorations on output
* Add extension gallery update reminder action (#17644)
* Fix extensionsGallery.json name (#17646)
* Remove galleries list action (#17648)
* multi-level table support (#17638)
* multi-level table support
* comments
* address comments
* add period to end of sentence.
* Show connection string example for add sql binding quickpick (#17650)
* add connection string example
* reorder
* Resolves same-origin-policy violation when ADS web is running in a container (#17555)
* Stops appending port to authority for web mode
* Clarifies comment
* Adds missing sql carbon edit tag
* vbump STS (#17653)
* use latest STS (#17658)
* Refactoring readProjFile() (#17637)
* move reading project parts to different helper functions
* cleanup
* remove comment
* addressing comments
* Corrects Web Build Pipeline ENOENT Error (#17656)
* Checks for successful directory creation
* Revert "Checks for successful directory creation"
This reverts commit 372409ef323f0d82e11992bc7bc33d607a7d5581.
* Checks for the existence of the logs directory before accessing.
* Adds SQL carbon edit comment
* Removing call to copy from non-existing directory.
* Removes unneeded import
* Checks for file existence before copying.
* Provides explanation for modification
* Replaces file existence check with exception handling.
* Bump tools service (#17671)
* Apply changes from Remote Database to sqlproj - mssql changes (#17655)
* update project from database
* update project from database
* update project from database
* Re-adding schemaComparePublishChanges for temporary backcompat
* Adding comment for keeping enum values in sync
* Correcting enum value
Co-authored-by: Noureldine Yehia <t-nyehia@microsoft.com>
* update add file/folder for msbuild sdk style projects (#17660)
* update add file for msbuild sdk style projects
* also handle add folder
* fix comment
* fix issue reported by component governance (#17678)
* update json-schema version
* remove unused packages
* update package.json
* SQL Binding: Give default connection setting name (#17659)
* show sqlconnectionstring in quickpick
* fix duplicate sqlconnectionstring setting
* add (new)
* add sqlconnectionstring as default setting name
* check if sqlconnectionstring already exists
* Provide aria-labels for node checkboxes in the tree view. (#17676)
During accessibility testing, it was discovered that screen reader does not announce what checkboxes in the tree view represent. It was merely announcing "checkbox unchecked", so it was not clear without visuals which checkbox the focus is on.
This change sets an `aria-label` of the checkbox elements to match the label of the owning tree node. This way the announcement becomes "My Node; checkbox; unchecked". This is fine as a quick solution to the problem, but in the future we may want to consider adding additional checkbox label property to the nodes exposed by the tree provider, so that each checkbox can announce additional information, if needed.
* Respect ARIA label specified int he tree component options. (#17674)
During accessibility testing it was discovered that tree view in our wizard reads "Tree Node tree view" instead of the proper label that is specified. It turned out to be the problem with the tree component, where `ariaLabel` was hardcoded to "Tree Node", instead of the one provided in the options.
This change addresses the problem by passing through `ariaLabel` from the options object to the underlying tree control. I also removed the default `Tree Node` hardcoded label, as it didn't make much sense. This does mean that all tree-views that do not explicitly specify their aria-label will now get an empty label. I think this is better than having unrelated, unlocalized `Tree Node`.
I'm also worried about changes to the `ariaLabel` property after the component was initialized. I updated the code to propagate the value to the underlying tree view in the `setProperties` override of the tree component and hope that it will take care of it.
* Fix sql projects net6 warnings (#17673)
* fix .net 6 error showing on startup
* fix double warning
* addressing comments
* update key string
* undo adding space in net core sdk location setting (#17684)
* update names for msbuild sdk style projects (#17677)
* update names for msbuild sdk style projects
* remove msbuild from names
* update comments
* Designer: property descriptions (#17668)
* format
* added strings
* format doc
* use codicon instead
* show descriptions in property pane only
* fix ssdt string bug
* fix overflow option
* review comments
* review comments
* changes
* sts 156 vbump (#17683)
* Sql Binding: Add "Check out pane for more details" when nuget package download fails (#17680)
* check output for more details
* detail error
* wait for result from showerrormessage
* [Loc] Update to sql-database-projects and sql.xlf (#17687)
* update the vmImage for build jobs (#17689)
* update vmImage for windows build
* update tar command
* use specific macos version
* support building msbuild sdk style projects (#17675)
* support building msbuild sdk style projects
* fixes after merge
* add foreign keys and constraints (#17697)
* foreign keys and constraints
* refactoring
* fix issues
* properties pane improvements (#17700)
* [Loc] update to tabledesignercomponentinput (#17704)
* Add instructions for developing VS Code version of sql-database-projects (#17705)
* Adding UI for deploying a db proj to docker (#17495)
* code refactoring (#17706)
* Improve accessibility for wizard steps navigation (#17669)
Our extension is relying on the wizard dialog. During accessibility testing it was discovered that wizard step buttons are being reported as links by the screen reader (NVDA, JAWS). Claimed expected behavior by the tester is that they should be announced as buttons.
I discussed this issue with accessibility SMEs and they said it is perfectly fine to keep them as links. They did mention that they would probably design the UX differently from the start, but given that we already have it this way, links are fine. They did suggest to add few additional ARIA attributes to the link elements:
- `aria-current="step"` if the link is for the currently active step. This literally just announces "current step" at the end, when you focus on a link
- `aria-disabled="true"` makes it say "**unavailable**; link; *<step number>*" when in NVDA "browse" mode and move to the grayed-out link.
So this change implements the said improvements.
* bump sts version to 159 (#17709)
* LEGO: check in for main to temporary branch. (#17699)
* LEGO: check in for main to temporary branch. (#17702)
Co-authored-by: Alex Ma <alma1@microsoft.com>
* [Loc] update to sql-database-projects (#17713)
* LEGO: check in for main to temporary branch. (#17715)
* Register additional editor overrides when adding new notebook file types (#17708)
* Also standardized file extension contributions to always start with a period, and to always do lower case string comparisons for file extensions.
* input width in designer (#17714)
* Add additional properties to wizard page navigation events (#17716)
* Fix open external not working (#17717)
* save password checkbox fix (#17718)
* save password checkbox fix
* remove code to reset the checkbox value
* allow build to continue when cache task fails (#17720)
* cache task should not fail the build
* update cachesalt
* Fix language flavor change on connection when in sqlcmd mode (#17719)
* Fix language flavor change on connection when in sqlcmd mode
* comment + fix
* LEGO: check in for main to temporary branch. (#17722)
* LEGO: check in for main to temporary branch. (#17724)
Co-authored-by: Alex Ma <alma1@microsoft.com>
* Update one more variable name for sdk style projects (#17710)
* LEGO: check in for main to temporary branch. (#17725)
Co-authored-by: Alex Ma <alma1@microsoft.com>
* LEGO: check in for main to temporary branch. (#17726)
Co-authored-by: Alex Ma <alma1@microsoft.com>
* LEGO: check in for main to temporary branch. (#17730)
* Fix "unsupported version" error when adding sql binding package (#17721)
* Apply changes from remote database to sqlproj - schema-compare changes (#17679)
* update project from database
* update project from database
* Merge from main
* Removing dupe test stub
* PR feedback
* cleanup
* PR feedback
* Fixing tests, adding stubs to update sqlproj as schema compare target
* updating code comment
Co-authored-by: Noureldine Yehia <t-nyehia@microsoft.com>
* [Loc] Update to schema-compare XLF (#17733)
* Enabled deployment of Azure Arc data controllers in directly connected mode (#17707)
* Added fields for connectivity mode, custom loc, auto-metrics, auto-logs, and the dynamic enablement of such fields.
* Changed the description of the data controller details page.
* Change notebook params to work for direct mode
* Added login to dc deployment notebooks
* Fixed auto upload metrics and logs true/false, separated login into another cell.
* Removed localization of indirect and direct connectivity labels.
* Fix ordering of reading sqlproj Build Includes and Removes (#17712)
* evaluate includes and removes in order in sqlproj
* fix after merge
* fix comment
* update comment
* Add resource deployment samples for (#17734)
* Update remove file for sdk style sql projects (#17688)
* add support for removing file in new style project
* fix test
* only load files, not whole project when checking if a <Build Remove> needs to be added
* merge changes
* fixes after merge
* [Loc] update to Arc XLF (#17737)
* Bump to latest version of azdata (#17735)
* Remove .net 6 version cutoff for building sql projects (#17736)
* remove .net 6 version cutoff for building sql projects
* Revert "Warning when .NET 6 SDK is detected (#17422)"
This reverts commit 2ed8aeb565.
* add back skipVersionSupportedCheck
* add back return false
* addressing comments
* [Loc] update to sql-database-projects xlf (#17743)
* Add additional notebook tests for handling relative links. (#17739)
* [Loc] Fix for duplicate strings in LCL files (#17756)
* WIP spanish lcl duplicate removal
* Revert "WIP spanish lcl duplicate removal"
This reverts commit 5f943153ec8980849a045c8bf7256d852571a778.
* fix for duplicate strings
* removed spaces
* Fixes ADS Web bug around copying user codes and opening a browser tab when adding an Azure Account. (#17760)
* Fixes bug around copying user codes and opening a browser tab.
* Code review changes
* Additional review changes.
* Unnecessary import removed
* Editing pipeline ACR service connection endpoint to the latest one created (#17767)
* using the new registry endpoint
* updating the service connection
* Changing the name of acr service endpoint to SqlToolsContainer
* Updating web build acr endpoint as well.
* Notebooks: Add Tooltips for Link/Image Buttons on Markdown Toolbar (#17763)
* Add title for tooltips
* Tweak tooltips
* Added UI for user to accept EULA when deploying sql proj to docker container (#17762)
* fix sorting bug (#17769)
* fix sorting bug
* comments
* Set default radio button selection, evaluate default component popula… (#17764)
* Set default radio button selection, evaluate default component population off of selection instead of unprocessed input
* rename var
* if -> switches
* Remove project radio buttons because they require commands that aren't yet checked in (and fail as a result)
* Added fix for Publish Target Label Position (#17771)
* Added fix for Publish Target Label Position
* renamed checkbox
* LEGO: check in for main to temporary branch. (#17775)
* LEGO: check in for main to temporary branch. (#17778)
Co-authored-by: Alex Ma <alma1@microsoft.com>
* update dashboard taskbar separator (#17779)
* remove comments
* fix applying decorations
* add test
* enable find in sql result set
* add tests and update sql results highlight logic
* calculate the outputComponent index
* fix editor issues later
* remove newline replace on search
* address comments
* fix highlight issue
Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
Co-authored-by: Alan Ren <alanren@microsoft.com>
Co-authored-by: Lucy Zhang <luczhan@microsoft.com>
Co-authored-by: Lewis Sanchez <87730006+lewis-sanchez@users.noreply.github.com>
Co-authored-by: Kim Santiago <31145923+kisantia@users.noreply.github.com>
Co-authored-by: Benjin Dubishar <benjin.dubishar@gmail.com>
Co-authored-by: Noureldine Yehia <t-nyehia@microsoft.com>
Co-authored-by: Alexander Ivanov <nahk-ivanov@users.noreply.github.com>
Co-authored-by: Aditya Bist <adbist@microsoft.com>
Co-authored-by: Sai Avishkar Sreerama <74571829+ssreerama@users.noreply.github.com>
Co-authored-by: Alex Ma <alma1@microsoft.com>
Co-authored-by: Leila Lali <llali@microsoft.com>
Co-authored-by: csigs <csigs@users.noreply.github.com>
Co-authored-by: Cory Rivera <corivera@microsoft.com>
Co-authored-by: Candice Ye <candiceye@berkeley.edu>
Co-authored-by: Aasim Khan <aasimkhan30@gmail.com>
Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com>
* Remove undo/redo listeners from notebook component (#17966)
* remove undo/redo hostlisteners
* fix table focus issue (#17970)
* fix table focus issue
* fix hygiene error
* web
* new sts
* add await
* pr comments
* comments
Co-authored-by: Barbara Valdez <34872381+barbaravaldez@users.noreply.github.com>
Co-authored-by: brian-harris <61598682+brian-harris@users.noreply.github.com>
Co-authored-by: Kim Santiago <31145923+kisantia@users.noreply.github.com>
Co-authored-by: csigs <csigs@users.noreply.github.com>
Co-authored-by: Aditya Bist <adbist@microsoft.com>
Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
Co-authored-by: Maddy <12754347+MaddyDev@users.noreply.github.com>
Co-authored-by: Lucy Zhang <luczhan@microsoft.com>
Co-authored-by: Lewis Sanchez <87730006+lewis-sanchez@users.noreply.github.com>
Co-authored-by: Benjin Dubishar <benjin.dubishar@gmail.com>
Co-authored-by: Noureldine Yehia <t-nyehia@microsoft.com>
Co-authored-by: Alexander Ivanov <nahk-ivanov@users.noreply.github.com>
Co-authored-by: Sai Avishkar Sreerama <74571829+ssreerama@users.noreply.github.com>
Co-authored-by: Alex Ma <alma1@microsoft.com>
Co-authored-by: Leila Lali <llali@microsoft.com>
Co-authored-by: Cory Rivera <corivera@microsoft.com>
Co-authored-by: Candice Ye <candiceye@berkeley.edu>
Co-authored-by: Aasim Khan <aasimkhan30@gmail.com>
Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/v{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
||||
"version": "3.0.0-release.174",
|
||||
"version": "3.0.0-release.178",
|
||||
"downloadFileNames": {
|
||||
"Windows_86": "win-x86-net5.0.zip",
|
||||
"Windows_64": "win-x64-net5.0.zip",
|
||||
|
||||
@@ -1044,27 +1044,28 @@ export namespace GetSqlMigrationAssessmentItemsRequest {
|
||||
|
||||
export interface TableDesignerEditRequestParams {
|
||||
tableInfo: azdata.designers.TableInfo,
|
||||
tableChangeInfo: azdata.designers.DesignerEdit,
|
||||
viewModel: azdata.designers.DesignerViewModel
|
||||
tableChangeInfo: azdata.designers.DesignerEdit
|
||||
}
|
||||
|
||||
export interface SaveTableDesignerChangesRequestParams {
|
||||
tableInfo: azdata.designers.TableInfo,
|
||||
viewModel: azdata.designers.DesignerViewModel
|
||||
}
|
||||
|
||||
export namespace GetTableDesignerInfoRequest {
|
||||
export const type = new RequestType<azdata.designers.TableInfo, azdata.designers.TableDesignerInfo, void, void>('tabledesigner/gettabledesignerinfo');
|
||||
export namespace InitializeTableDesignerRequest {
|
||||
export const type = new RequestType<azdata.designers.TableInfo, azdata.designers.TableDesignerInfo, void, void>('tabledesigner/initialize');
|
||||
}
|
||||
|
||||
export namespace ProcessTableDesignerEditRequest {
|
||||
export const type = new RequestType<TableDesignerEditRequestParams, azdata.designers.DesignerEditResult, void, void>('tabledesigner/processedit');
|
||||
}
|
||||
|
||||
export namespace SaveTableDesignerChangesRequest {
|
||||
export const type = new RequestType<SaveTableDesignerChangesRequestParams, void, void, void>('tabledesigner/savechanges');
|
||||
export namespace PublishTableDesignerChangesRequest {
|
||||
export const type = new RequestType<azdata.designers.TableInfo, void, void, void>('tabledesigner/save');
|
||||
}
|
||||
|
||||
export namespace TableDesignerGenerateScriptRequest {
|
||||
export const type = new RequestType<azdata.designers.TableInfo, string, void, void>('tabledesigner/script');
|
||||
}
|
||||
|
||||
export namespace TableDesignerGenerateChangePreviewReportRequest {
|
||||
export const type = new RequestType<azdata.designers.TableInfo, string, void, void>('tabledesigner/report');
|
||||
}
|
||||
export namespace DisposeTableDesignerRequest {
|
||||
export const type = new RequestType<azdata.designers.TableInfo, void, void, void>('tabledesigner/dispose');
|
||||
}
|
||||
|
||||
@@ -1108,19 +1108,18 @@ export class TableDesignerFeature extends SqlOpsFeature<undefined> {
|
||||
protected registerProvider(options: undefined): Disposable {
|
||||
const client = this._client;
|
||||
|
||||
const getTableDesignerInfo = (tableInfo: azdata.designers.TableInfo): Thenable<azdata.designers.TableDesignerInfo> => {
|
||||
const initializeTableDesigner = (tableInfo: azdata.designers.TableInfo): Thenable<azdata.designers.TableDesignerInfo> => {
|
||||
try {
|
||||
return client.sendRequest(contracts.GetTableDesignerInfoRequest.type, tableInfo);
|
||||
return client.sendRequest(contracts.InitializeTableDesignerRequest.type, tableInfo);
|
||||
}
|
||||
catch (e) {
|
||||
client.logFailedRequest(contracts.GetTableDesignerInfoRequest.type, e);
|
||||
client.logFailedRequest(contracts.InitializeTableDesignerRequest.type, e);
|
||||
return Promise.reject(e);
|
||||
}
|
||||
};
|
||||
const processTableEdit = (tableInfo: azdata.designers.TableInfo, viewModel: azdata.designers.DesignerViewModel, tableChangeInfo: azdata.designers.DesignerEdit): Thenable<azdata.designers.DesignerEditResult> => {
|
||||
const processTableEdit = (tableInfo: azdata.designers.TableInfo, tableChangeInfo: azdata.designers.DesignerEdit): Thenable<azdata.designers.DesignerEditResult> => {
|
||||
let params: contracts.TableDesignerEditRequestParams = {
|
||||
tableInfo: tableInfo,
|
||||
viewModel: viewModel,
|
||||
tableChangeInfo: tableChangeInfo
|
||||
};
|
||||
try {
|
||||
@@ -1132,16 +1131,32 @@ export class TableDesignerFeature extends SqlOpsFeature<undefined> {
|
||||
}
|
||||
};
|
||||
|
||||
const saveTable = (tableInfo: azdata.designers.TableInfo, viewModel: azdata.designers.DesignerViewModel): Thenable<void> => {
|
||||
let params: contracts.SaveTableDesignerChangesRequestParams = {
|
||||
tableInfo: tableInfo,
|
||||
viewModel: viewModel
|
||||
};
|
||||
const publishChanges = (tableInfo: azdata.designers.TableInfo): Thenable<void> => {
|
||||
try {
|
||||
return client.sendRequest(contracts.SaveTableDesignerChangesRequest.type, params);
|
||||
return client.sendRequest(contracts.PublishTableDesignerChangesRequest.type, tableInfo);
|
||||
}
|
||||
catch (e) {
|
||||
client.logFailedRequest(contracts.SaveTableDesignerChangesRequest.type, e);
|
||||
client.logFailedRequest(contracts.PublishTableDesignerChangesRequest.type, e);
|
||||
return Promise.reject(e);
|
||||
}
|
||||
};
|
||||
|
||||
const generateScript = (tableInfo: azdata.designers.TableInfo): Thenable<string> => {
|
||||
try {
|
||||
return client.sendRequest(contracts.TableDesignerGenerateScriptRequest.type, tableInfo);
|
||||
}
|
||||
catch (e) {
|
||||
client.logFailedRequest(contracts.TableDesignerGenerateScriptRequest.type, e);
|
||||
return Promise.reject(e);
|
||||
}
|
||||
};
|
||||
|
||||
const generatePreviewReport = (tableInfo: azdata.designers.TableInfo): Thenable<string> => {
|
||||
try {
|
||||
return client.sendRequest(contracts.TableDesignerGenerateChangePreviewReportRequest.type, tableInfo);
|
||||
}
|
||||
catch (e) {
|
||||
client.logFailedRequest(contracts.TableDesignerGenerateChangePreviewReportRequest.type, e);
|
||||
return Promise.reject(e);
|
||||
}
|
||||
};
|
||||
@@ -1158,9 +1173,11 @@ export class TableDesignerFeature extends SqlOpsFeature<undefined> {
|
||||
|
||||
return azdata.dataprotocol.registerTableDesignerProvider({
|
||||
providerId: client.providerId,
|
||||
getTableDesignerInfo,
|
||||
initializeTableDesigner,
|
||||
processTableEdit,
|
||||
saveTable,
|
||||
publishChanges,
|
||||
generateScript,
|
||||
generatePreviewReport,
|
||||
disposeTableDesigner
|
||||
});
|
||||
}
|
||||
|
||||
25
src/sql/azdata.proposed.d.ts
vendored
25
src/sql/azdata.proposed.d.ts
vendored
@@ -1013,24 +1013,35 @@ declare module 'azdata' {
|
||||
*/
|
||||
export interface TableDesignerProvider extends DataProvider {
|
||||
/**
|
||||
* Gets the table designer information for the specified table.
|
||||
* Initialize the table designer for the specified table.
|
||||
* @param table the table information.
|
||||
*/
|
||||
getTableDesignerInfo(table: TableInfo): Thenable<TableDesignerInfo>;
|
||||
initializeTableDesigner(table: TableInfo): Thenable<TableDesignerInfo>;
|
||||
|
||||
/**
|
||||
* Process the table change.
|
||||
* @param table the table information
|
||||
* @param viewModel the object contains the state of the table designer
|
||||
* @param tableChangeInfo the information about the change user made through the UI.
|
||||
*/
|
||||
processTableEdit(table: TableInfo, viewModel: DesignerViewModel, tableChangeInfo: DesignerEdit): Thenable<DesignerEditResult>;
|
||||
processTableEdit(table: TableInfo, tableChangeInfo: DesignerEdit): Thenable<DesignerEditResult>;
|
||||
|
||||
/**
|
||||
* Save the table
|
||||
* Publish the changes.
|
||||
* @param table the table information
|
||||
* @param viewModel the object contains the state of the table designer
|
||||
*/
|
||||
saveTable(table: TableInfo, viewModel: DesignerViewModel): Thenable<void>;
|
||||
publishChanges(table: TableInfo): Thenable<void>;
|
||||
|
||||
/**
|
||||
* Generate script for the changes.
|
||||
* @param table the table information
|
||||
*/
|
||||
generateScript(table: TableInfo): Thenable<string>;
|
||||
|
||||
/**
|
||||
* Generate preview report describing the changes to be made.
|
||||
* @param table the table information
|
||||
*/
|
||||
generatePreviewReport(table: TableInfo): Thenable<string>;
|
||||
|
||||
/**
|
||||
* Notify the provider that the table designer has been closed.
|
||||
|
||||
@@ -26,7 +26,8 @@ export const enum ModalDialogName {
|
||||
AutoOAuth = 'AutoOAuth',
|
||||
AddNewDashboardTab = 'AddNewDashboardTab',
|
||||
ProfilerFilter = 'ProfilerFilter',
|
||||
CalloutDialog = 'CalloutDialog'
|
||||
CalloutDialog = 'CalloutDialog',
|
||||
TableDesignerPublishDialog = 'TableDesignerPublishDialog'
|
||||
}
|
||||
|
||||
export const enum TelemetryView {
|
||||
|
||||
@@ -513,14 +513,20 @@ export class MainThreadDataProtocol extends Disposable implements MainThreadData
|
||||
const self = this;
|
||||
this._tableDesignerService.registerProvider(providerId, <azdata.designers.TableDesignerProvider>{
|
||||
providerId: providerId,
|
||||
getTableDesignerInfo(tableInfo: azdata.designers.TableInfo): Thenable<azdata.designers.TableDesignerInfo> {
|
||||
return self._proxy.$getTableDesignerInfo(handle, tableInfo);
|
||||
initializeTableDesigner(tableInfo: azdata.designers.TableInfo): Thenable<azdata.designers.TableDesignerInfo> {
|
||||
return self._proxy.$initializeTableDesigner(handle, tableInfo);
|
||||
},
|
||||
processTableEdit(table, data, edit): Thenable<azdata.designers.DesignerEditResult> {
|
||||
return self._proxy.$processTableDesignerEdit(handle, table, data, edit);
|
||||
processTableEdit(table, edit): Thenable<azdata.designers.DesignerEditResult> {
|
||||
return self._proxy.$processTableDesignerEdit(handle, table, edit);
|
||||
},
|
||||
saveTable(tableInfo: azdata.designers.TableInfo, data: azdata.designers.DesignerViewModel): Thenable<void> {
|
||||
return self._proxy.$saveTable(handle, tableInfo, data);
|
||||
publishChanges(tableInfo: azdata.designers.TableInfo): Thenable<void> {
|
||||
return self._proxy.$publishTableDesignerChanges(handle, tableInfo);
|
||||
},
|
||||
generateScript(tableInfo: azdata.designers.TableInfo): Thenable<string> {
|
||||
return self._proxy.$generateScriptForTableDesigner(handle, tableInfo);
|
||||
},
|
||||
generatePreviewReport(tableInfo: azdata.designers.TableInfo): Thenable<string> {
|
||||
return self._proxy.$generatePreviewReportForTableDesigner(handle, tableInfo);
|
||||
},
|
||||
disposeTableDesigner(tableInfo: azdata.designers.TableInfo): Thenable<void> {
|
||||
return self._proxy.$disposeTableDesigner(handle, tableInfo);
|
||||
|
||||
@@ -892,16 +892,24 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
||||
}
|
||||
|
||||
// Table Designer
|
||||
public override $getTableDesignerInfo(handle: number, table: azdata.designers.TableInfo): Thenable<azdata.designers.TableDesignerInfo> {
|
||||
return this._resolveProvider<azdata.designers.TableDesignerProvider>(handle).getTableDesignerInfo(table);
|
||||
public override $initializeTableDesigner(handle: number, table: azdata.designers.TableInfo): Thenable<azdata.designers.TableDesignerInfo> {
|
||||
return this._resolveProvider<azdata.designers.TableDesignerProvider>(handle).initializeTableDesigner(table);
|
||||
}
|
||||
|
||||
public override $processTableDesignerEdit(handle: number, table: azdata.designers.TableInfo, viewModel: azdata.designers.DesignerViewModel, edit: azdata.designers.DesignerEdit): Thenable<azdata.designers.DesignerEditResult> {
|
||||
return this._resolveProvider<azdata.designers.TableDesignerProvider>(handle).processTableEdit(table, viewModel, edit);
|
||||
public override $processTableDesignerEdit(handle: number, table: azdata.designers.TableInfo, edit: azdata.designers.DesignerEdit): Thenable<azdata.designers.DesignerEditResult> {
|
||||
return this._resolveProvider<azdata.designers.TableDesignerProvider>(handle).processTableEdit(table, edit);
|
||||
}
|
||||
|
||||
public override $saveTable(handle: number, table: azdata.designers.TableInfo, viewModel: azdata.designers.DesignerViewModel): Thenable<void> {
|
||||
return this._resolveProvider<azdata.designers.TableDesignerProvider>(handle).saveTable(table, viewModel);
|
||||
public override $publishTableDesignerChanges(handle: number, table: azdata.designers.TableInfo): Thenable<void> {
|
||||
return this._resolveProvider<azdata.designers.TableDesignerProvider>(handle).publishChanges(table);
|
||||
}
|
||||
|
||||
public override $generateScriptForTableDesigner(handle: number, table: azdata.designers.TableInfo): Thenable<string> {
|
||||
return this._resolveProvider<azdata.designers.TableDesignerProvider>(handle).generateScript(table);
|
||||
}
|
||||
|
||||
public override $generatePreviewReportForTableDesigner(handle: number, table: azdata.designers.TableInfo): Thenable<string> {
|
||||
return this._resolveProvider<azdata.designers.TableDesignerProvider>(handle).generatePreviewReport(table);
|
||||
}
|
||||
|
||||
public override $disposeTableDesigner(handle: number, table: azdata.designers.TableInfo): Thenable<void> {
|
||||
|
||||
@@ -530,17 +530,27 @@ export abstract class ExtHostDataProtocolShape {
|
||||
/**
|
||||
* Gets the table designer info for the specified table
|
||||
*/
|
||||
$getTableDesignerInfo(handle: number, table: azdata.designers.TableInfo): Thenable<azdata.designers.TableDesignerInfo> { throw ni(); }
|
||||
$initializeTableDesigner(handle: number, table: azdata.designers.TableInfo): Thenable<azdata.designers.TableDesignerInfo> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Process the table edit.
|
||||
*/
|
||||
$processTableDesignerEdit(handle: number, table: azdata.designers.TableInfo, data: azdata.designers.DesignerViewModel, edit: azdata.designers.DesignerEdit): Thenable<azdata.designers.DesignerEditResult> { throw ni(); }
|
||||
$processTableDesignerEdit(handle: number, table: azdata.designers.TableInfo, edit: azdata.designers.DesignerEdit): Thenable<azdata.designers.DesignerEditResult> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Process the table edit.
|
||||
* Publish the table designer changes.
|
||||
*/
|
||||
$saveTable(handle: number, table: azdata.designers.TableInfo, data: azdata.designers.DesignerViewModel): Thenable<void> { throw ni(); }
|
||||
$publishTableDesignerChanges(handle: number, table: azdata.designers.TableInfo): Thenable<void> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Generate scripts.
|
||||
*/
|
||||
$generateScriptForTableDesigner(handle: number, table: azdata.designers.TableInfo): Thenable<string> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Generate preview report.
|
||||
*/
|
||||
$generatePreviewReportForTableDesigner(handle: number, table: azdata.designers.TableInfo): Thenable<string> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Dispose the table designer.
|
||||
|
||||
@@ -331,7 +331,7 @@ export class Designer extends Disposable implements IThemable {
|
||||
let timeout;
|
||||
switch (action) {
|
||||
case 'save':
|
||||
message = showLoading ? localize('designer.savingChanges', "Saving changes...") : localize('designer.savingChangesCompleted', "Changes have been saved");
|
||||
message = showLoading ? localize('designer.publishingChanges', "Publishing changes...") : localize('designer.publishChangesCompleted', "Changes have been published");
|
||||
timeout = 0;
|
||||
break;
|
||||
case 'initialize':
|
||||
@@ -344,7 +344,9 @@ export class Designer extends Disposable implements IThemable {
|
||||
timeout = 500;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
message = showLoading ? localize('designer.processing', "Processing...") : localize('designer.processingCompleted', "Processing completed");
|
||||
timeout = 0;
|
||||
break;
|
||||
}
|
||||
if (showLoading) {
|
||||
this.startLoading(message, useDelay ? timeout : 0);
|
||||
|
||||
@@ -74,7 +74,7 @@ export interface DesignerUIState {
|
||||
activeTabId: PanelTabIdentifier;
|
||||
}
|
||||
|
||||
export type DesignerAction = 'save' | 'initialize' | 'processEdit';
|
||||
export type DesignerAction = 'save' | 'initialize' | 'processEdit' | 'generateScript' | 'generateReport';
|
||||
|
||||
export interface DesignerEditProcessedEventArgs {
|
||||
result: DesignerEditResult;
|
||||
|
||||
@@ -81,7 +81,7 @@ export class TableDesignerInput extends EditorInput {
|
||||
}
|
||||
|
||||
override async save(group: GroupIdentifier, options?: ISaveOptions): Promise<IEditorInput | undefined> {
|
||||
await this._designerComponentInput.save();
|
||||
await this._designerComponentInput.openPublishDialog();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,15 +9,12 @@ import { Codicon } from 'vs/base/common/codicons';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { localize } from 'vs/nls';
|
||||
|
||||
export class SaveTableChangesAction extends Action {
|
||||
public static ID = 'tableDesigner.saveTableChanges';
|
||||
public static LABEL = localize('tableDesigner.saveTableChanges', "Save Changes");
|
||||
private _input: TableDesignerComponentInput;
|
||||
export abstract class TableChangesActionBase extends Action {
|
||||
protected _input: TableDesignerComponentInput;
|
||||
private _onStateChangeDisposable: IDisposable;
|
||||
|
||||
constructor(
|
||||
) {
|
||||
super(SaveTableChangesAction.ID, SaveTableChangesAction.LABEL, Codicon.save.classNames);
|
||||
constructor(id: string, label: string, iconClassNames: string) {
|
||||
super(id, label, iconClassNames);
|
||||
}
|
||||
|
||||
public setContext(input: TableDesignerComponentInput): void {
|
||||
@@ -29,10 +26,6 @@ export class SaveTableChangesAction extends Action {
|
||||
});
|
||||
}
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
await this._input.save();
|
||||
}
|
||||
|
||||
private updateState(): void {
|
||||
this.enabled = this._input.dirty && this._input.valid && this._input.pendingAction === undefined;
|
||||
}
|
||||
@@ -42,3 +35,28 @@ export class SaveTableChangesAction extends Action {
|
||||
this._onStateChangeDisposable?.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
export class PublishTableChangesAction extends TableChangesActionBase {
|
||||
public static ID = 'tableDesigner.publishTableChanges';
|
||||
public static LABEL = localize('tableDesigner.publishTableChanges', "Publish Changes...");
|
||||
constructor() {
|
||||
super(PublishTableChangesAction.ID, PublishTableChangesAction.LABEL, Codicon.repoPush.classNames);
|
||||
}
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
await this._input.openPublishDialog();
|
||||
}
|
||||
}
|
||||
|
||||
export class GenerateTableChangeScriptAction extends TableChangesActionBase {
|
||||
public static ID = 'tableDesigner.generateScript';
|
||||
public static LABEL = localize('tableDesigner.generateScript', "Generate Script");
|
||||
|
||||
constructor() {
|
||||
super(GenerateTableChangeScriptAction.ID, GenerateTableChangeScriptAction.LABEL, Codicon.output.classNames);
|
||||
}
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
await this._input.generateScript();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
|
||||
import { IEditorOpenContext } from 'vs/workbench/common/editor';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { SaveTableChangesAction } from 'sql/workbench/contrib/tableDesigner/browser/actions';
|
||||
import { GenerateTableChangeScriptAction, PublishTableChangesAction } from 'sql/workbench/contrib/tableDesigner/browser/actions';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { DesignerPaneSeparator } from 'sql/platform/theme/common/colorRegistry';
|
||||
@@ -25,7 +25,8 @@ export class TableDesignerEditor extends EditorPane {
|
||||
public static readonly ID: string = 'workbench.editor.tableDesigner';
|
||||
|
||||
private _designer: Designer;
|
||||
private _saveChangesAction: SaveTableChangesAction;
|
||||
private _publishChangesAction: PublishTableChangesAction;
|
||||
private _generateScriptAction: GenerateTableChangeScriptAction;
|
||||
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@@ -44,7 +45,8 @@ export class TableDesignerEditor extends EditorPane {
|
||||
await super.setInput(input, options, context, token);
|
||||
const designerInput = input.getComponentInput();
|
||||
this._designer.setInput(designerInput);
|
||||
this._saveChangesAction.setContext(designerInput);
|
||||
this._publishChangesAction.setContext(designerInput);
|
||||
this._generateScriptAction.setContext(designerInput);
|
||||
}
|
||||
|
||||
protected createEditor(parent: HTMLElement): void {
|
||||
@@ -54,9 +56,11 @@ export class TableDesignerEditor extends EditorPane {
|
||||
const designerContainer = container.appendChild(DOM.$('.designer-container'));
|
||||
const actionbar = new ActionBar(actionbarContainer);
|
||||
this._register(actionbar);
|
||||
this._saveChangesAction = this._instantiationService.createInstance(SaveTableChangesAction);
|
||||
this._saveChangesAction.enabled = false;
|
||||
actionbar.push(this._saveChangesAction, { icon: true, label: false });
|
||||
this._publishChangesAction = this._instantiationService.createInstance(PublishTableChangesAction);
|
||||
this._publishChangesAction.enabled = false;
|
||||
this._generateScriptAction = this._instantiationService.createInstance(GenerateTableChangeScriptAction);
|
||||
this._generateScriptAction.enabled = false;
|
||||
actionbar.push([this._publishChangesAction, this._generateScriptAction], { icon: true, label: false });
|
||||
|
||||
this._designer = this._instantiationService.createInstance(Designer, designerContainer);
|
||||
this._register(attachDesignerStyler(this._designer, this.themeService));
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.table-designer-publish-dialog {
|
||||
height: 350px;
|
||||
padding: 10px;
|
||||
overflow: scroll;
|
||||
user-select: text;
|
||||
}
|
||||
@@ -11,6 +11,9 @@ import { designers } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { deepClone, equals } from 'vs/base/common/objects';
|
||||
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { TableDesignerPublishDialogResult, TableDesignerPublishDialog } from 'sql/workbench/services/tableDesigner/browser/tableDesignerPublishDialog';
|
||||
|
||||
export class TableDesignerComponentInput implements DesignerComponentInput {
|
||||
|
||||
@@ -30,7 +33,9 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
|
||||
|
||||
constructor(private readonly _provider: TableDesignerProvider,
|
||||
private _tableInfo: azdata.designers.TableInfo,
|
||||
@INotificationService private readonly _notificationService: INotificationService) {
|
||||
@INotificationService private readonly _notificationService: INotificationService,
|
||||
@IQueryEditorService private readonly _queryEditorService: IQueryEditorService,
|
||||
@IInstantiationService private readonly _instantiationService: IInstantiationService) {
|
||||
}
|
||||
|
||||
get valid(): boolean {
|
||||
@@ -59,7 +64,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
|
||||
|
||||
processEdit(edit: DesignerEdit): void {
|
||||
this.updateState(this.valid, this.dirty, 'processEdit');
|
||||
this._provider.processTableEdit(this._tableInfo, this._viewModel!, edit).then(
|
||||
this._provider.processTableEdit(this._tableInfo, edit).then(
|
||||
result => {
|
||||
this._viewModel = result.viewModel;
|
||||
this.updateState(result.isValid, !equals(this._viewModel, this._originalViewModel), undefined);
|
||||
@@ -79,24 +84,72 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
|
||||
);
|
||||
}
|
||||
|
||||
async save(): Promise<void> {
|
||||
async generateScript(): Promise<void> {
|
||||
const notificationHandle = this._notificationService.notify({
|
||||
severity: Severity.Info,
|
||||
message: localize('tableDesigner.savingChanges', "Saving table designer changes...")
|
||||
message: localize('tableDesigner.generatingScript', "Generating script..."),
|
||||
sticky: true
|
||||
});
|
||||
try {
|
||||
this.updateState(this.valid, this.dirty, 'generateScript');
|
||||
const script = await this._provider.generateScript(this._tableInfo);
|
||||
this._queryEditorService.newSqlEditor({ initalContent: script });
|
||||
this.updateState(this.valid, this.dirty);
|
||||
notificationHandle.updateMessage(localize('tableDesigner.generatingScriptCompleted', "Script generated."));
|
||||
} catch (error) {
|
||||
notificationHandle.updateSeverity(Severity.Error);
|
||||
notificationHandle.updateMessage(localize('tableDesigner.generateScriptError', "An error occured while generating the script: {0}", error?.message ?? error));
|
||||
this.updateState(this.valid, this.dirty);
|
||||
}
|
||||
}
|
||||
|
||||
async publishChanges(): Promise<void> {
|
||||
const saveNotificationHandle = this._notificationService.notify({
|
||||
severity: Severity.Info,
|
||||
message: localize('tableDesigner.savingChanges', "Saving table designer changes..."),
|
||||
sticky: true
|
||||
});
|
||||
try {
|
||||
this.updateState(this.valid, this.dirty, 'save');
|
||||
await this._provider.saveTable(this._tableInfo, this._viewModel);
|
||||
await this._provider.publishChanges(this._tableInfo);
|
||||
this._originalViewModel = this._viewModel;
|
||||
this.updateState(true, false);
|
||||
notificationHandle.updateMessage(localize('tableDesigner.savedChangeSuccess', "The changes have been successfully saved."));
|
||||
saveNotificationHandle.updateMessage(localize('tableDesigner.publishChangeSuccess', "The changes have been successfully published."));
|
||||
} catch (error) {
|
||||
notificationHandle.updateSeverity(Severity.Error);
|
||||
notificationHandle.updateMessage(localize('tableDesigner.saveChangeError', "An error occured while saving changes: {0}", error?.message ?? error));
|
||||
saveNotificationHandle.updateSeverity(Severity.Error);
|
||||
saveNotificationHandle.updateMessage(localize('tableDesigner.publishChangeError', "An error occured while publishing changes: {0}", error?.message ?? error));
|
||||
this.updateState(this.valid, this.dirty);
|
||||
}
|
||||
}
|
||||
|
||||
async openPublishDialog(): Promise<void> {
|
||||
const reportNotificationHandle = this._notificationService.notify({
|
||||
severity: Severity.Info,
|
||||
message: localize('tableDesigner.generatingPreviewReport', "Generating preview report..."),
|
||||
sticky: true
|
||||
});
|
||||
|
||||
let report;
|
||||
try {
|
||||
this.updateState(this.valid, this.dirty, 'generateReport');
|
||||
report = await this._provider.generatePreviewReport(this._tableInfo);
|
||||
reportNotificationHandle.close();
|
||||
this.updateState(this.valid, this.dirty);
|
||||
} catch (error) {
|
||||
reportNotificationHandle.updateSeverity(Severity.Error);
|
||||
reportNotificationHandle.updateMessage(localize('tableDesigner.generatePreviewReportError', "An error occured while generating preview report: {0}", error?.message ?? error));
|
||||
this.updateState(this.valid, this.dirty);
|
||||
return;
|
||||
}
|
||||
const dialog = this._instantiationService.createInstance(TableDesignerPublishDialog);
|
||||
const result = await dialog.open(report);
|
||||
if (result === TableDesignerPublishDialogResult.GenerateScript) {
|
||||
await this.generateScript();
|
||||
} else if (result === TableDesignerPublishDialogResult.UpdateDatabase) {
|
||||
await this.publishChanges();
|
||||
}
|
||||
}
|
||||
|
||||
async revert(): Promise<void> {
|
||||
this.updateState(true, false);
|
||||
}
|
||||
@@ -131,7 +184,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
|
||||
}
|
||||
|
||||
this.updateState(this.valid, this.dirty, 'initialize');
|
||||
this._provider.getTableDesignerInfo(this._tableInfo).then(result => {
|
||||
this._provider.initializeTableDesigner(this._tableInfo).then(result => {
|
||||
this.doInitialization(result);
|
||||
this._onInitialized.fire();
|
||||
}, error => {
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./media/tableDesignerPublishDialog';
|
||||
import { Button } from 'sql/base/browser/ui/button/button';
|
||||
import { Modal } from 'sql/workbench/browser/modal/modal';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { localize } from 'vs/nls';
|
||||
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
const OkText: string = localize('tableDesigner.UpdateDatabase', "Update Database");
|
||||
const CancelText: string = localize('tableDesigner.cancel', "Cancel");
|
||||
const GenerateScriptText: string = localize('tableDesigner.generateScript', "Generate Script");
|
||||
|
||||
export enum TableDesignerPublishDialogResult {
|
||||
UpdateDatabase,
|
||||
GenerateScript,
|
||||
Cancel
|
||||
}
|
||||
|
||||
export class TableDesignerPublishDialog extends Modal {
|
||||
|
||||
private _report?: string;
|
||||
private _okButton?: Button;
|
||||
private _generateScriptButton?: Button;
|
||||
private _cancelButton?: Button;
|
||||
private _promiseResolver: (value: TableDesignerPublishDialogResult) => void;
|
||||
|
||||
constructor(
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@ILogService logService: ILogService,
|
||||
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
|
||||
) {
|
||||
super('', TelemetryKeys.ModalDialogName.TableDesignerPublishDialog, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { dialogStyle: 'normal', hasTitleIcon: false });
|
||||
}
|
||||
|
||||
public open(report: string): Promise<TableDesignerPublishDialogResult> {
|
||||
this._report = report;
|
||||
this.render();
|
||||
this.show();
|
||||
const promise = new Promise<TableDesignerPublishDialogResult>((resolve) => {
|
||||
this._promiseResolver = resolve;
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
|
||||
public override render() {
|
||||
super.render();
|
||||
this.title = localize('tableDesigner.previewDatabaseUpdates', "Preview Database Updates");
|
||||
this._register(attachModalDialogStyler(this, this._themeService));
|
||||
this._okButton = this.addFooterButton(OkText, () => this.handleOkButtonClick());
|
||||
this._generateScriptButton = this.addFooterButton(GenerateScriptText, () => this.handleGenerateScriptButtonClick(), 'right', true);
|
||||
this._cancelButton = this.addFooterButton(CancelText, () => this.handleCancelButtonClick(), 'right', true);
|
||||
this._register(attachButtonStyler(this._okButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._generateScriptButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._cancelButton, this._themeService));
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement) {
|
||||
const body = DOM.append(container, DOM.$('.table-designer-publish-dialog'));
|
||||
body.innerText = this._report;
|
||||
}
|
||||
|
||||
protected layout(height?: number): void {
|
||||
// Nothing to re-layout
|
||||
}
|
||||
|
||||
/* espace key */
|
||||
protected override onClose() {
|
||||
this.handleCancelButtonClick();
|
||||
}
|
||||
|
||||
/* enter key */
|
||||
protected override onAccept() {
|
||||
this.handleOkButtonClick();
|
||||
}
|
||||
|
||||
private handleOkButtonClick(): void {
|
||||
this.hide('ok');
|
||||
this._promiseResolver(TableDesignerPublishDialogResult.UpdateDatabase);
|
||||
}
|
||||
|
||||
private handleGenerateScriptButtonClick(): void {
|
||||
this.hide('ok');
|
||||
this._promiseResolver(TableDesignerPublishDialogResult.GenerateScript);
|
||||
}
|
||||
|
||||
private handleCancelButtonClick(): void {
|
||||
this.hide('cancel');
|
||||
this._promiseResolver(TableDesignerPublishDialogResult.Cancel);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user