Skip to content

Commit

Permalink
Merge remote-tracking branch 'grafana/master' into useQueryRunner-in-…
Browse files Browse the repository at this point in the history
…MetricPanelCtrl

* grafana/master: (24 commits)
  CSV: escape quotes in toCSV  (grafana#16874)
  Dashboard: Lazy load out of view panels (grafana#15554)
  LDAP: Added reload endpoint for LDAP config (grafana#15470)
  PluginsList: Removed icons and updated snapshots (grafana#16872)
  Panels: Fixed issue with panel type change and data updates (grafana#16871)
  Chore: fix modes for non-executable files (grafana#16864)
  DataSourceSettings: Minor fix for uncontrolled input (grafana#16863)
  Chore: Lowered implicit anys limit to 5623
  TestData: Add dashboards to testdata (grafana#16855)
  Input Datasource: convert from angular config to react ConfigEditor (grafana#16856)
  DataSources: minor typescript cleanups and comments (grafana#16860)
  TestDataDatasource: Add config editor (grafana#16861)
  App Plugins: support react pages and tabs (grafana#16586)
  Add Windows MSI generation to build process (grafana#16502)
  Datasources: add support for POST HTTP verb for InfluxDB (grafana#16690)
  Add pattern validation in configs (grafana#16837)
  Search: Enable filtering dashboards in search by current folder (grafana#16790)
  FormLabel: allow any rather than just a string for tooltip (grafana#16841)
  prometheus: fix regression after adding support for tracing headers (grafana#16829)
  area/circleci: Speed up circleci build process for branches and pr (grafana#16778)
  ...
  • Loading branch information
ryantxu committed May 3, 2019
2 parents f71de25 + 2af69cc commit 85c3901
Show file tree
Hide file tree
Showing 141 changed files with 4,022 additions and 1,010 deletions.
163 changes: 159 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,117 @@ jobs:
paths:
- dist/*

build-fast-backend:
docker:
- image: grafana/build-container:1.2.6
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- run:
name: prepare build tools
command: '/tmp/bootstrap.sh'
- run:
name: build grafana backend
command: './scripts/build/build.sh --fast --backend-only'
- persist_to_workspace:
root: .
paths:
- bin/*

build-fast-frontend:
docker:
- image: grafana/build-container:1.2.6
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- run:
name: prepare build tools
command: '/tmp/bootstrap.sh'
- restore_cache:
key: frontend-dependency-cache-{{ checksum "yarn.lock" }}
- run:
name: build grafana frontend
command: './scripts/build/build.sh --fast --frontend-only'
- save_cache:
key: frontend-dependency-cache-{{ checksum "yarn.lock" }}
paths:
- node_modules
- persist_to_workspace:
root: .
paths:
- public/build/*
- tools/phantomjs/*

build-fast-package:
docker:
- image: grafana/build-container:1.2.6
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
key: frontend-dependency-cache-{{ checksum "yarn.lock" }}
- run:
name: prepare build tools
command: '/tmp/bootstrap.sh'
- run:
name: package grafana
command: './scripts/build/build.sh --fast --package-only'
- run:
name: sha-sum packages
command: 'go run build.go sha-dist'
- run:
name: Test Grafana.com release publisher
command: 'cd scripts/build/release_publisher && go test .'
- persist_to_workspace:
root: /go/src/github.com/grafana/grafana
paths:
- dist/*

build-fast-save:
docker:
- image: grafana/build-container:1.2.6
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
- run:
name: debug cache
command: 'ls -al /go/src/github.com/grafana/grafana/node_modules'
- run:
name: prepare build tools
command: '/tmp/bootstrap.sh'
- run:
name: build grafana backend
command: './scripts/build/build.sh --fast --backend-only'
- run:
name: build grafana frontend
command: './scripts/build/build.sh --fast --frontend-only'
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
paths:
- /go/src/github.com/grafana/grafana/node_modules
- run:
name: package grafana
command: './scripts/build/build.sh --fast --package-only'
- run:
name: sign packages
command: './scripts/build/sign_packages.sh'
- run:
name: sha-sum packages
command: 'go run build.go sha-dist'
- run:
name: Test Grafana.com release publisher
command: 'cd scripts/build/release_publisher && go test .'
- persist_to_workspace:
root: .
paths:
- dist/*

grafana-docker-master:
machine:
image: circleci/classic:201808-01
Expand All @@ -224,7 +335,7 @@ jobs:
- run: docker info
- run: docker run --privileged linuxkit/binfmt:v0.6
- run: cp dist/grafana-latest.linux-*.tar.gz packaging/docker
- run: cd packaging/docker && ./build.sh "${CIRCLE_SHA1}"
- run: cd packaging/docker && ./build.sh --fast "${CIRCLE_SHA1}"

grafana-docker-release:
machine:
Expand Down Expand Up @@ -441,6 +552,21 @@ jobs:
name: Update RPM repository
command: './scripts/build/update_repo/update-rpm.sh "oss" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG" "dist"'

build-oss-msi:
docker:
- image: grafana/wix-toolset-ci:v3
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Build OSS MSI
command: './scripts/build/ci-msi-build/ci-msi-build-oss.sh'
- persist_to_workspace:
root: .
paths:
- dist/grafana-*.msi

store-build-artifacts:
docker:
- image: circleci/node:8
Expand Down Expand Up @@ -479,6 +605,7 @@ workflows:
- backend-lint
- mysql-integration-test
- postgres-integration-test
- build-oss-msi
filters: *filter-only-master
- grafana-docker-master:
requires:
Expand All @@ -502,6 +629,16 @@ workflows:
- postgres-integration-test
- build-all-enterprise
filters: *filter-only-master
- build-oss-msi:
requires:
- build-all
- test-backend
- test-frontend
- codespell
- backend-lint
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-master

release:
jobs:
Expand Down Expand Up @@ -530,6 +667,7 @@ workflows:
- backend-lint
- mysql-integration-test
- postgres-integration-test
- build-oss-msi
filters: *filter-only-release
- deploy-enterprise-release:
requires:
Expand All @@ -553,11 +691,28 @@ workflows:
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-release
- build-oss-msi:
requires:
- build-all
- test-backend
- test-frontend
- codespell
- backend-lint
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-master

build-branches-and-prs:
jobs:
- build:
- build-fast-backend:
filters: *filter-not-release-or-master
- build-fast-frontend:
filters: *filter-not-release-or-master
- build-fast-package:
filters: *filter-not-release-or-master
requires:
- build-fast-backend
- build-fast-frontend
- codespell:
filters: *filter-not-release-or-master
- backend-lint:
Expand All @@ -574,7 +729,7 @@ workflows:
filters: *filter-not-release-or-master
- grafana-docker-pr:
requires:
- build
- build-fast-package
- test-backend
- test-frontend
- codespell
Expand All @@ -585,7 +740,7 @@ workflows:
filters: *filter-not-release-or-master
- store-build-artifacts:
requires:
- build
- build-fast-package
- test-backend
- test-frontend
- codespell
Expand Down
3 changes: 3 additions & 0 deletions docs/sources/features/datasources/influxdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Name | Description
*Database* | Name of your influxdb database
*User* | Name of your database user
*Password* | Database user's password
*HTTP mode* | How to query the database (`GET` or `POST` HTTP verb). The `POST` verb allows heavy queries that would return an error using the `GET` verb. Default is `GET`.

Access mode controls how requests to the data source will be handled. Server should be the preferred way if nothing else stated.

Expand Down Expand Up @@ -212,4 +213,6 @@ datasources:
user: grafana
password: grafana
url: http://localhost:8086
jsonData:
httpMode: GET
```
2 changes: 1 addition & 1 deletion docs/sources/http_api/folder_dashboard_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Query parameters:
- **folderIds** – List of folder id's to search in for dashboards
- **starred** – Flag indicating if only starred Dashboards should be returned
- **limit** – Limit the number of returned results (max 5000)
- **page** – Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size.
- **page** – Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size. Only available in Grafana v6.2+.

**Example request for retrieving folders and dashboards of the general folder**:

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
"reselect": "4.0.0",
"rst2html": "github:thoward/rst2html#990cb89",
"rxjs": "6.4.0",
"search-query-parser": "1.5.2",
"slate": "0.33.8",
"slate-plain-serializer": "0.5.41",
"slate-prism": "0.5.0",
Expand Down
15 changes: 13 additions & 2 deletions packages/grafana-ui/src/components/FormField/FormField.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { InputHTMLAttributes, FunctionComponent } from 'react';
import { FormLabel } from '../FormLabel/FormLabel';
import { PopperContent } from '../Tooltip/PopperController';

export interface Props extends InputHTMLAttributes<HTMLInputElement> {
label: string;
tooltip?: PopperContent<any>;
labelWidth?: number;
inputWidth?: number;
inputEl?: React.ReactNode;
Expand All @@ -17,10 +19,19 @@ const defaultProps = {
* Default form field including label used in Grafana UI. Default input element is simple <input />. You can also pass
* custom inputEl if required in which case inputWidth and inputProps are ignored.
*/
export const FormField: FunctionComponent<Props> = ({ label, labelWidth, inputWidth, inputEl, ...inputProps }) => {
export const FormField: FunctionComponent<Props> = ({
label,
tooltip,
labelWidth,
inputWidth,
inputEl,
...inputProps
}) => {
return (
<div className="form-field">
<FormLabel width={labelWidth}>{label}</FormLabel>
<FormLabel width={labelWidth} tooltip={tooltip}>
{label}
</FormLabel>
{inputEl || <input type="text" className={`gf-form-input width-${inputWidth}`} {...inputProps} />}
</div>
);
Expand Down
3 changes: 2 additions & 1 deletion packages/grafana-ui/src/components/FormLabel/FormLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React, { FunctionComponent, ReactNode } from 'react';
import classNames from 'classnames';
import { Tooltip } from '../Tooltip/Tooltip';
import { PopperContent } from '../Tooltip/PopperController';

interface Props {
children: ReactNode;
className?: string;
htmlFor?: string;
isFocused?: boolean;
isInvalid?: boolean;
tooltip?: string;
tooltip?: PopperContent<any>;
width?: number;
}

Expand Down
62 changes: 62 additions & 0 deletions packages/grafana-ui/src/types/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { ComponentClass } from 'react';
import { NavModel } from './navModel';
import { PluginMeta, PluginIncludeType, GrafanaPlugin } from './plugin';

export interface AppRootProps {
meta: AppPluginMeta;

path: string; // The URL path to this page
query: { [s: string]: any }; // The URL query parameters

/**
* Pass the nav model to the container... is there a better way?
*/
onNavChanged: (nav: NavModel) => void;
}

export interface AppPluginMeta extends PluginMeta {
// TODO anything specific to apps?
}

export class AppPlugin extends GrafanaPlugin<AppPluginMeta> {
// Content under: /a/${plugin-id}/*
root?: ComponentClass<AppRootProps>;
rootNav?: NavModel; // Initial navigation model

// Old style pages
angularPages?: { [component: string]: any };

/**
* Set the component displayed under:
* /a/${plugin-id}/*
*/
setRootPage(root: ComponentClass<AppRootProps>, rootNav?: NavModel) {
this.root = root;
this.rootNav = rootNav;
return this;
}

setComponentsFromLegacyExports(pluginExports: any) {
if (pluginExports.ConfigCtrl) {
this.angularConfigCtrl = pluginExports.ConfigCtrl;
}

const { meta } = this;
if (meta && meta.includes) {
for (const include of meta.includes) {
const { type, component } = include;
if (type === PluginIncludeType.page && component) {
const exp = pluginExports[component];
if (!exp) {
console.warn('App Page uses unknown component: ', component, meta);
continue;
}
if (!this.angularPages) {
this.angularPages = {};
}
this.angularPages[component] = exp;
}
}
}
}
}
Loading

0 comments on commit 85c3901

Please sign in to comment.