We need to explicitly tell the UI to not show the bucket-list
when we are displaying imported services. If we make
this depend on the data we will sometimes not show
it due to data-loader caching.
Working with a peer model as a relationship is much
easier than to workaround a non-relationship in
imported services. This is currently only relevant
for imported-services where we know the peer
in advance.
Add a helper that knows how to format past dates
in a smart way. When less than a week ago we will
use relative date strings - for dates older than a week
we will use a friendly human-readable format.
This matches best practices we want to adhere to
based on what Terraform did for date-formatting.
To measure the available space of an element when it
should take up the "rest" of the page. This matches
what `ListCollection` is doing internally but makes
the mechanism available in a composable component.
memdb's `WatchCh` method creates a goroutine that will publish to the
returned channel when the watchset is triggered or the given context
is canceled. Although this is called out in its godoc comment, it's
not obvious that this method creates a goroutine who's lifecycle you
need to manage.
In the xDS capacity controller, we were calling `WatchCh` on each
iteration of the control loop, meaning the number of goroutines would
grow on each autopilot event until there was catalog churn.
In the catalog config source, we were calling `WatchCh` with the
background context, meaning that the goroutine would keep running after
the sync loop had terminated.
We need a component abstraction that encapsulates
creating the dynamic tabs based on peering-type.
We create a `PeerTab`-abstraction that behaves like
the data-structure the tab-nav expects to achieve this
effect.