fix result selection summary issues (#15245)

This commit is contained in:
Alan Ren
2021-04-26 23:07:55 -07:00
committed by GitHub
parent a086ad6ff1
commit 0ed2a5d431
6 changed files with 34 additions and 23 deletions

View File

@@ -73,4 +73,5 @@ export interface ResultSetSubset {
export interface ICellValue {
displayValue: string;
isNull?: boolean;
invariantCultureDisplayValue?: string;
}

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import QueryRunner from 'sql/workbench/services/query/common/queryRunner';
import { IQueryMessage, ResultSetSubset } from 'sql/workbench/services/query/common/query';
import { ICellValue, IQueryMessage, ResultSetSubset } from 'sql/workbench/services/query/common/query';
import { DataService } from 'sql/workbench/services/query/common/dataService';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { Event } from 'vs/base/common/event';
@@ -48,8 +48,8 @@ export interface IQueryEvent {
export interface IQueryModelService {
_serviceBrand: undefined;
onCellSelectionChanged: Event<string[]>;
notifyCellSelectionChanged(selectedValues: string[]): void;
onCellSelectionChanged: Event<ICellValue[]>;
notifyCellSelectionChanged(selectedValues: ICellValue[]): void;
getQueryRunner(uri: string): QueryRunner | undefined;

View File

@@ -5,7 +5,7 @@
import * as GridContentEvents from 'sql/workbench/services/query/common/gridContentEvents';
import QueryRunner from 'sql/workbench/services/query/common/queryRunner';
import { ResultSetSubset } from 'sql/workbench/services/query/common/query';
import { ICellValue, ResultSetSubset } from 'sql/workbench/services/query/common/query';
import { DataService } from 'sql/workbench/services/query/common/dataService';
import { IQueryModelService, IQueryEvent } from 'sql/workbench/services/query/common/queryModel';
@@ -62,7 +62,7 @@ export class QueryModelService implements IQueryModelService {
private _onRunQueryComplete: Emitter<string>;
private _onQueryEvent: Emitter<IQueryEvent>;
private _onEditSessionReady: Emitter<azdata.EditSessionReadyParams>;
private _onCellSelectionChangedEmitter = new Emitter<string[]>();
private _onCellSelectionChangedEmitter = new Emitter<ICellValue[]>();
// EVENTS /////////////////////////////////////////////////////////////
public get onRunQueryStart(): Event<string> { return this._onRunQueryStart.event; }
@@ -70,7 +70,7 @@ export class QueryModelService implements IQueryModelService {
public get onRunQueryComplete(): Event<string> { return this._onRunQueryComplete.event; }
public get onQueryEvent(): Event<IQueryEvent> { return this._onQueryEvent.event; }
public get onEditSessionReady(): Event<azdata.EditSessionReadyParams> { return this._onEditSessionReady.event; }
public get onCellSelectionChanged(): Event<string[]> { return this._onCellSelectionChangedEmitter.event; }
public get onCellSelectionChanged(): Event<ICellValue[]> { return this._onCellSelectionChangedEmitter.event; }
// CONSTRUCTOR /////////////////////////////////////////////////////////
constructor(
@@ -100,10 +100,10 @@ export class QueryModelService implements IQueryModelService {
/**
* Notify the event subscribers about the new selected cell values
* @param selectedValues current selected cell values
* @param selectedCells current selected cells
*/
public notifyCellSelectionChanged(selectedValues: string[]): void {
this._onCellSelectionChangedEmitter.fire(selectedValues);
public notifyCellSelectionChanged(selectedCells: ICellValue[]): void {
this._onCellSelectionChangedEmitter.fire(selectedCells);
}
/**

View File

@@ -10,12 +10,12 @@ import { Event } from 'vs/base/common/event';
import { QueryInfo } from 'sql/workbench/services/query/common/queryModelService';
import { DataService } from 'sql/workbench/services/query/common/dataService';
import { IRange } from 'vs/editor/common/core/range';
import { ICellValue } from 'sql/workbench/services/query/common/query';
export class TestQueryModelService implements IQueryModelService {
_serviceBrand: any;
onRunQueryUpdate: Event<string>;
onCellSelectionChanged: Event<string[]>;
notifyCellSelectionChanged(selectedValues: string[]): void {
onCellSelectionChanged: Event<ICellValue[]>;
notifyCellSelectionChanged(selectedCells: ICellValue[]): void {
throw new Error('Method not implemented.');
}
getQueryRunner(uri: string): QueryRunner {