Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Add list support to Worker Inspector #1396

Merged
merged 7 commits into from
Jun 17, 2020

Conversation

jamiebrynes7
Copy link
Contributor

@jamiebrynes7 jamiebrynes7 commented Jun 15, 2020

Description

This PR introduces list support for the worker inspector by adding a PaginatedListView<TElement, TData> visual element for use in the worker inspector. This maintains a pool of TElement objects that it will reuse. By default, the number of elements per page is 5, we can tweak this pretty easily. The PaginatedListView accepts two closures in its constructor:

  • Func<TElement> makeElement. This is what the pool calls when it needs to create a new element.
  • Action<int, TData, TElement> bindElement. This is what is called when the list view is updating an element. The int parameter is the absolute position of the element in the list (i.e. - not the position in the page).

The pagination handles elements being removed from the list underneath you as well as additions.

image

(See CubeSpawner component for the list)

Tests

  • Cube spawner in playground
  • Some unit tests for the list view around pagination and viewing a list slice.
  • Exhaustive list renderer.

@improbable-prow-robot improbable-prow-robot added jira/no-ticket Indicates a PR has no corresponding JIRA ticket do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jun 15, 2020
@improbable-prow-robot improbable-prow-robot added A: tooling Area: Tooling size/L Denotes a PR that changes 150-299 lines, ignoring generated files. labels Jun 15, 2020
@jamiebrynes7 jamiebrynes7 force-pushed the feature/worker-inspector-paginated-list branch from 1909fa0 to 8c11302 Compare June 15, 2020 16:29
@jamiebrynes7
Copy link
Contributor Author

Also as a note, the elements in the list view are lazily created (rather than creating the max-per-page up front) as certain schema will cause a stack overflow. I.e. -

type RecursiveList {
	list<RecursiveList> list = 1;
}

(This could happen with options, but we prevent recursive options for other reasons!)

@jamiebrynes7 jamiebrynes7 force-pushed the feature/worker-inspector-paginated-list branch from 7374c46 to 243b7c1 Compare June 16, 2020 16:26
@improbable-prow-robot improbable-prow-robot added size/XL Denotes a PR that changes 300-599 lines, ignoring generated files. and removed size/L Denotes a PR that changes 150-299 lines, ignoring generated files. labels Jun 16, 2020
@jamiebrynes7 jamiebrynes7 marked this pull request as ready for review June 16, 2020 16:26
@improbable-prow-robot improbable-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 16, 2020
@jamiebrynes7 jamiebrynes7 requested a review from zeroZshadow June 16, 2020 16:26
@jamiebrynes7 jamiebrynes7 force-pushed the feature/worker-inspector-paginated-list branch from 243b7c1 to 2a061cc Compare June 16, 2020 16:29
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

91.9% 91.9% Coverage
0.0% 0.0% Duplication

@jamiebrynes7 jamiebrynes7 merged commit 352b85a into develop Jun 17, 2020
@improbable-prow-robot improbable-prow-robot deleted the feature/worker-inspector-paginated-list branch June 17, 2020 16:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A: tooling Area: Tooling jira/no-ticket Indicates a PR has no corresponding JIRA ticket size/XL Denotes a PR that changes 300-599 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants