consul/ui/packages/consul-ui/app/models
John Cowen 25f989753b
ui: Adds @NullValue attr decorator (#9587)
There are many places in the API where we receive a property set to
`null` which can then lead to defensive code deeper in the app in order
to guard for this type of thing when usually we are expecting an array
or for the property to be undefined using omitempty on the backend.

Previously we had two places where we would deal with this in the
serializer using our 'remove-null' util (KV and Intentions).

This new decorator lets you declaritively define this type of data using
a decorator @NullValue([]) (which would replce a null value with [].

@NullValue in turn uses a more generic @replace helper, which we
currently don't need but would let you replace any value with another,
not just a null value.

An additional benefit here is that the guard/replacement is executed
lazily when we get the property instead of serializing all the values
when they come in via the API. On super large datasets, where we only
visualize part of the dataset (say in our scroll panes), this feels like
a good improvement on the previous approach.
2021-01-27 10:41:24 +00:00
..
acl.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00
coordinate.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00
dc.js ui: Show local datacenter by default on first visit (#9377) 2020-12-14 15:29:40 +00:00
discovery-chain.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00
gateway-config.js ui: Convert Service.GatewayConfig to a model fragment (#9586) 2021-01-20 15:36:23 +00:00
health-check.js ui: HealthCheck Search/Sort/Filtering (#9314) 2020-12-07 09:14:30 +00:00
intention-permission-http-header.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00
intention-permission-http.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00
intention-permission.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00
intention.js ui: Adds @NullValue attr decorator (#9587) 2021-01-27 10:41:24 +00:00
kv.js ui: Adds @NullValue attr decorator (#9587) 2021-01-27 10:41:24 +00:00
node.js ui: New search/sort/filtering bar for Node > ServiceInstances (#9326) 2020-12-09 13:08:30 +00:00
nspace.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00
oidc-provider.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00
policy.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00
proxy.js ui: Rename a model attribute to not be overwritten by ember-data (#9524) 2021-01-12 09:53:21 -05:00
role.js ui: Search/filtering 'Filtered by:' search status (#9442) 2021-01-25 18:13:54 +00:00
service-instance.js ui: Move linting to the `node:test` script (#9385) 2020-12-14 15:28:35 +00:00
service.js ui: Adds @NullValue attr decorator (#9587) 2021-01-27 10:41:24 +00:00
session.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00
token.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00
topology.js ui: Move ember-data classes to use native JS classes/decorators (#9136) 2020-11-09 17:29:12 +00:00