From 64fab61e955c5515230d16dbb3950f037b234481 Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Tue, 12 Dec 2023 19:10:36 +0100 Subject: [PATCH 1/4] fix table select --- frontend/src/pages/Charts/Configs/ChartConfig.jsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/Charts/Configs/ChartConfig.jsx b/frontend/src/pages/Charts/Configs/ChartConfig.jsx index 0b188e9..df43b6f 100644 --- a/frontend/src/pages/Charts/Configs/ChartConfig.jsx +++ b/frontend/src/pages/Charts/Configs/ChartConfig.jsx @@ -51,10 +51,11 @@ function ChartConfig({ onConfigChange, onRequiredSelected, chartConfig, isLoadin return chartConfig.nivoConfig && Object.keys(chartConfig.nivoConfig).length > 0; }; - const handleTableChange = (event) => { - const selectedTable = event.target.value; - setSelectedTable(selectedTable); - } + const handleTableSelect = async (table) => { + setSelectedTable(table); + const data = await fetchOrganizationTables(table); // fetchTableData is your API call function + setTables(data); + }; const handleChartTypeChange = (event) => { const selectedType = event.target.value; @@ -63,7 +64,7 @@ function ChartConfig({ onConfigChange, onRequiredSelected, chartConfig, isLoadin return( - + {isLoading ? ( From 3f01e7ab0a46ee8948fa17b87f0a69aeb789be3f Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Tue, 12 Dec 2023 19:13:28 +0100 Subject: [PATCH 2/4] rename page component --- frontend/src/App.jsx | 2 +- .../src/pages/Analytics/{Analytics.jsx => AnalyticsPage.jsx} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename frontend/src/pages/Analytics/{Analytics.jsx => AnalyticsPage.jsx} (100%) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index d560633..c58ecf1 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -13,7 +13,7 @@ import LandingLayout from './components/layouts/LandingLayout'; import RequireAuth from './components/auth/RequireAuth'; import AboutPage from './pages/About'; import AdminPage from './pages/admin/Admin'; -import AnalyticsPage from './pages/analytics/Analytics'; +import AnalyticsPage from './pages/analytics/AnalyticsPage'; import BlogPage from './pages/Blog'; import CreateChartPage from './pages/charts/CreateChart'; import CreateDashboardPage from './pages/dashboards/CreateDashboard'; diff --git a/frontend/src/pages/Analytics/Analytics.jsx b/frontend/src/pages/Analytics/AnalyticsPage.jsx similarity index 100% rename from frontend/src/pages/Analytics/Analytics.jsx rename to frontend/src/pages/Analytics/AnalyticsPage.jsx From 851a5afdb602357b22b600bce263976f1836c581 Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Tue, 12 Dec 2023 19:22:53 +0100 Subject: [PATCH 3/4] add label to select component --- frontend/src/components/tables/selects/TableSelectDropdown.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/tables/selects/TableSelectDropdown.jsx b/frontend/src/components/tables/selects/TableSelectDropdown.jsx index b54f8ae..aeac70b 100644 --- a/frontend/src/components/tables/selects/TableSelectDropdown.jsx +++ b/frontend/src/components/tables/selects/TableSelectDropdown.jsx @@ -7,12 +7,13 @@ function TableSelectDropdown({ tables, selectedTable, onTableSelect }) { }; return ( - + Select Table