bug: current page is updated in redux to see the updated values

This commit is contained in:
Palash gupta 2022-04-06 10:52:46 +05:30
parent 8809105a8d
commit d72dacdc1f
No known key found for this signature in database
GPG Key ID: 8FD05AE6F9150AD6
3 changed files with 33 additions and 2 deletions

View File

@ -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,

View File

@ -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;
}

View File

@ -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;