PLT-2616 making dev mode javascript error red (#2787)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
e3d70a4667
Коммит
a9cde2b0f9
@@ -67,8 +67,14 @@ export default class ErrorBar extends React.Component {
|
|||||||
return <div/>;
|
return <div/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var errClass = 'error-bar';
|
||||||
|
|
||||||
|
if (this.state.type && this.state.type === 'developer') {
|
||||||
|
errClass = 'error-bar-developer';
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='error-bar'>
|
<div className={errClass}>
|
||||||
<span>{this.state.message}</span>
|
<span>{this.state.message}</span>
|
||||||
<a
|
<a
|
||||||
href='#'
|
href='#'
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ function preRenderSetup(callwhendone) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (window.mm_config && window.mm_config.EnableDeveloper === 'true') {
|
if (window.mm_config && window.mm_config.EnableDeveloper === 'true') {
|
||||||
window.ErrorStore.storeLastError({message: 'DEVELOPER MODE: A javascript error has occured. Please use the javascript console to capture and report the error (row: ' + line + ' col: ' + column + ').'});
|
window.ErrorStore.storeLastError({type: 'developer', message: 'DEVELOPER MODE: A javascript error has occured. Please use the javascript console to capture and report the error (row: ' + line + ' col: ' + column + ').'});
|
||||||
window.ErrorStore.emitChange();
|
window.ErrorStore.emitChange();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,3 +29,33 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.error-bar-developer {
|
||||||
|
background-color: #B0171F;
|
||||||
|
color: white;
|
||||||
|
padding: 5px 30px;
|
||||||
|
position: absolute;
|
||||||
|
text-align: center;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 9999;
|
||||||
|
|
||||||
|
a {
|
||||||
|
&.error-bar__close {
|
||||||
|
color: $white;
|
||||||
|
font-family: 'Open Sans', sans-serif;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 0 10px;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
text-decoration: none;
|
||||||
|
top: 0;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: $white;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user