Skip to content

Commit f556492

Browse files
committed
fix(query): incorrect selector
1 parent 69bdb59 commit f556492

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/containers/Tenant/utils/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ export const MAX_QUERY_HEIGHT = 6;
66

77
export const QUERY_TABLE_SETTINGS: Settings = {
88
...DEFAULT_TABLE_SETTINGS,
9-
dynamicRenderType: 'variable',
9+
dynamicRenderType: 'simple',
1010
};

src/store/reducers/query/query.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,6 @@ const slice = createSlice({
148148
selectResult: (state) => state.result,
149149
selectStartTime: (state) => state.result?.startTime,
150150
selectEndTime: (state) => state.result?.endTime,
151-
selectQueriesHistory: (state) => {
152-
const items = state.history.queries;
153-
const filter = state.history.filter?.toLowerCase();
154-
155-
return filter
156-
? items.filter((item) => item.queryText.toLowerCase().includes(filter))
157-
: items;
158-
},
159151
selectUserInput: (state) => state.input,
160152
selectIsDirty: (state) => state.isDirty,
161153
selectQueriesHistoryCurrentIndex: (state) => state.history?.currentIndex,
@@ -174,6 +166,19 @@ export const selectQueryDuration = createSelector(
174166
},
175167
);
176168

169+
export const selectQueriesHistory = createSelector(
170+
[
171+
(state: RootState) => state.query.history.queries,
172+
(state: RootState) => state.query.history.filter,
173+
],
174+
(queries, filter) => {
175+
const normalizedFilter = filter?.toLowerCase();
176+
return normalizedFilter
177+
? queries.filter((item) => item.queryText.toLowerCase().includes(normalizedFilter))
178+
: queries;
179+
},
180+
);
181+
177182
export default slice.reducer;
178183
export const {
179184
changeUserInput,
@@ -194,7 +199,6 @@ export const {
194199
export const {
195200
selectQueriesHistoryFilter,
196201
selectQueriesHistoryCurrentIndex,
197-
selectQueriesHistory,
198202
selectTenantPath,
199203
selectResult,
200204
selectUserInput,

0 commit comments

Comments
 (0)