diff --git a/packages/grafana-ui/src/components/Alert/Alert.story.tsx b/packages/grafana-ui/src/components/Alert/Alert.story.tsx index 2ec320a16e8..d9517371f99 100644 --- a/packages/grafana-ui/src/components/Alert/Alert.story.tsx +++ b/packages/grafana-ui/src/components/Alert/Alert.story.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { select } from '@storybook/addon-knobs'; import { action } from '@storybook/addon-actions'; -import { Alert, AlertVariant } from './Alert'; +import { Alert, AlertVariant, VerticalGroup } from '@grafana/ui'; import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from '../Alert/Alert.mdx'; +import { StoryExample } from '../../utils/storybook/StoryExample'; export default { title: 'Overlays/Alert', @@ -18,24 +18,34 @@ export default { const severities: AlertVariant[] = ['error', 'warning', 'info', 'success']; -export const basic = () => { - const severity = select('Severity', severities, 'info'); - return ; -}; - -export const withRemove = () => { - const severity = select('Severity', severities, 'info'); - return ; -}; - -export const customButtonContent = () => { - const severity = select('Severity', severities, 'info'); +export const Examples = () => { return ( - Close} - onRemove={action('Remove button clicked')} - /> + + + Close} + onRemove={action('Remove button clicked')} + > + Child content that includes some alert details, like maybe what actually happened. + + + + + + + + {severities.map((severity) => ( + + ))} + + + ); }; diff --git a/packages/grafana-ui/src/components/Alert/Alert.tsx b/packages/grafana-ui/src/components/Alert/Alert.tsx index 451197091d9..df5566eea99 100644 --- a/packages/grafana-ui/src/components/Alert/Alert.tsx +++ b/packages/grafana-ui/src/components/Alert/Alert.tsx @@ -79,6 +79,7 @@ const getStyles = (theme: GrafanaTheme, severity: AlertVariant, outline: boolean return { alert: css` + flex-grow: 1; padding: 15px 20px; margin-bottom: ${theme.spacing.xs}; position: relative; diff --git a/packages/grafana-ui/src/utils/colors.ts b/packages/grafana-ui/src/utils/colors.ts index d88e25924ef..5d28628c275 100644 --- a/packages/grafana-ui/src/utils/colors.ts +++ b/packages/grafana-ui/src/utils/colors.ts @@ -134,8 +134,10 @@ export let sortedColors = sortColorsByHue(colors); export function getColorsFromSeverity(severity: AlertVariant, theme: GrafanaTheme): [string, string] { switch (severity) { case 'error': - case 'warning': return [theme.palette.redBase, theme.palette.redShade]; + case 'warning': + return [theme.palette.queryOrange, theme.palette.orange]; + case 'info': case 'info': return [theme.palette.blue80, theme.palette.blue77]; case 'success': diff --git a/public/app/features/datasources/settings/DataSourceSettingsPage.tsx b/public/app/features/datasources/settings/DataSourceSettingsPage.tsx index 4c09bce62f4..5857f334d4d 100644 --- a/public/app/features/datasources/settings/DataSourceSettingsPage.tsx +++ b/public/app/features/datasources/settings/DataSourceSettingsPage.tsx @@ -23,7 +23,7 @@ import { getRouteParamsId } from 'app/core/selectors/location'; // Types import { CoreEvents, StoreState } from 'app/types/'; import { DataSourcePluginMeta, DataSourceSettings, NavModel, UrlQueryMap } from '@grafana/data'; -import { Alert } from '@grafana/ui'; +import { Alert, InfoBox } from '@grafana/ui'; import { getDataSourceLoadingNav } from '../state/navModel'; import PluginStateinfo from 'app/features/plugins/PluginStateInfo'; import { dataSourceLoaded, setDataSourceName, setIsDefault } from '../state/reducers'; @@ -100,10 +100,10 @@ export class DataSourceSettingsPage extends PureComponent { renderIsReadOnlyMessage() { return ( -
+ This datasource was added by config and cannot be modified using the UI. Please contact your server admin to update this datasource. -
+ ); } diff --git a/public/app/features/datasources/settings/__snapshots__/DataSourceSettingsPage.test.tsx.snap b/public/app/features/datasources/settings/__snapshots__/DataSourceSettingsPage.test.tsx.snap index 8c6fd417c91..831c65adead 100644 --- a/public/app/features/datasources/settings/__snapshots__/DataSourceSettingsPage.test.tsx.snap +++ b/public/app/features/datasources/settings/__snapshots__/DataSourceSettingsPage.test.tsx.snap @@ -295,11 +295,11 @@ exports[`Render should render is ready only message 1`] = `
-
This datasource was added by config and cannot be modified using the UI. Please contact your server admin to update this datasource. -
+ { return (
-
+
Support for flux in Grafana is currently in beta

Please report any issues to:
@@ -82,7 +82,7 @@ export class ConfigEditor extends PureComponent { https://github.com/grafana/grafana/issues

-
+

@@ -231,7 +231,7 @@ export class ConfigEditor extends PureComponent {
-
+
Database Access

Setting the database for this datasource does not deny access to other databases. The InfluxDB query @@ -242,7 +242,7 @@ export class ConfigEditor extends PureComponent {
To support data isolation and security, make sure appropriate permissions are configured in InfluxDB.

-
+
diff --git a/public/app/plugins/datasource/influxdb/components/__snapshots__/ConfigEditor.test.tsx.snap b/public/app/plugins/datasource/influxdb/components/__snapshots__/ConfigEditor.test.tsx.snap index b311ad46086..40248a90417 100644 --- a/public/app/plugins/datasource/influxdb/components/__snapshots__/ConfigEditor.test.tsx.snap +++ b/public/app/plugins/datasource/influxdb/components/__snapshots__/ConfigEditor.test.tsx.snap @@ -234,9 +234,7 @@ exports[`Render should disable basic auth password input 1`] = `
-
+
Database Access
@@ -253,7 +251,7 @@ exports[`Render should disable basic auth password input 1`] = `
To support data isolation and security, make sure appropriate permissions are configured in InfluxDB.

-
+
-
+
Database Access
@@ -541,7 +537,7 @@ exports[`Render should hide basic auth fields when switch off 1`] = `
To support data isolation and security, make sure appropriate permissions are configured in InfluxDB.

-
+
-
+
Database Access
@@ -829,7 +823,7 @@ exports[`Render should hide white listed cookies input when browser access chose
To support data isolation and security, make sure appropriate permissions are configured in InfluxDB.

-
+
-
+
Database Access
@@ -1117,7 +1109,7 @@ exports[`Render should render component 1`] = `
To support data isolation and security, make sure appropriate permissions are configured in InfluxDB.

-
+