forked from microsoft/azuredatastudio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing Visualizer to SQL Query Editor (microsoft#6422)
* extension recommendation on application launch * Introducing Visualizer (SandDance) to the SQL Query Editor. (microsoft#6347) * Created Visualizer icon in the results grid. Utilized a context key so that the icon only shows if Visualizer extensions (currently, just SandDance) is installed. Visualizer icon open up SandDance in a top-level document. * When the user clicks on Charts, visualizer recommendation popup appears. User can click on "Install Extensions" to download the visualizer extensions. * Enabled SQL Query Editor to pass query data to SandDance extension. * Introducing Visualizer (SandDance) to the SQL Query Editor. (microsoft#6347) * Created Visualizer icon in the results grid. Utilized a context key so that the icon only shows if Visualizer extensions (currently, just SandDance) is installed. Visualizer icon open up SandDance in a top-level document. * When the user clicks on Charts, visualizer recommendation popup appears. User can click on "Install Extensions" to download the visualizer extensions. * Enabled SQL Query Editor to pass query data to SandDance extension. * Cleaned code; made changes according to PR comments * removed the test service for extensions gallary * Cleaned up code according to PR changes * unid changes to build/azure-piplines * Removed all the build/azure-pipelines changes * removed changes on media/language.svg * refactored extension recommendation system to allow it to be generic * updated extensionsViews to support generic extension query search; added localized constants for visualizer extensions * Made syntax and error message changes acccording to PR comments. * Updated recommendation message according to scenario type
- Loading branch information
1 parent
720a7fb
commit 2c8a22b
Showing
28 changed files
with
337 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the Source EULA. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
export const visualizerExtensions = 'visualizerExtensions'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the Source EULA. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { localize } from 'vs/nls'; | ||
import { IAction, Action } from 'vs/base/common/actions'; | ||
import { ShowViewletAction } from 'vs/workbench/browser/viewlet'; | ||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; | ||
import { IExtension, ExtensionState, IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet, AutoUpdateConfigurationKey, IExtensionContainer, EXTENSIONS_CONFIG, ExtensionsPolicy, ExtensionsPolicyKey } from 'vs/workbench/contrib/extensions/common/extensions'; | ||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; | ||
import { IExtensionRecommendation, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; | ||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; | ||
import { IOpenerService } from 'vs/platform/opener/common/opener'; | ||
import { CancellationToken } from 'vs/base/common/cancellation'; | ||
import { PagedModel } from 'vs/base/common/paging'; | ||
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; | ||
|
||
function getScenarioID(scenarioType: string) { | ||
return 'workbench.extensions.action.show' + scenarioType; | ||
} | ||
|
||
export class ShowRecommendedExtensionsByScenarioAction extends Action { | ||
constructor( | ||
private readonly scenarioType: string, | ||
@IViewletService private readonly viewletService: IViewletService | ||
) { | ||
super(getScenarioID(scenarioType), localize('showRecommendations', "Show Recommendations"), undefined, true); | ||
} | ||
|
||
run(): Promise<void> { | ||
return this.viewletService.openViewlet(VIEWLET_ID, true) | ||
.then(viewlet => viewlet as IExtensionsViewlet) | ||
.then(viewlet => { | ||
viewlet.search('@' + this.scenarioType); | ||
viewlet.focus(); | ||
}); | ||
} | ||
} | ||
|
||
export class InstallRecommendedExtensionsByScenarioAction extends Action { | ||
private _recommendations: IExtensionRecommendation[] = []; | ||
get recommendations(): IExtensionRecommendation[] { return this._recommendations; } | ||
set recommendations(recommendations: IExtensionRecommendation[]) { this._recommendations = recommendations; this.enabled = this._recommendations.length > 0; } | ||
|
||
constructor( | ||
private readonly scenarioType: string, | ||
recommendations: IExtensionRecommendation[], | ||
@IViewletService private readonly viewletService: IViewletService, | ||
@INotificationService private readonly notificationService: INotificationService, | ||
@IInstantiationService private readonly instantiationService: IInstantiationService, | ||
@IOpenerService private readonly openerService: IOpenerService, | ||
@IExtensionsWorkbenchService private readonly extensionWorkbenchService: IExtensionsWorkbenchService, | ||
@IConfigurationService private readonly configurationService: IConfigurationService, | ||
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService | ||
) { | ||
super(getScenarioID(scenarioType), localize('Install Extensions', "Install Extensions"), 'extension-action'); | ||
this.recommendations = recommendations; | ||
} | ||
|
||
run(): Promise<any> { | ||
if (!this.recommendations.length) { return Promise.resolve(); } | ||
return this.viewletService.openViewlet(VIEWLET_ID, true) | ||
.then(viewlet => viewlet as IExtensionsViewlet) | ||
.then(viewlet => { | ||
viewlet.search('@' + this.scenarioType); | ||
viewlet.focus(); | ||
const names = this.recommendations.map(({ extensionId }) => extensionId); | ||
return this.extensionWorkbenchService.queryGallery({ names, source: 'install-' + this.scenarioType }, CancellationToken.None).then(pager => { | ||
let installPromises: Promise<any>[] = []; | ||
let model = new PagedModel(pager); | ||
for (let i = 0; i < pager.total; i++) { | ||
installPromises.push(model.resolve(i, CancellationToken.None).then(e => this.extensionWorkbenchService.install(e))); | ||
} | ||
return Promise.all(installPromises); | ||
}); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,4 @@ export class ChartTab implements IPanelTab { | |
public clear() { | ||
this.view.clear(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.