-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Schema: All models filter by user (#1824)
* task: added basic structure of filters * task: add filter dropdown function * task: dynamic button based on filter status * task: moved hooks folder to components root dir * task: added filters reducer * task: add filter logic * task: added filter logic for other filters * task: added reusable flterbase component * task: rename component * task: use filterbutton component for lastupdate and people filters * task: fixed height issue * task: removed unused imports * task: removed todo * task: added user type and updated getUsers type * task: added filter logic * task: added user filter menu item * task: made no results component reusable * task: moved UserFilter and FilterButton to shell/components * task: renamed props * task: cleanup * task: changed value type for filters
- Loading branch information
1 parent
7370831
commit 2ec712f
Showing
13 changed files
with
238 additions
and
82 deletions.
There are no files selected for viewing
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
src/apps/schema/src/appRevamp/components/Filters/LastUpdated.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
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
13 changes: 0 additions & 13 deletions
13
src/apps/schema/src/appRevamp/components/Filters/People.tsx
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Box, Typography, Button, SxProps, SvgIcon } from "@mui/material"; | ||
import SearchRoundedIcon from "@mui/icons-material/SearchRounded"; | ||
import RestartAltRounded from "@mui/icons-material/RestartAltRounded"; | ||
|
||
import noSearchResults from "../../../../../../public/images/noSearchResults.svg"; | ||
|
||
const TEXT_CONFIG = { | ||
search: { | ||
header: "Your search “{searchTerm}” could not find any results", | ||
subHeader: | ||
"Try adjusting your search. We suggest check all words are spelled correctly or try using different keywords.", | ||
buttonText: "Search Again", | ||
buttonIcon: SearchRoundedIcon, | ||
}, | ||
filter: { | ||
header: "No models were found", | ||
subHeader: "Try adjusting the filters to find what you were looking for.", | ||
buttonText: "Clear Filters", | ||
buttonIcon: RestartAltRounded, | ||
}, | ||
}; | ||
|
||
interface Props { | ||
type: "search" | "filter"; | ||
searchTerm?: string; | ||
onButtonClick: () => void; | ||
sx?: SxProps; | ||
} | ||
export const NoResults = ({ type, searchTerm, onButtonClick, sx }: Props) => { | ||
return ( | ||
<Box textAlign="center" sx={sx}> | ||
<img src={noSearchResults} alt="No search results" /> | ||
<Typography pt={1.5} pb={1} variant="h4" fontWeight={600}> | ||
{TEXT_CONFIG[type].header.replace("{searchTerm}", searchTerm)} | ||
</Typography> | ||
<Typography variant="body2" pb={3} color="text.secondary"> | ||
{TEXT_CONFIG[type].subHeader} | ||
</Typography> | ||
<Button | ||
onClick={onButtonClick} | ||
variant="contained" | ||
startIcon={<SvgIcon component={TEXT_CONFIG[type].buttonIcon} />} | ||
> | ||
{TEXT_CONFIG[type].buttonText} | ||
</Button> | ||
</Box> | ||
); | ||
}; |
31 changes: 0 additions & 31 deletions
31
src/apps/schema/src/appRevamp/components/NoSearchResults.tsx
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.