Skip to content

Commit

Permalink
Fixing issues with zooming during search
Browse files Browse the repository at this point in the history
Signed-off-by: hriday-panchasara <hriday.panchasara@ericsson.com>
  • Loading branch information
hriday-panchasara committed Jun 30, 2023
1 parent e150859 commit df9b517
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions timeline-chart/src/layer/time-graph-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,14 @@ export class TimeGraphChart extends TimeGraphChartLayer {
const request = { worldRange, resolution, rowIds: [rowIds[i]], additionalParams, fullSearch };
await this.fetchRows(request, i === rowIds.length -1, fine);
} catch(error) {
break;
return;
}
}
// When row-by-row fetch is completed (not interrupted by new request), update model with filter
for (let i = 0; i < rowIds.length; i++) {
const rowComponent = this.rowComponents.get(rowIds[i]);
if (rowComponent && rowComponent.providedModel) {
rowComponent.providedModel.filterExpressionsMap = this._filterExpressionsMap;
}
}
} else {
Expand Down Expand Up @@ -566,7 +573,7 @@ export class TimeGraphChart extends TimeGraphChartLayer {
return Promise.reject(new Error("Ongoing request updated"));
}
if (rowData) {
this.addOrUpdateRows(rowData, request.fullSearch);
this.addOrUpdateRows(rowData);
if (this.isNavigating) {
this.selectStateInNavigation();
}
Expand Down Expand Up @@ -602,11 +609,11 @@ export class TimeGraphChart extends TimeGraphChartLayer {
this.selectedStateChangedHandler.forEach((handler) => handler(this.selectedStateModel));
}

protected addOrUpdateRows(rowData: { rows: TimelineChart.TimeGraphRowModel[], range: TimelineChart.TimeGraphRange, resolution: number }, fullSearch?: boolean) {
protected addOrUpdateRows(rowData: { rows: TimelineChart.TimeGraphRowModel[], range: TimelineChart.TimeGraphRange, resolution: number }) {
if (!this.stateController) {
throw 'Add this TimeGraphChart to a container before adding rows.';
}
const providedModel = { range: rowData.range, resolution: rowData.resolution, filterExpressionsMap: fullSearch ? this._filterExpressionsMap : undefined };
const providedModel = { range: rowData.range, resolution: rowData.resolution };
rowData.rows.forEach(row => {
const rowComponent = this.rowComponents.get(row.id);
if (rowComponent) {
Expand Down

0 comments on commit df9b517

Please sign in to comment.