diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 8086a6b86e5..00000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,16 +0,0 @@ -Read before posting: - -- Questions should be posted to https://community.grafana.com. Please search there and here on GitHub for similar issues before creating a new issue. -- Checkout FAQ: https://community.grafana.com/c/howto/faq -- Checkout How to troubleshoot metric query issues: https://community.grafana.com/t/how-to-troubleshoot-metric-query-issues/50 - -Please include this information: -### What Grafana version are you using? -### What datasource are you using? -### What OS are you running grafana on? -### What did you do? -### What was the expected result? -### What happened instead? -### If related to metric query / data viz: -### Include raw network request & response: get by opening Chrome Dev Tools (F12, Ctrl+Shift+I on windows, Cmd+Opt+I on Mac), go the network tab. - diff --git a/.github/ISSUE_TEMPLATE/1-bug_report.md b/.github/ISSUE_TEMPLATE/1-bug_report.md new file mode 100644 index 00000000000..eb87a7fc1c9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-bug_report.md @@ -0,0 +1,27 @@ +--- +name: Bug report +about: Report a bug you found when using Grafana +labels: 'type: bug' +--- + + + +**What happened**: + +**What you expected to happen**: + +**How to reproduce it (as minimally and precisely as possible)**: + +**Anything else we need to know?**: + +**Environment**: +- Grafana version: +- Data source type & version: +- OS Grafana is installed on: +- User OS & Browser: +- Grafana plugins: +- Others: diff --git a/.github/ISSUE_TEMPLATE/2-feature_request.md b/.github/ISSUE_TEMPLATE/2-feature_request.md new file mode 100644 index 00000000000..ccb9f3cc391 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2-feature_request.md @@ -0,0 +1,11 @@ +--- +name: Enhancement request +about: Suggest an enhancement or new feature for the Grafana project +labels: 'type: feature request' +--- + + + +**What would you like to be added**: + +**Why is this needed**: diff --git a/.github/ISSUE_TEMPLATE/3-accessibility.md b/.github/ISSUE_TEMPLATE/3-accessibility.md new file mode 100644 index 00000000000..51b3ecc255b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/3-accessibility.md @@ -0,0 +1,26 @@ +--- +name: Accessibility issue +about: Help make Grafana be better at keyboard navigation, screen-readable and accessible to all. +labels: 'type: accessibility' +--- + + + +**Steps to reproduce**: + +**Actual Result**: + +**Expected Result** + +**Relevant WCAG Criteria:** [#.#.# WCAG Criterion](link to https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0) + +**Environment**: +- Grafana version: +- Data source type & version: +- User OS & Browser: +- Others: diff --git a/.github/ISSUE_TEMPLATE/4-question.md b/.github/ISSUE_TEMPLATE/4-question.md new file mode 100644 index 00000000000..3e3a20e49ed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/4-question.md @@ -0,0 +1,14 @@ +--- +name: Support request +about: 'Question or support request relating to using Grafana' +title: '' +labels: '' +assignees: '' +--- + +STOP -- PLEASE READ! + +GitHub is not the right place for questions and support requests. + +Please ask questions on our community site: [https://community.grafana.com/](https://community.grafana.com/) + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 69ce3168730..5ecbc8397df 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,27 @@ -* Follow the contribution guidelines in [`CONTRIBUTING.md`](https://github.com/grafana/grafana/blob/master/CONTRIBUTING.md) -* Rebase your PR if it gets out of sync with master -* Include `closes #` or a link to the issue in the description + + +**What this PR does / why we need it**: + +**Which issue(s) this PR fixes**: + +Fixes # + +**Special notes for your reviewer**: + +**Release note**: + +```release-note + +``` diff --git a/README.md b/README.md index 550e7facfa8..8c84bfd0e87 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,6 @@ Grafana is an open source, feature rich metrics dashboard and graph editor for Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB. -![](https://www.grafanacon.org/2019/images/grafanacon_la_nav-logo.png) - -Join us Feb 25-26 in Los Angeles, California for GrafanaCon - a two-day event with talks focused on Grafana and the surrounding open source monitoring ecosystem. Get deep dives into Loki, the Explore workflow and all of the new features of Grafana 6, plus participate in hands on workshops to help you get the most out of your data. - -Time is running out - grab your ticket now! http://grafanacon.org - diff --git a/docs/sources/installation/upgrading.md b/docs/sources/installation/upgrading.md index e235f25b9e9..511d6117eb3 100644 --- a/docs/sources/installation/upgrading.md +++ b/docs/sources/installation/upgrading.md @@ -120,7 +120,7 @@ If you're using systemd and have a large amount of annotations consider temporar ## Upgrading to v6.0 -If you have text panels with script tags they will no longer work due to a new setting that per default disallow unsanitzied HTML. +If you have text panels with script tags they will no longer work due to a new setting that per default disallow unsanitized HTML. Read more [here](/installation/configuration/#disable-sanitize-html) about this new setting. ### Authentication and security @@ -147,4 +147,4 @@ login_maximum_inactive_lifetime_days = 1 login_maximum_lifetime_days = 1 ``` -The default cookie name for storing the auth token is `grafana_session`. you can configure this with `login_cookie_name` in `[auth]` settings. \ No newline at end of file +The default cookie name for storing the auth token is `grafana_session`. you can configure this with `login_cookie_name` in `[auth]` settings. diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts index da096f261c6..2473c1b8e36 100644 --- a/public/app/core/services/keybindingSrv.ts +++ b/public/app/core/services/keybindingSrv.ts @@ -4,6 +4,7 @@ import _ from 'lodash'; import coreModule from 'app/core/core_module'; import appEvents from 'app/core/app_events'; import { getExploreUrl } from 'app/core/utils/explore'; +import { store } from 'app/store/store'; import Mousetrap from 'mousetrap'; import 'mousetrap-global-bind'; @@ -294,7 +295,9 @@ export class KeybindingSrv { //Autofit panels this.bind('d a', () => { // this has to be a full page reload - window.location.href = window.location.href + '&autofitpanels'; + const queryParams = store.getState().location.query; + const newUrlParam = queryParams.autofitpanels ? '' : '&autofitpanels'; + window.location.href = window.location.href + newUrlParam; }); } } diff --git a/public/app/features/dashboard/components/DashNav/DashNav.tsx b/public/app/features/dashboard/components/DashNav/DashNav.tsx index d2f22d7d010..453c5d1f9ac 100644 --- a/public/app/features/dashboard/components/DashNav/DashNav.tsx +++ b/public/app/features/dashboard/components/DashNav/DashNav.tsx @@ -8,7 +8,6 @@ import { appEvents } from 'app/core/app_events'; import { PlaylistSrv } from 'app/features/playlist/playlist_srv'; // Components -import { ClickOutsideWrapper } from 'app/core/components/ClickOutsideWrapper/ClickOutsideWrapper'; import { DashNavButton } from './DashNavButton'; import { Tooltip } from '@grafana/ui'; @@ -174,28 +173,26 @@ export class DashNav extends PureComponent { {this.renderDashboardTitleSearchButton()} {this.playlistSrv.isPlaying && ( - -
- - - -
-
+
+ + + +
)}
diff --git a/public/app/features/dashboard/dashgrid/DataPanel.tsx b/public/app/features/dashboard/dashgrid/DataPanel.tsx index ae3486e40fe..09864d85960 100644 --- a/public/app/features/dashboard/dashgrid/DataPanel.tsx +++ b/public/app/features/dashboard/dashgrid/DataPanel.tsx @@ -44,6 +44,7 @@ export interface State { isFirstLoad: boolean; loading: LoadingState; response: DataQueryResponse; + panelData: PanelData; } export class DataPanel extends Component { @@ -63,6 +64,7 @@ export class DataPanel extends Component { response: { data: [], }, + panelData: {}, isFirstLoad: true, }; } @@ -147,6 +149,7 @@ export class DataPanel extends Component { this.setState({ loading: LoadingState.Done, response: resp, + panelData: this.getPanelData(resp), isFirstLoad: false, }); } catch (err) { @@ -169,9 +172,7 @@ export class DataPanel extends Component { } }; - getPanelData = () => { - const { response } = this.state; - + getPanelData(response: DataQueryResponse) { if (response.data.length > 0 && (response.data[0] as TableData).type === 'table') { return { tableData: response.data[0] as TableData, @@ -183,12 +184,11 @@ export class DataPanel extends Component { timeSeries: response.data as TimeSeries[], tableData: null, }; - }; + } render() { const { queries } = this.props; - const { loading, isFirstLoad } = this.state; - const panelData = this.getPanelData(); + const { loading, isFirstLoad, panelData } = this.state; // do not render component until we have first data if (isFirstLoad && (loading === LoadingState.Loading || loading === LoadingState.NotStarted)) { diff --git a/public/app/features/datasources/NewDataSourcePage.tsx b/public/app/features/datasources/NewDataSourcePage.tsx index 7b028a4e3ea..b572bacc1a1 100644 --- a/public/app/features/datasources/NewDataSourcePage.tsx +++ b/public/app/features/datasources/NewDataSourcePage.tsx @@ -70,6 +70,7 @@ function mapStateToProps(state: StoreState) { return { navModel: getNavModel(state.navIndex, 'datasources'), dataSourceTypes: getDataSourceTypes(state.dataSources), + dataSourceTypeSearchQuery: state.dataSources.dataSourceTypeSearchQuery, isLoading: state.dataSources.isLoadingDataSources, }; } diff --git a/public/app/plugins/panel/gauge/GaugePanel.tsx b/public/app/plugins/panel/gauge/GaugePanel.tsx index 2a42e31b9ab..b75d4a1c7f3 100644 --- a/public/app/plugins/panel/gauge/GaugePanel.tsx +++ b/public/app/plugins/panel/gauge/GaugePanel.tsx @@ -1,5 +1,5 @@ // Libraries -import React, { PureComponent } from 'react'; +import React, { Component } from 'react'; // Services & Utils import { processTimeSeries, ThemeContext } from '@grafana/ui'; @@ -12,15 +12,27 @@ import { GaugeOptions } from './types'; import { PanelProps, NullValueMode, TimeSeriesValue } from '@grafana/ui/src/types'; interface Props extends PanelProps {} +interface State { + value: TimeSeriesValue; +} -export class GaugePanel extends PureComponent { - render() { - const { panelData, width, height, replaceVariables, options } = this.props; - const { valueOptions } = options; +export class GaugePanel extends Component { + constructor(props: Props) { + super(props); + this.state = { + value: this.findValue(props), + }; + } - const prefix = replaceVariables(valueOptions.prefix); - const suffix = replaceVariables(valueOptions.suffix); - let value: TimeSeriesValue; + componentDidUpdate(prevProps: Props) { + if (this.props.panelData !== prevProps.panelData) { + this.setState({ value: this.findValue(this.props) }); + } + } + + findValue(props: Props): number | null { + const { panelData, options } = props; + const { valueOptions } = options; if (panelData.timeSeries) { const vmSeries = processTimeSeries({ @@ -29,14 +41,21 @@ export class GaugePanel extends PureComponent { }); if (vmSeries[0]) { - value = vmSeries[0].stats[valueOptions.stat]; - } else { - value = null; + return vmSeries[0].stats[valueOptions.stat]; } } else if (panelData.tableData) { - value = panelData.tableData.rows[0].find(prop => prop > 0); + return panelData.tableData.rows[0].find(prop => prop > 0); } + return null; + } + + render() { + const { width, height, replaceVariables, options } = this.props; + const { valueOptions } = options; + const { value } = this.state; + const prefix = replaceVariables(valueOptions.prefix); + const suffix = replaceVariables(valueOptions.suffix); return ( {theme => ( diff --git a/public/views/index-template.html b/public/views/index-template.html index 895b0e4ae19..ad28821230f 100644 --- a/public/views/index-template.html +++ b/public/views/index-template.html @@ -179,8 +179,7 @@

1. This could be caused by your reverse proxy settings.

2. If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath

- 3. If you have a local dev build make sure you build frontend using: npm run dev, npm run watch, or npm run - build

+ 3. If you have a local dev build make sure you build frontend using: yarn start, yarn start:hot, or yarn build

4. Sometimes restarting grafana-server can help

diff --git a/scripts/cli/index.ts b/scripts/cli/index.ts index ced56e1eacd..301592315bc 100644 --- a/scripts/cli/index.ts +++ b/scripts/cli/index.ts @@ -16,7 +16,7 @@ program .description('Starts Grafana front-end in development mode with watch enabled') .action(async cmd => { await execTask(startTask)({ - watchThemes: cmd.theme, + watchThemes: cmd.watchTheme, hot: cmd.hot, }); });