Skip to content

Feature 80 switch to vb codes#82

Merged
DarianGill merged 10 commits into
developfrom
feature-80-switch-to-vb-codes
Oct 17, 2025
Merged

Feature 80 switch to vb codes#82
DarianGill merged 10 commits into
developfrom
feature-80-switch-to-vb-codes

Conversation

@DarianGill

@DarianGill DarianGill commented Oct 16, 2025

Copy link
Copy Markdown
Collaborator

What
This PR aligns all vegbankweb files and tests with the latest API behavior. Every view should be working except the community concept detail view which will be changed in the next pr to resemble the plant concept detail view.

Why
So that the web app works with the latest API standardization on vb codes, and removes it's deprecated use of accession codes and IDs

How
Renamed or replaced every accession code and ID reference in the repo to use vb codes
Pulled new RDS files (and modified the existing ones for the taxon obs) to update the cached data
Uploaded the cached data to drive
Added new todos for missing api values (lots of places where we have a code but no label to make a human-readable link with)
Fixed tests

Testing
All tests pass, including API tests run against a local instance of the latest dev API
Used devtools::test_coverage() to verify that we're at 100% coverage
Verified that devtools::check() runs locally without errors or warnings

@DarianGill DarianGill requested a review from Copilot October 16, 2025 21:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR transitions the vegbankweb application from using deprecated accession codes and IDs to standardized VegBank codes across all files and tests, aligning with the latest API behavior.

Key Changes

  • Renamed all column references from accession code formats (e.g., obs_accession_code, party_accession_code) to VegBank code formats (e.g., ob_code, py_code)
  • Updated cached data file paths to use standardized naming conventions with dates
  • Revised documentation and comments to reflect VegBank code terminology

Reviewed Changes

Copilot reviewed 14 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/testthat/test_plot_table.R Updated test data to use ob_code, to_code, and cl_code instead of accession codes
tests/testthat/test_plot_map.R Replaced obs_accession_code with ob_code in test fixtures
tests/testthat/test_party_table.R Changed party_accession_code to py_code and removed party_id column
tests/testthat/test_detail_view.R Updated mock API function parameters to use VegBank code naming
tests/testthat/test_community_table.R Replaced accession_code and default_name with cc_code and comm_name
inst/shiny/www/faq.md Updated terminology from "Accession Code" to "VegBank Code" throughout documentation
R/ui.R Renamed JavaScript variables and message handlers from accession to VegBank code terminology
R/table_project.R Changed action button value from project_accession_code to pj_code
R/table_plot.R Updated column references and join keys to use ob_code, to_code, and cl_code
R/table_party.R Changed button value from party_accession_code to py_code
R/table_community.R Updated column references to cc_code and comm_name, added numeric type for obs_count
R/server.R Renamed state variables and function parameters from accession to VegBank code terminology, updated cached data file paths
R/map.R Updated parameter names and column references to use ob_code instead of obs_accession_code
R/detail_view.R Changed function parameters from accession_code to vb_code, updated field names in detail views

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread inst/shiny/www/faq.md Outdated
Comment thread inst/shiny/www/faq.md Outdated
DarianGill and others added 2 commits October 16, 2025 12:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DarianGill DarianGill marked this pull request as ready for review October 16, 2025 22:25
@DarianGill DarianGill requested a review from regetz October 16, 2025 22:25

@regetz regetz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @DarianGill! Looks good other than the missing PC cache file, at least as far as I can tell. Seems to work fine after renaming plant_concepts_all_20250924.RDS to pc_20250924.RDS, but I'll let you decide whether a simple git mv is sufficient or whether the missing file is actually different.

Comment thread R/server.R
plant_data <- load_data_type(
"plant concepts",
"inst/cached_data/plant_concepts_all_20250924.RDS",
"inst/cached_data/pc_20250924.RDS",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this file isn't currently committed to the repo, although I do see a inst/cached_data/plant_concepts_all_20250924.RDS.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yea, I'd gitignored it because you mentioned not wanting to commit the 30 mb file, but I forgot to delete the old one when I updated the gitignore, so here we are 😅 I'll delete the old files and update the git ignore to include the renamed pc one.

Comment thread R/detail_view.R
row <- sorted_taxa[i, ]
htmltools::tags$tr(
# TODO: Change to author name? To avoid NA in lots of cases
htmltools::tags$td(row$int_curr_plant_sci_name_no_auth),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I believe what plant names shows up in the "top five taxa" list on the original VegBank web app is controlled by JSP code here that controls table entries, and here providing the selector for name type.

I haven't totally worked out the logic, but it does seem to fall back readily to the author plant name.

Page example: http://vegbank.org/get/std/observation/2948

Image

Comment thread .gitignore Outdated
@@ -1,4 +1,4 @@
plant_concepts_all_20250924.RDS
pc_20250924.RDS

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I guess this explains why this RDS file isn't committed :)

@DarianGill DarianGill merged commit fab3e37 into develop Oct 17, 2025
@DarianGill DarianGill mentioned this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants