consul/ui/packages/consul-ui/app/utils
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
..
dom ui: Metrics - Don't swallow metrics errors (#9044) 2020-10-27 14:51:15 +00:00
editor ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
filter ui: Add 'Search Across' for finer grained searching (#9282) 2020-12-01 15:45:09 +00:00
form ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
helpers ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
http ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
intl ui: Search/filtering 'Filtered by:' search status (#9442) 2021-01-25 18:13:54 +00:00
routing ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
search ui: Fuzzy and Regex searching (#9424) 2020-12-18 10:38:15 +00:00
storage ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
ticker ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
acls-status.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
ascend.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
atob.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
btoa.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
callable-type.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
create-fingerprinter.js ui: New search/sort/filtering bar for Node > ServiceInstances (#9326) 2020-12-09 13:08:30 +00:00
distance.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
get-environment.js Fix -ui-content-path without regex (#9569) 2021-01-20 18:40:46 +00:00
get-form-name-property.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
isFolder.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
keyToArray.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
left-trim.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
maybe-call.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
minimizeModel.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
non-empty-set.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
promisedTimeout.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
right-trim.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
templatize.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
tomography.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
ucfirst.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
update-array-object.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00