diff --git a/conf/defaults.ini b/conf/defaults.ini index 679a6a88eb7..c535adc1330 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -249,7 +249,7 @@ signout_redirect_url = #################################### Anonymous Auth ###################### [auth.anonymous] # enable anonymous access -enabled = false +enabled = true # specify organization name that should be used for unauthenticated users org_name = Main Org. diff --git a/public/app/core/components/Picker/__snapshots__/PickerOption.test.tsx.snap b/public/app/core/components/Picker/__snapshots__/PickerOption.test.tsx.snap index 748fcbee4aa..b376ab24934 100644 --- a/public/app/core/components/Picker/__snapshots__/PickerOption.test.tsx.snap +++ b/public/app/core/components/Picker/__snapshots__/PickerOption.test.tsx.snap @@ -14,3 +14,4 @@ exports[`PickerOption renders correctly 1`] = ` `; + \ No newline at end of file diff --git a/public/app/features/plugins/TemplateQueryComponentLoader.tsx b/public/app/features/plugins/VariableQueryComponentLoader.tsx similarity index 67% rename from public/app/features/plugins/TemplateQueryComponentLoader.tsx rename to public/app/features/plugins/VariableQueryComponentLoader.tsx index bc2ff323ae6..c7bb826d302 100644 --- a/public/app/features/plugins/TemplateQueryComponentLoader.tsx +++ b/public/app/features/plugins/VariableQueryComponentLoader.tsx @@ -2,19 +2,19 @@ import coreModule from 'app/core/core_module'; import { importPluginModule } from './plugin_loader'; import React from 'react'; import ReactDOM from 'react-dom'; -import DefaultTemplateQueryComponent from '../templating/DefaultTemplateQueryComponent'; +import DefaultVariableQueryEditor from '../templating/DefaultVariableQueryEditor'; async function loadComponent(module) { const component = await importPluginModule(module); - if (component && component.TemplateQueryComponent) { - return component.TemplateQueryComponent; + if (component && component.VariableQueryEditor) { + return component.VariableQueryEditor; } else { - return DefaultTemplateQueryComponent; + return DefaultVariableQueryEditor; } } /** @ngInject */ -function templateQueryComponentLoader() { +function variableQueryEditorLoader() { return { restrict: 'E', link: async (scope, elem) => { @@ -32,4 +32,4 @@ function templateQueryComponentLoader() { }; } -coreModule.directive('templateQueryComponentLoader', templateQueryComponentLoader); +coreModule.directive('variableQueryEditorLoader', variableQueryEditorLoader); diff --git a/public/app/features/plugins/all.ts b/public/app/features/plugins/all.ts index 8f902ea5bdf..757a9a2f491 100644 --- a/public/app/features/plugins/all.ts +++ b/public/app/features/plugins/all.ts @@ -4,4 +4,4 @@ import './import_list/import_list'; import './ds_edit_ctrl'; import './datasource_srv'; import './plugin_component'; -import './TemplateQueryComponentLoader'; +import './VariableQueryComponentLoader'; diff --git a/public/app/features/templating/DefaultTemplateQueryComponent.tsx b/public/app/features/templating/DefaultVariableQueryEditor.tsx similarity index 83% rename from public/app/features/templating/DefaultTemplateQueryComponent.tsx rename to public/app/features/templating/DefaultVariableQueryEditor.tsx index 26c5db54d7c..ce9fd79f793 100644 --- a/public/app/features/templating/DefaultTemplateQueryComponent.tsx +++ b/public/app/features/templating/DefaultVariableQueryEditor.tsx @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react'; -import { TemplateQueryProps } from 'app/types/plugins'; +import { VariableQueryProps } from 'app/types/plugins'; -export default class DefaultTemplateQueryComponent extends PureComponent { +export default class DefaultVariableQueryEditor extends PureComponent { constructor(props) { super(props); this.state = { value: props.query }; diff --git a/public/app/features/templating/partials/editor.html b/public/app/features/templating/partials/editor.html index 58a12ba872e..15984eba7d6 100644 --- a/public/app/features/templating/partials/editor.html +++ b/public/app/features/templating/partials/editor.html @@ -200,8 +200,8 @@ - - + +
diff --git a/public/app/plugins/datasource/stackdriver/components/TemplateQueryComponent.test.tsx b/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.test.tsx similarity index 68% rename from public/app/plugins/datasource/stackdriver/components/TemplateQueryComponent.test.tsx rename to public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.test.tsx index e81037e2822..d3b1aa54656 100644 --- a/public/app/plugins/datasource/stackdriver/components/TemplateQueryComponent.test.tsx +++ b/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.test.tsx @@ -1,14 +1,14 @@ import React from 'react'; import renderer from 'react-test-renderer'; -import { StackdriverTemplateQueryComponent } from './TemplateQueryComponent'; -import { TemplateQueryProps } from 'app/types/plugins'; +import { StackdriverVariableQueryEditor } from './VariableQueryEditor'; +import { VariableQueryProps } from 'app/types/plugins'; import { MetricFindQueryTypes } from '../types'; jest.mock('../functions', () => ({ getMetricTypes: () => ({ metricTypes: [], selectedMetricType: '' }), })); -const props: TemplateQueryProps = { +const props: VariableQueryProps = { onChange: (query, definition) => {}, query: {}, datasource: { @@ -16,9 +16,9 @@ const props: TemplateQueryProps = { }, }; -describe('StackdriverTemplateQueryComponent', () => { +describe('VariableQueryEditor', () => { it('renders correctly', () => { - const tree = renderer.create().toJSON(); + const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); @@ -28,7 +28,7 @@ describe('StackdriverTemplateQueryComponent', () => { expect(definition).toBe('Stackdriver - Metric Types'); done(); }; - renderer.create().toJSON(); + renderer.create().toJSON(); }); }); @@ -39,7 +39,7 @@ describe('StackdriverTemplateQueryComponent', () => { expect(definition).toBe('Stackdriver - Metric Labels'); done(); }; - renderer.create().toJSON(); + renderer.create().toJSON(); }); }); }); diff --git a/public/app/plugins/datasource/stackdriver/components/TemplateQueryComponent.tsx b/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx similarity index 94% rename from public/app/plugins/datasource/stackdriver/components/TemplateQueryComponent.tsx rename to public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx index be6303b99fa..c2fba266408 100644 --- a/public/app/plugins/datasource/stackdriver/components/TemplateQueryComponent.tsx +++ b/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx @@ -1,11 +1,11 @@ import React, { PureComponent } from 'react'; import uniqBy from 'lodash/uniqBy'; -import { TemplateQueryProps } from 'app/types/plugins'; +import { VariableQueryProps } from 'app/types/plugins'; import SimpleSelect from './SimpleSelect'; import { getMetricTypes } from '../functions'; -import { MetricFindQueryTypes, TemplateQueryComponentData } from '../types'; +import { MetricFindQueryTypes, VariableQueryData } from '../types'; -export class StackdriverTemplateQueryComponent extends PureComponent { +export class StackdriverVariableQueryEditor extends PureComponent { queryTypes: Array<{ value: string; name: string }> = [ { value: MetricFindQueryTypes.MetricTypes, name: 'Metric Types' }, { value: MetricFindQueryTypes.MetricLabels, name: 'Metric Labels' }, @@ -16,7 +16,7 @@ export class StackdriverTemplateQueryComponent extends PureComponent l === this.state.labelKey) ? this.state.labelKey : labels[0]; diff --git a/public/app/plugins/datasource/stackdriver/components/__snapshots__/TemplateQueryComponent.test.tsx.snap b/public/app/plugins/datasource/stackdriver/components/__snapshots__/VariableQueryEditor.test.tsx.snap similarity index 95% rename from public/app/plugins/datasource/stackdriver/components/__snapshots__/TemplateQueryComponent.test.tsx.snap rename to public/app/plugins/datasource/stackdriver/components/__snapshots__/VariableQueryEditor.test.tsx.snap index 48f6cca4b64..7478bb7a32e 100644 --- a/public/app/plugins/datasource/stackdriver/components/__snapshots__/TemplateQueryComponent.test.tsx.snap +++ b/public/app/plugins/datasource/stackdriver/components/__snapshots__/VariableQueryEditor.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`StackdriverTemplateQueryComponent renders correctly 1`] = ` +exports[`VariableQueryEditor renders correctly 1`] = ` Array [
({ value: p.projectId, name: p.name })); + } + async query(options) { const result = []; const data = await this.getTimeSeries(options); diff --git a/public/app/plugins/datasource/stackdriver/module.ts b/public/app/plugins/datasource/stackdriver/module.ts index 2a83f3bb548..1b81d29af73 100644 --- a/public/app/plugins/datasource/stackdriver/module.ts +++ b/public/app/plugins/datasource/stackdriver/module.ts @@ -2,12 +2,12 @@ import StackdriverDatasource from './datasource'; import { StackdriverQueryCtrl } from './query_ctrl'; import { StackdriverConfigCtrl } from './config_ctrl'; import { StackdriverAnnotationsQueryCtrl } from './annotations_query_ctrl'; -import { StackdriverTemplateQueryComponent } from './components/TemplateQueryComponent'; +import { StackdriverVariableQueryEditor } from './components/VariableQueryEditor'; export { StackdriverDatasource as Datasource, StackdriverQueryCtrl as QueryCtrl, StackdriverConfigCtrl as ConfigCtrl, StackdriverAnnotationsQueryCtrl as AnnotationsQueryCtrl, - StackdriverTemplateQueryComponent as TemplateQueryComponent, + StackdriverVariableQueryEditor as VariableQueryEditor, }; diff --git a/public/app/plugins/datasource/stackdriver/partials/query.editor.html b/public/app/plugins/datasource/stackdriver/partials/query.editor.html index 98c8fcc83e8..8763bfc36db 100755 --- a/public/app/plugins/datasource/stackdriver/partials/query.editor.html +++ b/public/app/plugins/datasource/stackdriver/partials/query.editor.html @@ -13,9 +13,14 @@
-
+ +
+ Project +