-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display category and scenario name as breadcrumbs on scenario list (#…
- Loading branch information
Showing
13 changed files
with
103 additions
and
45 deletions.
There are no files selected for viewing
Binary file modified
BIN
+2.59 KB
(100%)
...apshots__/electron/Linux/Processes list should filter by processing mode #0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 41 additions & 8 deletions
49
designer/submodules/packages/components/src/common/categoryChip.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,56 @@ | ||
import React, { useCallback, useMemo } from "react"; | ||
import { Chip } from "@mui/material"; | ||
import { Button, Chip, Typography } from "@mui/material"; | ||
|
||
interface Props { | ||
value: string; | ||
filterValue: string[]; | ||
category: string; | ||
filterValues: string[]; | ||
setFilter: (value: string[]) => void; | ||
} | ||
|
||
export function CategoryChip({ value, filterValue, setFilter }: Props): JSX.Element { | ||
const isSelected = useMemo(() => filterValue.includes(value), [filterValue, value]); | ||
export function CategoryChip({ category, filterValues, setFilter }: Props): JSX.Element { | ||
const isSelected = useMemo(() => filterValues.includes(category), [filterValues, category]); | ||
|
||
const onClick = useCallback( | ||
(e) => { | ||
setFilter(isSelected ? filterValue.filter((v) => v !== value) : [...filterValue, value]); | ||
setFilter(isSelected ? filterValues.filter((v) => v !== category) : [...filterValues, category]); | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
}, | ||
[setFilter, isSelected, filterValue, value], | ||
[setFilter, isSelected, filterValues, category], | ||
); | ||
|
||
return <Chip tabIndex={0} label={value} size="small" color={isSelected ? "primary" : "default"} onClick={onClick} />; | ||
return <Chip tabIndex={0} label={category} size="small" color={isSelected ? "primary" : "default"} onClick={onClick} />; | ||
} | ||
|
||
export function CategoryButton({ category, filterValues, setFilter }: Props): JSX.Element { | ||
const isSelected = useMemo(() => filterValues.includes(category), [filterValues, category]); | ||
|
||
const onClick = useCallback( | ||
(e) => { | ||
setFilter(isSelected ? filterValues.filter((v) => v !== category) : [...filterValues, category]); | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
}, | ||
[setFilter, isSelected, filterValues, category], | ||
); | ||
|
||
return ( | ||
<Typography | ||
component={Button} | ||
color={isSelected ? "primary" : "inherit"} | ||
sx={{ | ||
textTransform: "capitalize", | ||
display: "flex", | ||
gap: 1, | ||
alignItems: "center", | ||
minWidth: "unset", | ||
p: 0, | ||
mx: 0, | ||
}} | ||
onClick={onClick} | ||
aria-selected={isSelected} | ||
> | ||
{category} | ||
</Typography> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
designer/submodules/packages/components/src/components/usages/usagesFiltersModel.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters