From 93f9a0c39cf0fe3713c375bcfece848706794a5c Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Fri, 20 Nov 2015 03:10:24 -0800 Subject: [PATCH 1/4] Fixed created & updated columns in dashboard table --- pkg/models/dashboards.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/models/dashboards.go b/pkg/models/dashboards.go index 7d4a2690556..a07d6d1ee88 100644 --- a/pkg/models/dashboards.go +++ b/pkg/models/dashboards.go @@ -73,9 +73,12 @@ func NewDashboardFromJson(data map[string]interface{}) *Dashboard { if dash.Data["version"] != nil { dash.Version = int(dash.Data["version"].(float64)) + dash.Updated = time.Now() } } else { dash.Data["version"] = 0 + dash.Created = time.Now() + dash.Updated = time.Now() } return dash From ca01604b43d3585b98bd98d1db2ded8e9b3fce75 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Fri, 20 Nov 2015 04:37:24 -0800 Subject: [PATCH 2/4] Added statements in constructor --- pkg/models/dashboards.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/models/dashboards.go b/pkg/models/dashboards.go index a07d6d1ee88..1c6f2fad484 100644 --- a/pkg/models/dashboards.go +++ b/pkg/models/dashboards.go @@ -43,7 +43,9 @@ func NewDashboard(title string) *Dashboard { dash.Data = make(map[string]interface{}) dash.Data["title"] = title dash.Title = title - dash.UpdateSlug() + dash.Created = time.Now() + dash.Updated = time.Now() + dash.UpdateSlug() return dash } @@ -66,19 +68,19 @@ func NewDashboardFromJson(data map[string]interface{}) *Dashboard { dash := &Dashboard{} dash.Data = data dash.Title = dash.Data["title"].(string) - dash.UpdateSlug() + dash.UpdateSlug() if dash.Data["id"] != nil { dash.Id = int64(dash.Data["id"].(float64)) if dash.Data["version"] != nil { dash.Version = int(dash.Data["version"].(float64)) - dash.Updated = time.Now() - } + dash.Updated = time.Now() + } } else { dash.Data["version"] = 0 - dash.Created = time.Now() - dash.Updated = time.Now() + dash.Created = time.Now() + dash.Updated = time.Now() } return dash From 1b7f4f31ca39d68f16ab1003da6940732cb97ffb Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Fri, 20 Nov 2015 04:52:50 -0800 Subject: [PATCH 3/4] Tired of gofmt --- pkg/models/dashboards.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/models/dashboards.go b/pkg/models/dashboards.go index 1c6f2fad484..5b926c3e314 100644 --- a/pkg/models/dashboards.go +++ b/pkg/models/dashboards.go @@ -44,8 +44,8 @@ func NewDashboard(title string) *Dashboard { dash.Data["title"] = title dash.Title = title dash.Created = time.Now() - dash.Updated = time.Now() - dash.UpdateSlug() + dash.Updated = time.Now() + dash.UpdateSlug() return dash } @@ -68,19 +68,19 @@ func NewDashboardFromJson(data map[string]interface{}) *Dashboard { dash := &Dashboard{} dash.Data = data dash.Title = dash.Data["title"].(string) - dash.UpdateSlug() + dash.UpdateSlug() if dash.Data["id"] != nil { dash.Id = int64(dash.Data["id"].(float64)) if dash.Data["version"] != nil { dash.Version = int(dash.Data["version"].(float64)) - dash.Updated = time.Now() - } + dash.Updated = time.Now() + } } else { dash.Data["version"] = 0 - dash.Created = time.Now() - dash.Updated = time.Now() + dash.Created = time.Now() + dash.Updated = time.Now() } return dash From 396f53d20e1112b0ab84ae585d9f21b0f97a0f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sat, 21 Nov 2015 13:47:58 +0100 Subject: [PATCH 4/4] fix(tests): removed it.only accidentally cecked in --- .../datasource/elasticsearch/specs/elastic_response_specs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/elasticsearch/specs/elastic_response_specs.ts b/public/app/plugins/datasource/elasticsearch/specs/elastic_response_specs.ts index 4e80833c55b..5d4c84e01bd 100644 --- a/public/app/plugins/datasource/elasticsearch/specs/elastic_response_specs.ts +++ b/public/app/plugins/datasource/elasticsearch/specs/elastic_response_specs.ts @@ -443,7 +443,7 @@ describe('ElasticResponse', function() { result = new ElasticResponse(targets, response).getTimeSeries(); }); - it.only('should return table', function() { + it('should return table', function() { expect(result.data.length).to.be(1); expect(result.data[0].type).to.be('docs'); expect(result.data[0].datapoints.length).to.be(2);