mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
chore: Fix typings and add Page-component to DataSourceSettingsPage #14762
This commit is contained in:
parent
3372dc9441
commit
98fa17f0e4
@ -4,8 +4,7 @@ import { hot } from 'react-hot-loader';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import PageHeader from 'app/core/components/PageHeader/PageHeader';
|
import Page from 'app/core/components/Page/Page';
|
||||||
import PageLoader from 'app/core/components/PageLoader/PageLoader';
|
|
||||||
import PluginSettings from './PluginSettings';
|
import PluginSettings from './PluginSettings';
|
||||||
import BasicSettings from './BasicSettings';
|
import BasicSettings from './BasicSettings';
|
||||||
import ButtonRow from './ButtonRow';
|
import ButtonRow from './ButtonRow';
|
||||||
@ -51,7 +50,7 @@ enum DataSourceStates {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class DataSourceSettingsPage extends PureComponent<Props, State> {
|
export class DataSourceSettingsPage extends PureComponent<Props, State> {
|
||||||
constructor(props) {
|
constructor(props: Props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
@ -65,8 +64,8 @@ export class DataSourceSettingsPage extends PureComponent<Props, State> {
|
|||||||
await loadDataSource(pageId);
|
await loadDataSource(pageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit = async event => {
|
onSubmit = async (evt: React.FormEvent<HTMLFormElement>) => {
|
||||||
event.preventDefault();
|
evt.preventDefault();
|
||||||
|
|
||||||
await this.props.updateDataSource({ ...this.state.dataSource, name: this.props.dataSource.name });
|
await this.props.updateDataSource({ ...this.state.dataSource, name: this.props.dataSource.name });
|
||||||
|
|
||||||
@ -89,7 +88,7 @@ export class DataSourceSettingsPage extends PureComponent<Props, State> {
|
|||||||
this.props.deleteDataSource();
|
this.props.deleteDataSource();
|
||||||
};
|
};
|
||||||
|
|
||||||
onModelChange = dataSource => {
|
onModelChange = (dataSource: DataSourceSettings) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
dataSource: dataSource,
|
dataSource: dataSource,
|
||||||
});
|
});
|
||||||
@ -170,17 +169,18 @@ export class DataSourceSettingsPage extends PureComponent<Props, State> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasDataSource() {
|
||||||
|
return Object.keys(this.props.dataSource).length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { dataSource, dataSourceMeta, navModel, setDataSourceName, setIsDefault } = this.props;
|
const { dataSource, dataSourceMeta, navModel, setDataSourceName, setIsDefault } = this.props;
|
||||||
const { testingMessage, testingStatus } = this.state;
|
const { testingMessage, testingStatus } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<Page navModel={navModel}>
|
||||||
<PageHeader model={navModel} />
|
<Page.Contents isLoading={!this.hasDataSource}>
|
||||||
{Object.keys(dataSource).length === 0 ? (
|
{this.hasDataSource && <div className="page-container page-body">
|
||||||
<PageLoader pageName="Data source settings" />
|
|
||||||
) : (
|
|
||||||
<div className="page-container page-body">
|
|
||||||
<div>
|
<div>
|
||||||
<form onSubmit={this.onSubmit}>
|
<form onSubmit={this.onSubmit}>
|
||||||
{this.isReadOnly() && this.renderIsReadOnlyMessage()}
|
{this.isReadOnly() && this.renderIsReadOnlyMessage()}
|
||||||
@ -225,9 +225,9 @@ export class DataSourceSettingsPage extends PureComponent<Props, State> {
|
|||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>}
|
||||||
)}
|
</Page.Contents>
|
||||||
</div>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,415 +1,426 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`Render should render alpha info text 1`] = `
|
exports[`Render should render alpha info text 1`] = `
|
||||||
<div>
|
<Page
|
||||||
<PageHeader
|
navModel={Object {}}
|
||||||
model={Object {}}
|
>
|
||||||
/>
|
<PageContents
|
||||||
<div
|
isLoading={false}
|
||||||
className="page-container page-body"
|
|
||||||
>
|
>
|
||||||
<div>
|
<div
|
||||||
<form
|
className="page-container page-body"
|
||||||
onSubmit={[Function]}
|
>
|
||||||
>
|
<div>
|
||||||
<div
|
<form
|
||||||
className="grafana-info-box"
|
|
||||||
>
|
|
||||||
This plugin is marked as being in alpha state, which means it is in early development phase and updates will include breaking changes.
|
|
||||||
</div>
|
|
||||||
<BasicSettings
|
|
||||||
dataSourceName="gdev-cloudwatch"
|
|
||||||
isDefault={false}
|
|
||||||
onDefaultChange={[Function]}
|
|
||||||
onNameChange={[Function]}
|
|
||||||
/>
|
|
||||||
<PluginSettings
|
|
||||||
dataSource={
|
|
||||||
Object {
|
|
||||||
"access": "",
|
|
||||||
"basicAuth": false,
|
|
||||||
"basicAuthPassword": "",
|
|
||||||
"basicAuthUser": "",
|
|
||||||
"database": "",
|
|
||||||
"id": 13,
|
|
||||||
"isDefault": false,
|
|
||||||
"jsonData": Object {
|
|
||||||
"authType": "credentials",
|
|
||||||
"defaultRegion": "eu-west-2",
|
|
||||||
},
|
|
||||||
"name": "gdev-cloudwatch",
|
|
||||||
"orgId": 1,
|
|
||||||
"password": "",
|
|
||||||
"readOnly": false,
|
|
||||||
"type": "cloudwatch",
|
|
||||||
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
|
|
||||||
"url": "",
|
|
||||||
"user": "",
|
|
||||||
"withCredentials": false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dataSourceMeta={
|
|
||||||
Object {
|
|
||||||
"defaultNavUrl": "some/url",
|
|
||||||
"enabled": false,
|
|
||||||
"hasUpdate": false,
|
|
||||||
"id": "1",
|
|
||||||
"info": Object {
|
|
||||||
"author": Object {
|
|
||||||
"name": "Grafana Labs",
|
|
||||||
"url": "url/to/GrafanaLabs",
|
|
||||||
},
|
|
||||||
"description": "pretty decent plugin",
|
|
||||||
"links": Array [
|
|
||||||
Object {
|
|
||||||
"name": "project",
|
|
||||||
"url": "one link",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"logos": Object {
|
|
||||||
"large": "large/logo",
|
|
||||||
"small": "small/logo",
|
|
||||||
},
|
|
||||||
"screenshots": Array [
|
|
||||||
Object {
|
|
||||||
"path": "screenshot",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"updated": "2018-09-26",
|
|
||||||
"version": "1",
|
|
||||||
},
|
|
||||||
"latestVersion": "1",
|
|
||||||
"module": Object {},
|
|
||||||
"name": "pretty cool plugin 1",
|
|
||||||
"pinned": false,
|
|
||||||
"state": "alpha",
|
|
||||||
"type": "",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onModelChange={[Function]}
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
className="gf-form-group section"
|
|
||||||
/>
|
|
||||||
<ButtonRow
|
|
||||||
isReadOnly={false}
|
|
||||||
onDelete={[Function]}
|
|
||||||
onSubmit={[Function]}
|
onSubmit={[Function]}
|
||||||
/>
|
>
|
||||||
</form>
|
<div
|
||||||
|
className="grafana-info-box"
|
||||||
|
>
|
||||||
|
This plugin is marked as being in alpha state, which means it is in early development phase and updates will include breaking changes.
|
||||||
|
</div>
|
||||||
|
<BasicSettings
|
||||||
|
dataSourceName="gdev-cloudwatch"
|
||||||
|
isDefault={false}
|
||||||
|
onDefaultChange={[Function]}
|
||||||
|
onNameChange={[Function]}
|
||||||
|
/>
|
||||||
|
<PluginSettings
|
||||||
|
dataSource={
|
||||||
|
Object {
|
||||||
|
"access": "",
|
||||||
|
"basicAuth": false,
|
||||||
|
"basicAuthPassword": "",
|
||||||
|
"basicAuthUser": "",
|
||||||
|
"database": "",
|
||||||
|
"id": 13,
|
||||||
|
"isDefault": false,
|
||||||
|
"jsonData": Object {
|
||||||
|
"authType": "credentials",
|
||||||
|
"defaultRegion": "eu-west-2",
|
||||||
|
},
|
||||||
|
"name": "gdev-cloudwatch",
|
||||||
|
"orgId": 1,
|
||||||
|
"password": "",
|
||||||
|
"readOnly": false,
|
||||||
|
"type": "cloudwatch",
|
||||||
|
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
|
||||||
|
"url": "",
|
||||||
|
"user": "",
|
||||||
|
"withCredentials": false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dataSourceMeta={
|
||||||
|
Object {
|
||||||
|
"defaultNavUrl": "some/url",
|
||||||
|
"enabled": false,
|
||||||
|
"hasUpdate": false,
|
||||||
|
"id": "1",
|
||||||
|
"info": Object {
|
||||||
|
"author": Object {
|
||||||
|
"name": "Grafana Labs",
|
||||||
|
"url": "url/to/GrafanaLabs",
|
||||||
|
},
|
||||||
|
"description": "pretty decent plugin",
|
||||||
|
"links": Array [
|
||||||
|
Object {
|
||||||
|
"name": "project",
|
||||||
|
"url": "one link",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"logos": Object {
|
||||||
|
"large": "large/logo",
|
||||||
|
"small": "small/logo",
|
||||||
|
},
|
||||||
|
"screenshots": Array [
|
||||||
|
Object {
|
||||||
|
"path": "screenshot",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"updated": "2018-09-26",
|
||||||
|
"version": "1",
|
||||||
|
},
|
||||||
|
"latestVersion": "1",
|
||||||
|
"module": Object {},
|
||||||
|
"name": "pretty cool plugin 1",
|
||||||
|
"pinned": false,
|
||||||
|
"state": "alpha",
|
||||||
|
"type": "",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onModelChange={[Function]}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="gf-form-group section"
|
||||||
|
/>
|
||||||
|
<ButtonRow
|
||||||
|
isReadOnly={false}
|
||||||
|
onDelete={[Function]}
|
||||||
|
onSubmit={[Function]}
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</PageContents>
|
||||||
</div>
|
</Page>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`Render should render beta info text 1`] = `
|
exports[`Render should render beta info text 1`] = `
|
||||||
<div>
|
<Page
|
||||||
<PageHeader
|
navModel={Object {}}
|
||||||
model={Object {}}
|
>
|
||||||
/>
|
<PageContents
|
||||||
<div
|
isLoading={false}
|
||||||
className="page-container page-body"
|
|
||||||
>
|
>
|
||||||
<div>
|
<div
|
||||||
<form
|
className="page-container page-body"
|
||||||
onSubmit={[Function]}
|
>
|
||||||
>
|
<div>
|
||||||
<div
|
<form
|
||||||
className="grafana-info-box"
|
|
||||||
>
|
|
||||||
This plugin is marked as being in a beta development state. This means it is in currently in active development and could be missing important features.
|
|
||||||
</div>
|
|
||||||
<BasicSettings
|
|
||||||
dataSourceName="gdev-cloudwatch"
|
|
||||||
isDefault={false}
|
|
||||||
onDefaultChange={[Function]}
|
|
||||||
onNameChange={[Function]}
|
|
||||||
/>
|
|
||||||
<PluginSettings
|
|
||||||
dataSource={
|
|
||||||
Object {
|
|
||||||
"access": "",
|
|
||||||
"basicAuth": false,
|
|
||||||
"basicAuthPassword": "",
|
|
||||||
"basicAuthUser": "",
|
|
||||||
"database": "",
|
|
||||||
"id": 13,
|
|
||||||
"isDefault": false,
|
|
||||||
"jsonData": Object {
|
|
||||||
"authType": "credentials",
|
|
||||||
"defaultRegion": "eu-west-2",
|
|
||||||
},
|
|
||||||
"name": "gdev-cloudwatch",
|
|
||||||
"orgId": 1,
|
|
||||||
"password": "",
|
|
||||||
"readOnly": false,
|
|
||||||
"type": "cloudwatch",
|
|
||||||
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
|
|
||||||
"url": "",
|
|
||||||
"user": "",
|
|
||||||
"withCredentials": false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dataSourceMeta={
|
|
||||||
Object {
|
|
||||||
"defaultNavUrl": "some/url",
|
|
||||||
"enabled": false,
|
|
||||||
"hasUpdate": false,
|
|
||||||
"id": "1",
|
|
||||||
"info": Object {
|
|
||||||
"author": Object {
|
|
||||||
"name": "Grafana Labs",
|
|
||||||
"url": "url/to/GrafanaLabs",
|
|
||||||
},
|
|
||||||
"description": "pretty decent plugin",
|
|
||||||
"links": Array [
|
|
||||||
Object {
|
|
||||||
"name": "project",
|
|
||||||
"url": "one link",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"logos": Object {
|
|
||||||
"large": "large/logo",
|
|
||||||
"small": "small/logo",
|
|
||||||
},
|
|
||||||
"screenshots": Array [
|
|
||||||
Object {
|
|
||||||
"path": "screenshot",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"updated": "2018-09-26",
|
|
||||||
"version": "1",
|
|
||||||
},
|
|
||||||
"latestVersion": "1",
|
|
||||||
"module": Object {},
|
|
||||||
"name": "pretty cool plugin 1",
|
|
||||||
"pinned": false,
|
|
||||||
"state": "beta",
|
|
||||||
"type": "",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onModelChange={[Function]}
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
className="gf-form-group section"
|
|
||||||
/>
|
|
||||||
<ButtonRow
|
|
||||||
isReadOnly={false}
|
|
||||||
onDelete={[Function]}
|
|
||||||
onSubmit={[Function]}
|
onSubmit={[Function]}
|
||||||
/>
|
>
|
||||||
</form>
|
<div
|
||||||
|
className="grafana-info-box"
|
||||||
|
>
|
||||||
|
This plugin is marked as being in a beta development state. This means it is in currently in active development and could be missing important features.
|
||||||
|
</div>
|
||||||
|
<BasicSettings
|
||||||
|
dataSourceName="gdev-cloudwatch"
|
||||||
|
isDefault={false}
|
||||||
|
onDefaultChange={[Function]}
|
||||||
|
onNameChange={[Function]}
|
||||||
|
/>
|
||||||
|
<PluginSettings
|
||||||
|
dataSource={
|
||||||
|
Object {
|
||||||
|
"access": "",
|
||||||
|
"basicAuth": false,
|
||||||
|
"basicAuthPassword": "",
|
||||||
|
"basicAuthUser": "",
|
||||||
|
"database": "",
|
||||||
|
"id": 13,
|
||||||
|
"isDefault": false,
|
||||||
|
"jsonData": Object {
|
||||||
|
"authType": "credentials",
|
||||||
|
"defaultRegion": "eu-west-2",
|
||||||
|
},
|
||||||
|
"name": "gdev-cloudwatch",
|
||||||
|
"orgId": 1,
|
||||||
|
"password": "",
|
||||||
|
"readOnly": false,
|
||||||
|
"type": "cloudwatch",
|
||||||
|
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
|
||||||
|
"url": "",
|
||||||
|
"user": "",
|
||||||
|
"withCredentials": false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dataSourceMeta={
|
||||||
|
Object {
|
||||||
|
"defaultNavUrl": "some/url",
|
||||||
|
"enabled": false,
|
||||||
|
"hasUpdate": false,
|
||||||
|
"id": "1",
|
||||||
|
"info": Object {
|
||||||
|
"author": Object {
|
||||||
|
"name": "Grafana Labs",
|
||||||
|
"url": "url/to/GrafanaLabs",
|
||||||
|
},
|
||||||
|
"description": "pretty decent plugin",
|
||||||
|
"links": Array [
|
||||||
|
Object {
|
||||||
|
"name": "project",
|
||||||
|
"url": "one link",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"logos": Object {
|
||||||
|
"large": "large/logo",
|
||||||
|
"small": "small/logo",
|
||||||
|
},
|
||||||
|
"screenshots": Array [
|
||||||
|
Object {
|
||||||
|
"path": "screenshot",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"updated": "2018-09-26",
|
||||||
|
"version": "1",
|
||||||
|
},
|
||||||
|
"latestVersion": "1",
|
||||||
|
"module": Object {},
|
||||||
|
"name": "pretty cool plugin 1",
|
||||||
|
"pinned": false,
|
||||||
|
"state": "beta",
|
||||||
|
"type": "",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onModelChange={[Function]}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="gf-form-group section"
|
||||||
|
/>
|
||||||
|
<ButtonRow
|
||||||
|
isReadOnly={false}
|
||||||
|
onDelete={[Function]}
|
||||||
|
onSubmit={[Function]}
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</PageContents>
|
||||||
</div>
|
</Page>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`Render should render component 1`] = `
|
exports[`Render should render component 1`] = `
|
||||||
<div>
|
<Page
|
||||||
<PageHeader
|
navModel={Object {}}
|
||||||
model={Object {}}
|
>
|
||||||
/>
|
<PageContents
|
||||||
<div
|
isLoading={false}
|
||||||
className="page-container page-body"
|
|
||||||
>
|
>
|
||||||
<div>
|
<div
|
||||||
<form
|
className="page-container page-body"
|
||||||
onSubmit={[Function]}
|
>
|
||||||
>
|
<div>
|
||||||
<BasicSettings
|
<form
|
||||||
dataSourceName="gdev-cloudwatch"
|
|
||||||
isDefault={false}
|
|
||||||
onDefaultChange={[Function]}
|
|
||||||
onNameChange={[Function]}
|
|
||||||
/>
|
|
||||||
<PluginSettings
|
|
||||||
dataSource={
|
|
||||||
Object {
|
|
||||||
"access": "",
|
|
||||||
"basicAuth": false,
|
|
||||||
"basicAuthPassword": "",
|
|
||||||
"basicAuthUser": "",
|
|
||||||
"database": "",
|
|
||||||
"id": 13,
|
|
||||||
"isDefault": false,
|
|
||||||
"jsonData": Object {
|
|
||||||
"authType": "credentials",
|
|
||||||
"defaultRegion": "eu-west-2",
|
|
||||||
},
|
|
||||||
"name": "gdev-cloudwatch",
|
|
||||||
"orgId": 1,
|
|
||||||
"password": "",
|
|
||||||
"readOnly": false,
|
|
||||||
"type": "cloudwatch",
|
|
||||||
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
|
|
||||||
"url": "",
|
|
||||||
"user": "",
|
|
||||||
"withCredentials": false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dataSourceMeta={
|
|
||||||
Object {
|
|
||||||
"defaultNavUrl": "some/url",
|
|
||||||
"enabled": false,
|
|
||||||
"hasUpdate": false,
|
|
||||||
"id": "1",
|
|
||||||
"info": Object {
|
|
||||||
"author": Object {
|
|
||||||
"name": "Grafana Labs",
|
|
||||||
"url": "url/to/GrafanaLabs",
|
|
||||||
},
|
|
||||||
"description": "pretty decent plugin",
|
|
||||||
"links": Array [
|
|
||||||
Object {
|
|
||||||
"name": "project",
|
|
||||||
"url": "one link",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"logos": Object {
|
|
||||||
"large": "large/logo",
|
|
||||||
"small": "small/logo",
|
|
||||||
},
|
|
||||||
"screenshots": Array [
|
|
||||||
Object {
|
|
||||||
"path": "screenshot",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"updated": "2018-09-26",
|
|
||||||
"version": "1",
|
|
||||||
},
|
|
||||||
"latestVersion": "1",
|
|
||||||
"module": Object {},
|
|
||||||
"name": "pretty cool plugin 1",
|
|
||||||
"pinned": false,
|
|
||||||
"state": "",
|
|
||||||
"type": "",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onModelChange={[Function]}
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
className="gf-form-group section"
|
|
||||||
/>
|
|
||||||
<ButtonRow
|
|
||||||
isReadOnly={false}
|
|
||||||
onDelete={[Function]}
|
|
||||||
onSubmit={[Function]}
|
onSubmit={[Function]}
|
||||||
/>
|
>
|
||||||
</form>
|
<BasicSettings
|
||||||
|
dataSourceName="gdev-cloudwatch"
|
||||||
|
isDefault={false}
|
||||||
|
onDefaultChange={[Function]}
|
||||||
|
onNameChange={[Function]}
|
||||||
|
/>
|
||||||
|
<PluginSettings
|
||||||
|
dataSource={
|
||||||
|
Object {
|
||||||
|
"access": "",
|
||||||
|
"basicAuth": false,
|
||||||
|
"basicAuthPassword": "",
|
||||||
|
"basicAuthUser": "",
|
||||||
|
"database": "",
|
||||||
|
"id": 13,
|
||||||
|
"isDefault": false,
|
||||||
|
"jsonData": Object {
|
||||||
|
"authType": "credentials",
|
||||||
|
"defaultRegion": "eu-west-2",
|
||||||
|
},
|
||||||
|
"name": "gdev-cloudwatch",
|
||||||
|
"orgId": 1,
|
||||||
|
"password": "",
|
||||||
|
"readOnly": false,
|
||||||
|
"type": "cloudwatch",
|
||||||
|
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
|
||||||
|
"url": "",
|
||||||
|
"user": "",
|
||||||
|
"withCredentials": false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dataSourceMeta={
|
||||||
|
Object {
|
||||||
|
"defaultNavUrl": "some/url",
|
||||||
|
"enabled": false,
|
||||||
|
"hasUpdate": false,
|
||||||
|
"id": "1",
|
||||||
|
"info": Object {
|
||||||
|
"author": Object {
|
||||||
|
"name": "Grafana Labs",
|
||||||
|
"url": "url/to/GrafanaLabs",
|
||||||
|
},
|
||||||
|
"description": "pretty decent plugin",
|
||||||
|
"links": Array [
|
||||||
|
Object {
|
||||||
|
"name": "project",
|
||||||
|
"url": "one link",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"logos": Object {
|
||||||
|
"large": "large/logo",
|
||||||
|
"small": "small/logo",
|
||||||
|
},
|
||||||
|
"screenshots": Array [
|
||||||
|
Object {
|
||||||
|
"path": "screenshot",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"updated": "2018-09-26",
|
||||||
|
"version": "1",
|
||||||
|
},
|
||||||
|
"latestVersion": "1",
|
||||||
|
"module": Object {},
|
||||||
|
"name": "pretty cool plugin 1",
|
||||||
|
"pinned": false,
|
||||||
|
"state": "",
|
||||||
|
"type": "",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onModelChange={[Function]}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="gf-form-group section"
|
||||||
|
/>
|
||||||
|
<ButtonRow
|
||||||
|
isReadOnly={false}
|
||||||
|
onDelete={[Function]}
|
||||||
|
onSubmit={[Function]}
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</PageContents>
|
||||||
</div>
|
</Page>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`Render should render is ready only message 1`] = `
|
exports[`Render should render is ready only message 1`] = `
|
||||||
<div>
|
<Page
|
||||||
<PageHeader
|
navModel={Object {}}
|
||||||
model={Object {}}
|
>
|
||||||
/>
|
<PageContents
|
||||||
<div
|
isLoading={false}
|
||||||
className="page-container page-body"
|
|
||||||
>
|
>
|
||||||
<div>
|
<div
|
||||||
<form
|
className="page-container page-body"
|
||||||
onSubmit={[Function]}
|
>
|
||||||
>
|
<div>
|
||||||
<div
|
<form
|
||||||
className="grafana-info-box span8"
|
|
||||||
>
|
|
||||||
This datasource was added by config and cannot be modified using the UI. Please contact your server admin to update this datasource.
|
|
||||||
</div>
|
|
||||||
<BasicSettings
|
|
||||||
dataSourceName="gdev-cloudwatch"
|
|
||||||
isDefault={false}
|
|
||||||
onDefaultChange={[Function]}
|
|
||||||
onNameChange={[Function]}
|
|
||||||
/>
|
|
||||||
<PluginSettings
|
|
||||||
dataSource={
|
|
||||||
Object {
|
|
||||||
"access": "",
|
|
||||||
"basicAuth": false,
|
|
||||||
"basicAuthPassword": "",
|
|
||||||
"basicAuthUser": "",
|
|
||||||
"database": "",
|
|
||||||
"id": 13,
|
|
||||||
"isDefault": false,
|
|
||||||
"jsonData": Object {
|
|
||||||
"authType": "credentials",
|
|
||||||
"defaultRegion": "eu-west-2",
|
|
||||||
},
|
|
||||||
"name": "gdev-cloudwatch",
|
|
||||||
"orgId": 1,
|
|
||||||
"password": "",
|
|
||||||
"readOnly": true,
|
|
||||||
"type": "cloudwatch",
|
|
||||||
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
|
|
||||||
"url": "",
|
|
||||||
"user": "",
|
|
||||||
"withCredentials": false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dataSourceMeta={
|
|
||||||
Object {
|
|
||||||
"defaultNavUrl": "some/url",
|
|
||||||
"enabled": false,
|
|
||||||
"hasUpdate": false,
|
|
||||||
"id": "1",
|
|
||||||
"info": Object {
|
|
||||||
"author": Object {
|
|
||||||
"name": "Grafana Labs",
|
|
||||||
"url": "url/to/GrafanaLabs",
|
|
||||||
},
|
|
||||||
"description": "pretty decent plugin",
|
|
||||||
"links": Array [
|
|
||||||
Object {
|
|
||||||
"name": "project",
|
|
||||||
"url": "one link",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"logos": Object {
|
|
||||||
"large": "large/logo",
|
|
||||||
"small": "small/logo",
|
|
||||||
},
|
|
||||||
"screenshots": Array [
|
|
||||||
Object {
|
|
||||||
"path": "screenshot",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"updated": "2018-09-26",
|
|
||||||
"version": "1",
|
|
||||||
},
|
|
||||||
"latestVersion": "1",
|
|
||||||
"module": Object {},
|
|
||||||
"name": "pretty cool plugin 1",
|
|
||||||
"pinned": false,
|
|
||||||
"state": "",
|
|
||||||
"type": "",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onModelChange={[Function]}
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
className="gf-form-group section"
|
|
||||||
/>
|
|
||||||
<ButtonRow
|
|
||||||
isReadOnly={true}
|
|
||||||
onDelete={[Function]}
|
|
||||||
onSubmit={[Function]}
|
onSubmit={[Function]}
|
||||||
/>
|
>
|
||||||
</form>
|
<div
|
||||||
|
className="grafana-info-box span8"
|
||||||
|
>
|
||||||
|
This datasource was added by config and cannot be modified using the UI. Please contact your server admin to update this datasource.
|
||||||
|
</div>
|
||||||
|
<BasicSettings
|
||||||
|
dataSourceName="gdev-cloudwatch"
|
||||||
|
isDefault={false}
|
||||||
|
onDefaultChange={[Function]}
|
||||||
|
onNameChange={[Function]}
|
||||||
|
/>
|
||||||
|
<PluginSettings
|
||||||
|
dataSource={
|
||||||
|
Object {
|
||||||
|
"access": "",
|
||||||
|
"basicAuth": false,
|
||||||
|
"basicAuthPassword": "",
|
||||||
|
"basicAuthUser": "",
|
||||||
|
"database": "",
|
||||||
|
"id": 13,
|
||||||
|
"isDefault": false,
|
||||||
|
"jsonData": Object {
|
||||||
|
"authType": "credentials",
|
||||||
|
"defaultRegion": "eu-west-2",
|
||||||
|
},
|
||||||
|
"name": "gdev-cloudwatch",
|
||||||
|
"orgId": 1,
|
||||||
|
"password": "",
|
||||||
|
"readOnly": true,
|
||||||
|
"type": "cloudwatch",
|
||||||
|
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
|
||||||
|
"url": "",
|
||||||
|
"user": "",
|
||||||
|
"withCredentials": false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dataSourceMeta={
|
||||||
|
Object {
|
||||||
|
"defaultNavUrl": "some/url",
|
||||||
|
"enabled": false,
|
||||||
|
"hasUpdate": false,
|
||||||
|
"id": "1",
|
||||||
|
"info": Object {
|
||||||
|
"author": Object {
|
||||||
|
"name": "Grafana Labs",
|
||||||
|
"url": "url/to/GrafanaLabs",
|
||||||
|
},
|
||||||
|
"description": "pretty decent plugin",
|
||||||
|
"links": Array [
|
||||||
|
Object {
|
||||||
|
"name": "project",
|
||||||
|
"url": "one link",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"logos": Object {
|
||||||
|
"large": "large/logo",
|
||||||
|
"small": "small/logo",
|
||||||
|
},
|
||||||
|
"screenshots": Array [
|
||||||
|
Object {
|
||||||
|
"path": "screenshot",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"updated": "2018-09-26",
|
||||||
|
"version": "1",
|
||||||
|
},
|
||||||
|
"latestVersion": "1",
|
||||||
|
"module": Object {},
|
||||||
|
"name": "pretty cool plugin 1",
|
||||||
|
"pinned": false,
|
||||||
|
"state": "",
|
||||||
|
"type": "",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onModelChange={[Function]}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="gf-form-group section"
|
||||||
|
/>
|
||||||
|
<ButtonRow
|
||||||
|
isReadOnly={true}
|
||||||
|
onDelete={[Function]}
|
||||||
|
onSubmit={[Function]}
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</PageContents>
|
||||||
</div>
|
</Page>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`Render should render loader 1`] = `
|
exports[`Render should render loader 1`] = `
|
||||||
<div>
|
<Page
|
||||||
<PageHeader
|
navModel={Object {}}
|
||||||
model={Object {}}
|
>
|
||||||
|
<PageContents
|
||||||
|
isLoading={true}
|
||||||
/>
|
/>
|
||||||
<PageLoader
|
</Page>
|
||||||
pageName="Data source settings"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
`;
|
`;
|
||||||
|
Loading…
Reference in New Issue
Block a user