diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b525a62999..b7d233c8237 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - [Issue #802](https://github.com/grafana/grafana/issues/802). Annotations: Fix when using InfluxDB datasource - [Issue #795](https://github.com/grafana/grafana/issues/795). Chrome: Fix for display issue in chrome beta & chrome canary when entering edit mode - [Issue #818](https://github.com/grafana/grafana/issues/818). Graph: Added percent y-axis format +- [Issue #828](https://github.com/grafana/grafana/issues/828). Elasticsearch: saving new dashboard with title equal to slugified url would cause it to deleted. # 1.8.0-RC1 (2014-09-12) diff --git a/src/app/services/elasticsearch/es-datasource.js b/src/app/services/elasticsearch/es-datasource.js index 4f69df61f17..ab03c614a83 100644 --- a/src/app/services/elasticsearch/es-datasource.js +++ b/src/app/services/elasticsearch/es-datasource.js @@ -169,7 +169,7 @@ function (angular, _, config, kbn, moment) { return this._request('PUT', '/dashboard/' + id, this.index, data) .then(function(results) { - self._removeUnslugifiedDashboard(results, title); + self._removeUnslugifiedDashboard(results, title, id); return { title: title, url: '/dashboard/db/' + id }; }, function() { throw 'Failed to save to elasticsearch'; @@ -177,8 +177,9 @@ function (angular, _, config, kbn, moment) { } }; - ElasticDatasource.prototype._removeUnslugifiedDashboard = function(saveResult, title) { + ElasticDatasource.prototype._removeUnslugifiedDashboard = function(saveResult, title, id) { if (saveResult.statusText !== 'Created') { return; } + if (title === id) { return; } var self = this; this._get('/dashboard/' + title).then(function() {