fix(create-object): update wizard template to use new API endpoints #170
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
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→/subtypesAnd response field names:
super_types→categoriessub_types→subtypessub_type_count→subtype_countHowever, the JavaScript in
create_object_wizard.htmlwas 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:
This message was confusing because it implied the
import_or_remotesetting 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)/categoriesinstead of/super-typesdata.categoriesinstead ofdata.super_types/subtypesinstead of/sub-typesdata.subtypesinstead ofdata.sub_typessubtype_countinstead ofsub_type_countFile Status Fix (
bloom_lims/domain/files.py)Changed status message from confusing:
To clear:
Testing