Skip to content

Commit 6b65609

Browse files
committed
Merge remote-tracking branch 'upstream/master' into postgres-query-builder
2 parents 83200c2 + 9650494 commit 6b65609

File tree

7 files changed

+47
-3
lines changed

7 files changed

+47
-3
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 5.1.0 (unreleased)
2+
3+
* **Postgres/MySQL**: Ability to insert 0s or nulls for missing intervals [#9487](https://github.com/grafana/grafana/issues/9487), thanks [@svenklemm](https://github.com/svenklemm)
4+
5+
6+
# 5.0.1 (unreleased)
7+
8+
* **Postgres**: PostgreSQL error when using ipv6 address as hostname in connection string [#11055](https://github.com/grafana/grafana/issues/11055), thanks [@svenklemm](https://github.com/svenklemm)
9+
110
# 5.0.0-stable (2018-03-01)
211

312
### Fixes

docs/versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[
2+
{ "version": "v5.1", "path": "/v5.1", "archived": false },
23
{ "version": "v5.0", "path": "/", "archived": false, "current": true },
34
{ "version": "v4.6", "path": "/v4.6", "archived": true },
45
{ "version": "v4.5", "path": "/v4.5", "archived": true },

pkg/tsdb/postgres/postgres.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ func generateConnectionString(datasource *models.DataSource) string {
5454
}
5555

5656
sslmode := datasource.JsonData.Get("sslmode").MustString("verify-full")
57-
return fmt.Sprintf("postgres://%s:%s@%s/%s?sslmode=%s", url.PathEscape(datasource.User), url.PathEscape(password), url.PathEscape(datasource.Url), url.PathEscape(datasource.Database), url.QueryEscape(sslmode))
57+
u := &url.URL{Scheme: "postgres", User: url.UserPassword(datasource.User, password), Host: datasource.Url, Path: datasource.Database, RawQuery: "sslmode=" + sslmode}
58+
return u.String()
5859
}
5960

6061
func (e *PostgresQueryEndpoint) Query(ctx context.Context, dsInfo *models.DataSource, tsdbQuery *tsdb.TsdbQuery) (*tsdb.Response, error) {

public/app/core/utils/kbn.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,17 @@ kbn.valueFormats.degree = kbn.formatBuilders.fixedUnit('°');
571571
kbn.valueFormats.radian = kbn.formatBuilders.fixedUnit('rad');
572572
kbn.valueFormats.grad = kbn.formatBuilders.fixedUnit('grad');
573573

574+
// Radiation
575+
kbn.valueFormats.radbq = kbn.formatBuilders.decimalSIPrefix('Bq');
576+
kbn.valueFormats.radci = kbn.formatBuilders.decimalSIPrefix('Ci');
577+
kbn.valueFormats.radgy = kbn.formatBuilders.decimalSIPrefix('Gy');
578+
kbn.valueFormats.radrad = kbn.formatBuilders.decimalSIPrefix('rad');
579+
kbn.valueFormats.radsv = kbn.formatBuilders.decimalSIPrefix('Sv');
580+
kbn.valueFormats.radrem = kbn.formatBuilders.decimalSIPrefix('rem');
581+
kbn.valueFormats.radexpckg = kbn.formatBuilders.decimalSIPrefix('C/kg');
582+
kbn.valueFormats.radr = kbn.formatBuilders.decimalSIPrefix('R');
583+
kbn.valueFormats.radsvh = kbn.formatBuilders.decimalSIPrefix('Sv/h');
584+
574585
// Time
575586
kbn.valueFormats.hertz = kbn.formatBuilders.decimalSIPrefix('Hz');
576587

@@ -1036,6 +1047,20 @@ kbn.getUnitFormats = function() {
10361047
{ text: 'G unit', value: 'accG' },
10371048
],
10381049
},
1050+
{
1051+
text: 'radiation',
1052+
submenu: [
1053+
{ text: 'Becquerel (Bq)', value: 'radbq' },
1054+
{ text: 'curie (Ci)', value: 'radci' },
1055+
{ text: 'Gray (Gy)', value: 'radgy' },
1056+
{ text: 'rad', value: 'radrad' },
1057+
{ text: 'Sievert (Sv)', value: 'radsv' },
1058+
{ text: 'rem', value: 'radrem' },
1059+
{ text: 'Exposure (C/kg)', value: 'radexpckg' },
1060+
{ text: 'roentgen (R)', value: 'radr' },
1061+
{ text: 'Sievert/hour (Sv/h)', value: 'radsvh' },
1062+
],
1063+
},
10391064
];
10401065
};
10411066

public/app/features/dashboard/specs/unsaved_changes_srv_specs.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ describe('unsavedChangesSrv', function() {
6666
expect(tracker.hasChanges()).to.be(false);
6767
});
6868

69+
it('Should ignore .iteration changes', () => {
70+
dash.iteration = new Date().getTime() + 1;
71+
expect(tracker.hasChanges()).to.be(false);
72+
});
73+
6974
it.skip('Should ignore row collapse change', function() {
7075
dash.rows[0].collapse = true;
7176
expect(tracker.hasChanges()).to.be(false);

public/app/features/dashboard/unsaved_changes_srv.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ export class Tracker {
9797
dash.refresh = 0;
9898
dash.schemaVersion = 0;
9999

100+
// ignore iteration property
101+
delete dash.iteration;
102+
100103
// filter row and panels properties that should be ignored
101104
dash.rows = _.filter(dash.rows, function(row) {
102105
if (row.repeatRowId) {

public/app/plugins/panel/heatmap/rendering.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,13 +649,13 @@ export default function link(scope, elem, attrs, ctrl) {
649649
selection.x2 = limitSelection(event.offsetX);
650650
drawSelection(selection.x1, selection.x2);
651651
} else {
652-
emitGraphHoverEvet(event);
652+
emitGraphHoverEvent(event);
653653
drawCrosshair(event.offsetX);
654654
tooltip.show(event, data);
655655
}
656656
}
657657

658-
function emitGraphHoverEvet(event) {
658+
function emitGraphHoverEvent(event) {
659659
let x = xScale.invert(event.offsetX - yAxisWidth).valueOf();
660660
let y = yScale.invert(event.offsetY);
661661
let pos = {

0 commit comments

Comments
 (0)