[React UI] A couple of fixes (#1966)

main
Boris Sekachev 6 years ago committed by GitHub
parent 0062ecdec3
commit f6c396557f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Intelligent polygon editing (<https://github.com/opencv/cvat/pull/1921>) - Intelligent polygon editing (<https://github.com/opencv/cvat/pull/1921>)
- Support creating multiple jobs for each task through python cli (https://github.com/opencv/cvat/pull/1950) - Support creating multiple jobs for each task through python cli (https://github.com/opencv/cvat/pull/1950)
- python cli over https (<https://github.com/opencv/cvat/pull/1942>) - python cli over https (<https://github.com/opencv/cvat/pull/1942>)
- Error message when plugins weren't able to initialize instead of infinite loading (<https://github.com/opencv/cvat/pull/1966>)
### Changed ### Changed
- Smaller object details (<https://github.com/opencv/cvat/pull/1877>) - Smaller object details (<https://github.com/opencv/cvat/pull/1877>)
@ -42,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Interpolated shapes exported as `keyframe = True` (<https://github.com/opencv/cvat/pull/1937>) - Interpolated shapes exported as `keyframe = True` (<https://github.com/opencv/cvat/pull/1937>)
- Stylelint filetype scans (<https://github.com/opencv/cvat/pull/1952>) - Stylelint filetype scans (<https://github.com/opencv/cvat/pull/1952>)
- Fixed toolip closing issue (<https://github.com/opencv/cvat/pull/1955>) - Fixed toolip closing issue (<https://github.com/opencv/cvat/pull/1955>)
- Clearing frame cache when close a task (<https://github.com/opencv/cvat/pull/1966>)
### Security ### Security
- -

@ -1,6 +1,6 @@
{ {
"name": "cvat-core", "name": "cvat-core",
"version": "3.3.0", "version": "3.3.1",
"description": "Part of Computer Vision Tool which presents an interface for client-side integration", "description": "Part of Computer Vision Tool which presents an interface for client-side integration",
"main": "babel.config.js", "main": "babel.config.js",
"scripts": { "scripts": {

@ -605,10 +605,18 @@
}; };
} }
function clear(taskID) {
if (taskID in frameDataCache) {
frameDataCache[taskID].frameBuffer.clear();
delete frameDataCache[taskID];
}
}
module.exports = { module.exports = {
FrameData, FrameData,
getFrame, getFrame,
getRanges, getRanges,
getPreview, getPreview,
clear,
}; };
})(); })();

@ -11,7 +11,12 @@
const PluginRegistry = require('./plugins'); const PluginRegistry = require('./plugins');
const loggerStorage = require('./logger-storage'); const loggerStorage = require('./logger-storage');
const serverProxy = require('./server-proxy'); const serverProxy = require('./server-proxy');
const { getFrame, getRanges, getPreview } = require('./frames'); const {
getFrame,
getRanges,
getPreview,
clear: clearFrames,
} = require('./frames');
const { ArgumentError } = require('./exceptions'); const { ArgumentError } = require('./exceptions');
const { TaskStatus } = require('./enums'); const { TaskStatus } = require('./enums');
const { Label } = require('./labels'); const { Label } = require('./labels');
@ -1593,6 +1598,7 @@
}; };
Task.prototype.close.implementation = function closeTask() { Task.prototype.close.implementation = function closeTask() {
clearFrames(this.id);
for (const job of this.jobs) { for (const job of this.jobs) {
closeSession(job); closeSession(job);
} }

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

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

@ -8,7 +8,8 @@ import PluginChecker from 'utils/plugin-checker';
export enum PluginsActionTypes { export enum PluginsActionTypes {
CHECK_PLUGINS = 'CHECK_PLUGINS', CHECK_PLUGINS = 'CHECK_PLUGINS',
CHECKED_ALL_PLUGINS = 'CHECKED_ALL_PLUGINS' CHECKED_ALL_PLUGINS = 'CHECKED_ALL_PLUGINS',
RAISE_PLUGIN_CHECK_ERROR = 'RAISE_PLUGIN_CHECK_ERROR'
} }
type PluginObjects = Record<SupportedPlugins, boolean>; type PluginObjects = Record<SupportedPlugins, boolean>;
@ -20,6 +21,11 @@ const pluginActions = {
list, list,
}) })
), ),
raisePluginCheckError: (error: Error) => (
createAction(PluginsActionTypes.RAISE_PLUGIN_CHECK_ERROR, {
error,
})
),
}; };
export type PluginActions = ActionUnion<typeof pluginActions>; export type PluginActions = ActionUnion<typeof pluginActions>;
@ -39,9 +45,13 @@ export function checkPluginsAsync(): ThunkAction {
PluginChecker.check(SupportedPlugins.DEXTR_SEGMENTATION), PluginChecker.check(SupportedPlugins.DEXTR_SEGMENTATION),
]; ];
const values = await Promise.all(promises); try {
[plugins.ANALYTICS, plugins.GIT_INTEGRATION, const values = await Promise.all(promises);
plugins.DEXTR_SEGMENTATION] = values; [plugins.ANALYTICS, plugins.GIT_INTEGRATION,
dispatch(pluginActions.checkedAllPlugins(plugins)); plugins.DEXTR_SEGMENTATION] = values;
dispatch(pluginActions.checkedAllPlugins(plugins));
} catch (error) {
dispatch(pluginActions.raisePluginCheckError(error));
}
}; };
} }

@ -235,8 +235,9 @@ export interface NotificationsState {
userAgreements: { userAgreements: {
fetching: null | ErrorState; fetching: null | ErrorState;
}; };
plugins: {
[index: string]: any; initializationError: null | ErrorState;
};
}; };
messages: { messages: {
tasks: { tasks: {
@ -245,8 +246,6 @@ export interface NotificationsState {
models: { models: {
inferenceDone: string; inferenceDone: string;
}; };
[index: string]: any;
}; };
} }

@ -15,9 +15,11 @@ import { AnnotationActionTypes } from 'actions/annotation-actions';
import { NotificationsActionType } from 'actions/notification-actions'; import { NotificationsActionType } from 'actions/notification-actions';
import { BoundariesActionTypes } from 'actions/boundaries-actions'; import { BoundariesActionTypes } from 'actions/boundaries-actions';
import { UserAgreementsActionTypes } from 'actions/useragreements-actions'; import { UserAgreementsActionTypes } from 'actions/useragreements-actions';
import { PluginsActionTypes } from 'actions/plugins-actions';
import { NotificationsState } from './interfaces'; import { NotificationsState } from './interfaces';
const defaultState: NotificationsState = { const defaultState: NotificationsState = {
errors: { errors: {
auth: { auth: {
@ -84,6 +86,9 @@ const defaultState: NotificationsState = {
userAgreements: { userAgreements: {
fetching: null, fetching: null,
}, },
plugins: {
initializationError: null,
},
}, },
messages: { messages: {
tasks: { tasks: {
@ -805,6 +810,21 @@ export default function (state = defaultState, action: AnyAction): Notifications
}, },
}; };
} }
case PluginsActionTypes.RAISE_PLUGIN_CHECK_ERROR: {
return {
...state,
errors: {
...state.errors,
plugins: {
...state.errors.plugins,
initializationError: {
message: 'Could not initialize plugins state',
reason: action.payload.error.toString(),
},
},
},
};
}
case NotificationsActionType.RESET_ERRORS: { case NotificationsActionType.RESET_ERRORS: {
return { return {
...state, ...state,

Loading…
Cancel
Save