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-627: Fix Manage Telemetry Page #1452

Merged
merged 13 commits into from
Dec 16, 2024

Conversation

NickPhura
Copy link
Collaborator

@NickPhura NickPhura commented Dec 11, 2024

Links to Jira Tickets

https://apps.nrs.gov.bc.ca/int/jira/browse/SIMSBIOHUB-627

Description of Changes

Fix the add/edit/delete manual telemetry functionality.
Add server-side pagination/sorting to manage telemetry table.
Fix device credentials upload endpoint (remove call to bctw)

Misc

Minor UI cleanup/tweaks.
Resolves some warnings about incorrect html.
Fix two incorrect useEffects for the device/deployment edit forms.

Testing Notes

  • I did not touch the import telemetry feature, so it is likely still broken. Will be updated to use the latest csv import code in a separate PR. Disabled the button in the meantime.

Resolves some warnings about incorrect html.
Fix two incorrect useEffects for the device/deployment edit forms.
@NickPhura NickPhura added the Ready For Review PR is ready for review label Dec 11, 2024
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 12.50000% with 105 lines in your changes missing coverage. Please review.

Project coverage is 45.74%. Comparing base (227667d) to head (1ef61b5).
Report is 1 commits behind head on SIMSBIOHUB-627.

Files with missing lines Patch % Lines
app/src/contexts/telemetryTableContext.tsx 3.12% 31 Missing ⚠️
...ry-repositories/telemetry-deployment-repository.ts 21.73% 17 Missing and 1 partial ⚠️
...es/surveys/telemetry/list/SurveyDeploymentList.tsx 0.00% 13 Missing ⚠️
...eys/view/survey-spatial/SurveySpatialContainer.tsx 0.00% 8 Missing ⚠️
...emetry-repositories/telemetry-vendor-repository.ts 0.00% 6 Missing ⚠️
app/src/hooks/api/useTelemetryApi.ts 25.00% 6 Missing ⚠️
...ponents/measurements/search/MeasurementsSearch.tsx 0.00% 5 Missing ⚠️
...etry/manage/deployments/table/DeploymentsTable.tsx 0.00% 5 Missing ⚠️
...telemetry-services/telemetry-deployment-service.ts 0.00% 3 Missing ⚠️
.../src/components/fields/DeviceAutocompleteField.tsx 0.00% 3 Missing ⚠️
... and 4 more
Additional details and impacted files
@@                Coverage Diff                 @@
##           SIMSBIOHUB-627    #1452      +/-   ##
==================================================
- Coverage           45.88%   45.74%   -0.14%     
==================================================
  Files                 891      881      -10     
  Lines               23336    23178     -158     
  Branches             3417     3410       -7     
==================================================
- Hits                10707    10603     -104     
+ Misses              12017    11965      -52     
+ Partials              612      610       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -5,7 +5,7 @@ import { getBctwUser } from '../../../services/bctw-service/bctw-service';
import { BctwTelemetryService } from '../../../services/bctw-service/bctw-telemetry-service';
import { getLogger } from '../../../utils/logger';

const defaultLog = getLogger('paths/telemetry/manual');
const defaultLog = getLogger('paths/telemetry/vendor/deployments');
Copy link
Collaborator

@mauberti-bc mauberti-bc Dec 12, 2024

Choose a reason for hiding this comment

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

Should this endpoint end with telemetry? like vendor/deployments/telemetry? I would assume that fetching deployments would omit telemetry points and for the telemetry points to be a different request.

EDIT: It looks like this endpoint is making a request to BCTW and is never called in SIMS - can we remove it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah this endpoint is going to be dropped. This change isn't really needed, I was just updating some other instances of 'telemetry/manual' and this got caught in the crossfire.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Most of the related code will need to be updated or removed, etc, as part of the larger work needed to update the Manage Telemetry page.

@mauberti-bc
Copy link
Collaborator

Not sure if related to this PR but deployment do not display in the left side panel of the manage telemetry page, yet the request succeeds
image

@NickPhura
Copy link
Collaborator Author

NickPhura commented Dec 12, 2024

Not sure if related to this PR but deployment do not display in the left side panel of the manage telemetry page, yet the request succeeds ![image](https://private-user-images.githubusercontent.com/108430771/394963852-7e92b328-ef1d-445c-b6d4-8250eae62b4c.png?

I think this is due to the fact that the seed critter records in SIMS don't match real records in Critterbase.

It looks like we do it in 2 places (in the app at least):
In the side bar
In the deployment colum in the table

If you add a new critter, then you can add them to a deployment, and they show up.

image

(Creating the manual telemetry record fails, because its calling that old endpoint)

@NickPhura NickPhura changed the title SIMSBIOHUB-627: Misc Cleanup SIMSBIOHUB-627: Fix Manage Telemetry Page Dec 12, 2024
@NickPhura NickPhura added Early Feedback Welcome PR is not finished, but early review feedback is welcomed and removed Ready For Review PR is ready for review labels Dec 13, 2024
@mauberti-bc
Copy link
Collaborator

mauberti-bc commented Dec 14, 2024

Looks great! Made me think of something made small enough to add to this PR: we need to let users somehow remove vendor telemetry from a survey, in case they imported the wrong device or just want it gone. Right now you cannot remove vendor telemetry records and therefore can't get around the foreign key constraint preventing deployments from being deleted.

@NickPhura NickPhura added Ready For Review PR is ready for review and removed Early Feedback Welcome PR is not finished, but early review feedback is welcomed labels Dec 16, 2024
Copy link
Collaborator

@MacQSL MacQSL left a comment

Choose a reason for hiding this comment

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

🥅

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@NickPhura NickPhura merged commit 19c4239 into SIMSBIOHUB-627 Dec 16, 2024
18 of 21 checks passed
@NickPhura NickPhura deleted the SIMSBIOHUB-627-cleanup branch December 16, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants