add className for elements

main
Dmitriy Oparin 5 years ago
parent 8a3da9619c
commit ddb225da04

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

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

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

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

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

Loading…
Cancel
Save