diff --git a/frontend/src/container/Trace/TraceTable/index.tsx b/frontend/src/container/Trace/TraceTable/index.tsx index b78d709b4f..8115c8ee64 100644 --- a/frontend/src/container/Trace/TraceTable/index.tsx +++ b/frontend/src/container/Trace/TraceTable/index.tsx @@ -10,7 +10,10 @@ import { Dispatch } from 'redux'; import { updateURL } from 'store/actions/trace/util'; import { AppState } from 'store/reducers'; import AppActions from 'types/actions'; -import { UPDATE_SPAN_ORDER } from 'types/actions/trace'; +import { + UPDATE_SPAN_ORDER, + UPDATE_SPANS_AGGREGATE_PAGE_NUMBER, +} from 'types/actions/trace'; import { TraceReducer } from 'types/reducer/trace'; dayjs.extend(duration); @@ -136,6 +139,13 @@ function TraceTable(): JSX.Element { }, }); + dispatch({ + type: UPDATE_SPANS_AGGREGATE_PAGE_NUMBER, + payload: { + currentPage: props.current, + }, + }); + updateURL( selectedFilter, filterToFetchData, diff --git a/frontend/src/store/reducers/trace.ts b/frontend/src/store/reducers/trace.ts index 46328c4858..010813c16e 100644 --- a/frontend/src/store/reducers/trace.ts +++ b/frontend/src/store/reducers/trace.ts @@ -11,6 +11,7 @@ import { UPDATE_SELECTED_TAGS, UPDATE_SPAN_ORDER, UPDATE_SPANS_AGGREGATE, + UPDATE_SPANS_AGGREGATE_PAGE_NUMBER, UPDATE_TAG_MODAL_VISIBILITY, UPDATE_TRACE_FILTER, UPDATE_TRACE_FILTER_LOADING, @@ -213,6 +214,16 @@ const traceReducer = ( }; } + case UPDATE_SPANS_AGGREGATE_PAGE_NUMBER: { + return { + ...state, + spansAggregate: { + ...state.spansAggregate, + currentPage: action.payload.currentPage, + }, + }; + } + default: return state; } diff --git a/frontend/src/types/actions/trace.ts b/frontend/src/types/actions/trace.ts index c6f1f12bba..cfdb86bcbb 100644 --- a/frontend/src/types/actions/trace.ts +++ b/frontend/src/types/actions/trace.ts @@ -26,6 +26,8 @@ export const UPDATE_FILTER_RESPONSE_SELECTED = export const UPDATE_FILTER_EXCLUDE = 'UPDATE_FILTER_EXCLUDE'; export const UPDATE_SPAN_ORDER = 'UPDATE_SPAN_ORDER'; +export const UPDATE_SPANS_AGGREGATE_PAGE_NUMBER = + 'UPDATE_SPANS_AGGREGATE_PAGE_NUMBER'; export interface UpdateFilter { type: typeof UPDATE_TRACE_FILTER; @@ -152,6 +154,13 @@ export interface UpdateSpans { }; } +export interface UpdateSpansAggregatePageNumber { + type: typeof UPDATE_SPANS_AGGREGATE_PAGE_NUMBER; + payload: { + currentPage: TraceReducer['spansAggregate']['currentPage']; + }; +} + export interface UpdateSpanOrder { type: typeof UPDATE_SPAN_ORDER; payload: { @@ -177,4 +186,5 @@ export type TraceActions = | ResetTraceFilter | UpdateSelected | UpdateFilterExclude - | UpdateSpanOrder; + | UpdateSpanOrder + | UpdateSpansAggregatePageNumber;