Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIMSBIOHUB-426: Calculate Submission Regions #231

Closed
wants to merge 201 commits into from
Closed

Conversation

al-rosenthal
Copy link
Contributor

@al-rosenthal al-rosenthal commented Jan 12, 2024

Links to Jira Tickets

SIMSBIOHUB-426

Description of Changes

  • Added migrations for region_lookup and submission_regions
  • Added seed files for existing regions (taken from SIMS)
  • Modified Submission fetch to include regions
  • Modified intake to include region calculations

Testing Notes

  • Run both SIMS and BioHub locally
  • Create a Project/ Survey in SIMS
  • Publish that Survey
  • In BioHub navigate to Submissions tab and see regions on new submission

MacQSL and others added 30 commits December 5, 2023 15:49
Update dashboard page to load submission data.
Add tests for service/repo functions.
@al-rosenthal al-rosenthal marked this pull request as ready for review January 15, 2024 23:32
api/src/services/region-service.ts Show resolved Hide resolved
api/src/repositories/bcgw-repository.ts Outdated Show resolved Hide resolved
api/src/repositories/region-repository.ts Outdated Show resolved Hide resolved
api/src/repositories/search-index-respository.ts Outdated Show resolved Hide resolved
curtisupshall
curtisupshall previously approved these changes Jan 16, 2024
Copy link
Contributor

@curtisupshall curtisupshall left a comment

Choose a reason for hiding this comment

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

Looks good to me 🗺️

api/src/services/region-service.ts Show resolved Hide resolved
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

5.9% Duplication on New Code (required ≤ 3%)
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@@ -189,6 +190,12 @@ const UnreviewedSubmissionsTable = () => {
<dd>Source:</dd>
<dt>{submissionRecord.source_system}</dt>
</Stack>
{submissionRecord.regions.length && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will render a "0" if regions have a zero length.

Can be updated to submissionRecord.regions.length > 0

@@ -200,6 +200,12 @@ const ReviewedSubmissionsTable = () => {
<dd>Source:</dd>
<dt>{submissionRecord.source_system}</dt>
</Stack>
{submissionRecord.regions.length && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will render a "0" if regions have a zero length.

Can be updated to submissionRecord.regions.length > 0

@@ -207,6 +207,12 @@ const PublishedSubmissionsTable = () => {
<dd>Source:</dd>
<dt>{submissionRecord.source_system}</dt>
</Stack>
{submissionRecord.regions.length && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

@@ -0,0 +1,17 @@
-- *******************************************************************
-- Procedure: fn_calculate_area_intersect
-- Purpose: returns true if both geometries intersect by the given tolerance amount (0.4 == 40% coverage)
Copy link
Collaborator

Choose a reason for hiding this comment

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

"Both" geometries or "either"?

ie: Is it AND vs OR?

@NickPhura NickPhura self-assigned this Jan 17, 2024
Copy link
Contributor

@KjartanE KjartanE left a comment

Choose a reason for hiding this comment

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

Tested locally, works as expected. 🐈

@al-rosenthal al-rosenthal deleted the SIMSBIOHUB-426 branch January 17, 2024 20:41
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.

6 participants