From bde5499552ca7a273f1fc39905192a85579f99ac Mon Sep 17 00:00:00 2001 From: Tyler Tolley Date: Fri, 2 Feb 2018 07:29:54 -0700 Subject: [PATCH 01/41] #10724 Fix finding the x bucket --- public/app/plugins/panel/heatmap/heatmap_tooltip.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/heatmap/heatmap_tooltip.ts b/public/app/plugins/panel/heatmap/heatmap_tooltip.ts index 17621dfe398..a1f8691f84f 100644 --- a/public/app/plugins/panel/heatmap/heatmap_tooltip.ts +++ b/public/app/plugins/panel/heatmap/heatmap_tooltip.ts @@ -153,7 +153,15 @@ export class HeatmapTooltip { getXBucketIndex(offsetX, data) { let x = this.scope.xScale.invert(offsetX - this.scope.yAxisWidth).valueOf(); - let xBucketIndex = getValueBucketBound(x, data.xBucketSize, 1); + let xBucket = _.find(data.buckets, (bucket, bucketIndex) => { + return x-bucket.x <= data.xBucketSize && x-bucket.x >0; + }); + let xBucketIndex; + if(!xBucket) + xBucketIndex = getValueBucketBound(x, data.xBucketSize, 1); + else + xBucketIndex = xBucket.x; + return xBucketIndex; } From ca3c1d8c631c1d04f2db7d4a50c9faccc34a2dc2 Mon Sep 17 00:00:00 2001 From: Tyler Tolley Date: Fri, 2 Feb 2018 09:31:05 -0700 Subject: [PATCH 02/41] #10724 Fix whitespace --- public/app/plugins/panel/heatmap/heatmap_tooltip.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/panel/heatmap/heatmap_tooltip.ts b/public/app/plugins/panel/heatmap/heatmap_tooltip.ts index a1f8691f84f..81bac685d3a 100644 --- a/public/app/plugins/panel/heatmap/heatmap_tooltip.ts +++ b/public/app/plugins/panel/heatmap/heatmap_tooltip.ts @@ -157,11 +157,11 @@ export class HeatmapTooltip { return x-bucket.x <= data.xBucketSize && x-bucket.x >0; }); let xBucketIndex; - if(!xBucket) + if (!xBucket) { xBucketIndex = getValueBucketBound(x, data.xBucketSize, 1); - else + } else { xBucketIndex = xBucket.x; - + } return xBucketIndex; } From e800b19ef6c07eeb85b261b0b9797790e41e873d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 5 Feb 2018 17:56:48 +0100 Subject: [PATCH 03/41] docs: fix download link --- docs/sources/guides/whats-new-in-v5.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sources/guides/whats-new-in-v5.md b/docs/sources/guides/whats-new-in-v5.md index 0dd9337e404..9712976e0dc 100644 --- a/docs/sources/guides/whats-new-in-v5.md +++ b/docs/sources/guides/whats-new-in-v5.md @@ -12,7 +12,7 @@ weight = -6 # What's New in Grafana v5.0 -> Out in beta: [Download now!](https://www.youtube.com/watch?v=Izr0IBgoTZQ) +> Out in beta: [Download now!](https://grafana.com/grafana/download/5.0.0-beta1) This is the most substantial update that Grafana has ever seen. This article will detail the major new features and enhancements. @@ -27,7 +27,7 @@ This is the most substantial update that Grafana has ever seen. This article wil ### Video showing new features - +
## New Dashboard Layout Engine From e1d857887fe1064385a29b7008f7b9bcd6589e7c Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Mon, 5 Feb 2018 17:58:43 +0100 Subject: [PATCH 04/41] docs: update dashboard model, persistent urls and api changes in what's new in v5 --- docs/sources/guides/whats-new-in-v5.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/sources/guides/whats-new-in-v5.md b/docs/sources/guides/whats-new-in-v5.md index 0dd9337e404..90651872964 100644 --- a/docs/sources/guides/whats-new-in-v5.md +++ b/docs/sources/guides/whats-new-in-v5.md @@ -24,6 +24,7 @@ This is the most substantial update that Grafana has ever seen. This article wil - [Group users into teams]({{< relref "#teams" >}}) and use them in the new permission system. - [Datasource provisioning]({{< relref "#data-sources" >}}) makes it possible to setup datasources via config files. - [Dashboard provisioning]({{< relref "#dashboards" >}}) makes it possible to setup dashboards via config files. +- [Persistent dashboard url's]({{< relref "#dashboard-model-persistent-url-s-and-api-changes" >}}) makes it possible to rename dashboards without breaking links. ### Video showing new features @@ -51,7 +52,7 @@ Almost every page has seen significant UX improvements. All pages (except dashbo
-### Dashboard Settings +## Dashboard Settings {{< docs-imagebox img="/img/docs/v50/dashboard_settings.png" max-width="1000px" class="docs-image--right" >}} Dashboard pages have a new header toolbar where buttons and actions are now all moved to the right. All the dashboard @@ -95,7 +96,7 @@ data sources a user can access nor what queries a user can issue.
-# Provisioning from configuration +## Provisioning from configuration In previous versions of Grafana, you could only use the API for provisioning data sources and dashboards. But that required the service to be running before you started creating dashboards and you also needed to @@ -117,17 +118,22 @@ in sync with dashboards in Grafana's database. The dashboard provisioner has mul which makes it possible to star them, use one as the home dashboard, set permissions and other features in Grafana that expects the dashboards to exist in the database. More info in the [dashboard provisioning docs](/administration/provisioning/#dashboards) -# Dashboard model, new url structure & API changes +## Dashboard model, persistent url's and API changes We are introducing a new unique identifier (`uid`) in the dashboard JSON model. It's automatically generated if not provided when creating a dashboard and will have a length of 9-12 characters. -The unique identifier allows having consistent URL's for accessing dashboards and sharing them -between instances. The new routes and API's for accessing dashboards will use the `uid` instead -of the `slug`. We'll keep supporting the old routes for accessing dashboards for backward -compatibility, but please note that we'll deprecate the old slug-based routes in the future. -This means that changing the title of dashboards will not break any bookmarked links. +The unique identifier allows having persistent URL's for accessing dashboards, sharing them +between instances and when using [dashboard provisioning](#dashboards). This means that dashboard can +be renamed without breaking any links. We're changing the url format for dashboards +from `/dashboard/db/:slug` to `/d/:uid/:slug`. We'll keep supporting the old slug-based url's for dashboards +and redirects to the new one for backward compatibility. Please note that the old slug-based url's +have been deprecated and will be removed in a future release. Sharing dashboards between instances becomes much easier since the `uid` is unique (unique enough). This might seem like a small change, but we are incredibly excited about it since it will make it much easier to manage, collaborate and navigate between dashboards. + +### API changes +New uid-based routes in the dashboard API have been introduced to retrieve and delete dashboards. +The corresponding slug-based routes have been deprecated and will be removed in a future release. From 4ce862c5b49a6d5d8e6fd69c10378d16b855e1ee Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Mon, 5 Feb 2018 18:11:43 +0100 Subject: [PATCH 05/41] scroll: use wheelpropagation. Ref #10772 Once the vertical scrollbar comes to its end position, it should allow the page scroll bar to start scrolling. --- public/app/core/components/ScrollBar/ScrollBar.tsx | 5 +++-- public/app/core/components/scroll/scroll.ts | 4 +++- public/app/features/panel/panel_directive.ts | 4 +++- public/app/plugins/panel/graph/legend.ts | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/app/core/components/ScrollBar/ScrollBar.tsx b/public/app/core/components/ScrollBar/ScrollBar.tsx index 49a200b0f3b..7d9e015df94 100644 --- a/public/app/core/components/ScrollBar/ScrollBar.tsx +++ b/public/app/core/components/ScrollBar/ScrollBar.tsx @@ -7,7 +7,6 @@ export interface Props { } export default class ScrollBar extends React.Component { - private container: any; private ps: PerfectScrollbar; @@ -16,7 +15,9 @@ export default class ScrollBar extends React.Component { } componentDidMount() { - this.ps = new PerfectScrollbar(this.container); + this.ps = new PerfectScrollbar(this.container, { + wheelPropagation: true, + }); } componentDidUpdate() { diff --git a/public/app/core/components/scroll/scroll.ts b/public/app/core/components/scroll/scroll.ts index 99245ed3331..720334d8973 100644 --- a/public/app/core/components/scroll/scroll.ts +++ b/public/app/core/components/scroll/scroll.ts @@ -6,7 +6,9 @@ export function geminiScrollbar() { return { restrict: 'A', link: function(scope, elem, attrs) { - let scrollbar = new PerfectScrollbar(elem[0]); + let scrollbar = new PerfectScrollbar(elem[0], { + wheelPropagation: true, + }); let lastPos = 0; appEvents.on( diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index 01730e2fede..dec7868a553 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/public/app/features/panel/panel_directive.ts @@ -100,7 +100,9 @@ module.directive('grafanaPanel', function($rootScope, $document, $timeout) { // update scrollbar after mounting ctrl.events.on('component-did-mount', () => { if (ctrl.__proto__.constructor.scrollable) { - panelScrollbar = new PerfectScrollbar(panelContent[0]); + panelScrollbar = new PerfectScrollbar(panelContent[0], { + wheelPropagation: true, + }); } }); diff --git a/public/app/plugins/panel/graph/legend.ts b/public/app/plugins/panel/graph/legend.ts index 5db0a122b31..cd43ac58469 100644 --- a/public/app/plugins/panel/graph/legend.ts +++ b/public/app/plugins/panel/graph/legend.ts @@ -246,6 +246,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) { // Number of pixels the content height can surpass the container height without enabling the scroll bar. scrollYMarginOffset: 2, suppressScrollX: true, + wheelPropagation: true, }; if (!legendScrollbar) { From 24d882e7d89e0c5259e6f6d39cc2519c0aa6e9d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 5 Feb 2018 18:12:45 +0100 Subject: [PATCH 06/41] docs: fix --- docs/sources/guides/whats-new-in-v5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/guides/whats-new-in-v5.md b/docs/sources/guides/whats-new-in-v5.md index 7b52bf6fe89..14419f7a4be 100644 --- a/docs/sources/guides/whats-new-in-v5.md +++ b/docs/sources/guides/whats-new-in-v5.md @@ -28,7 +28,7 @@ This is the most substantial update that Grafana has ever seen. This article wil ### Video showing new features - +
## New Dashboard Layout Engine From f97be541af45f7112619957bcf1f195b4c424a46 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Mon, 5 Feb 2018 20:17:47 +0300 Subject: [PATCH 07/41] redirect "permission denied" requests to "/" (#10773) --- pkg/middleware/auth.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/middleware/auth.go b/pkg/middleware/auth.go index be3415d990b..826287e12f3 100644 --- a/pkg/middleware/auth.go +++ b/pkg/middleware/auth.go @@ -42,8 +42,7 @@ func accessForbidden(c *Context) { return } - c.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+c.Req.RequestURI), 0, setting.AppSubUrl+"/") - c.Redirect(setting.AppSubUrl + "/login") + c.Redirect(setting.AppSubUrl + "/") } func notAuthorized(c *Context) { From 690beac277ab37bc4edab9e6475bd8cacae95f68 Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Mon, 5 Feb 2018 18:42:47 +0100 Subject: [PATCH 08/41] Update changelog with deprecation notes of http api --- CHANGELOG.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 901a2145e0f..6508c4ff76a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # 5.0.0-beta1 (2018-02-05) -Grafana v5.0 is going to be the biggest and most foundational release Grafana has ever had, coming with a ton of UX improvements, a new dashboard grid engine, dashboard folders, user teams and permissions. Checkout out this [video preview](https://www.youtube.com/watch?v=BC_YRNpqj5k) of Grafana v5. +Grafana v5.0 is going to be the biggest and most foundational release Grafana has ever had, coming with a ton of UX improvements, a new dashboard grid engine, dashboard folders, user teams and permissions. Checkout out this [video preview](https://www.youtube.com/watch?v=Izr0IBgoTZQ) of Grafana v5. ### New Major Features - **Dashboards** Dashboard folders, [#1611](https://github.com/grafana/grafana/issues/1611) @@ -69,6 +69,17 @@ Dashboard panels and rows are positioned using a gridPos object `{x: 0, y: 0, w: ## Tech * **RabbitMq**: Remove support for publishing events to RabbitMQ [#9645](https://github.com/grafana/grafana/issues/9645) +## Deprecation notes + +### HTTP API +The following operations have been deprecated and will be removed in a future release: + - `GET /api/dashboards/db/:slug` -> Use `GET /api/dashboards/uid/:uid` instead + - `DELETE /api/dashboards/db/:slug` -> Use `DELETE /api/dashboards/uid/:uid` instead + +The following properties have been deprecated and will be removed in a future release: + - `uri` property in `GET /api/search` -> Use new `url` or `uid` property instead + - `meta.slug` property in `GET /api/dashboards/uid/:uid` and `GET /api/dashboards/db/:slug` -> Use new `meta.url` or `dashboard.uid` property instead + # 4.6.3 (2017-12-14) ## Fixes From 1a8501450cfd400a3423baffe83c601a280352a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 5 Feb 2018 18:46:03 +0100 Subject: [PATCH 09/41] docs: video fix --- docs/sources/guides/whats-new-in-v5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/guides/whats-new-in-v5.md b/docs/sources/guides/whats-new-in-v5.md index 14419f7a4be..bf056442e6b 100644 --- a/docs/sources/guides/whats-new-in-v5.md +++ b/docs/sources/guides/whats-new-in-v5.md @@ -28,7 +28,7 @@ This is the most substantial update that Grafana has ever seen. This article wil ### Video showing new features - +
## New Dashboard Layout Engine From 5d756707ab665b5aabb17bfd9d5af996507d770d Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Mon, 5 Feb 2018 19:18:20 +0100 Subject: [PATCH 10/41] dashlist: scroll fix when no header The first item in the dashlist has a margin that messes up the height calculation for the scroll bar when the Show headings option is not selected. This fix adds a margin-top set to 0 for the 1st item in the list in this case. This prevents a scrollbar being shown incorrectly. Fixes #10772 --- public/app/plugins/panel/dashlist/module.html | 2 +- public/sass/components/_panel_dashlist.scss | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/dashlist/module.html b/public/app/plugins/panel/dashlist/module.html index 8fa3e7ef71f..586e7f7d097 100644 --- a/public/app/plugins/panel/dashlist/module.html +++ b/public/app/plugins/panel/dashlist/module.html @@ -4,7 +4,7 @@ {{group.header}}
- + {{dash.title}} diff --git a/public/sass/components/_panel_dashlist.scss b/public/sass/components/_panel_dashlist.scss index 09ad4208099..5d100c7421c 100644 --- a/public/sass/components/_panel_dashlist.scss +++ b/public/sass/components/_panel_dashlist.scss @@ -21,4 +21,8 @@ .fa-star { color: $orange; } + + &--no-margintop { + margin-top: 0; + } } From 8c027ea7075fca07c53a8d8ab93f710447f43635 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Mon, 5 Feb 2018 19:31:16 +0100 Subject: [PATCH 11/41] scroll: css for #10722 Missed adding to previous commit. Ref #10722 --- public/sass/components/_panel_dashlist.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/sass/components/_panel_dashlist.scss b/public/sass/components/_panel_dashlist.scss index 5d100c7421c..2ac95a97ee0 100644 --- a/public/sass/components/_panel_dashlist.scss +++ b/public/sass/components/_panel_dashlist.scss @@ -22,7 +22,7 @@ color: $orange; } - &--no-margintop { + &--no-section-header { margin-top: 0; } } From 45d66e4b29ce325ee873dac53dc9834fa20772f1 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Tue, 6 Feb 2018 12:01:10 +0300 Subject: [PATCH 12/41] embedded panel: hide side menu during init (#10788) --- public/app/features/panel/solo_panel_ctrl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/features/panel/solo_panel_ctrl.ts b/public/app/features/panel/solo_panel_ctrl.ts index 323a88ddaee..2c7698db08e 100644 --- a/public/app/features/panel/solo_panel_ctrl.ts +++ b/public/app/features/panel/solo_panel_ctrl.ts @@ -9,7 +9,7 @@ export class SoloPanelCtrl { $scope.init = function() { contextSrv.sidemenu = false; - appEvents.emit('toggle-sidemenu'); + appEvents.emit('toggle-sidemenu-hidden'); var params = $location.search(); panelId = parseInt(params.panelId); From 5ca03972a89763dba10ec741cb0b0ace9e412200 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Tue, 6 Feb 2018 10:02:28 +0100 Subject: [PATCH 13/41] org-switcher: should redirect to home page (#10782) Fixes #10776 --- public/app/core/components/org_switcher.ts | 10 +++------- public/app/core/specs/org_switcher.jest.ts | 13 +++++++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/public/app/core/components/org_switcher.ts b/public/app/core/components/org_switcher.ts index d6efeb51779..1816e11af49 100644 --- a/public/app/core/components/org_switcher.ts +++ b/public/app/core/components/org_switcher.ts @@ -1,5 +1,6 @@ import coreModule from 'app/core/core_module'; import { contextSrv } from 'app/core/services/context_srv'; +import config from 'app/core/config'; const template = `