Skip to content

Commit

Permalink
applying linter changes
Browse files Browse the repository at this point in the history
  • Loading branch information
siddheshraze committed Oct 18, 2024
1 parent 821e03d commit 5bf7df9
Show file tree
Hide file tree
Showing 12 changed files with 142 additions and 162 deletions.
69 changes: 34 additions & 35 deletions frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -307,20 +307,19 @@
7. materialized view reload has been adjusted to be optional. user should be able to continue the process even if one or
more of the views fails.

---
---

### 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
4. trigger definitions have been recorded
5. view implementations have been updated

48 changes: 24 additions & 24 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ documentation [here](https://github.com/ForestGeoHack/ForestGEO/wiki/ForestGEO-A

1. Before running the project, you must create an `.env.local` file in the overhead directory with
the following values:
- `AZURE_AD_CLIENT_ID`
- `AZURE_AD_CLIENT_SECRET`
- `AZURE_AD_TENANT_ID`
- `NEXTAUTH_SECRET`
- `NEXTAUTH_URL`
- all `AZURE_` values must be created/populated from Azure's App Registration portal
- `AZURE_AD_CLIENT_ID`
- `AZURE_AD_CLIENT_SECRET`
- `AZURE_AD_TENANT_ID`
- `NEXTAUTH_SECRET`
- `NEXTAUTH_URL`
- all `AZURE_` values must be created/populated from Azure's App Registration portal
2. Once `.env.local` is made, run `npm install` from the overhead directory to install dependencies
3. Run `npm run build` to compile/optimize the application for running
4. Run `npm run dev` to create a dev instance of the application locally on your machine
Expand Down Expand Up @@ -65,12 +65,12 @@ In order from left to right, please note the following points of interest:
- `[plotKey]`: this is the first required variable when accessing this endpoint -- you will have to
add some string `plotKey` to the end of the URL: `.../browse/[your plot key]` in order to
successfully view the page.
- wrapping a folder in `[]` will designate that folder as a **required** dynamic parameter
- wrapping in `[...folderName]` designates `folderName` as a catch-all route. All following
values after `folderName` (i.e., `.../a/b` will return `folderName = [a, b]` )
- wrapping in `[[...folderName]]` designates `folderName` as an _optional_ catch-all route. As
expected, all values for/after `folderName` will be returned as part of the dynamic route,
but `undefined` will also be returned if no value is entered at all (instead of a 404 error)
- wrapping a folder in `[]` will designate that folder as a **required** dynamic parameter
- wrapping in `[...folderName]` designates `folderName` as a catch-all route. All following
values after `folderName` (i.e., `.../a/b` will return `folderName = [a, b]` )
- wrapping in `[[...folderName]]` designates `folderName` as an _optional_ catch-all route. As
expected, all values for/after `folderName` will be returned as part of the dynamic route,
but `undefined` will also be returned if no value is entered at all (instead of a 404 error)
- `[plotNum]`: second required variable when accessing this endpoint - your resulting endpoint will
look like (example) `http://localhost:3000/browse/plotKey/plotNum`.

Expand All @@ -79,21 +79,21 @@ In order from left to right, please note the following points of interest:
### Release Notes (v0.1.0):

- endpoints have been added and routed to require a plot key/number combination for access
- initial state has been converted to new `Plot {key: 'none', num: 0}` instead of `''`
- initial state has been converted to new `Plot {key: 'none', num: 0}` instead of `''`
- MUI JoyUI has been partially implemented as a replacement for MaterialUI. However, due to time
limitations, MaterialUI has still been incorporated into converted sections from ForestGeoHack
- The current plan is to solely implement either NextUI or ChakraUI instead of either of these
options, and future updates will include this information.
- The current plan is to solely implement either NextUI or ChakraUI instead of either of these
options, and future updates will include this information.
- `SelectPlotProps` has been removed and replaced with NextJS dynamic routing (each endpoint will
dynamically retrieve plot information). Endpoints have been updated to reflect dynamic param-based
retrieval
- The navigation bar has been updated to use useEffect to push live endpoint updates when the
plot is changed (if you are at an endpoint and the plot is changed, the page will be reloaded
to reflect that)
- The navigation bar has been updated to use useEffect to push live endpoint updates when the
plot is changed (if you are at an endpoint and the plot is changed, the page will be reloaded
to reflect that)
- New components/moved-over information:
- `Fileuploadcomponents` --> css code has been udpated to be dark theme-friendly
- `FileList` --> moved over
- `Loginlogout` --> created component, login/logout process has been relegated to avatar icon
dropdown menu
- `Plotselection` --> partially created from SelectPlot, changed to utilize dynamic
routing/selection instead of requiring a new dropdown in each page
- `Fileuploadcomponents` --> css code has been udpated to be dark theme-friendly
- `FileList` --> moved over
- `Loginlogout` --> created component, login/logout process has been relegated to avatar icon
dropdown menu
- `Plotselection` --> partially created from SelectPlot, changed to utilize dynamic
routing/selection instead of requiring a new dropdown in each page
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ export default function ViewFullTableDataGrid() {
}

useEffect(() => {
reloadVFT().catch(console.error).then(() => setLoading(false));
reloadVFT()
.catch(console.error)
.then(() => setLoading(false));
}, []);

return (
Expand Down
6 changes: 3 additions & 3 deletions frontend/documentation/Logging into App.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ back after the
#### Logging into the app requires the following:

1. You must have received and accepted an invitation to the SIOCIORC ForestGEO SI tenant
1. An admin needs to perform this action with you over email
1. An admin needs to perform this action with you over email
2. You'll need to set up MS Authenticator (this'll definitely take a little while, make sure you have someone to reach
out to in case of issues)
3. Your email needs to be added to the Azure MySQL catalog database
1. This is another layer of security -- your information needs to be entered and you need to be assigned a site and
admin status (if applicable)
1. This is another layer of security -- your information needs to be entered and you need to be assigned a site and
admin status (if applicable)

> [!tip]
> Something of an optional step, but your site needs to be populated with information. Manual plot/site submissions or
Expand Down
16 changes: 8 additions & 8 deletions frontend/documentation/topics/Adding-New-Information.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
>
Expand Down Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---

Expand Down
4 changes: 2 additions & 2 deletions frontend/documentation/topics/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Before you're ready to start using ForestGEO, you'll need to make sure that you

1. A registered account on the SI tenant.
2. A registered account on the ForestGEO server, and:
1. **at least one site registered to your account in-server.**
1. **at least one site registered to your account in-server.**

> Missing one of these? Please contact an administrator to request access!
Expand All @@ -16,7 +16,7 @@ Once you've gotten both of these set up, you can access the ForestGEO website by
two following URLs:

| Production | Development |
|-----------------------------------------------------------------|------------------------------------------------------------------------------|
| --------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [Production URL](https://forestgeo-livesite.azurewebsites.net/) | [Development URL](https://forestgeo-livesite-development.azurewebsites.net/) |

> Which website should I use?
Expand Down
54 changes: 27 additions & 27 deletions frontend/documentation/topics/Understanding-the-Dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,33 @@ They're listed here again with some more information to better explain what they
- You will need to submit supporting data before being able to submit new measurements for your census.

- Before you can submit new measurements for a census, you'll need to submit some supporting data that's needed to
make sure that your measurements are correctly correlated to the right location, plant, or time period. 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!
- Before you can submit new measurements for a census, you'll need to submit some supporting data that's needed to
make sure that your measurements are correctly correlated to the right location, plant, or time period. 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!

### User-Specific Information

Expand Down
8 changes: 4 additions & 4 deletions frontend/styles/customtablesettings.css
Original file line number Diff line number Diff line change
@@ -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;
}
10 changes: 5 additions & 5 deletions frontend/styles/dropzone.css
Original file line number Diff line number Diff line change
@@ -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;
}
Loading

0 comments on commit 5bf7df9

Please sign in to comment.