Skip to content

Commit 19debbc

Browse files
atrakhConvex, Inc.
authored andcommitted
dashboard: fix bug in logs page component filtering logic (#37254)
Updates `filterLogs` to keep filter out logs that don't belong to the selected components in the case where the selected set of functions is "all" GitOrigin-RevId: 9b2f75d9eaa888d0ad333e0e106fa9a40216ae65
1 parent 7e46a6b commit 19debbc

File tree

6 files changed

+324
-7
lines changed

6 files changed

+324
-7
lines changed

npm-packages/dashboard-common/src/features/functions/components/FunctionLogs.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export function FunctionLogs({
9191
logTypes: DEFAULT_LOG_LEVELS,
9292
functions: [functionId],
9393
selectedFunctions: [functionId],
94+
selectedNents: selectedNent ? [selectedNent.path] : "all",
9495
filter: "",
9596
},
9697
entries,
@@ -149,6 +150,7 @@ export function FunctionLogs({
149150
logTypes: selectedLevels,
150151
functions: [functionId],
151152
selectedFunctions: [functionId],
153+
selectedNents: selectedNent ? [selectedNent.path] : "all",
152154
filter: filter ?? "",
153155
},
154156
logs,

npm-packages/dashboard-common/src/features/logs/components/LogList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ function RequestIdLogs({
308308
logTypes: selectedLevels,
309309
functions,
310310
selectedFunctions,
311+
selectedNents: "all" as MultiSelectValue,
311312
filter,
312313
};
313314

npm-packages/dashboard-common/src/features/logs/components/LogToolbar.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,8 @@ export const selectNentOption =
164164

165165
export const functionsForSelectedNents = (
166166
nents: MultiSelectValue,
167-
functions: string[] | MultiSelectValue,
167+
functions: string[],
168168
): string[] | "all" => {
169-
if (functions === "all") return functions;
170-
171169
const nentArray = nents === "all" ? [] : nents;
172170
const functionArray = Array.isArray(functions) ? functions : [];
173171

npm-packages/dashboard-common/src/features/logs/components/Logs.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@ export function Logs({
109109
() => ({
110110
logTypes: levels,
111111
functions,
112+
selectedNents,
112113
selectedFunctions,
113114
filter,
114115
}),
115-
[filter, functions, levels, selectedFunctions],
116+
[filter, functions, levels, selectedFunctions, selectedNents],
116117
);
117118
const previousFilters = usePrevious(filters);
118119

0 commit comments

Comments
 (0)