Merge branch 'release-1.7.0'
commit
967b0fee2c
@ -1,46 +1,45 @@
|
||||
// Copyright (C) 2019-2020 Intel Corporation
|
||||
// Copyright (C) 2019-2021 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
const globalConfig = require('../.eslintrc.js');
|
||||
|
||||
module.exports = {
|
||||
env: {
|
||||
node: true,
|
||||
},
|
||||
ignorePatterns: [
|
||||
'.eslintrc.js',
|
||||
'webpack.config.js',
|
||||
'node_modules/**',
|
||||
'dist/**',
|
||||
],
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser',
|
||||
ecmaVersion: 6,
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
plugins: ['@typescript-eslint', 'import'],
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'airbnb-typescript/base',
|
||||
'plugin:import/errors',
|
||||
'plugin:import/warnings',
|
||||
'plugin:import/typescript',
|
||||
],
|
||||
plugins: ['@typescript-eslint'],
|
||||
extends: ['plugin:@typescript-eslint/recommended', 'airbnb-typescript/base'],
|
||||
rules: {
|
||||
...globalConfig.rules,
|
||||
|
||||
'@typescript-eslint/no-explicit-any': 0,
|
||||
'@typescript-eslint/indent': ['warn', 4],
|
||||
'no-plusplus': 0,
|
||||
'no-restricted-syntax': [
|
||||
0,
|
||||
'@typescript-eslint/indent': ['error', 4],
|
||||
'@typescript-eslint/lines-between-class-members': 0,
|
||||
'@typescript-eslint/no-explicit-any': [0],
|
||||
'@typescript-eslint/explicit-function-return-type': ['warn', { allowExpressions: true }],
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/ban-types': [
|
||||
'error',
|
||||
{
|
||||
selector: 'ForOfStatement',
|
||||
types: {
|
||||
'{}': false, // TODO: try to fix with Record<string, unknown>
|
||||
object: false, // TODO: try to fix with Record<string, unknown>
|
||||
Function: false, // TODO: try to fix somehow
|
||||
},
|
||||
},
|
||||
],
|
||||
'max-len': ['error', { code: 120 }],
|
||||
'no-continue': 0,
|
||||
'func-names': 0,
|
||||
'no-console': 0, // this rule deprecates console.log, console.warn etc. because 'it is not good in production code'
|
||||
'lines-between-class-members': 0,
|
||||
'import/prefer-default-export': 0, // works incorrect with interfaces
|
||||
'newline-per-chained-call': 0, // makes code uglier
|
||||
},
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
node: {
|
||||
extensions: ['.ts', '.js', '.json'],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -1 +0,0 @@
|
||||
dist
|
||||
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
dist
|
||||
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
webpack.config.js
|
||||
@ -1,5 +0,0 @@
|
||||
docs
|
||||
node_modules
|
||||
reports
|
||||
yarn.lock
|
||||
dist
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
||||
**/3rdparty/*.js
|
||||
webpack.config.js
|
||||
@ -1 +0,0 @@
|
||||
dist
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,8 +0,0 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
/node_modules
|
||||
/dist
|
||||
/build
|
||||
/yarn.lock
|
||||
.eslintcache
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,210 @@
|
||||
// Copyright (C) 2021 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { Dispatch, ActionCreator } from 'redux';
|
||||
import { ActionUnion, createAction, ThunkAction } from 'utils/redux';
|
||||
import getCore from 'cvat-core-wrapper';
|
||||
import { CloudStoragesQuery, CloudStorage } from 'reducers/interfaces';
|
||||
|
||||
const cvat = getCore();
|
||||
|
||||
export enum CloudStorageActionTypes {
|
||||
UPDATE_CLOUD_STORAGES_GETTING_QUERY = 'UPDATE_CLOUD_STORAGES_GETTING_QUERY',
|
||||
GET_CLOUD_STORAGES = 'GET_CLOUD_STORAGES',
|
||||
GET_CLOUD_STORAGE_SUCCESS = 'GET_CLOUD_STORAGES_SUCCESS',
|
||||
GET_CLOUD_STORAGE_FAILED = 'GET_CLOUD_STORAGES_FAILED',
|
||||
GET_CLOUD_STORAGE_STATUS = 'GET_CLOUD_STORAGE_STATUS',
|
||||
GET_CLOUD_STORAGE_STATUS_SUCCESS = 'GET_CLOUD_STORAGE_STATUS_SUCCESS',
|
||||
GET_CLOUD_STORAGE_STATUS_FAILED = 'GET_CLOUD_STORAGE_STATUS_FAILED',
|
||||
GET_CLOUD_STORAGE_PREVIEW = 'GET_CLOUD_STORAGE_PREVIEW',
|
||||
GET_CLOUD_STORAGE_PREVIEW_SUCCESS = 'GET_CLOUD_STORAGE_PREVIEW_SUCCESS',
|
||||
GET_CLOUD_STORAGE_PREVIEW_FAILED = 'GET_CLOUD_STORAGE_PREVIEW_FAILED',
|
||||
CREATE_CLOUD_STORAGE = 'CREATE_CLOUD_STORAGE',
|
||||
CREATE_CLOUD_STORAGE_SUCCESS = 'CREATE_CLOUD_STORAGE_SUCCESS',
|
||||
CREATE_CLOUD_STORAGE_FAILED = 'CREATE_CLOUD_STORAGE_FAILED',
|
||||
DELETE_CLOUD_STORAGE = 'DELETE_CLOUD_STORAGE',
|
||||
DELETE_CLOUD_STORAGE_SUCCESS = 'DELETE_CLOUD_STORAGE_SUCCESS',
|
||||
DELETE_CLOUD_STORAGE_FAILED = 'DELETE_CLOUD_STORAGE_FAILED',
|
||||
UPDATE_CLOUD_STORAGE = 'UPDATE_CLOUD_STORAGE',
|
||||
UPDATE_CLOUD_STORAGE_SUCCESS = 'UPDATE_CLOUD_STORAGE_SUCCESS',
|
||||
UPDATE_CLOUD_STORAGE_FAILED = 'UPDATE_CLOUD_STORAGE_FAILED',
|
||||
LOAD_CLOUD_STORAGE_CONTENT = 'LOAD_CLOUD_STORAGE_CONTENT',
|
||||
LOAD_CLOUD_STORAGE_CONTENT_FAILED = 'LOAD_CLOUD_STORAGE_CONTENT_FAILED',
|
||||
LOAD_CLOUD_STORAGE_CONTENT_SUCCESS = 'LOAD_CLOUD_STORAGE_CONTENT_SUCCESS',
|
||||
}
|
||||
|
||||
const cloudStoragesActions = {
|
||||
updateCloudStoragesGettingQuery: (query: Partial<CloudStoragesQuery>) => (
|
||||
createAction(CloudStorageActionTypes.UPDATE_CLOUD_STORAGES_GETTING_QUERY, { query })
|
||||
),
|
||||
getCloudStorages: () => createAction(CloudStorageActionTypes.GET_CLOUD_STORAGES),
|
||||
getCloudStoragesSuccess: (
|
||||
array: any[],
|
||||
count: number,
|
||||
query: Partial<CloudStoragesQuery>,
|
||||
) => createAction(CloudStorageActionTypes.GET_CLOUD_STORAGE_SUCCESS, {
|
||||
array,
|
||||
count,
|
||||
query,
|
||||
}),
|
||||
getCloudStoragesFailed: (error: any, query: Partial<CloudStoragesQuery>) => (
|
||||
createAction(CloudStorageActionTypes.GET_CLOUD_STORAGE_FAILED, { error, query })
|
||||
),
|
||||
deleteCloudStorage: (cloudStorageID: number) => (
|
||||
createAction(CloudStorageActionTypes.DELETE_CLOUD_STORAGE, { cloudStorageID })
|
||||
),
|
||||
deleteCloudStorageSuccess: (cloudStorageID: number) => (
|
||||
createAction(CloudStorageActionTypes.DELETE_CLOUD_STORAGE_SUCCESS, { cloudStorageID })
|
||||
),
|
||||
deleteCloudStorageFailed: (error: any, cloudStorageID: number) => (
|
||||
createAction(CloudStorageActionTypes.DELETE_CLOUD_STORAGE_FAILED, { error, cloudStorageID })
|
||||
),
|
||||
createCloudStorage: () => createAction(CloudStorageActionTypes.CREATE_CLOUD_STORAGE),
|
||||
createCloudStorageSuccess: (cloudStorageID: number) => (
|
||||
createAction(CloudStorageActionTypes.CREATE_CLOUD_STORAGE_SUCCESS, { cloudStorageID })
|
||||
),
|
||||
createCloudStorageFailed: (error: any) => (
|
||||
createAction(CloudStorageActionTypes.CREATE_CLOUD_STORAGE_FAILED, { error })
|
||||
),
|
||||
updateCloudStorage: () => createAction(CloudStorageActionTypes.UPDATE_CLOUD_STORAGE, {}),
|
||||
updateCloudStorageSuccess: (cloudStorage: CloudStorage) => (
|
||||
createAction(CloudStorageActionTypes.UPDATE_CLOUD_STORAGE_SUCCESS, { cloudStorage })
|
||||
),
|
||||
updateCloudStorageFailed: (cloudStorage: CloudStorage, error: any) => (
|
||||
createAction(CloudStorageActionTypes.UPDATE_CLOUD_STORAGE_FAILED, { cloudStorage, error })
|
||||
),
|
||||
loadCloudStorageContent: () => createAction(CloudStorageActionTypes.LOAD_CLOUD_STORAGE_CONTENT),
|
||||
loadCloudStorageContentSuccess: (cloudStorageID: number, content: any) => (
|
||||
createAction(CloudStorageActionTypes.LOAD_CLOUD_STORAGE_CONTENT_SUCCESS, { cloudStorageID, content })
|
||||
),
|
||||
loadCloudStorageContentFailed: (cloudStorageID: number, error: any) => (
|
||||
createAction(CloudStorageActionTypes.LOAD_CLOUD_STORAGE_CONTENT_FAILED, { cloudStorageID, error })
|
||||
),
|
||||
getCloudStorageStatus: (id: number) => createAction(CloudStorageActionTypes.GET_CLOUD_STORAGE_STATUS, { id }),
|
||||
getCloudStorageStatusSuccess: (cloudStorageID: number, status: string) => (
|
||||
createAction(CloudStorageActionTypes.GET_CLOUD_STORAGE_STATUS_SUCCESS, { cloudStorageID, status })
|
||||
),
|
||||
getCloudStorageStatusFailed: (cloudStorageID: number, error: any) => (
|
||||
createAction(CloudStorageActionTypes.GET_CLOUD_STORAGE_STATUS_FAILED, { cloudStorageID, error })
|
||||
),
|
||||
getCloudStoragePreiew: (cloudStorageID: number) => (
|
||||
createAction(CloudStorageActionTypes.GET_CLOUD_STORAGE_PREVIEW, { cloudStorageID })
|
||||
),
|
||||
getCloudStoragePreiewSuccess: (cloudStorageID: number, preview: string) => (
|
||||
createAction(CloudStorageActionTypes.GET_CLOUD_STORAGE_PREVIEW_SUCCESS, { cloudStorageID, preview })
|
||||
),
|
||||
getCloudStoragePreiewFailed: (cloudStorageID: number, error: any) => (
|
||||
createAction(CloudStorageActionTypes.GET_CLOUD_STORAGE_PREVIEW_FAILED, { cloudStorageID, error })
|
||||
),
|
||||
};
|
||||
|
||||
export type CloudStorageActions = ActionUnion<typeof cloudStoragesActions>;
|
||||
|
||||
export function getCloudStoragesAsync(query: Partial<CloudStoragesQuery>): ThunkAction {
|
||||
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
|
||||
dispatch(cloudStoragesActions.getCloudStorages());
|
||||
dispatch(cloudStoragesActions.updateCloudStoragesGettingQuery(query));
|
||||
|
||||
const filteredQuery = { ...query };
|
||||
for (const key in filteredQuery) {
|
||||
if (filteredQuery[key] === null) {
|
||||
delete filteredQuery[key];
|
||||
}
|
||||
}
|
||||
|
||||
let result = null;
|
||||
try {
|
||||
result = await cvat.cloudStorages.get(filteredQuery);
|
||||
} catch (error) {
|
||||
dispatch(cloudStoragesActions.getCloudStoragesFailed(error, query));
|
||||
return;
|
||||
}
|
||||
|
||||
const array = Array.from(result);
|
||||
|
||||
dispatch(cloudStoragesActions.getCloudStoragesSuccess(
|
||||
array,
|
||||
result.count,
|
||||
query,
|
||||
));
|
||||
};
|
||||
}
|
||||
|
||||
export function deleteCloudStorageAsync(cloudStorageInstance: any): ThunkAction {
|
||||
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
|
||||
try {
|
||||
dispatch(cloudStoragesActions.deleteCloudStorage(cloudStorageInstance.id));
|
||||
await cloudStorageInstance.delete();
|
||||
} catch (error) {
|
||||
dispatch(cloudStoragesActions.deleteCloudStorageFailed(error, cloudStorageInstance.id));
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch(cloudStoragesActions.deleteCloudStorageSuccess(cloudStorageInstance.id));
|
||||
};
|
||||
}
|
||||
|
||||
export function createCloudStorageAsync(data: any): ThunkAction {
|
||||
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
|
||||
const cloudStorageInstance = new cvat.classes.CloudStorage(data);
|
||||
|
||||
dispatch(cloudStoragesActions.createCloudStorage());
|
||||
try {
|
||||
const savedCloudStorage = await cloudStorageInstance.save();
|
||||
dispatch(cloudStoragesActions.createCloudStorageSuccess(savedCloudStorage.id));
|
||||
} catch (error) {
|
||||
dispatch(cloudStoragesActions.createCloudStorageFailed(error));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function updateCloudStorageAsync(data: any): ThunkAction {
|
||||
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
|
||||
const cloudStorageInstance = new cvat.classes.CloudStorage(data);
|
||||
|
||||
dispatch(cloudStoragesActions.updateCloudStorage());
|
||||
try {
|
||||
const savedCloudStorage = await cloudStorageInstance.save();
|
||||
dispatch(cloudStoragesActions.updateCloudStorageSuccess(savedCloudStorage));
|
||||
} catch (error) {
|
||||
dispatch(cloudStoragesActions.updateCloudStorageFailed(data, error));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function loadCloudStorageContentAsync(cloudStorage: CloudStorage): ThunkAction {
|
||||
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
|
||||
dispatch(cloudStoragesActions.loadCloudStorageContent());
|
||||
try {
|
||||
const result = await cloudStorage.getContent();
|
||||
dispatch(cloudStoragesActions.loadCloudStorageContentSuccess(cloudStorage.id, result));
|
||||
} catch (error) {
|
||||
dispatch(cloudStoragesActions.loadCloudStorageContentFailed(cloudStorage.id, error));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function getCloudStorageStatusAsync(cloudStorage: CloudStorage): ThunkAction {
|
||||
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
|
||||
dispatch(cloudStoragesActions.getCloudStorageStatus(cloudStorage.id));
|
||||
try {
|
||||
const result = await cloudStorage.getStatus();
|
||||
dispatch(cloudStoragesActions.getCloudStorageStatusSuccess(cloudStorage.id, result));
|
||||
} catch (error) {
|
||||
dispatch(cloudStoragesActions.getCloudStorageStatusFailed(cloudStorage.id, error));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function getCloudStoragePreviewAsync(cloudStorage: CloudStorage): ThunkAction {
|
||||
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
|
||||
dispatch(cloudStoragesActions.getCloudStoragePreiew(cloudStorage.id));
|
||||
try {
|
||||
const result = await cloudStorage.getPreview();
|
||||
dispatch(cloudStoragesActions.getCloudStoragePreiewSuccess(cloudStorage.id, result));
|
||||
} catch (error) {
|
||||
dispatch(cloudStoragesActions.getCloudStoragePreiewFailed(cloudStorage.id, error));
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0)">
|
||||
<path d="M1.289 2.771L0 3.30333V12.6463L1.289 13.1755L1.29675 13.1678V2.77833L1.289 2.771Z" fill="#8C3123"/>
|
||||
<path d="M8.18756 11.8195L1.28906 13.1755V2.771L8.18756 4.0975V11.8195Z" fill="#E05243"/>
|
||||
<path d="M5.07349 9.69626L7.99961 10.0039L8.01798 9.96888L8.03442 6.00655L7.99961 5.97559L5.07349 6.27876V9.69626Z" fill="#8C3123"/>
|
||||
<path d="M7.99976 11.8347L14.7104 13.1784L14.721 13.1645L14.7208 2.78029L14.7102 2.771L7.99976 4.11273V11.8347Z" fill="#8C3123"/>
|
||||
<path d="M10.9267 9.69626L7.99976 10.0039V5.97559L10.9267 6.27876V9.69626Z" fill="#E05243"/>
|
||||
<path d="M10.9265 4.62622L7.99961 5.06674L5.07349 4.62622L7.99592 3.99365L10.9265 4.62622Z" fill="#5E1F18"/>
|
||||
<path d="M10.9265 11.3448L7.99961 10.9014L5.07349 11.3448L7.99605 12.0185L10.9265 11.3448Z" fill="#F2B0A9"/>
|
||||
<path d="M5.07349 4.62612L7.99961 4.02813L8.0233 4.02209V0.0161548L7.99961 0L5.07349 1.20841V4.62612Z" fill="#8C3123"/>
|
||||
<path d="M10.9267 4.62612L7.99976 4.02813V0L10.9267 1.20841V4.62612Z" fill="#E05243"/>
|
||||
<path d="M7.99968 15.9704L5.07324 14.7624V11.3447L7.99968 11.9425L8.04274 11.9829L8.03106 15.9006L7.99968 15.9704Z" fill="#8C3123"/>
|
||||
<path d="M7.99976 15.9704L10.9264 14.7624V11.3447L7.99976 11.9425V15.9704Z" fill="#E05243"/>
|
||||
<path d="M14.7104 2.771L16 3.30333V12.6463L14.7104 13.1784V2.771Z" fill="#E05243"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0">
|
||||
<rect width="16" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 428 B |
|
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 428 B |
@ -0,0 +1,4 @@
|
||||
<svg width="1em" height="1em" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.98 25.9939C18.55 25.2679 21.498 24.6669 21.532 24.6589L21.594 24.6439L18.224 20.0289C16.37 17.4909 14.854 15.4039 14.854 15.3919C14.854 15.3799 18.334 4.3359 18.354 4.2969C18.361 4.2839 20.729 8.9909 24.095 15.7079L29.869 27.2289L29.913 27.3169H8.49097L14.98 25.9939Z" fill="#0089D6"/>
|
||||
<path d="M2.125 24.586C2.125 24.58 3.713 21.406 5.654 17.533L9.183 10.492L13.3 6.52002C15.562 4.33502 17.419 2.54402 17.426 2.54102C17.4112 2.60727 17.3891 2.67167 17.36 2.73302L12.89 13.759L8.5 24.589H5.311C4.24902 24.5999 3.18696 24.5989 2.125 24.586V24.586Z" fill="#0089D6"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 683 B |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue