console: fix error notification non json, auto height css (#354)

This commit is contained in:
Praveen Durairaj 2018-09-05 12:06:21 +05:30 committed by Shahidh K Muhammed
parent 0a3f68a6eb
commit d397d932d6
3 changed files with 41 additions and 37 deletions

View File

@ -7,6 +7,7 @@ import * as tooltip from './Tooltips';
import 'react-toggle/style.css';
import Spinner from '../Common/Spinner/Spinner';
import { loadServerVersion, checkServerUpdates } from './Actions';
import './NotificationOverrides.css';
const semver = require('semver');

View File

@ -0,0 +1,3 @@
.notifications-wrapper .notification {
height: auto !important;
}

View File

@ -72,44 +72,44 @@ const showErrorNotification = (title, message, reqBody, error) => {
level: 'error',
title,
message: modMessage,
action: reqBody
action: finalJson
? {
label: 'Details',
callback: () => {
dispatch(
showNotification({
level: 'error',
title,
message: modMessage,
dismissible: 'button',
children: [
<div className={styles.aceBlock}>
<i
onClick={e => {
e.preventDefault();
expandClicked(finalJson);
}}
className={styles.aceBlockExpand + ' fa fa-expand'}
/>
<AceEditor
readOnly
showPrintMargin={false}
mode="json"
showGutter={false}
theme="github"
name="notification-response"
value={JSON.stringify(finalJson, null, 4)}
minLines={1}
maxLines={15}
width="100%"
/>
{refreshBtn}
</div>,
],
})
);
},
}
label: 'Details',
callback: () => {
dispatch(
showNotification({
level: 'error',
title,
message: modMessage,
dismissible: 'button',
children: [
<div className={styles.aceBlock}>
<i
onClick={e => {
e.preventDefault();
expandClicked(finalJson);
}}
className={styles.aceBlockExpand + ' fa fa-expand'}
/>
<AceEditor
readOnly
showPrintMargin={false}
mode="json"
showGutter={false}
theme="github"
name="notification-response"
value={JSON.stringify(finalJson, null, 4)}
minLines={1}
maxLines={15}
width="100%"
/>
{refreshBtn}
</div>,
],
})
);
},
}
: null,
})
);