Plugins: better warning when plugins fail to load (#18671)

* better pluin feedback

* add server side check for module.js
This commit is contained in:
Ryan McKinley
2019-08-21 22:04:02 -07:00
committed by Torkel Ödegaard
parent c98c5c3c8e
commit f7c55d3968
6 changed files with 44 additions and 15 deletions

View File

@@ -1,10 +1,10 @@
import React, { FunctionComponent } from 'react';
import React, { FunctionComponent, ReactNode } from 'react';
import { AppNotificationSeverity } from 'app/types';
interface Props {
title: string;
icon?: string;
text?: string;
body?: ReactNode;
severity: AppNotificationSeverity;
onClose?: () => void;
}
@@ -22,7 +22,7 @@ function getIconFromSeverity(severity: AppNotificationSeverity): string {
}
}
export const AlertBox: FunctionComponent<Props> = ({ title, icon, text, severity, onClose }) => {
export const AlertBox: FunctionComponent<Props> = ({ title, icon, body, severity, onClose }) => {
return (
<div className={`alert alert-${severity}`}>
<div className="alert-icon">
@@ -30,7 +30,7 @@ export const AlertBox: FunctionComponent<Props> = ({ title, icon, text, severity
</div>
<div className="alert-body">
<div className="alert-title">{title}</div>
{text && <div className="alert-text">{text}</div>}
{body && <div className="alert-text">{body}</div>}
</div>
{onClose && (
<button type="button" className="alert-close" onClick={onClose}>

View File

@@ -26,7 +26,7 @@ export default class AppNotificationItem extends Component<Props> {
<AlertBox
severity={appNotification.severity}
title={appNotification.title}
text={appNotification.text}
body={appNotification.text}
icon={appNotification.icon}
onClose={() => onClearNotification(appNotification.id)}
/>