Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release v2.1.0 #4556

Merged
merged 37 commits into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b0e6074
Update CHANGELOG and the server version
Mar 4, 2022
2c863f0
Added ATLANTIS in README. (#4423)
smhassanerfani Mar 9, 2022
42fdea9
fixed: Permission error occured when accessing the JobCommits #4434 (…
k1won Mar 9, 2022
c69f10b
fixed: job assignee can remove or update any issue created by the tas…
k1won Mar 10, 2022
3dc4371
Feature/fixed build macos (#4414)
evekeen Mar 10, 2022
53f6699
Fixed bug: Incorrect point deletion with keyboard shortcut (#4420)
klakhov Mar 11, 2022
1225fbb
Enhanced filtration/sorting for tasks/projects/tasks in projects/clou…
bsekachev Mar 11, 2022
1fa2676
Tus for task annotations import (#4327)
klakhov Mar 11, 2022
09e9084
Bump pillow from 9.0.0 to 9.0.1 in /utils/dataset_manifest (#4447)
dependabot[bot] Mar 12, 2022
c360852
Bump pillow from 9.0.0 to 9.0.1 in /utils/dicom_converter (#4446)
dependabot[bot] Mar 12, 2022
7ef553f
Create SECURITY.md
Mar 12, 2022
2b81592
Fix a linter issue with SECURITY.md file
Mar 14, 2022
fc520a3
Intel® Bug Bounty Program (#4454)
Mar 14, 2022
8810125
Remote files test (#4443)
Mar 14, 2022
751937b
Added missing geos dependency (#4451)
evekeen Mar 14, 2022
be334fd
Update REST API documentation (#4391)
Marishka17 Mar 14, 2022
6dd73b0
Improve REST API testing system (#4403)
Mar 16, 2022
93ccf21
Better readme to Helm chart (#4366)
kbegiedza Mar 16, 2022
b7e881f
fix linter issue (#4488)
Marishka17 Mar 18, 2022
d42e37c
Update documentation. Update sections about pages (#4480)
TOsmanov Mar 18, 2022
dd60b2d
REST API tests: patch tasks, post/patch issues (#4465)
ActiveChooN Mar 18, 2022
bceae22
Tus for project dataset (#4485)
klakhov Mar 22, 2022
96af4f1
Support paginated list for job commits #4476 (#4482)
k1won Mar 23, 2022
2a05316
Add REST API GET, POST, PATCH tests for cloud storage (#4353)
Marishka17 Mar 24, 2022
0fc15d7
Bump minimist from 1.2.5 to 1.2.6 in /cvat-core (#4509)
dependabot[bot] Mar 25, 2022
c96e353
Bump minimist from 1.2.5 to 1.2.6 in /cvat-ui (#4510)
dependabot[bot] Mar 25, 2022
940548d
Bump minimist from 1.2.5 to 1.2.6 in /tests (#4511)
dependabot[bot] Mar 25, 2022
2fb2a6a
Add a link on JSON:API
Mar 25, 2022
21251b5
added reset of activeShapeType (#4517)
klakhov Mar 25, 2022
449ae0c
fixed: Unable to upload annotations #4459 (#4513)
k1won Mar 25, 2022
eb63420
Return the response from the AI tool (#4432) (#4505)
amteusch Mar 25, 2022
6fd7a0e
Support CVAT 2.X deployment using helm (#4448)
se-wo Mar 27, 2022
737ee71
fix build dependencies for Siammask (#4486)
VRichardJP Mar 30, 2022
2b6fe74
Fix filter (#4541)
Marishka17 Apr 4, 2022
d22b12d
EXIF orientation support (#4529)
ActiveChooN Apr 4, 2022
de30cb2
REST API tests: project accessibility (#4496)
ivk Apr 5, 2022
119a27b
Release v2.1.0
nmanovic Apr 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enhanced filtration/sorting for tasks/projects/tasks in projects/clou…
…d storages (#4409)
  • Loading branch information
bsekachev authored Mar 11, 2022
commit 1225fbb1bcf2b4b508e132e1dff29d896682c71a
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## \[2.1.0] - Unreleased
### Added
- TDB
- Advanced filtration and sorting for a list of tasks/projects/cloudstorages (<https://github.com/openvinotoolkit/cvat/pull/4403>)

### Changed
- TDB
Expand Down
4 changes: 2 additions & 2 deletions cvat-core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cvat-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-core",
"version": "4.2.1",
"version": "5.0.0",
"description": "Part of Computer Vision Tool which presents an interface for client-side integration",
"main": "babel.config.js",
"scripts": {
Expand Down
65 changes: 33 additions & 32 deletions cvat-core/src/api-implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const config = require('./config');
isString,
checkFilter,
checkExclusiveFields,
camelToSnake,
checkObjectType,
} = require('./common');

Expand Down Expand Up @@ -171,7 +170,14 @@ const config = require('./config');
}
}

const jobsData = await serverProxy.jobs.get(filter);
const searchParams = {};
for (const key of Object.keys(filter)) {
if (['page', 'sort', 'search', 'filter'].includes(key)) {
searchParams[key] = filter[key];
}
}

const jobsData = await serverProxy.jobs.get(searchParams);
const jobs = jobsData.results.map((jobData) => new Job(jobData));
jobs.count = jobsData.count;
return jobs;
Expand All @@ -182,32 +188,33 @@ const config = require('./config');
page: isInteger,
projectId: isInteger,
id: isInteger,
sort: isString,
search: isString,
filter: isString,
ordering: isString,
});

checkExclusiveFields(filter, ['id', 'projectId'], ['page']);

const searchParams = {};
for (const field of [
'filter',
'search',
'ordering',
'id',
'page',
'projectId',
]) {
if (Object.prototype.hasOwnProperty.call(filter, field)) {
searchParams[camelToSnake(field)] = filter[field];
for (const key of Object.keys(filter)) {
if (['page', 'id', 'sort', 'search', 'filter', 'ordering'].includes(key)) {
searchParams[key] = filter[key];
}
}

const tasksData = await serverProxy.tasks.get(searchParams);
const tasks = tasksData.map((task) => new Task(task));
let tasksData = null;
if (filter.projectId) {
if (searchParams.filter) {
const parsed = JSON.parse(searchParams.filter);
searchParams.filter = JSON.stringify({ and: [parsed, { '==': [{ var: 'project_id' }, filter.projectId] }] });
} else {
searchParams.filter = JSON.stringify({ and: [{ '==': [{ var: 'project_id' }, filter.projectId] }] });
}
}

tasksData = await serverProxy.tasks.get(searchParams);
const tasks = tasksData.map((task) => new Task(task));
tasks.count = tasksData.count;

return tasks;
};

Expand All @@ -216,15 +223,15 @@ const config = require('./config');
id: isInteger,
page: isInteger,
search: isString,
sort: isString,
filter: isString,
});

checkExclusiveFields(filter, ['id'], ['page']);

const searchParams = {};
for (const field of ['filter', 'search', 'status', 'id', 'page']) {
if (Object.prototype.hasOwnProperty.call(filter, field)) {
searchParams[camelToSnake(field)] = filter[field];
for (const key of Object.keys(filter)) {
if (['id', 'page', 'search', 'sort', 'page'].includes(key)) {
searchParams[key] = filter[key];
}
}

Expand All @@ -246,25 +253,19 @@ const config = require('./config');
checkFilter(filter, {
page: isInteger,
filter: isString,
sort: isString,
id: isInteger,
search: isString,
});

checkExclusiveFields(filter, ['id', 'search'], ['page']);

const searchParams = new URLSearchParams();
for (const field of [
'filter',
'search',
'id',
'page',
]) {
if (Object.prototype.hasOwnProperty.call(filter, field)) {
searchParams.set(camelToSnake(field), filter[field]);
const searchParams = {};
for (const key of Object.keys(filter)) {
if (['page', 'filter', 'sort', 'id', 'search'].includes(key)) {
searchParams[key] = filter[key];
}
}

const cloudStoragesData = await serverProxy.cloudStorages.get(searchParams.toString());
const cloudStoragesData = await serverProxy.cloudStorages.get(searchParams);
const cloudStorages = cloudStoragesData.map((cloudStorage) => new CloudStorage(cloudStorage));
cloudStorages.count = cloudStoragesData.count;
return cloudStorages;
Expand Down
11 changes: 0 additions & 11 deletions cvat-core/src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@
return true;
}

function camelToSnake(str) {
if (typeof str !== 'string') {
throw new ArgumentError('str is expected to be string');
}

return (
str[0].toLowerCase() + str.slice(1, str.length).replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`)
);
}

class FieldUpdateTrigger {
constructor() {
let updatedFlags = {};
Expand Down Expand Up @@ -136,7 +126,6 @@
checkFilter,
checkObjectType,
checkExclusiveFields,
camelToSnake,
FieldUpdateTrigger,
};
})();
6 changes: 4 additions & 2 deletions cvat-core/src/server-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1521,13 +1521,15 @@
}
}

async function getCloudStorages(filter = '') {
async function getCloudStorages(filter = {}) {
const { backendAPI } = config;

let response = null;
try {
response = await Axios.get(`${backendAPI}/cloudstorages?page_size=12&${filter}`, {
response = await Axios.get(`${backendAPI}/cloudstorages`, {
proxy: config.proxy,
params: filter,
page_size: 12,
});
} catch (errorData) {
throw generateError(errorData);
Expand Down
4 changes: 2 additions & 2 deletions cvat-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cvat-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.36.0",
"version": "1.37.0",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
30 changes: 3 additions & 27 deletions cvat-ui/src/actions/cloud-storage-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { Dispatch, ActionCreator } from 'redux';
import { ActionUnion, createAction, ThunkAction } from 'utils/redux';
import getCore from 'cvat-core-wrapper';
import { CloudStoragesQuery, CloudStorage } from 'reducers/interfaces';
import { CloudStoragesQuery, CloudStorage, Indexable } from 'reducers/interfaces';

const cvat = getCore();

Expand Down Expand Up @@ -103,40 +103,16 @@ export type CloudStorageActions = ActionUnion<typeof cloudStoragesActions>;

export function getCloudStoragesAsync(query: Partial<CloudStoragesQuery>): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
function camelToSnake(str: string): string {
return (
str[0].toLowerCase() + str.slice(1, str.length)
.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`)
);
}

dispatch(cloudStoragesActions.getCloudStorages());
dispatch(cloudStoragesActions.updateCloudStoragesGettingQuery(query));

const filteredQuery = { ...query };
for (const key in filteredQuery) {
if (filteredQuery[key] === null) {
delete filteredQuery[key];
if ((filteredQuery as Indexable)[key] === null) {
delete (filteredQuery as Indexable)[key];
}
}

// Temporary hack to do not change UI currently for cloud storages
// Will be redesigned in a different PR
const filter = {
and: ['displayName', 'resource', 'description', 'owner', 'providerType', 'credentialsType'].reduce<object[]>((acc, filterField) => {
if (filterField in filteredQuery) {
acc.push({ '==': [{ var: camelToSnake(filterField) }, filteredQuery[filterField]] });
delete filteredQuery[filterField];
}

return acc;
}, []),
};

if (filter.and.length) {
filteredQuery.filter = JSON.stringify(filter);
}

let result = null;
try {
result = await cvat.cloudStorages.get(filteredQuery);
Expand Down
4 changes: 2 additions & 2 deletions cvat-ui/src/actions/import-actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2021 Intel Corporation
// Copyright (C) 2021-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -52,7 +52,7 @@ export const importDatasetAsync = (instance: any, format: string, file: File): T
}

dispatch(importActions.importDatasetSuccess());
dispatch(getProjectsAsync({ id: instance.id }));
dispatch(getProjectsAsync({ id: instance.id }, getState().projects.tasksGettingQuery));
}
);

Expand Down
15 changes: 8 additions & 7 deletions cvat-ui/src/actions/jobs-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { ActionUnion, createAction, ThunkAction } from 'utils/redux';
import getCore from 'cvat-core-wrapper';
import { JobsQuery } from 'reducers/interfaces';
import { Indexable, JobsQuery } from 'reducers/interfaces';

const cvat = getCore();

Expand All @@ -30,12 +30,13 @@ export type JobsActions = ActionUnion<typeof jobsActions>;

export const getJobsAsync = (query: JobsQuery): ThunkAction => async (dispatch) => {
try {
// Remove all keys with null values from the query
const filteredQuery: Partial<JobsQuery> = { ...query };
if (filteredQuery.page === null) delete filteredQuery.page;
if (filteredQuery.filter === null) delete filteredQuery.filter;
if (filteredQuery.sort === null) delete filteredQuery.sort;
if (filteredQuery.search === null) delete filteredQuery.search;
// We remove all keys with null values from the query
const filteredQuery = { ...query };
for (const key of Object.keys(query)) {
if ((filteredQuery as Indexable)[key] === null) {
delete (filteredQuery as Indexable)[key];
}
}

dispatch(jobsActions.getJobs(filteredQuery));
const jobs = await cvat.jobs.get(filteredQuery);
Expand Down
38 changes: 13 additions & 25 deletions cvat-ui/src/actions/projects-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import { Dispatch, ActionCreator } from 'redux';

import { ActionUnion, createAction, ThunkAction } from 'utils/redux';
import { ProjectsQuery, TasksQuery, CombinedState } from 'reducers/interfaces';
import {
ProjectsQuery, TasksQuery, CombinedState, Indexable,
} from 'reducers/interfaces';
import { getTasksAsync } from 'actions/tasks-actions';
import { getCVATStore } from 'cvat-store';
import getCore from 'cvat-core-wrapper';
Expand Down Expand Up @@ -80,17 +82,19 @@ const projectActions = {
export type ProjectActions = ActionUnion<typeof projectActions>;

export function getProjectTasksAsync(tasksQuery: Partial<TasksQuery> = {}): ThunkAction<void> {
return (dispatch: ActionCreator<Dispatch>): void => {
return (dispatch: ActionCreator<Dispatch>, getState: () => CombinedState): void => {
const store = getCVATStore();
const state: CombinedState = store.getState();
dispatch(projectActions.updateProjectsGettingQuery({}, tasksQuery));
dispatch(projectActions.updateProjectsGettingQuery(
getState().projects.gettingQuery,
tasksQuery,
));
const query: Partial<TasksQuery> = {
...state.projects.tasksGettingQuery,
page: 1,
...tasksQuery,
};

dispatch(getTasksAsync(query));
dispatch(getTasksAsync(query, false));
};
}

Expand All @@ -107,29 +111,13 @@ export function getProjectsAsync(
...query,
};

for (const key in filteredQuery) {
if (filteredQuery[key] === null || typeof filteredQuery[key] === 'undefined') {
delete filteredQuery[key];
for (const key of Object.keys(filteredQuery)) {
const value = (filteredQuery as Indexable)[key];
if (value === null || typeof value === 'undefined') {
delete (filteredQuery as Indexable)[key];
}
}

// Temporary hack to do not change UI currently for projects
// Will be redesigned in a different PR
const filter = {
and: ['owner', 'assignee', 'name', 'status'].reduce<object[]>((acc, filterField) => {
if (filterField in filteredQuery) {
acc.push({ '==': [{ var: filterField }, filteredQuery[filterField]] });
delete filteredQuery[filterField];
}

return acc;
}, []),
};

if (filter.and.length) {
filteredQuery.filter = JSON.stringify(filter);
}

let result = null;
try {
result = await cvat.projects.get(filteredQuery);
Expand Down
Loading