Skip to content

Commit

Permalink
Change log level select clear option value to INVALID_LOG_LEVEL_VALUE.
Browse files Browse the repository at this point in the history
  • Loading branch information
junhaoliao committed Oct 1, 2024
1 parent b8b0682 commit 2d64c6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
import RemoveIcon from "@mui/icons-material/Remove";

import {
INVALID_LOG_LEVEL_VALUE,
LOG_LEVEL,
LOG_LEVEL_NAMES,
MAX_LOG_LEVEL,
Expand Down Expand Up @@ -123,7 +124,7 @@ interface ClearFiltersOptionProps {
*/
const ClearFiltersOption = ({onClick}: ClearFiltersOptionProps) => (
<Option
value={null}
value={INVALID_LOG_LEVEL_VALUE}
onClick={onClick}
>
<ListItemDecorator>
Expand Down
6 changes: 6 additions & 0 deletions new-log-viewer/src/typings/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ enum LOG_LEVEL {
FATAL
}

/**
* Out-of-range value for `LOG_LEVEL`.
*/
const INVALID_LOG_LEVEL_VALUE = LOG_LEVEL.UNKNOWN - 1;

/**
* Key names in enum `LOG_LEVEL`.
*/
Expand All @@ -27,6 +32,7 @@ const MAX_LOG_LEVEL = Math.max(...LOG_LEVEL_VALUES);
const INVALID_TIMESTAMP_VALUE = 0;

export {
INVALID_LOG_LEVEL_VALUE,
INVALID_TIMESTAMP_VALUE,
LOG_LEVEL,
LOG_LEVEL_NAMES,
Expand Down

0 comments on commit 2d64c6c

Please sign in to comment.