Admin interface should display Minor Trace Chemistry data#385
Merged
Conversation
Add read-only admin view for NMAMinorTraceChemistry model to browse legacy minor and trace chemistry analysis results. The view: - Displays chemistry data with parent ChemistrySampleInfo relationship - Enforces read-only access (no create/edit/delete) for legacy data - Provides searchable fields for analyte, symbol, and agency - Default sort by analysis_date descending Part of #383 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Register the new MinorTraceChemistry admin view so it appears in the admin sidebar and is accessible at /admin/n-m-a-minor-trace-chemistry. Part of #383 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 14 unit tests verifying: - View registration in admin interface - Read-only methods are callable (not boolean attributes) - List view configuration (columns, sort, pagination) - Form view field labels and searchable fields - HasOne relationship for parent ChemistrySampleInfo Part of #383 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Gherkin feature scenarios covering: - List view with default columns and sorting - Search by analyte - Pagination with 50 records per page - Read-only restrictions (no create/edit/delete buttons) - Detail view for viewing record information - Sidebar navigation with flask icon Part of #383 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Detail page currently fails to load - adding scenario to track fix. Part of #383 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add real HTTP integration tests that verify: - List view returns 200 and contains expected content - Detail view returns 200 and shows record data - Create/edit/delete endpoints are forbidden for read-only view - 404 returned for non-existent records These tests ensure the UI works when tests pass. Part of #383 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests now always use ocotilloapi_test to avoid polluting or depending on development data. Database name matches repo. Part of #383 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change default Postgres port from 5432 to 54321 to avoid conflicts with system Postgres. Also add override=True to load_dotenv to ensure .env values take precedence. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use storage.Client() for non-production environments, which automatically picks up GOOGLE_APPLICATION_CREDENTIALS env var or the default gcloud credential location (~/.config/gcloud/application_default_credentials.json). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Load dotenv before database imports to ensure correct config - Add startup check that raises error if POSTGRES_DB is a test database - Display database configuration in main() for verification - Add double-check in main() before running transfers Prevents accidental data pollution of test databases. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…r-trace-chemistry
The test suite now uses a dedicated test database (ocotilloapi_test) instead of the default postgres database. This ensures CI creates the database and enables PostGIS extension before tests run. Fixes CI failures from commit cd8535f. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Admin integration tests require AUTHENTIK_DISABLE_AUTHENTICATION=1 to bypass login, matching local development environment. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
BDD tests run as a separate process and need POSTGRES_DB set explicitly in CI environment to use the test database. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
jirhiker
reviewed
Jan 16, 2026
jirhiker
left a comment
Member
There was a problem hiding this comment.
default port should remain 5432
Changed all port references from 54321 to the standard PostgreSQL port 5432 based on PR review feedback. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…com/DataIntegrationGroup/OcotilloAPI into feature/admin-minor-trace-chemistry
Resolved conflict in db/initialization.py by removing unused GRANT_MEMBER_SQL constant (functionality exists in grant_app_read_members). Also fixed duplicate dotenv import in transfers/transfer.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
Closes #383
🤖 Generated with Claude Code