mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 01:25:38 -05:00
Add keyboard shortcuts for focus on current query and go to next output query tab (#1153)
* add go to next output query tab shotcut * add a new keyboard shortcut for focus on current query * minor change
This commit is contained in:
@@ -17,3 +17,4 @@ export let SelectAllMessages = 'SelectAllMessages';
|
||||
export let SaveAsCsv = 'SaveAsCSV';
|
||||
export let SaveAsJSON = 'SaveAsJSON';
|
||||
export let SaveAsExcel = 'SaveAsExcel';
|
||||
export let GoToNextQueryOutputTab = 'GoToNextQueryOutputTab';
|
||||
|
||||
@@ -24,6 +24,8 @@ export const MESSAGES_SELECTALL_ID = 'grid.messages.selectAll';
|
||||
export const MESSAGES_COPY_ID = 'grid.messages.copy';
|
||||
export const TOGGLERESULTS_ID = 'grid.toggleResultPane';
|
||||
export const TOGGLEMESSAGES_ID = 'grid.toggleMessagePane';
|
||||
export const GOTONEXTQUERYOUTPUTTAB_ID = 'query.goToNextQueryOutputTab';
|
||||
|
||||
|
||||
export class GridActionProvider {
|
||||
|
||||
|
||||
@@ -53,6 +53,10 @@ export const toggleResultsPane = (accessor: ServicesAccessor) => {
|
||||
runActionOnActiveResultsEditor(accessor, GridContentEvents.ToggleResultPane);
|
||||
};
|
||||
|
||||
export const goToNextQueryOutputTab = (accessor: ServicesAccessor) => {
|
||||
runActionOnActiveResultsEditor(accessor, GridContentEvents.GoToNextQueryOutputTab);
|
||||
};
|
||||
|
||||
export const saveAsCsv = (accessor: ServicesAccessor) => {
|
||||
runActionOnActiveResultsEditor(accessor, GridContentEvents.SaveAsCsv);
|
||||
};
|
||||
|
||||
@@ -165,6 +165,9 @@ export abstract class GridParentComponent {
|
||||
case GridContentEvents.SaveAsExcel:
|
||||
self.sendSaveRequest(SaveFormat.EXCEL);
|
||||
break;
|
||||
case GridContentEvents.GoToNextQueryOutputTab:
|
||||
self.goToNextQueryOutputTab();
|
||||
break;
|
||||
default:
|
||||
error('Unexpected grid content event type "' + type + '" sent');
|
||||
break;
|
||||
@@ -272,6 +275,9 @@ export abstract class GridParentComponent {
|
||||
return '';
|
||||
}
|
||||
|
||||
protected goToNextQueryOutputTab(): void {
|
||||
}
|
||||
|
||||
private initShortcutsBase(): void {
|
||||
let shortcuts = {
|
||||
'ToggleResultPane': () => {
|
||||
@@ -297,6 +303,9 @@ export abstract class GridParentComponent {
|
||||
},
|
||||
'SaveAsExcel': () => {
|
||||
this.sendSaveRequest(SaveFormat.EXCEL);
|
||||
},
|
||||
'GoToNextQueryOutputTab': () => {
|
||||
this.goToNextQueryOutputTab();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -146,6 +146,7 @@ export class QueryComponent extends GridParentComponent implements OnInit, OnDes
|
||||
public queryExecutionStatus: EventEmitter<string> = new EventEmitter<string>();
|
||||
public queryPlanAvailable: EventEmitter<string> = new EventEmitter<string>();
|
||||
public showChartRequested: EventEmitter<IGridDataSet> = new EventEmitter<IGridDataSet>();
|
||||
public goToNextQueryOutputTabRequested: EventEmitter<void> = new EventEmitter<void>();
|
||||
|
||||
@Input() public queryParameters: QueryComponentParams;
|
||||
|
||||
@@ -578,6 +579,10 @@ export class QueryComponent extends GridParentComponent implements OnInit, OnDes
|
||||
}
|
||||
}
|
||||
|
||||
protected goToNextQueryOutputTab(): void {
|
||||
this.goToNextQueryOutputTabRequested.emit();
|
||||
}
|
||||
|
||||
protected toggleResultPane(): void {
|
||||
this.resultActive = !this.resultActive;
|
||||
this._cd.detectChanges();
|
||||
|
||||
Reference in New Issue
Block a user