Skip to content

fix(reports): request changes form validation for compounds and organisms#804

Open
vcnainala wants to merge 3 commits into
developmentfrom
fix/request-changes-form-validation
Open

fix(reports): request changes form validation for compounds and organisms#804
vcnainala wants to merge 3 commits into
developmentfrom
fix/request-changes-form-validation

Conversation

@vcnainala

@vcnainala vcnainala commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

Changes

  • ReportResource: replace static molecule loading with resolveMolecule() / valueKeyedOptions() helpers; add hidden compound_id and type fields for Livewire persistence; use dynamic repeater schema for new organisms
  • Organism: parameterize getForm() with requireUniqueName and excludedNames for report-change context
  • Tests: unit coverage for option-key validation and organism name rules

Test plan

  • php artisan test tests/Unit/ReportResourceMoleculeOptionsTest.php tests/Unit/OrganismReportChangeFormTest.php
  • Request changes for a compound with synonyms/CAS (e.g. CNP0520383.0): rename and add synonym without validation errors
  • Request changes: add an organism that exists in COCONUT but is not linked to the molecule
  • Request changes: verify already-linked organism name is rejected with a clear message
  • Organism admin create still rejects duplicate organism names
  • After deploy: curate Add species and citation to CNP0512695.0 #170 (CNP0512695.0 — add Valeriana pavonii and Biomédica 2010 citation)

Related

Resolves

Closes #775
Closes #772

vcnainala added 2 commits June 7, 2026 17:15
Relax unique-name validation in the request-changes organism repeater so
users can link organisms that already exist in the database. Reject names
already attached to the target molecule instead.

Fixes #772
Align Filament v4 Select option keys with stored state for existing
synonyms, CAS, geo locations, organisms, and citations. Resolve the
target molecule from form state and report records so options remain
valid on Livewire submit requests.

Fixes #775
@codecov-commenter

codecov-commenter commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 31.11111% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 6.64%. Comparing base (4223a58) to head (3c2eb9d).

Files with missing lines Patch % Lines
...pp/Filament/Dashboard/Resources/ReportResource.php 22.05% 53 Missing ⚠️
app/Models/Organism.php 59.09% 9 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             development    #804      +/-   ##
================================================
+ Coverage           6.13%   6.64%   +0.50%     
- Complexity          1737    1749      +12     
================================================
  Files                227     227              
  Lines               8961    9012      +51     
================================================
+ Hits                 550     599      +49     
- Misses              8411    8413       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Use explicit null checks for molecule synonyms/CAS options and remove
unreachable is_string handling for mol_ids array cast.
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.

2 participants