From a919b72a6c2e4d9dd46b8023bd10cd5cae0a1109 Mon Sep 17 00:00:00 2001 From: sambokar Date: Fri, 14 Jun 2024 10:16:44 -0400 Subject: [PATCH] last-minute emergency changes -- updating page for demo backup recording --- frontend/app/(hub)/dashboard/page.tsx | 592 ++++++++++++-------------- 1 file changed, 283 insertions(+), 309 deletions(-) diff --git a/frontend/app/(hub)/dashboard/page.tsx b/frontend/app/(hub)/dashboard/page.tsx index 2dd68e0d..5e62820c 100644 --- a/frontend/app/(hub)/dashboard/page.tsx +++ b/frontend/app/(hub)/dashboard/page.tsx @@ -15,10 +15,15 @@ import { import WarningIcon from '@mui/icons-material/Warning'; import TravelExploreIcon from '@mui/icons-material/TravelExplore'; import Avatar from "@mui/joy/Avatar"; -import {CensusLogo, PlotLogo} from "@/components/icons"; +import { CensusLogo, PlotLogo } from "@/components/icons"; +import { useOrgCensusContext, usePlotContext, useSiteContext } from "@/app/contexts/userselectionprovider"; export default function DashboardPage() { + const currentSite = useSiteContext(); + const currentPlot = usePlotContext(); + const currentCensus = useOrgCensusContext(); + const attributeNote = "NOTE: If a code can be used for more than one status (e.g. The code “L” for a leaning tree, could\n" + "apply to either a dead or alive stem), or if a code does not indicate any of the above status\n" + "options, the status column should be left blank."; @@ -34,24 +39,24 @@ export default function DashboardPage() { "the previous census. Dead or lost stems should have the appropriate codes to indicate their absence\n" + "in subsequent censuses."; return ( - - Please use this guide to navigate through this + + Please use this guide to navigate through this app's key features and functionalities. Understanding the Sidebar - + The sidebar is intended to provide you with quick and easy access to the different features this app provides. - + - + - + - + Select a Site @@ -60,322 +65,291 @@ export default function DashboardPage() { Now that you have logged in, you will see the sidebar is currently empty, with the exception of a clickable - button saying "Select Site"
+ button saying "Select Site"
In order to fully access the website, you must select the site you are currently working in. - + -
+
Once you have selected a site, you should see a second menu option slide out to enable you to select a plot.
- - - - - - - Select a Plot - - - - - Following the same format as the Site, clicking on the Select Plot link will open a dialog box to allow - you to select a plot -
- If you have administrator access, you will be able to click on Add New Plot or Edit/Delete Plot (within - the selection menu) to make - changes to or add plots that are missing or incorrect. - - - - - -
-
-
- - - - - - - Select a Census - - - - - Similarly, clicking on the Select Census link will open a dialog box to allow you to select the census you - would like to update.
- Please note that available census will be organized by ongoing - census first, and historical censuses will be organized by - chronological descending order.
- Unlike the Site and Plot selections, Census selections are not restricted by access, so you should be able - to select any available censuses. -
- If you have admin access, you will be able to close, edit, or delete censuses while the menu is open. - Currently, - There is not (yet) functionality to reopen prior censuses, but if you need to open a new census, please - use the Add New Census button! -
-
-
+ {currentSite !== undefined && ( + + + + + + + Select a Plot + + + + + Following the same format as the Site, clicking on the Select Plot link will open a dialog box to allow + you to select a plot. +
+ After selecting a plot, you will see the navigation menu appear along with the census selection box. + However, it will remain disabled until you select a census! + + + + + +
+
+
+ )} + {currentSite !== undefined && currentPlot !== undefined && ( + + + + + + + Select a Census + + + + + Censuses are organized by Plot Census Number!
+ Within each plot census number, you can create any number of date ranges, which are then associated with an internal census ID.
+ Please note -- when you are uploading or adding information, it will be added to the nearest OPEN census.
+ You can only add information to an OPENED census!
+ You can only have one open census at a time!
+ Please note:
+ Censuses cannot be updated or deleted. If you need to add revising information, please start a new census, add the respective information, + and close that census to add it to the overall plot census category.
+ Please use the Reopen/Close census to add or close new date ranges to the existing Plot Census Number.
+ Please use the Start New Census button to create a new Plot Census Number, or an entirely new census. +
+
+
+ )}
- Navigating Through the Website - - - - Measurements Hub - - - - The Measurements Hub is intended to replace the main data view of CTFSWeb.
- It contains a table view of the given site/plot/census's recorded measurements, utilizing a dedicated - measurement summary view that provides detailed information about the measurements recorded in that - period, along with a set of filtering buttons to allow you to choose if you want to exclude rows with - validation errors or rows without.
- As you upload new files using the Upload button present on the right side of the Measurements Hub - page, please keep the following in mind regarding file input parameters and required headers: -
- - - - The tree data from each census must be in a separate file (i.e. one census, one file; three censuses, - three files). All files must have columns listed below, but they can be in any order.
- - - - - - - - - - -
- - tag: the tag number for the tree (this should be unique for each tree) - stemtag: the tag number of the stem. - spcode: a code used in the field to identify the species of the tree. This MUST match - the - spcode that appears in the species.txt file. - quadrat: the name of the quadrat (as designated in quadrat.txt) that the tree is - located in - lx: the x coordinate in meters of the stem within its quadrat - ly: the y coordinate in meters of the stem within its quadrat - - dbh: the diameter of the tree. - - - - - - - - codes: tree or measurement codes (as designated in codes.txt) - - - - - - - - hom: height (in meters) where the diameter was measured, if different from 1.3 meters. - - - - - - - date: the date the stem was measured, expressed in the format YYYY-MM-DD, e.g. - 2011-02-24 - to indicate the 24th of February, 2011. - -
-
-
-
- - - Measurement Properties Hub - - - - The Measurement Properties Hub expands to allow you to modify the different moving parts of a - census that you would originally modify through CTFSWeb. - - - - Attributes - - - - These are the codes used by field personnel to describe the condition of a tree, stem or - measurement. These codes are locally derived and can be in any language. These tree - measurement codes will eventually be inserted into the TSMAttributes table, which is a permanent - table. - - - code: one or more letters that describe or explain the condition of a tree, stem, - or - measurement (e.g. “L”) - description: a free text description of the code (e.g. “leaning”) - - - status: one of six standardized terms used as a summary category for the code and the - condition of the stem which it describes: - - - - - - - - alive: the stem is alive - alive-not measured: the stem is alive but was not measured - dead: the ENTIRE TREE is dead - missing: field crews missed this stem, and it was not measured during the - census + {currentSite !== undefined && currentPlot !== undefined && currentCensus !== undefined && ( + <> + Navigating Through the Website + + + + Understanding the Site System + + + + When you first log in and select a site, plot, and census, you will see a series of loading screens appear.
+ If you are starting a new census, you will see that the View Measurements button is disabled with a warning badge, + and that one or more of the Supporting Data Views menu links have a red danger badge attached.
+ This is the Prevalidation system. You must populate all of the tables that have a red badge in order to be able to add measurements.
+ You will also see a button in the bottom left corner that says "Reload Prevalidation". This button will manually re-check the respective tables + associated with the prevalidation system, in case the system does not automatically run after you add data to the system. +
+
+
+ + + Measurements Hub + + + + The Measurements Hub contains two primary links &em; the View Measurements link and the View Uploaded Files link.
+ You can use the View Measurements link to review uploaded information once it's been inserted, and you can use the + View Uploaded Files link to review past loaded files for the respective plot & census combination you are adding data to, as well as + delete or download them.

+ The View Measurements link and upload system will be disabled until you successfully populate all of the supporting data views. + Once this is done and the prevalidation system reloads, you will be able to click on the View Measurements link. + Use the Upload button there to upload information conforming to the census.txt
+
+ +
+
+ + + Supporting Data Views + + + + The Supporting Data Views expands to allow you to modify the different moving parts of a + census that you would originally modify through CTFSWeb. + + + + Attributes + + + + These are the codes used by field personnel to describe the condition of a tree, stem or + measurement. These codes are locally derived and can be in any language. These tree + measurement codes will eventually be inserted into the TSMAttributes table, which is a permanent + table. + + + code: one or more letters that describe or explain the condition of a tree, stem, + or + measurement (e.g. “L”) + description: a free text description of the code (e.g. “leaning”) + + + status: one of six standardized terms used as a summary category for the code and the + condition of the stem which it describes: + + + + + + + + alive: the stem is alive + alive-not measured: the stem is alive but was not measured + dead: the ENTIRE TREE is dead + missing: field crews missed this stem, and it was not measured during the + census + + broken below: the stem was previously ≥ 1 cm dbh, but in this census was found alive + but broken off, now with a dbh less than 1 cm + + stem dead: the stem is dead and/or not found + + + e.g. We may call a tree in the field “MS;R” – MS (multiple stems) could have an + “alive” status on this table and R (description: resprout) would have “broken below.” + + + + + + + + Personnel + + + + This file contains the names of the people who are or were involved with the plot, as well as the + role + that they played. If a person has played more than one role (for example she was a field + technician in + one census, then promoted to field supervisor in a later census), then that name should be entered + twice. This file should have three columns, as designated below. + + + firstname: the first (given) name of the person + lastname: the last name (surname) of the person + role: the role the person played in the census. This should match exactly one of + the + descriptions in the role.txt file. + + + + + + Quadrats + + + + This file contains a complete list of all quadrats used in your plot. + + + quadrat: the name of the quadrat, e.g. 0002 + startx: the x coordinate of the lower left corner of the quadrat, e.g. + 0 - broken below: the stem was previously ≥ 1 cm dbh, but in this census was found alive - but broken off, now with a dbh less than 1 cm + starty: the y coordinate of the lower left corner of the quadrat, e.g. 40 + + + + + - stem dead: the stem is dead and/or not found + dimx: the x dimension of the quadrat (in meters), e.g. 20 + dimy: the y dimension of the quadrat (in meters), e.g. 20 - - e.g. We may call a tree in the field “MS;R” – MS (multiple stems) could have an - “alive” status on this table and R (description: resprout) would have “broken below.” - -
-
-
-
- - - Personnel - - - - This file contains the names of the people who are or were involved with the plot, as well as the - role - that they played. If a person has played more than one role (for example she was a field - technician in - one census, then promoted to field supervisor in a later census), then that name should be entered - twice. This file should have three columns, as designated below. - - - firstname: the first (given) name of the person - lastname: the last name (surname) of the person - role: the role the person played in the census. This should match exactly one of - the - descriptions in the role.txt file. - - - - - - Quadrats - - - - This file contains a complete list of all quadrats used in your plot. - - - quadrat: the name of the quadrat, e.g. 0002 - startx: the x coordinate of the lower left corner of the quadrat, e.g. - 0 - - starty: the y coordinate of the lower left corner of the quadrat, e.g. 40 - - - - - - - dimx: the x dimension of the quadrat (in meters), e.g. 20 - dimy: the y dimension of the quadrat (in meters), e.g. 20 - - - - - - Species - - - - This file is integral to a key table in the system, so take time to review it for spelling errors, - etc. Make - sure the IDLevels are filled in. There should be at least one species code for unidentified - species if - your plot includes species not yet identified. There are four required columns (“spcode,” “genus,” - “species,” and “IDLevel”); the rest are optional. - - - - spcode: a code used in the field to identify the species of the tree - - Most ForestGEO sites use six letter codes where the first four are from the genus - name and - the last two are from the species. If two species yield the same code, then an alternative - letter or number as the last character may be used to differentiate them. For example, - codes for Shorea macroptera subsp. baillonii and Shorea macrophylla, would both be - SHORMA. The species codes ended up being SHORMB and SHORMC, respectively. - You should use a similar naming convention for each morphospecies incorporating - details - you know. For example, using LITSBL (Litsea “Big Leaf”) or APORS1 (Aporosa sp. 1) are - fine as long as each code applies to only one morphospecies. These can be changed once - identification is more complete - Other combinations are also acceptable. Some sites use 3 letters from the genus and - 3 - from the species, while others use 4 letters instead of 6 (2 letters from the genus and 2 - from - the species). + + + + + Subquadrats (Optional) + + + + If needed, you can submit subquadrat information in a file format similar to the quadrats file.
+ This is not needed in order to complete a census, BUT
+ If you do not add or upload subquadrats and try to reference them in your census.txt file, the values will be IGNORED. +
+ + {/* {label: "quadrat"}, {label: "xindex"}, {label: "yindex"}, {label: "unit"}, {label: "orderindex"}], */} + subquadrat: the name of the subquadrat + quadrat: the overhead quadrat it belongs to + dimx: the x-dimensions of the subquadrat (default is 5m) + dimy: the y-dimensions of the subquadrat (default is 5m) + xindex: starting x-coordinates (top left corner) of subquadrat + yindex: starting y-coordinates (top left corner) of subquadrat + unit: Please provide the SI unit (mm, cm, dm, m, Dm, hm, km); default is meters + orderindex: the order of the subquadrat within the quadrat at large, starting from top left corner - - genus: the taxonomic genus name according to the APG system. In case of an - unknown genus, - use “Unidentified.” - species: the species part of the Latin name; may be a morphospecies - name. - IDLevel: the deepest taxonomic level for which full identification is known. The - IDLevel is - limited to the values of: species, subspecies, genus, family, none, or multiple. “None” is used - when the family is not known. “Multiple” is used when the name may include a mixture of more - than one species. - family: the taxonomic family name (optional) - authority: author of the species (optional) - subspecies: subspecies identifier (optional) - -
-
- - - SubSpecies - - - - Similar to the Species data grid, this grid displays added subspecies information as provided for - this plot. This is not a required part of a census, so please take note that not every measurement - or species will have an associated subspecies unless needed. - - - -
-
-
-
-
+ + + + + Species + + + + This file is integral to a key table in the system, so take time to review it for spelling errors, + etc. Make + sure the IDLevels are filled in. There should be at least one species code for unidentified + species if + your plot includes species not yet identified. There are four required columns (“spcode,” “genus,” + “species,” and “IDLevel”); the rest are optional. + + + + spcode: a code used in the field to identify the species of the tree + + Most ForestGEO sites use six letter codes where the first four are from the genus + name and + the last two are from the species. If two species yield the same code, then an alternative + letter or number as the last character may be used to differentiate them. For example, + codes for Shorea macroptera subsp. baillonii and Shorea macrophylla, would both be + SHORMA. The species codes ended up being SHORMB and SHORMC, respectively. + You should use a similar naming convention for each morphospecies incorporating + details + you know. For example, using LITSBL (Litsea “Big Leaf”) or APORS1 (Aporosa sp. 1) are + fine as long as each code applies to only one morphospecies. These can be changed once + identification is more complete + Other combinations are also acceptable. Some sites use 3 letters from the genus and + 3 + from the species, while others use 4 letters instead of 6 (2 letters from the genus and 2 + from + the species). + + + genus: the taxonomic genus name according to the APG system. In case of an + unknown genus, use “Unidentified.” + species: the species part of the Latin name; may be a morphospecies + name. + idlevel: the deepest taxonomic level for which full identification is known. The + IDLevel is limited to the values of: species, subspecies, genus, family, none, or multiple. “None” is used + when the family is not known. “Multiple” is used when the name may include a mixture of more + than one species. + family: the taxonomic family name (optional) + authority: author of the species (optional) + subspecies: subspecies identifier (optional) + subspeciesauthority: authority of subspecies (optional) + + + +
+
+ + + + + )}
); }