AlertBox: Merged Alertbox into Alert (#19212)

* refatoring alert box and using alert

* refactoring alertbox to alert

* Changed default to Error

* added buttonText, onButtonClick, omRemove

* Minor fix to buttons

* fixed onRemove
This commit is contained in:
srid12
2019-09-20 17:11:00 +05:30
committed by Torkel Ödegaard
parent bf24cbba76
commit 2a1e130000
15 changed files with 158 additions and 103 deletions

View File

@@ -8,6 +8,7 @@ import find from 'lodash/find';
import { UrlQueryMap } from '@grafana/runtime';
import { StoreState, AppNotificationSeverity } from 'app/types';
import {
Alert,
PluginType,
GrafanaPlugin,
PluginInclude,
@@ -30,7 +31,6 @@ import { PluginDashboards } from './PluginDashboards';
import { appEvents } from 'app/core/core';
import { config } from 'app/core/config';
import { ContextSrv } from '../../core/services/context_srv';
import { AlertBox } from 'app/core/components/AlertBox/AlertBox';
export function getLoadingNav(): NavModel {
const node = {
@@ -141,7 +141,7 @@ class PluginPage extends PureComponent<Props, State> {
const { plugin, nav } = this.state;
if (!plugin) {
return <AlertBox severity={AppNotificationSeverity.Error} title="Plugin Not Found" />;
return <Alert severity={AppNotificationSeverity.Error} title="Plugin Not Found" />;
}
const active = nav.main.children.find(tab => tab.active);
@@ -300,10 +300,10 @@ class PluginPage extends PureComponent<Props, State> {
<div className="sidebar-container">
<div className="sidebar-content">
{plugin.loadError && (
<AlertBox
<Alert
severity={AppNotificationSeverity.Error}
title="Error Loading Plugin"
body={
children={
<>
Check the server startup logs for more information. <br />
If this plugin was loaded from git, make sure it was compiled.