From 08e5f213fbbe4b3d149374cae527824a8ddfbbc8 Mon Sep 17 00:00:00 2001 From: dlpzx Date: Tue, 6 Sep 2022 08:43:19 +0200 Subject: [PATCH] Set page filter to 1 for all lists when we click enter in search bar --- frontend/src/views/Dashboards/DashboardList.js | 1 + frontend/src/views/Datasets/DatasetList.js | 1 + frontend/src/views/Environments/EnvironmentList.js | 1 + frontend/src/views/MLStudio/NotebookList.js | 1 + frontend/src/views/Notebooks/NotebookList.js | 1 + frontend/src/views/Pipelines/PipelineList.js | 1 + frontend/src/views/Worksheets/WorksheetList.js | 1 + 7 files changed, 7 insertions(+) diff --git a/frontend/src/views/Dashboards/DashboardList.js b/frontend/src/views/Dashboards/DashboardList.js index 209845868..4feb62213 100644 --- a/frontend/src/views/Dashboards/DashboardList.js +++ b/frontend/src/views/Dashboards/DashboardList.js @@ -110,6 +110,7 @@ const DashboardList = () => { const handleInputKeyup = (event) => { if (event.code === 'Enter') { + setFilter({page: 1, term: event.target.value}); fetchItems().catch((e) => dispatch({ type: SET_ERROR, error: e.message }) ); diff --git a/frontend/src/views/Datasets/DatasetList.js b/frontend/src/views/Datasets/DatasetList.js index 2a764cd4b..a62fea7df 100644 --- a/frontend/src/views/Datasets/DatasetList.js +++ b/frontend/src/views/Datasets/DatasetList.js @@ -110,6 +110,7 @@ const DatasetList = () => { const handleInputKeyup = (event) => { if (event.code === 'Enter') { + setFilter({page: 1, term: event.target.value}); fetchItems().catch((e) => dispatch({ type: SET_ERROR, error: e.message }) ); diff --git a/frontend/src/views/Environments/EnvironmentList.js b/frontend/src/views/Environments/EnvironmentList.js index 43bbc81ea..6b105d1c2 100644 --- a/frontend/src/views/Environments/EnvironmentList.js +++ b/frontend/src/views/Environments/EnvironmentList.js @@ -84,6 +84,7 @@ const EnvironmentList = () => { const handleInputKeyup = (event) => { if (event.code === 'Enter') { + setFilter({page: 1, term: event.target.value}); fetchItems().catch((e) => dispatch({ type: SET_ERROR, error: e.message }) ); diff --git a/frontend/src/views/MLStudio/NotebookList.js b/frontend/src/views/MLStudio/NotebookList.js index d61710f07..d9fd45670 100644 --- a/frontend/src/views/MLStudio/NotebookList.js +++ b/frontend/src/views/MLStudio/NotebookList.js @@ -101,6 +101,7 @@ const NotebookList = () => { const handleInputKeyup = (event) => { if (event.code === 'Enter') { + setFilter({page: 1, term: event.target.value}); fetchItems().catch((e) => dispatch({ type: SET_ERROR, error: e.message }) ); diff --git a/frontend/src/views/Notebooks/NotebookList.js b/frontend/src/views/Notebooks/NotebookList.js index b04f1271f..deba2258d 100644 --- a/frontend/src/views/Notebooks/NotebookList.js +++ b/frontend/src/views/Notebooks/NotebookList.js @@ -99,6 +99,7 @@ const NotebookList = () => { const handleInputKeyup = (event) => { if (event.code === 'Enter') { + setFilter({page: 1, term: event.target.value}); fetchItems().catch((e) => dispatch({ type: SET_ERROR, error: e.message }) ); diff --git a/frontend/src/views/Pipelines/PipelineList.js b/frontend/src/views/Pipelines/PipelineList.js index 49345a4d6..e1eab1b9c 100644 --- a/frontend/src/views/Pipelines/PipelineList.js +++ b/frontend/src/views/Pipelines/PipelineList.js @@ -99,6 +99,7 @@ const PipelineList = () => { const handleInputKeyup = (event) => { if (event.code === 'Enter') { + setFilter({page: 1, term: event.target.value}); fetchItems().catch((e) => dispatch({ type: SET_ERROR, error: e.message }) ); diff --git a/frontend/src/views/Worksheets/WorksheetList.js b/frontend/src/views/Worksheets/WorksheetList.js index 805623b36..9d6a7b55a 100644 --- a/frontend/src/views/Worksheets/WorksheetList.js +++ b/frontend/src/views/Worksheets/WorksheetList.js @@ -108,6 +108,7 @@ const WorksheetList = () => { const handleInputKeyup = (event) => { if (event.code === 'Enter') { + setFilter({page: 1, term: event.target.value}); fetchItems().catch((e) => dispatch({ type: SET_ERROR, error: e.message }) );