Skip to content

Commit

Permalink
Stabilization is almost completed. Testing has been completed for all…
Browse files Browse the repository at this point in the history
… supporting grids except for species, roles, and quadratpersonnel, none of which are immediately vital.
  • Loading branch information
siddheshraze committed Sep 12, 2024
1 parent 07c4195 commit 98c25b9
Show file tree
Hide file tree
Showing 30 changed files with 2,764 additions and 710 deletions.
4 changes: 2 additions & 2 deletions frontend/app/(hub)/fixeddatainput/alltaxonomies/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import AllTaxonomiesViewDataGrid from '@/components/datagrids/applications/alltaxonomiesviewdatagrid';
import IsolatedAllTaxonomiesViewDataGrid from '@/components/datagrids/applications/isolated/isolatedalltaxonomiesdatagrid';

export default function AllTaxonomiesPage() {
return <AllTaxonomiesViewDataGrid />;
return <IsolatedAllTaxonomiesViewDataGrid />;
}
4 changes: 2 additions & 2 deletions frontend/app/(hub)/fixeddatainput/attributes/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import AttributesDataGrid from '@/components/datagrids/applications/attributesdatagrid';
import IsolatedAttributesDataGrid from '@/components/datagrids/applications/isolated/isolatedattributesdatagrid';

export default function AttributesPage() {
return <AttributesDataGrid />;
return <IsolatedAttributesDataGrid />;
}
4 changes: 2 additions & 2 deletions frontend/app/(hub)/fixeddatainput/personnel/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PersonnelDataGrid from '@/components/datagrids/applications/personneldatagrid';
import IsolatedPersonnelDataGrid from '@/components/datagrids/applications/isolated/isolatedpersonneldatagrid';

export default function PersonnelPage() {
return <PersonnelDataGrid />;
return <IsolatedPersonnelDataGrid />;
}
4 changes: 2 additions & 2 deletions frontend/app/(hub)/fixeddatainput/quadratpersonnel/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QuadratPersonnelDataGrid from '@/components/datagrids/applications/quadratpersonneldatagrid';
import IsolatedQuadratPersonnelDataGrid from '@/components/datagrids/applications/isolated/isolatedquadratpersonneldatagrid';

export default function QuadratPersonnelPage() {
return <QuadratPersonnelDataGrid />;
return <IsolatedQuadratPersonnelDataGrid />;
}
4 changes: 2 additions & 2 deletions frontend/app/(hub)/fixeddatainput/quadrats/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QuadratsDataGrid from '@/components/datagrids/applications/quadratsdatagrid';
import IsolatedQuadratsDataGrid from '@/components/datagrids/applications/isolated/isolatedquadratsdatagrid';

export default function QuadratsPage() {
return <QuadratsDataGrid />;
return <IsolatedQuadratsDataGrid />;
}
4 changes: 2 additions & 2 deletions frontend/app/(hub)/fixeddatainput/stemtaxonomies/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import StemTaxonomiesViewDataGrid from '@/components/datagrids/applications/stemtaxonomiesviewdatagrid';
import IsolatedStemTaxonomiesViewDataGrid from '@/components/datagrids/applications/isolated/isolatedstemtaxonomiesviewdatagrid';

export default function StemTaxonomiesPage() {
return <StemTaxonomiesViewDataGrid />;
return <IsolatedStemTaxonomiesViewDataGrid />;
}
6 changes: 1 addition & 5 deletions frontend/app/(hub)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export default function HubLayout({ children }: { children: React.ReactNode }) {
const fetchSiteList = useCallback(async () => {
const now = Date.now();
if (lastExecutedRef.current && now - lastExecutedRef.current < debounceDelay + 200) {
console.log('Debounced fetchSiteList: Too soon since last call.');
return;
}

Expand All @@ -88,7 +87,7 @@ export default function HubLayout({ children }: { children: React.ReactNode }) {

try {
setLoading(true, 'Loading Sites...');
if (session && !siteListLoaded) {
if (session && !siteListLoaded && !currentSite) {
const sites = session?.user?.allsites ?? [];
if (sites.length === 0) {
throw new Error('Session sites undefined');
Expand All @@ -107,7 +106,6 @@ export default function HubLayout({ children }: { children: React.ReactNode }) {
const loadPlotData = useCallback(async () => {
const now = Date.now();
if (plotLastExecutedRef.current && now - plotLastExecutedRef.current < debounceDelay) {
console.log('Debounced loadPlotData: Too soon since last call.');
return;
}
plotLastExecutedRef.current = now;
Expand All @@ -132,7 +130,6 @@ export default function HubLayout({ children }: { children: React.ReactNode }) {
const loadCensusData = useCallback(async () => {
const now = Date.now();
if (censusLastExecutedRef.current && now - censusLastExecutedRef.current < debounceDelay) {
console.log('Debounced loadCensusData: Too soon since last call.');
return;
}
censusLastExecutedRef.current = now;
Expand All @@ -158,7 +155,6 @@ export default function HubLayout({ children }: { children: React.ReactNode }) {
const loadQuadratData = useCallback(async () => {
const now = Date.now();
if (quadratLastExecutedRef.current && now - quadratLastExecutedRef.current < debounceDelay) {
console.log('Debounced loadQuadratData: Too soon since last call.');
return;
}
quadratLastExecutedRef.current = now;
Expand Down
12 changes: 8 additions & 4 deletions frontend/components/client/datagridcolumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const quadratGridColumns: GridColDef[] = [
headerName: 'Coordinate Units',
headerClassName: 'header',
flex: 1,
renderHeader: () => formatHeader('Coordinate', 'Units'),
// renderHeader: () => formatHeader('Coordinate', 'Units'),
align: 'right',
headerAlign: 'right',
editable: true,
Expand All @@ -104,7 +104,7 @@ export const quadratGridColumns: GridColDef[] = [
headerName: 'Area Unit',
headerClassName: 'header',
flex: 1,
renderHeader: () => formatHeader('Area', 'Unit'),
// renderHeader: () => formatHeader('Area', 'Unit'),
align: 'right',
headerAlign: 'right',
editable: true,
Expand All @@ -120,7 +120,9 @@ export const quadratGridColumns: GridColDef[] = [
align: 'right',
type: 'number',
valueFormatter: (value: any) => {
return Number(value).toFixed(2);
let parsedValue = Number(value);
if (isNaN(value)) parsedValue = 0.0;
return parsedValue.toFixed(2);
},
editable: true
},
Expand All @@ -134,7 +136,9 @@ export const quadratGridColumns: GridColDef[] = [
headerAlign: 'right',
type: 'number',
valueFormatter: (value: any) => {
return Number(value).toFixed(2);
let parsedValue = Number(value);
if (isNaN(value)) parsedValue = 0.0;
return parsedValue.toFixed(2);
},
editable: true
},
Expand Down
Loading

0 comments on commit 98c25b9

Please sign in to comment.