fix: broken selection of nested node executions #118
Merged
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.
TL;DR
#115 broke selection of nested items. This PR refactors how executions are referenced in the NodeExecutionsTable to allow lookup of nested NodeExecutions by ID, restoring selection of nested executions based on the updated logic in the previous PR.
Type
Are all requirements met?
Complete description
I naively fixed the previous issue by keeping track of the selected ID and looking it up in the
NodeExecutionsTable
state hook. That had the effect of only allowing selection of the first level of items, since those are the only ones present in the list we were searching.To mitigate this, I added functionality to the
ExecutionDataCache
to look up a previously fetchedNodeExecution
by its ID orcacheKey
. This allows setting of the selection from any level of the list while still being able to look up the selected item at the top layer to provide to theDetailsPanel
.This proved to be a little more complicated than I would like, as the
DetailsPanel
expects a decorated version ofNodeExecution
(DetailedNodeExecution
), which had been created by a separate hook in theNodeExecutionsTable
component and its descendants. To solve this, I moved the decoration ofNodeExecutions
into theExecutionDataCache
itself, so that fetching the list ofNodeExecutions
will immediately result in a list ofDetailedNodeExecution
items and all components in the tree expect to receive this type directly instead of constructing it themselves.Unit tests also needed to be updated, since our mocking there was a little messy.
Tracking Issue
NA
Follow-up issue
NA