influxdata / chronograf

Open source monitoring and visualization UI for the TICK stack
https://www.influxdata.com/time-series-platform/chronograf/
Other
1.51k stars 258 forks source link

Refactor AJAX function to 1) not graft data onto error object & 2) not manage links data itself #1486

Closed goller closed 5 years ago

goller commented 7 years ago

This code https://github.com/influxdata/chronograf/blob/master/ui/src/utils/ajax.js#L53 ended up causing issues downstream (see #1476)

@cryptoquick had an idea that we could use symbols (http://exploringjs.com/es6/ch_symbols.html) for additional properties of response objects rather than mashups.

jaredscheib commented 6 years ago
  1. The AJAX function in ajax.js is managing links state in a way that has led to much confusion, and seems outside of the scope of what it should be concerned with.
  2. Additionally, we're grafting data onto the error object, which leads to downstream confusion and challenges.

It would be good to clean up both of these so that we can straighten out how we handle links and errors throughout Chronograf.

It looks to me currently like this complexity was introduced in order to make it so that an ostensibly older pattern of passing in resource to AJAX could be accommodated. So one simple solution to clean all of this up is to simply refactor any cases of resource to an actual link that the server ought to provide, adding links to those provided by the server as needed.

russorat commented 5 years ago

closing due to inactivity