mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix handling of state in the grid panel (#5867)
* fix handling of state in the grid panel
* trigger rebuild
* trigger rebuild
(cherry picked from commit 7390dce536)
This commit is contained in:
committed by
Charles Gagnon
parent
bfb03d160e
commit
0e2d1e515e
@@ -272,14 +272,15 @@ export class QueryResultsView extends Disposable {
|
|||||||
this._input = input;
|
this._input = input;
|
||||||
dispose(this.runnerDisposables);
|
dispose(this.runnerDisposables);
|
||||||
this.runnerDisposables = [];
|
this.runnerDisposables = [];
|
||||||
|
|
||||||
|
[this.resultsTab, this.messagesTab, this.qpTab, this.topOperationsTab, this.chartTab].forEach(t => t.clear());
|
||||||
|
|
||||||
this.resultsTab.view.state = this.input.state.gridPanelState;
|
this.resultsTab.view.state = this.input.state.gridPanelState;
|
||||||
this.messagesTab.view.state = this.input.state.messagePanelState;
|
this.messagesTab.view.state = this.input.state.messagePanelState;
|
||||||
this.qpTab.view.state = this.input.state.queryPlanState;
|
this.qpTab.view.state = this.input.state.queryPlanState;
|
||||||
this.topOperationsTab.view.state = this.input.state.topOperationsState;
|
this.topOperationsTab.view.state = this.input.state.topOperationsState;
|
||||||
this.chartTab.view.state = this.input.state.chartState;
|
this.chartTab.view.state = this.input.state.chartState;
|
||||||
|
|
||||||
[this.resultsTab, this.messagesTab, this.qpTab, this.topOperationsTab, this.chartTab].forEach(t => t.clear());
|
|
||||||
|
|
||||||
let info = this.queryModelService._getQueryInfo(input.uri);
|
let info = this.queryModelService._getQueryInfo(input.uri);
|
||||||
if (info) {
|
if (info) {
|
||||||
this.setQueryRunner(info.queryRunner);
|
this.setQueryRunner(info.queryRunner);
|
||||||
|
|||||||
@@ -257,13 +257,13 @@ export class GridPanel {
|
|||||||
|
|
||||||
for (let set of resultSet) {
|
for (let set of resultSet) {
|
||||||
let tableState: GridTableState;
|
let tableState: GridTableState;
|
||||||
if (this._state) {
|
if (this.state) {
|
||||||
tableState = this.state.tableStates.find(e => e.batchId === set.batchId && e.resultId === set.id);
|
tableState = this.state.tableStates.find(e => e.batchId === set.batchId && e.resultId === set.id);
|
||||||
}
|
}
|
||||||
if (!tableState) {
|
if (!tableState) {
|
||||||
tableState = new GridTableState(set.id, set.batchId);
|
tableState = new GridTableState(set.id, set.batchId);
|
||||||
if (this._state) {
|
if (this.state) {
|
||||||
this._state.tableStates.push(tableState);
|
this.state.tableStates.push(tableState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let table = this.instantiationService.createInstance(GridTable, this.runner, set, tableState);
|
let table = this.instantiationService.createInstance(GridTable, this.runner, set, tableState);
|
||||||
@@ -295,13 +295,13 @@ export class GridPanel {
|
|||||||
|
|
||||||
public clear() {
|
public clear() {
|
||||||
this.reset();
|
this.reset();
|
||||||
|
this.state = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
private reset() {
|
private reset() {
|
||||||
for (let i = this.splitView.length - 1; i >= 0; i--) {
|
for (let i = this.splitView.length - 1; i >= 0; i--) {
|
||||||
this.splitView.removeView(i);
|
this.splitView.removeView(i);
|
||||||
}
|
}
|
||||||
this._state = undefined;
|
|
||||||
dispose(this.tables);
|
dispose(this.tables);
|
||||||
dispose(this.tableDisposable);
|
dispose(this.tableDisposable);
|
||||||
this.tableDisposable = [];
|
this.tableDisposable = [];
|
||||||
@@ -336,15 +336,17 @@ export class GridPanel {
|
|||||||
|
|
||||||
public set state(val: GridPanelState) {
|
public set state(val: GridPanelState) {
|
||||||
this._state = val;
|
this._state = val;
|
||||||
this.tables.map(t => {
|
if (this.state) {
|
||||||
let state = this.state.tableStates.find(s => s.batchId === t.resultSet.batchId && s.resultId === t.resultSet.id);
|
this.tables.map(t => {
|
||||||
if (!state) {
|
let state = this.state.tableStates.find(s => s.batchId === t.resultSet.batchId && s.resultId === t.resultSet.id);
|
||||||
this.state.tableStates.push(t.state);
|
if (!state) {
|
||||||
}
|
this.state.tableStates.push(t.state);
|
||||||
if (state) {
|
}
|
||||||
t.state = state;
|
if (state) {
|
||||||
}
|
t.state = state;
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public get state() {
|
public get state() {
|
||||||
|
|||||||
Reference in New Issue
Block a user