fix(create-object): update wizard template to use new API endpoints#170
Open
fix(create-object): update wizard template to use new API endpoints#170
Conversation
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.
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
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