Skip to content

fix(create-object): update wizard template to use new API endpoints#170

Open
iamh2o wants to merge 4 commits intomainfrom
fix/create-object-wizard-api-endpoints
Open

fix(create-object): update wizard template to use new API endpoints#170
iamh2o wants to merge 4 commits intomainfrom
fix/create-object-wizard-api-endpoints

Conversation

@iamh2o
Copy link
Contributor

@iamh2o iamh2o commented Feb 4, 2026

Summary

Fixes the create object wizard page (/create_object) which was broken after the field name migration, and improves the file status message for files awaiting data.

Problem 1: Create Object Wizard Broken

The field name migration (PR #168) changed API endpoints from legacy BLOOM names to TapDB naming convention:

  • /super-types/categories
  • /sub-types/subtypes

And response field names:

  • super_typescategories
  • sub_typessubtypes
  • sub_type_countsubtype_count

However, the JavaScript in create_object_wizard.html was not updated, so it was calling endpoints that no longer exist.

Problem 2: Confusing File Status Message

When a file instance is created without actual file data, the status was set to:

no file data provided or import is not 'import'

This message was confusing because it implied the import_or_remote setting was wrong when the actual issue was simply that no file data had been provided yet.

Changes

Template Fix (templates/modern/create_object_wizard.html)

  1. Fetch from /categories instead of /super-types
  2. Use data.categories instead of data.super_types
  3. Fetch from /subtypes instead of /sub-types
  4. Use data.subtypes instead of data.sub_types
  5. Use subtype_count instead of sub_type_count

File Status Fix (bloom_lims/domain/files.py)

Changed status message from confusing:

no file data provided or {import_or_remote} is not 'import'

To clear:

awaiting file data

Testing

  • All 622 tests passing
  • 41.46% coverage (above 39% minimum)
  • API endpoints verified working
  • FI1 status updated in database

The field name migration changed API endpoints from:
- /super-types -> /categories
- /sub-types -> /subtypes

And response field names from:
- super_types -> categories
- sub_types -> subtypes
- sub_type_count -> subtype_count

Updated the JavaScript in create_object_wizard.html to match
the new API naming convention.

All 622 tests passing, 41.46% coverage.
Changed confusing status message from:
  'no file data provided or {import_or_remote} is not import'
to:
  'awaiting file data'

The old message was misleading because it implied the import_or_remote
setting was wrong when the actual issue was simply that no file data
had been provided yet.

All 622 tests passing.
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.

1 participant