From ed69352dc872d2ee95cf0b11d862a3e7a29b910f Mon Sep 17 00:00:00 2001 From: Omran NAJJAR Date: Thu, 29 Jun 2023 12:04:51 +0200 Subject: [PATCH] If a filter exists, show an info message with option to remove filter --- .../AIModels/AIModelsList/AIModelsList.js | 27 +++++++++++++++++ .../TrainingDS/DatasetList/DatasetList.js | 29 ++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Layout/AIModels/AIModelsList/AIModelsList.js b/frontend/src/components/Layout/AIModels/AIModelsList/AIModelsList.js index 89c3edf6..c1fb802b 100644 --- a/frontend/src/components/Layout/AIModels/AIModelsList/AIModelsList.js +++ b/frontend/src/components/Layout/AIModels/AIModelsList/AIModelsList.js @@ -5,6 +5,7 @@ import { Container, Grid, IconButton, + Link, Tooltip, Typography, } from "@mui/material"; @@ -170,6 +171,32 @@ const AIModelsList = (props) => { {error} )} + {localStorage.getItem("modelFilter") !== null && + JSON.parse(localStorage.getItem("modelFilter")).items.length > 0 && + JSON.parse(localStorage.getItem("modelFilter")).items[0].value && ( + + + + Below list is filtered, click{" "} + { + e.preventDefault(); + localStorage.setItem( + "modelFilter", + JSON.stringify(DEFAULT_FILTER) + ); + refetch(); + }} + > + here + {" "} + to show all models + + + + )} {isLoading &&

Loading ...

} {!isLoading && ( diff --git a/frontend/src/components/Layout/TrainingDS/DatasetList/DatasetList.js b/frontend/src/components/Layout/TrainingDS/DatasetList/DatasetList.js index e5c8bbdb..641cfff7 100644 --- a/frontend/src/components/Layout/TrainingDS/DatasetList/DatasetList.js +++ b/frontend/src/components/Layout/TrainingDS/DatasetList/DatasetList.js @@ -5,6 +5,7 @@ import { Container, Grid, IconButton, + Link, Tooltip, Typography, } from "@mui/material"; @@ -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", @@ -186,6 +187,32 @@ const DatasetList = (props) => { {error}
)} + {localStorage.getItem("dsFilter") !== null && + JSON.parse(localStorage.getItem("dsFilter")).items.length > 0 && + JSON.parse(localStorage.getItem("dsFilter")).items[0].value && ( + + + + Below list is filtered, click{" "} + { + e.preventDefault(); + localStorage.setItem( + "dsFilter", + JSON.stringify(DEFAULT_FILTER) + ); + refetch(); + }} + > + here + {" "} + to show all training dataset + + + + )} {isLoading &&

Loading ...

} {!isLoading && (