This repository has been archived by the owner on Feb 29, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for uploading dashboard definitions.
This enables PUT-ing and GET-ing of full dashboard definitions through /<slug>.json. In this API, the 'dashboards_json' database field is converted from a JSON string to a native JSON suboject of the Rails Dashboard model JSON. The full externally exposed JSON looks like this: { "name": "Test Dashboard", "created_at": "2014-11-07T00:25:57.000Z", "updated_at": "2014-11-07T00:38:23.000Z", "dashboard_json": { "globalConfig": { // ...global configuration... }, "widgets": [ // ...widget definitions... ] } } Upon PUT, the 'dashboards_json' field is validated against the JSON-schema definition in the file 'dashboard_schema.json' and then saved again as a string in a single database field. Since Rails converts JSON empty arrays to "nil" values by default, this also upgrades PromDash to Rails 4.1.1, which supports an option to turn off this automatic conversion. See the following issues about this regarding security implications (which for now we shouldn't need to worry about in PromDash): rails/rails#8832 rails/rails#13420 Further, as we're exposing the dashboard_json as an external API for the first time, this also includes a lot of naming cleanups in the JSON fields and the related code.
- Loading branch information
Showing
41 changed files
with
602 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.