Commit Graph

7 Commits (1aebbf2bd4220031233a454d6a871c4f118a815b)

Author SHA1 Message Date
Michael Desa 36e14cb111 Refactor data stores into a common interface 2017-10-31 16:41:17 -04:00
Tim Raymond c24db57385 Add validation around Base and Scale
The Base and Scale options on axes can only be one of two parameters. We
weren't validating that this was the case. This patch ensures that Base
can only ever be "10" or "2", and Scale must be either "linear" or
"log".

Associated test coverage was also added.
2017-08-24 15:37:19 -04:00
Tim Raymond 74f464800d Fix missing cell type
Because we are now creating new instances of dashboards when we create a
response, it's critical to copy every element of Dashboards from the
previous to the new instance.

We were not previously copying the Type field of cells, so this was
defaulting to the empty string zero value. This patch adds "Type" to the
tests and ensures that it's properly copied
2017-08-14 13:41:31 -04:00
Tim Raymond 08bf8aeff5 Ensure cell bounds come back as empty array
The contract with the frontend states that bounds should come back as an
empty array instead of null when there are no bounds present. We must
explicitly specify []string{} for this to happen.
2017-07-31 16:36:16 -04:00
Tim Raymond 4391004e7f Enforce presence of "x", "y", and "y2" axes
Certain aspects of the frontend requires the presence of these three
axes, so part of the contract established is that the backend will
always provide them. Since we centralize creation of
dashboardCellResponses, this is where these axes are added to all cell
responses.

Additionally, because there was previously no coverage over the
dashboard cells endpoints, a test has been added to cover the
DashboardCells method of Service.
2017-07-31 16:36:07 -04:00
Tim Raymond 2ff3e27e1f Convert Axis Bounds to []string
Due to various limitations with the previous implementation of Bounds as
a [2]int64{}, we've decided to change this to a []string{}. This will
allow clients to store arbitrary data specifying a bound and interpret
it as they wish.
2017-07-31 16:35:53 -04:00
Tim Raymond ee6a2fa54b Enforce only "x", "y", and "y2" axes
For the forseeable future, we will only be using the "x", "y", and "y2"
axes, even though the underlying serialization can support arbitrary
axes (for the future).

This ensures that only "x", "y", and "y2" axes are present and updates
the Swagger docs to reflect that fact
2017-07-21 12:09:49 -04:00