Skip to content

Commit

Permalink
If a filter exists, show an info message with option to remove filter
Browse files Browse the repository at this point in the history
  • Loading branch information
omranlm committed Jun 29, 2023
1 parent e621f0a commit ed69352
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Container,
Grid,
IconButton,
Link,
Tooltip,
Typography,
} from "@mui/material";
Expand Down Expand Up @@ -170,6 +171,32 @@ const AIModelsList = (props) => {
<Alert severity="error">{error}</Alert>
</Grid>
)}
{localStorage.getItem("modelFilter") !== null &&
JSON.parse(localStorage.getItem("modelFilter")).items.length > 0 &&
JSON.parse(localStorage.getItem("modelFilter")).items[0].value && (
<Grid item xs={12}>
<Grid container justifyContent="flex-end">
<Alert severity="info">
Below list is filtered, click{" "}
<Link
href="#"
color="inherit"
onClick={(e) => {
e.preventDefault();
localStorage.setItem(
"modelFilter",
JSON.stringify(DEFAULT_FILTER)
);
refetch();
}}
>
here
</Link>{" "}
to show all models
</Alert>
</Grid>
</Grid>
)}
<Grid item xs={12}>
{isLoading && <p>Loading ... </p>}
{!isLoading && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Container,
Grid,
IconButton,
Link,
Tooltip,
Typography,
} from "@mui/material";
Expand All @@ -19,7 +20,7 @@ import { trainingDSStatus } from "../../../../utils";
import OSMUser from "../../../Shared/OSMUser";

const DEFAULT_FILTER = {
items: [{ columnField: "created_date", id: 8537, operatorValue: "contains" }],
items: [],
linkOperator: "and",
quickFilterValues: [],
quickFilterLogicOperator: "and",
Expand Down Expand Up @@ -186,6 +187,32 @@ const DatasetList = (props) => {
<Alert severity="error">{error}</Alert>
</Grid>
)}
{localStorage.getItem("dsFilter") !== null &&
JSON.parse(localStorage.getItem("dsFilter")).items.length > 0 &&
JSON.parse(localStorage.getItem("dsFilter")).items[0].value && (
<Grid item xs={12}>
<Grid container justifyContent="flex-end">
<Alert severity="info">
Below list is filtered, click{" "}
<Link
href="#"
color="inherit"
onClick={(e) => {
e.preventDefault();
localStorage.setItem(
"dsFilter",
JSON.stringify(DEFAULT_FILTER)
);
refetch();
}}
>
here
</Link>{" "}
to show all training dataset
</Alert>
</Grid>
</Grid>
)}
<Grid item xs={12}>
{isLoading && <p>Loading ... </p>}
{!isLoading && (
Expand Down

0 comments on commit ed69352

Please sign in to comment.