Assemble worksheets (layout + QC analyses) through the API - #105
Open
ramonski wants to merge 2 commits into
Open
Assemble worksheets (layout + QC analyses) through the API#105ramonski wants to merge 2 commits into
ramonski wants to merge 2 commits into
Conversation
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.
Description
Setting a Worksheet's
analysesfield through the API only writes the back reference. The worksheet keeps its slot/position information in a separateLayoutfield (theanalysesfield is documented as "used for back references"), and the results view (manage_results) renders fromLayout. So a worksheet assembled by plain field setting looks empty in the UI even though its analyses are catalog-linked. OnlyWorksheet.addAnalyses->addAnalysis->addToLayoutbuilds the layout, and the API never called it. QC analyses (reference and duplicate) are likewise created only throughaddReferenceAnalyses/addDuplicateAnalyses, which were unreachable through the API.This PR adds an
IUpdateadapter forIWorksheetthat routes assembly through the worksheet's own methods. It covers both create and update, because non-delegated creation builds a minimal (open) object and then applies the record viaupdate_object_with_data, which uses this adapter. Every non-assembly key is still applied through the regular field managers; validation, anytransitionand reindex happen in the caller as before.Recognised keys (all optional):
analyses: list of routine analysis UIDs (or{"uid": ...}) ->addAnalysesreference_analyses: list of{"reference_uid": <ReferenceSample>, "services": [<uid>, ...], "slot": <int>}->addReferenceAnalysesduplicate_analyses: list of{"src_slot": <int>, "dest_slot": <int>}->addDuplicateAnalysesCurrent behavior before PR
A worksheet created/updated via the API with an
analyseslist has noLayout, somanage_resultsshows no analyses; QC (reference/duplicate) analyses cannot be created at all.Desired behavior after PR is merged
The
analyseslist is routed throughaddAnalyses, building the layout so the worksheet renders correctly, and QC reference/duplicate analyses can be added through the API.Stacked on #104.