From c7de12b987f63438398a17d5bf53f73f96415dbf Mon Sep 17 00:00:00 2001 From: siddheshraze <81591724+siddheshraze@users.noreply.github.com> Date: Mon, 3 Feb 2025 11:17:58 -0500 Subject: [PATCH] formatting changes --- frontend/CHANGELOG.md | 66 +++++++++---------- .../measurementshub/validations/page.tsx | 2 +- frontend/app/(login)/login/page.tsx | 2 +- frontend/app/contexts/loadingprovider.tsx | 2 +- .../client/rendergridexplanations.tsx | 4 +- .../applications/multiline/multilinemodal.tsx | 2 +- frontend/config/connectionmanager.ts | 26 ++++---- frontend/config/datagridhelpers.ts | 4 +- frontend/config/macros.ts | 3 + frontend/config/macros/azurestorage.ts | 1 + frontend/config/macros/siteconfigs.ts | 1 + frontend/config/poolmonitor.ts | 8 +-- frontend/config/sqlrdsdefinitions/core.ts | 7 ++ .../config/sqlrdsdefinitions/personnel.ts | 3 + .../config/sqlrdsdefinitions/taxonomies.ts | 16 +++++ .../config/sqlrdsdefinitions/validations.ts | 6 ++ frontend/config/sqlrdsdefinitions/views.ts | 2 + frontend/config/sqlrdsdefinitions/zones.ts | 5 ++ frontend/cypress/support/component-index.html | 22 +++---- .../topics/Adding-New-Information.md | 16 ++--- .../topics/After-Adding-Measurements.md | 6 +- .../Database-Setup-and-CTFSWeb-Integration.md | 8 +-- .../topics/Navigable-Endpoints.md | 22 +++---- .../documentation/topics/Submitting-Data.md | 8 +-- .../topics/Submitting-Form-Data.md | 62 ++++++++--------- frontend/styles/customtablesettings.css | 8 +-- frontend/styles/dropzone.css | 10 +-- frontend/styles/styles.module.css | 14 ++-- frontend/styles/validationtable.css | 46 ++++++------- frontend/tsconfig.json | 32 +++++++-- 30 files changed, 241 insertions(+), 173 deletions(-) diff --git a/frontend/CHANGELOG.md b/frontend/CHANGELOG.md index c04d7c05..ffff6414 100644 --- a/frontend/CHANGELOG.md +++ b/frontend/CHANGELOG.md @@ -118,11 +118,11 @@ 1. FixedData cases' queries updated to correctly work with updated schemas 2. New tables/cases added: - 1. `personnelrole` - 2. `sitespecificvalidations` - 3. `roles` - 4. `measurementssummary` - 5. `viewfulltable` + 1. `personnelrole` + 2. `sitespecificvalidations` + 3. `roles` + 4. `measurementssummary` + 5. `viewfulltable` ###### POST @@ -142,18 +142,18 @@ 1. Postvalidation summary statistics calculation endpoint 2. Statistics queries: - 1. `number of records by quadrat` - 2. `all stem records by quadrat (count only)` - 3. `live stem records by quadrat (count only)` - 4. `tree records by quadrat (count only)` - 5. `number of dead or missing stems by census` - 6. `trees outside of plot limits` - 7. `stems with largest DBH/HOM measurements by species` - 8. `all trees that were recorded in last census that are NOT in current census` - 9. `number of new stems per quadrat per census` - 10. `quadrats with most and least new stems per census` - 11. `number of dead stems per quadrat per census` - 12. `number of dead stems per species per census` + 1. `number of records by quadrat` + 2. `all stem records by quadrat (count only)` + 3. `live stem records by quadrat (count only)` + 4. `tree records by quadrat (count only)` + 5. `number of dead or missing stems by census` + 6. `trees outside of plot limits` + 7. `stems with largest DBH/HOM measurements by species` + 8. `all trees that were recorded in last census that are NOT in current census` + 9. `number of new stems per quadrat per census` + 10. `quadrats with most and least new stems per census` + 11. `number of dead stems per quadrat per census` + 12. `number of dead stems per species per census` #### frontend/app/api/refreshviews/[view]/[schema]/route.ts @@ -220,7 +220,7 @@ 3. customized cell and edit cell rendering added 4. some exceptions exist -- for instances where specific additional handling is needed, column states are directly defined in the datagrid components themselves. - 1. `alltaxonomiesview` -- specieslimits column customized addition + 1. `alltaxonomiesview` -- specieslimits column customized addition #### GitHub Feedback Modal @@ -250,18 +250,18 @@ 1. The DataGridCommons generic datagrid instance has been replaced by the IsolatedDataGridCommons instance, which isolates as much information as possible to the generic instance rather than the existing DataGridCommons, which requires parameter drilling of all MUI X DataGrid parameters. Current datagrids using this new implementation are: - - `alltaxonomiesview` - - `attributes` - - `personnel` - - `quadratpersonnel` - - `quadrats` - - `roles` - - `stemtaxonomiesview` + - `alltaxonomiesview` + - `attributes` + - `personnel` + - `quadratpersonnel` + - `quadrats` + - `roles` + - `stemtaxonomiesview` 2. found that attempting to use typescript runtime utilities to create "default" initial states for each RDS type was causing cascading failures. Due to the way that runtime utility functions work, no data was actually reaching the datagrids importing those initial states - 1. replaced with manual definition of initial states -- planning on centralizing this to another place, similar to - the `datagridcolumns.tsx` file + 1. replaced with manual definition of initial states -- planning on centralizing this to another place, similar to + the `datagridcolumns.tsx` file 3. `measurementssummaryview` datagrid instance added as a replacement to the previously defined summary page #### Re-Entry Data Modal @@ -312,12 +312,12 @@ ### SQL Updates 1. Schema has been been updated -- new tables added: - 1. `roles` - outlines user roles - 2. `specieslimits` - allows setting min/max bounds on measurements - 3. `specimens` - recording specimen data (added on request by ForestGEO) - 4. `unifiedchangelog` - partitioned table that tracks all changes to all tables in schema. All tables have triggers - that automatically update the `unifiedchangelog` on every change - 5. `sitespecificvalidations` - for specific validations applicable only to the host site + 1. `roles` - outlines user roles + 2. `specieslimits` - allows setting min/max bounds on measurements + 3. `specimens` - recording specimen data (added on request by ForestGEO) + 4. `unifiedchangelog` - partitioned table that tracks all changes to all tables in schema. All tables have triggers + that automatically update the `unifiedchangelog` on every change + 5. `sitespecificvalidations` - for specific validations applicable only to the host site 2. validation stored procedures have been deprecated and removed, replaced with `validationprocedures` and `sitespecificvalidations` tables 3. migration script set has been completed and tested diff --git a/frontend/app/(hub)/measurementshub/validations/page.tsx b/frontend/app/(hub)/measurementshub/validations/page.tsx index cb6bd060..c442f051 100644 --- a/frontend/app/(hub)/measurementshub/validations/page.tsx +++ b/frontend/app/(hub)/measurementshub/validations/page.tsx @@ -1,5 +1,5 @@ 'use client'; -import React, { useEffect, useState, useMemo } from 'react'; +import React, { useEffect, useMemo, useState } from 'react'; import useSWR from 'swr'; import { ValidationProceduresRDS } from '@/config/sqlrdsdefinitions/validations'; import { useOrgCensusContext, usePlotContext, useSiteContext } from '@/app/contexts/userselectionprovider'; diff --git a/frontend/app/(login)/login/page.tsx b/frontend/app/(login)/login/page.tsx index fcd8d7e6..6bacb7e4 100644 --- a/frontend/app/(login)/login/page.tsx +++ b/frontend/app/(login)/login/page.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { useEffect, useState } from 'react'; import { useSession } from 'next-auth/react'; -import { motion, AnimatePresence } from 'framer-motion'; +import { AnimatePresence, motion } from 'framer-motion'; import styles from '@/styles/styles.module.css'; import Box from '@mui/joy/Box'; import UnauthenticatedSidebar from '@/components/unauthenticatedsidebar'; diff --git a/frontend/app/contexts/loadingprovider.tsx b/frontend/app/contexts/loadingprovider.tsx index a49d10e0..61e72876 100644 --- a/frontend/app/contexts/loadingprovider.tsx +++ b/frontend/app/contexts/loadingprovider.tsx @@ -1,6 +1,6 @@ 'use client'; -import React, { createContext, useContext, useEffect, useState, useRef } from 'react'; +import React, { createContext, useContext, useEffect, useRef, useState } from 'react'; const LoadingContext = createContext<{ isLoading: boolean; diff --git a/frontend/components/client/rendergridexplanations.tsx b/frontend/components/client/rendergridexplanations.tsx index ee10318b..62ed01e7 100644 --- a/frontend/components/client/rendergridexplanations.tsx +++ b/frontend/components/client/rendergridexplanations.tsx @@ -2,10 +2,10 @@ import { DatagridType, HeadersByDatagridType } from '@/config/macros/formdetails'; import { - AccordionGroup, Accordion, - AccordionSummary, AccordionDetails, + AccordionGroup, + AccordionSummary, Alert, Box, Card, diff --git a/frontend/components/datagrids/applications/multiline/multilinemodal.tsx b/frontend/components/datagrids/applications/multiline/multilinemodal.tsx index f27b4138..030c1dab 100644 --- a/frontend/components/datagrids/applications/multiline/multilinemodal.tsx +++ b/frontend/components/datagrids/applications/multiline/multilinemodal.tsx @@ -1,6 +1,6 @@ 'use client'; -import { DialogTitle, IconButton, Modal, ModalDialog, Typography } from '@mui/joy'; +import { DialogTitle, IconButton, Modal, ModalDialog } from '@mui/joy'; import CloseIcon from '@mui/icons-material/Close'; import MultilineSpeciesDataGrid from '@/components/datagrids/applications/multiline/multilinespeciesdatagrid'; import MultilineAttributesDataGrid from '@/components/datagrids/applications/multiline/multilineattributesdatagrid'; diff --git a/frontend/config/connectionmanager.ts b/frontend/config/connectionmanager.ts index 7cf28037..255697e7 100644 --- a/frontend/config/connectionmanager.ts +++ b/frontend/config/connectionmanager.ts @@ -20,19 +20,6 @@ class ConnectionManager { return ConnectionManager.instance; } - // Acquire a connection for the current operation - private async acquireConnectionInternal(): Promise { - try { - const connection = await getConn(); // Reuse getConn from processormacros - await connection.ping(); // Validate connection - // console.log(chalk.green('Connection validated.')); - return connection; - } catch (error) { - console.error(chalk.red('Error acquiring or validating connection:', error)); - throw error; - } - } - // Execute a query using the acquired connection public async executeQuery(query: string, params?: any[], transactionId?: string): Promise { const connection = transactionId ? this.transactionConnections.get(transactionId) : await this.acquireConnectionInternal(); @@ -116,6 +103,19 @@ class ConnectionManager { public async closeConnection(): Promise { // console.warn(chalk.yellow('Warning: closeConnection is deprecated for concurrency. Connections are managed dynamically and do not persist.')); } + + // Acquire a connection for the current operation + private async acquireConnectionInternal(): Promise { + try { + const connection = await getConn(); // Reuse getConn from processormacros + await connection.ping(); // Validate connection + // console.log(chalk.green('Connection validated.')); + return connection; + } catch (error) { + console.error(chalk.red('Error acquiring or validating connection:', error)); + throw error; + } + } } export default ConnectionManager; diff --git a/frontend/config/datagridhelpers.ts b/frontend/config/datagridhelpers.ts index 5197fe50..73f6eb14 100644 --- a/frontend/config/datagridhelpers.ts +++ b/frontend/config/datagridhelpers.ts @@ -7,7 +7,7 @@ import { getAllTaxonomiesViewHCs, getAllViewFullTableViewsHCs, getMeasurementsSu import { getPersonnelHCs } from '@/config/sqlrdsdefinitions/personnel'; import { getCoreMeasurementsHCs } from '@/config/sqlrdsdefinitions/core'; import { GridColDef, GridFilterModel, GridRowId, GridRowModel, GridRowModesModel, GridRowsProp, GridSortDirection } from '@mui/x-data-grid'; -import { Dispatch, MutableRefObject, RefObject, SetStateAction } from 'react'; +import { Dispatch, RefObject, SetStateAction } from 'react'; import { AlertProps } from '@mui/material'; import styled from '@emotion/styled'; import { getSpeciesLimitsHCs } from '@/config/sqlrdsdefinitions/taxonomies'; @@ -172,6 +172,7 @@ export function getGridID(gridType: string): string { } type VisibleFilter = 'valid' | 'errors' | 'pending'; + interface ExtendedGridFilterModel extends GridFilterModel { visible: VisibleFilter[]; } @@ -243,6 +244,7 @@ export interface PendingAction { actionType: 'save' | 'delete' | ''; actionId: GridRowId | null; } + export const CellItemContainer = styled('div')({ display: 'flex', flexDirection: 'column', diff --git a/frontend/config/macros.ts b/frontend/config/macros.ts index 7f84fb3c..639d3f0a 100644 --- a/frontend/config/macros.ts +++ b/frontend/config/macros.ts @@ -103,6 +103,7 @@ export const booleanToBit = (value: boolean | undefined): number => (value ? 1 : export const unitSelectionOptions = ['km', 'hm', 'dam', 'm', 'dm', 'cm', 'mm']; export const areaSelectionOptions = ['km2', 'hm2', 'dam2', 'm2', 'dm2', 'cm2', 'mm2']; + export interface UnifiedValidityFlags { attributes: boolean; personnel: boolean; @@ -137,6 +138,7 @@ export interface FileMapping { columnMappings: Record; specialProcessing?: (props: Readonly) => Promise; } + // Define the mappings for each file type export const fileMappings: Record = { attributes: { @@ -192,6 +194,7 @@ export const fileMappings: Record = { specialProcessing: processCensus } }; + export interface ValidationResponse { totalRows: number; failedRows: number; diff --git a/frontend/config/macros/azurestorage.ts b/frontend/config/macros/azurestorage.ts index 9be5f3e6..9c9f1643 100644 --- a/frontend/config/macros/azurestorage.ts +++ b/frontend/config/macros/azurestorage.ts @@ -32,6 +32,7 @@ const MAX_RETRIES = 3; // Maximum number of retries const RETRY_DELAY_MS = 3000; // Delay between retries in milliseconds export const FORMSEARCH_LIMIT = 5; + export interface FileRowErrors { stemtag: string; tag: string; diff --git a/frontend/config/macros/siteconfigs.ts b/frontend/config/macros/siteconfigs.ts index 89924d37..cf37dfad 100644 --- a/frontend/config/macros/siteconfigs.ts +++ b/frontend/config/macros/siteconfigs.ts @@ -26,6 +26,7 @@ export interface SiteConfigProps { icon: React.ElementType; }[]; } + export const siteConfig = { name: 'ForestGEO', description: 'Census data entry and storage', diff --git a/frontend/config/poolmonitor.ts b/frontend/config/poolmonitor.ts index d8f0be3c..13d3a54d 100644 --- a/frontend/config/poolmonitor.ts +++ b/frontend/config/poolmonitor.ts @@ -55,6 +55,10 @@ export class PoolMonitor { } } + public isPoolClosed(): boolean { + return this.poolClosed; + } + private async reinitializePool(): Promise { if (this.reinitializing) return; // Prevent concurrent reinitialization this.reinitializing = true; @@ -151,8 +155,4 @@ export class PoolMonitor { } }, 10000); // Poll every 10 seconds } - - public isPoolClosed(): boolean { - return this.poolClosed; - } } diff --git a/frontend/config/sqlrdsdefinitions/core.ts b/frontend/config/sqlrdsdefinitions/core.ts index 2d52383b..8dbb020d 100644 --- a/frontend/config/sqlrdsdefinitions/core.ts +++ b/frontend/config/sqlrdsdefinitions/core.ts @@ -71,6 +71,7 @@ export interface CMAttributesRDS { coreMeasurementID?: number; code?: string; } + export type CMAttributesResult = ResultType; export interface CMAttributesStagingRDS { @@ -81,12 +82,14 @@ export interface CMAttributesStagingRDS { } export type CMAttributesStagingResult = ResultType; + export interface CMVErrorRDS { id?: number; cmvErrorID?: number; coreMeasurementID?: number; validationErrorID?: number; } + export type CMVErrorResult = ResultType; const ATTRIBUTES_CODE_LIMIT = 10; export const validateAttributesRow: ValidationFunction = (row: FileRow) => { @@ -106,16 +109,19 @@ export const validateAttributesRow: ValidationFunction = (row: FileRow) => { return Object.keys(errors).length > 0 ? errors : null; }; + export interface AttributesRDS { id?: number; code?: string; description?: string; status?: string; } + export type AttributesResult = ResultType; export const initialAttributesRDSRow = createInitialObject(); export const AttributeStatusOptions = ['alive', 'alive-not measured', 'dead', 'missing', 'broken below', 'stem dead']; export const attributesFields = ['code', 'description', 'status']; + export interface UnifiedChangelogRDS { id?: number; changeID?: number; @@ -129,4 +135,5 @@ export interface UnifiedChangelogRDS { plotID?: number; censusID?: number; } + export type UnifiedChangelogResult = ResultType; diff --git a/frontend/config/sqlrdsdefinitions/personnel.ts b/frontend/config/sqlrdsdefinitions/personnel.ts index 600b9135..c2533c73 100644 --- a/frontend/config/sqlrdsdefinitions/personnel.ts +++ b/frontend/config/sqlrdsdefinitions/personnel.ts @@ -10,6 +10,7 @@ export interface PersonnelRDS { lastName?: string; roleID?: number; } + export type PersonnelResult = ResultType; // personnel table column character limits const PERSONNEL_FIRSTNAME_LIMIT = 50; @@ -47,10 +48,12 @@ export interface QuadratPersonnelRDS { } export type QuadratPersonnelResult = ResultType; + export interface RoleRDS { id?: number; roleID?: number; roleName?: string; roleDescription?: string; } + export type RoleResult = ResultType; diff --git a/frontend/config/sqlrdsdefinitions/taxonomies.ts b/frontend/config/sqlrdsdefinitions/taxonomies.ts index 116a125b..ab068dbc 100644 --- a/frontend/config/sqlrdsdefinitions/taxonomies.ts +++ b/frontend/config/sqlrdsdefinitions/taxonomies.ts @@ -20,6 +20,7 @@ export interface SpeciesRDS { export type SpeciesResult = ResultType; export const initialSpeciesRDSRow = createInitialObject(); + export interface SpeciesLimitsRDS { id?: number; speciesLimitID?: number; @@ -30,6 +31,7 @@ export interface SpeciesLimitsRDS { upperBound?: number; lowerBound?: number; } + export type SpeciesLimitsResult = ResultType; export function getSpeciesLimitsHCs(): ColumnStates { @@ -77,13 +79,16 @@ export const validateSpeciesFormRow: ValidationFunction = row => { return Object.keys(errors).length > 0 ? errors : null; }; + export interface FamilyRDS { id?: number; familyID?: number; family?: string; referenceID?: number; } + export type FamilyResult = ResultType; + export interface GenusRDS { id?: number; genusID?: number; @@ -92,7 +97,9 @@ export interface GenusRDS { referenceID?: number; genusAuthority?: string; } + export type GenusResult = ResultType; + export interface ReferenceRDS { id?: number; referenceID?: number; @@ -100,7 +107,9 @@ export interface ReferenceRDS { fullReference?: string; dateOfPublication?: Date; } + export type ReferenceResult = ResultType; + export interface StemRDS { id?: number; stemID?: number; @@ -113,14 +122,18 @@ export interface StemRDS { moved?: boolean; stemDescription?: string; } + export type StemResult = ResultType; + export interface TreeRDS { id?: number; treeID?: number; treeTag?: string; speciesID?: number; } + export type TreeResult = ResultType; + export interface SpecimensRDS { id?: number; specimenID?: number; @@ -134,7 +147,9 @@ export interface SpecimensRDS { determinedBy?: string; description?: string; } + export type SpecimensResult = ResultType; + export interface SpeciesInventoryRDS { id: number; speciesInventoryID: number; @@ -143,4 +158,5 @@ export interface SpeciesInventoryRDS { speciesID: number | null; subSpeciesID: number | null; } + export type SpeciesInventoryResult = ResultType; diff --git a/frontend/config/sqlrdsdefinitions/validations.ts b/frontend/config/sqlrdsdefinitions/validations.ts index dddbcf46..4e41eb59 100644 --- a/frontend/config/sqlrdsdefinitions/validations.ts +++ b/frontend/config/sqlrdsdefinitions/validations.ts @@ -11,6 +11,7 @@ export interface PostValidationQueriesRDS { lastRunResult?: string; lastRunStatus?: string; } + export type PostValidationQueriesResult = ResultType; export interface ValidationProceduresRDS { @@ -24,8 +25,10 @@ export interface ValidationProceduresRDS { createdAt?: Date; updatedAt?: Date; } + export type ValidationProceduresResult = ResultType; export const initialValidationProcedure = createInitialObject(); + export interface ValidationChangelogRDS { id?: number; validationRunID?: number; @@ -39,7 +42,9 @@ export interface ValidationChangelogRDS { expectedValueRange?: string; additionalDetails?: string; } + export type ValidationChangelogResult = ResultType; + export interface SiteSpecificValidationsRDS { id?: number; validationProcedureID?: number; @@ -48,5 +53,6 @@ export interface SiteSpecificValidationsRDS { description?: string; isEnabled?: boolean; } + export type SiteSpecificValidationsResult = ResultType; export const initialSiteSpecificValidation = createInitialObject(); diff --git a/frontend/config/sqlrdsdefinitions/views.ts b/frontend/config/sqlrdsdefinitions/views.ts index 5b7c7967..c741be96 100644 --- a/frontend/config/sqlrdsdefinitions/views.ts +++ b/frontend/config/sqlrdsdefinitions/views.ts @@ -20,6 +20,7 @@ export interface AllTaxonomiesViewRDS { fieldFamily?: string; description?: string; } + export type AllTaxonomiesViewResult = ResultType; export function getAllTaxonomiesViewHCs(): ColumnStates { @@ -61,6 +62,7 @@ export interface MeasurementsSummaryRDS { userDefinedFields?: string; errors?: string; } + export type MeasurementsSummaryResult = ResultType; export function getMeasurementsSummaryViewHCs(): ColumnStates { diff --git a/frontend/config/sqlrdsdefinitions/zones.ts b/frontend/config/sqlrdsdefinitions/zones.ts index d4395aee..b68d42a3 100644 --- a/frontend/config/sqlrdsdefinitions/zones.ts +++ b/frontend/config/sqlrdsdefinitions/zones.ts @@ -11,6 +11,7 @@ export interface SitesRDS { subquadratDimY?: number; doubleDataEntry?: boolean; } + export type Site = SitesRDS | undefined; export interface SitesResult { @@ -73,8 +74,10 @@ export interface PlotRDS { numQuadrats?: number; usesSubquadrats?: boolean; } + export type Plot = PlotRDS | undefined; export type PlotsResult = ResultType; + export interface QuadratRDS { id?: number; quadratID?: number; @@ -87,6 +90,7 @@ export interface QuadratRDS { area?: number; quadratShape?: string; } + export type QuadratResult = ResultType; export type Quadrat = QuadratRDS | undefined; export const validateQuadratsRow: ValidationFunction = row => { @@ -108,4 +112,5 @@ export interface CensusQuadratRDS { quadratID?: number; censusID?: number; } + export type CensusQuadratResult = ResultType; diff --git a/frontend/cypress/support/component-index.html b/frontend/cypress/support/component-index.html index 2cbfac66..800e8bdc 100644 --- a/frontend/cypress/support/component-index.html +++ b/frontend/cypress/support/component-index.html @@ -1,14 +1,14 @@ - - - - - Components App - -
- - -
- + + + + + Components App + +
+ + +
+ diff --git a/frontend/documentation/topics/Adding-New-Information.md b/frontend/documentation/topics/Adding-New-Information.md index 29d38be8..26e45ea8 100644 --- a/frontend/documentation/topics/Adding-New-Information.md +++ b/frontend/documentation/topics/Adding-New-Information.md @@ -14,18 +14,18 @@ respective table. There are several different ways you can interact with the vie At the top of each data view, you should see a toolbar with a variety of options: 1. Filters - 1. Allows you to filter the view by placing constraints on the columns in the view. - 2. These filters will ONLY apply to the page you're currently viewing! + 1. Allows you to filter the view by placing constraints on the columns in the view. + 2. These filters will ONLY apply to the page you're currently viewing! 2. Density - 1. Allows you to change the height of the headers + 1. Allows you to change the height of the headers 3. Export - 1. Allows you to export the current page you're viewing + 1. Allows you to export the current page you're viewing 4. Add Row - 1. Allows you to add new rows. Please see below for more guidance on how exactly that works! + 1. Allows you to add new rows. Please see below for more guidance on how exactly that works! 5. Refresh - 1. Reloads data from the table. + 1. Reloads data from the table. 6. Export Full Data - 1. Exports all data in the table to JSON + 1. Exports all data in the table to JSON > Row Actions: > @@ -85,7 +85,7 @@ data en masse by directly uploading a file (or form) of data. There are five types of forms currently accepted, along with the headers that they accept: | Form | Headers | -| -------------- | ------------------------------------------------------------------------------------------------ | +|----------------|--------------------------------------------------------------------------------------------------| | `attributes` | code, description, status | | `personnel` | firstname, lastname, role | | `species` | spcode, family, genus, species, subspecies, idlevel, authority, subspeciesauthority | diff --git a/frontend/documentation/topics/After-Adding-Measurements.md b/frontend/documentation/topics/After-Adding-Measurements.md index 5313a574..681c0005 100644 --- a/frontend/documentation/topics/After-Adding-Measurements.md +++ b/frontend/documentation/topics/After-Adding-Measurements.md @@ -15,9 +15,9 @@ After navigating to the page, you should see a table appear with a set of: - SQL queries - a brief explanation of their function - historical data columns indicating: - - the last time they were run - - whether they were successful - - what their successful run returned + - the last time they were run + - whether they were successful + - what their successful run returned Use the checkboxes to select the queries you want to run, and then click on the **Run Statistics** button to run the queries. The queries should update momentarily. diff --git a/frontend/documentation/topics/Database-Setup-and-CTFSWeb-Integration.md b/frontend/documentation/topics/Database-Setup-and-CTFSWeb-Integration.md index e80dff85..6f768525 100644 --- a/frontend/documentation/topics/Database-Setup-and-CTFSWeb-Integration.md +++ b/frontend/documentation/topics/Database-Setup-and-CTFSWeb-Integration.md @@ -11,13 +11,13 @@ ensure your development environment is compatible with Unix systems before you p Before getting started, please ensure you have the following starting components: - A SQL flat file of an existing site - - This should be a very large (think 100s of MBs) SQL file that contains a direct SQL dump of a full site's census - history. + - This should be a very large (think 100s of MBs) SQL file that contains a direct SQL dump of a full site's census + history. - An empty data source to migrate the old schema into. - An empty data source to migrate the data into. - Time! - - A word to the wise, this takes a ridiculous amount of time, so make sure you have a couple hours to spare. I'd - - recommend making sure your machine is plugged in and has a steady internet connection. + - A word to the wise, this takes a ridiculous amount of time, so make sure you have a couple hours to spare. I'd + - recommend making sure your machine is plugged in and has a steady internet connection. --- diff --git a/frontend/documentation/topics/Navigable-Endpoints.md b/frontend/documentation/topics/Navigable-Endpoints.md index 1b63f18c..95101653 100644 --- a/frontend/documentation/topics/Navigable-Endpoints.md +++ b/frontend/documentation/topics/Navigable-Endpoints.md @@ -4,15 +4,15 @@ This a brief overview of the pages you can access in the app and their function! - Dashboard (users start here) - Stem & Plot Details (supporting data goes here) - - Stem Codes (stem attributes) - - Personnel (people involved in the collection of data) - - Quadrats (the smallest recorded region of measurement in a plot) - - Species (taxonomic information for the stems being measured) + - Stem Codes (stem attributes) + - Personnel (people involved in the collection of data) + - Quadrats (the smallest recorded region of measurement in a plot) + - Species (taxonomic information for the stems being measured) - Census Hub (main measurements and calculations covered here) - - View Data (upload and view census-specific measurements here) - - Post-Census Statistics (calculate statistics for the census) - - Uploaded Files (review uploaded files here) - - View All Historical Data (view all data, irrespective of census, here) - - Validations (review validations, what they are examining, and toggle them on/off here) - > Toggling validations is an admin-only feature! - > {style='warning'} + - View Data (upload and view census-specific measurements here) + - Post-Census Statistics (calculate statistics for the census) + - Uploaded Files (review uploaded files here) + - View All Historical Data (view all data, irrespective of census, here) + - Validations (review validations, what they are examining, and toggle them on/off here) + > Toggling validations is an admin-only feature! + > {style='warning'} diff --git a/frontend/documentation/topics/Submitting-Data.md b/frontend/documentation/topics/Submitting-Data.md index f78e7d8b..04a3f773 100644 --- a/frontend/documentation/topics/Submitting-Data.md +++ b/frontend/documentation/topics/Submitting-Data.md @@ -21,8 +21,8 @@ Again, let's use the stem codes page as an example: 1. Click on the **Manual Entry Form** button to open the bulk data input interface 2. This will open a popup with a new grid, with buttons to add new rows, save, and submit. 3. Add rows as needed and ensure that you save your changes before submitting. - 1. Note: Bulk data input follows the same header format as file upload. Please ensure you - correctly enter your data. + 1. Note: Bulk data input follows the same header format as file upload. Please ensure you + correctly enter your data. 4. The grid will reload and you should see your new rows. ### File upload @@ -31,8 +31,8 @@ Again, let's use the stem codes page as an example: 1. Click on the **Upload** button to open the file upload interface 2. Follow the prompts to upload, review, and submit your file. - 1. Note: your file should be in CSV format and correctly match the header format outlined in - the first page of the interface. + 1. Note: your file should be in CSV format and correctly match the header format outlined in + the first page of the interface. 3. After the upload completes, you should see your new rows in the grid. ### Editing Existing Data diff --git a/frontend/documentation/topics/Submitting-Form-Data.md b/frontend/documentation/topics/Submitting-Form-Data.md index 5e57c095..edbce338 100644 --- a/frontend/documentation/topics/Submitting-Form-Data.md +++ b/frontend/documentation/topics/Submitting-Form-Data.md @@ -6,34 +6,34 @@ This supporting data makes up the navigation links under the Stem & Plot Details navigation menu. - - Stem Codes: - - Attribute information for a stem - - Allows you to add characteristics like 'alive,' 'dead,' 'missing,' etc. to a stem. - This becomes important later—it's important to make sure you don't accidentally mark a stem as - dead when it's not! - - Personnel: - - Who's working on the plot? - - This data is organized on a census-by-census basis, so you can clearly see who was working on - the plot at what - time. - - You can also assign a role to a person, which can include anything from 'plot supervisor' to - 'field technician' to 'volunteer'! - - Quadrats: - - This is a more granular system to subdivide the plot. Each plot can be massive, but dividing - it into quadrats - can make it easier to keep track of each stem. - - Quadrats, like personnel, are also organized on a census-by-census basis, so you can get a - better idea of how - the plot was divided for a particular census. - - Species List: - - Species information for all stems in the plot. - - This is a dedicated list of the different species designations assigned to stems in the plot. - - Plot-Species List: - - This is a special case! This is a list of all species listed in the plot, but filtered by - stems physically - located in the plot. It's always possible that species in a plot come and go as environmental - conditions - change, so this is a way to take a look at species assignments specifically at the place and - time you're - working with. You shouldn't need to modify or add to this view -- it should be used for - reference only! + - Stem Codes: + - Attribute information for a stem + - Allows you to add characteristics like 'alive,' 'dead,' 'missing,' etc. to a stem. + This becomes important later—it's important to make sure you don't accidentally mark a stem as + dead when it's not! + - Personnel: + - Who's working on the plot? + - This data is organized on a census-by-census basis, so you can clearly see who was working on + the plot at what + time. + - You can also assign a role to a person, which can include anything from 'plot supervisor' to + 'field technician' to 'volunteer'! + - Quadrats: + - This is a more granular system to subdivide the plot. Each plot can be massive, but dividing + it into quadrats + can make it easier to keep track of each stem. + - Quadrats, like personnel, are also organized on a census-by-census basis, so you can get a + better idea of how + the plot was divided for a particular census. + - Species List: + - Species information for all stems in the plot. + - This is a dedicated list of the different species designations assigned to stems in the plot. + - Plot-Species List: + - This is a special case! This is a list of all species listed in the plot, but filtered by + stems physically + located in the plot. It's always possible that species in a plot come and go as environmental + conditions + change, so this is a way to take a look at species assignments specifically at the place and + time you're + working with. You shouldn't need to modify or add to this view -- it should be used for + reference only! diff --git a/frontend/styles/customtablesettings.css b/frontend/styles/customtablesettings.css index 289f418c..573dd9b3 100644 --- a/frontend/styles/customtablesettings.css +++ b/frontend/styles/customtablesettings.css @@ -1,9 +1,9 @@ .header { - font-weight: bold; - font-size: 14pt; + font-weight: bold; + font-size: 14pt; } .error { - font-weight: bold; - color: red; + font-weight: bold; + color: red; } diff --git a/frontend/styles/dropzone.css b/frontend/styles/dropzone.css index b5978689..eeee5843 100644 --- a/frontend/styles/dropzone.css +++ b/frontend/styles/dropzone.css @@ -1,7 +1,7 @@ #outerBox { - justify-content: center; - width: 600px; - height: 400px; - background-color: #46424f; - border: 3px dashed; + justify-content: center; + width: 600px; + height: 400px; + background-color: #46424f; + border: 3px dashed; } diff --git a/frontend/styles/styles.module.css b/frontend/styles/styles.module.css index 6b2d9742..271c5330 100644 --- a/frontend/styles/styles.module.css +++ b/frontend/styles/styles.module.css @@ -1,9 +1,9 @@ .bg { - position: absolute; - flex: 1 1 0; - width: 100vw; - height: 100vh; - background-size: cover; - background-position: center; - will-change: opacity; + position: absolute; + flex: 1 1 0; + width: 100vw; + height: 100vh; + background-size: cover; + background-position: center; + will-change: opacity; } diff --git a/frontend/styles/validationtable.css b/frontend/styles/validationtable.css index 12b9200a..a0ad6424 100644 --- a/frontend/styles/validationtable.css +++ b/frontend/styles/validationtable.css @@ -1,37 +1,37 @@ @import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap'); /** create spacing between rows */ table { - border-collapse: separate; /** border-spacing is allow only if border-collapse is separate */ - border-spacing: 0 20px; - margin-left: auto; - margin-right: auto; - width: auto; + border-collapse: separate; /** border-spacing is allow only if border-collapse is separate */ + border-spacing: 0 20px; + margin-left: auto; + margin-right: auto; + width: auto; } .tablecontainer { - border-collapse: separate; /** border-spacing is allow only if border-collapse is separate */ - border-spacing: 0 20px; - margin-left: auto; - margin-right: auto; - width: auto; + border-collapse: separate; /** border-spacing is allow only if border-collapse is separate */ + border-spacing: 0 20px; + margin-left: auto; + margin-right: auto; + width: auto; } th, td { - border: 1px solid #aba5a5; - display: inline-block; /* no line break // elements can be close together */ - width: auto; - height: auto; - overflow: auto; - text-align: justify; - padding: 8px 5px; - font-family: 'Roboto', sans-serif; + border: 1px solid #aba5a5; + display: inline-block; /* no line break // elements can be close together */ + width: auto; + height: auto; + overflow: auto; + text-align: justify; + padding: 8px 5px; + font-family: 'Roboto', sans-serif; } .errorMessage { - color: red; - font-family: 'Roboto', sans-serif; - border: none; - padding: 0; - width: auto; + color: red; + font-family: 'Roboto', sans-serif; + border: none; + padding: 0; + width: auto; } diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 5a565956..6fda3c97 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -3,7 +3,12 @@ "experimentalDecorators": true, "emitDecoratorMetadata": true, "target": "es2017", - "lib": ["dom", "dom.iterable", "esnext", "es2015"], + "lib": [ + "dom", + "dom.iterable", + "esnext", + "es2015" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -22,10 +27,27 @@ } ], "paths": { - "@/*": ["./*"] + "@/*": [ + "./*" + ] }, - "types": ["vitest/globals", "node"] + "types": [ + "vitest/globals", + "node" + ] }, - "include": ["types/next-auth.d.ts", "next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "build/types/**/*.ts", "./vitest.setup.ts", "**/*.sql"], - "exclude": ["node_modules", "**/*.cy.*"] + "include": [ + "types/next-auth.d.ts", + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts", + "build/types/**/*.ts", + "./vitest.setup.ts", + "**/*.sql" + ], + "exclude": [ + "node_modules", + "**/*.cy.*" + ] }