add className for elements

main
Dmitriy Oparin 5 years ago
parent 8a3da9619c
commit ddb225da04

@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.11.5",
"version": "1.11.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.11.5",
"version": "1.11.6",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {

@ -200,6 +200,7 @@ function RemoveItem(props: ItemProps): JSX.Element {
onClick={(): void => {
if (locked) {
Modal.confirm({
className: 'cvat-modal-confirm',
title: 'Object is locked',
content: 'Are you sure you want to remove it?',
onOk() {

@ -187,9 +187,11 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP
}
private showErrors(): void {
function showError(title: string, _error: any): void {
function showError(title: string, _error: any, className?: string): void {
const error = _error.toString();
const dynamicProps = typeof className === 'undefined' ? {} : { className };
notification.error({
...dynamicProps,
message: (
<div
// eslint-disable-next-line
@ -214,7 +216,7 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP
const error = (notifications as any).errors[where][what];
shown = shown || !!error;
if (error) {
showError(error.message, error.reason);
showError(error.message, error.reason, error.className);
}
}
}

@ -213,6 +213,7 @@ export interface ModelsState {
export interface ErrorState {
message: string;
reason: string;
className?: string;
}
export interface NotificationsState {

@ -776,6 +776,7 @@ export default function (state = defaultState, action: AnyAction): Notifications
removing: {
message: 'Could not remove the object',
reason: action.payload.error.toString(),
className: 'cvat-notification-notice-remove-object-failed',
},
},
},

Loading…
Cancel
Save