mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
feat(LogsViewer): refactor saved view query handling for improved clarity and type safety
This commit is contained in:
@@ -567,15 +567,15 @@ const DashboardLogsViewer: FunctionComponent<ComponentProps> = (
|
||||
const applySavedView: (savedView: LogSavedView) => void = useCallback(
|
||||
(savedView: LogSavedView): void => {
|
||||
const baseQuery: Query<Log> = buildBaseQuery(props);
|
||||
const rawQuery: JSONObject =
|
||||
(savedView.query as unknown as JSONObject) || {};
|
||||
const savedQuery: Query<Log> = (JSONFunctions.deserialize(
|
||||
JSONFunctions.serialize(
|
||||
(savedView.query || {}) as unknown as JSONObject,
|
||||
),
|
||||
JSONFunctions.serialize(rawQuery),
|
||||
) || {}) as Query<Log>;
|
||||
const mergedQuery: Query<Log> = {
|
||||
...savedQuery,
|
||||
...baseQuery,
|
||||
} as Query<Log>;
|
||||
...(savedQuery as unknown as JSONObject),
|
||||
...(baseQuery as unknown as JSONObject),
|
||||
} as unknown as Query<Log>;
|
||||
const nextTimeRange: RangeStartAndEndDateTime | undefined =
|
||||
resolveSavedTimeRange(savedQuery);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user