From c7b17b748705779bb09cca668f4ee45c62ea642a Mon Sep 17 00:00:00 2001
From: Andrew <105487051+LouisThedroux@users.noreply.github.com>
Date: Thu, 18 Jul 2024 13:59:46 -0700
Subject: [PATCH 01/19] initial commit from transferring otu of
method-standards
---
app/src/AppRouter.tsx | 7 ++
.../standards/DoubleStandardsPage.tsx | 103 ++++++++++++++++++
2 files changed, 110 insertions(+)
create mode 100644 app/src/features/standards/DoubleStandardsPage.tsx
diff --git a/app/src/AppRouter.tsx b/app/src/AppRouter.tsx
index 3a0ce4c006..f3d6e7ad81 100644
--- a/app/src/AppRouter.tsx
+++ b/app/src/AppRouter.tsx
@@ -7,6 +7,7 @@ import FundingSourcesRouter from 'features/funding-sources/FundingSourcesRouter'
import ProjectsRouter from 'features/projects/ProjectsRouter';
import ResourcesPage from 'features/resources/ResourcesPage';
import SpeciesStandardsPage from 'features/standards/SpeciesStandardsPage';
+import DoubleStandardsPage from 'features/standards/DoubleStandardsPage';
import BaseLayout from 'layouts/BaseLayout';
import AccessDenied from 'pages/403/AccessDenied';
import NotFoundPage from 'pages/404/NotFoundPage';
@@ -105,6 +106,12 @@ const AppRouter: React.FC = () => {
+
+
+
+
+
+
diff --git a/app/src/features/standards/DoubleStandardsPage.tsx b/app/src/features/standards/DoubleStandardsPage.tsx
new file mode 100644
index 0000000000..e6ef003aa8
--- /dev/null
+++ b/app/src/features/standards/DoubleStandardsPage.tsx
@@ -0,0 +1,103 @@
+import { Box, Container, Paper, ToggleButton, ToggleButtonGroup, Toolbar, Typography } from '@mui/material';
+import { styled } from '@mui/system';
+import PageHeader from 'components/layout/PageHeader';
+import SpeciesAutocompleteField from 'components/species/components/SpeciesAutocompleteField';
+import { useBiohubApi } from 'hooks/useBioHubApi';
+import useDataLoader from 'hooks/useDataLoader';
+import { ITaxonomy } from 'interfaces/useTaxonomyApi.interface';
+import React, { useState } from 'react';
+import SpeciesStandardsResults from './view/SpeciesStandardsResults';
+
+/**
+ * Page to display both species and method standards and data capture standards
+ *
+ * @return {*}
+ */
+
+// Custom styled ToggleButton
+const StyledToggleButton = styled(ToggleButton)(({ theme }) => ({
+ color: theme.palette.text.primary,
+ borderColor: theme.palette.primary.main,
+ '&.Mui-selected': {
+ backgroundColor: theme.palette.primary.main,
+ color: theme.palette.common.white
+ },
+ '&:hover': {
+ backgroundColor: theme.palette.primary.light,
+ color: theme.palette.common.primary
+ }
+}));
+
+const DoubleStandardsPage = () => {
+ const [currentTab, setCurrentTab] = useState('');
+
+ const biohubApi = useBiohubApi();
+ const standardsDataLoader = useDataLoader((species: ITaxonomy) =>
+ biohubApi.standards.getSpeciesStandards(species.tsn)
+ );
+
+ const views = [
+ { label: 'Species Data & Variables', value: 'SPECIES' },
+ { label: 'Data Capture & Methodologies', value: 'METHODS' }
+ ];
+
+ return (
+ <>
+
+
+
+
+
+
+ Standards for Species and Methodologies
+
+
+
+
+
+ , view: any) => setCurrentTab(view)}
+ exclusive
+ sx={{ mb: 2 }}>
+ {views.map((view) => (
+
+ {view.label}
+
+ ))}
+
+
+ {currentTab === 'SPECIES' && (
+ {
+ if (value) {
+ standardsDataLoader.refresh(value);
+ }
+ }}
+ />
+ )}
+ {/* This is te bit of code that shoes the results for search bar. Is there a way to make sure this is only showing when currentTab is species? */}
+
+
+ {/* Nothing really going on in this part riht now. Using the search bar to search methodologies in */}
+ {currentTab === 'METHODS' && (
+
+
+ Data Capture & Methodologies Placeholder
+
+
+ This is a placeholder for future functionality related to Data Capture & Methodologies API calls,
+ where ever that might come from (technique_attribute_quantitativ etc)
+
+
+ )}
+
+
+
+ >
+ );
+};
+
+export default DoubleStandardsPage;
From 46e1f10133fd03bd644d36fb91d8b3df032e6ec0 Mon Sep 17 00:00:00 2001
From: Andrew <105487051+LouisThedroux@users.noreply.github.com>
Date: Thu, 18 Jul 2024 14:01:57 -0700
Subject: [PATCH 02/19] quick div to box fix for header not showing
---
app/src/features/standards/DoubleStandardsPage.tsx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/src/features/standards/DoubleStandardsPage.tsx b/app/src/features/standards/DoubleStandardsPage.tsx
index e6ef003aa8..c1002da2a6 100644
--- a/app/src/features/standards/DoubleStandardsPage.tsx
+++ b/app/src/features/standards/DoubleStandardsPage.tsx
@@ -47,11 +47,12 @@ const DoubleStandardsPage = () => {
-