Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: broken selection of nested node executions #118

Merged
merged 1 commit into from
Nov 11, 2020

Conversation

schottra
Copy link
Contributor

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

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

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 fetched NodeExecution by its ID or cacheKey. 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 the DetailsPanel.

This proved to be a little more complicated than I would like, as the DetailsPanel expects a decorated version of NodeExecution (DetailedNodeExecution), which had been created by a separate hook in the NodeExecutionsTable component and its descendants. To solve this, I moved the decoration of NodeExecutions into the ExecutionDataCache itself, so that fetching the list of NodeExecutions will immediately result in a list of DetailedNodeExecution 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

@service-github-lyft-semantic-release
Copy link
Contributor

🎉 This PR is included in version 0.17.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

3 participants