mirror of https://github.com/grafana/grafana.git
Elasticsearch: fix for issue when saving dashboard with title equal to slugified url, would cause the backward compatible fix to delete it, Closes #828
This commit is contained in:
parent
fa31fc046e
commit
a97bcc3ca7
|
@ -4,6 +4,7 @@
|
||||||
- [Issue #802](https://github.com/grafana/grafana/issues/802). Annotations: Fix when using InfluxDB datasource
|
- [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 #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 #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)
|
# 1.8.0-RC1 (2014-09-12)
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ function (angular, _, config, kbn, moment) {
|
||||||
|
|
||||||
return this._request('PUT', '/dashboard/' + id, this.index, data)
|
return this._request('PUT', '/dashboard/' + id, this.index, data)
|
||||||
.then(function(results) {
|
.then(function(results) {
|
||||||
self._removeUnslugifiedDashboard(results, title);
|
self._removeUnslugifiedDashboard(results, title, id);
|
||||||
return { title: title, url: '/dashboard/db/' + id };
|
return { title: title, url: '/dashboard/db/' + id };
|
||||||
}, function() {
|
}, function() {
|
||||||
throw 'Failed to save to elasticsearch';
|
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 (saveResult.statusText !== 'Created') { return; }
|
||||||
|
if (title === id) { return; }
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
this._get('/dashboard/' + title).then(function() {
|
this._get('/dashboard/' + title).then(function() {
|
||||||
|
|
Loading…
Reference in New Issue