Skip to content

Commit

Permalink
Fixed UI fails when inactive user is assigneed to a task/job (cvat-ai…
Browse files Browse the repository at this point in the history
…#3343)

* Fixed UI fails when inactive user is assigneed to a task/job

* Updated changelog

* Fixed tests
  • Loading branch information
Boris Sekachev committed Jun 18, 2021
1 parent 0d56e29 commit 8a64394
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- TypeError: Cannot read property 'clientX' of undefined when draw cuboids with hotkeys (<https://github.com/openvinotoolkit/cvat/pull/3308>)
- Duplication of the cuboids when redraw them (<https://github.com/openvinotoolkit/cvat/pull/3308>)
- Some code issues in Deep Extreme Cut handler code (<https://github.com/openvinotoolkit/cvat/pull/3325>)
- UI fails when inactive user is assigneed to a task/job (<https://github.com/openvinotoolkit/cvat/pull/3343>)

### Security

Expand Down
2 changes: 1 addition & 1 deletion 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": "3.13.2",
"version": "3.13.3",
"description": "Part of Computer Vision Tool which presents an interface for client-side integration",
"main": "babel.config.js",
"scripts": {
Expand Down
5 changes: 1 addition & 4 deletions cvat-core/src/api-implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@
users = await serverProxy.users.self();
users = [users];
} else {
// get list of active users as default
const searchParams = {
is_active: true,
};
const searchParams = {};
for (const key in filter) {
if (filter[key] && key !== 'self') {
searchParams[key] = filter[key];
Expand Down
2 changes: 1 addition & 1 deletion 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.20.4",
"version": "1.20.5",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions cvat-ui/src/components/task-page/user-selector.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2020-2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -29,6 +29,7 @@ const searchUsers = debounce(
.get({
search: searchValue,
limit: 10,
is_active: true,
})
.then((result: User[]) => {
if (result) {
Expand All @@ -50,7 +51,7 @@ export default function UserSelector(props: Props): JSX.Element {
const autocompleteRef = useRef<RefSelectProps | null>(null);

useEffect(() => {
core.users.get({ limit: 10 }).then((result: User[]) => {
core.users.get({ limit: 10, is_active: true }).then((result: User[]) => {
if (result) {
setInitialUsers(result);
}
Expand Down
6 changes: 2 additions & 4 deletions tests/cypress/support/commands_review_pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ Cypress.Commands.add('resolveReopenIssue', (issueLabel, resolveText, reopen) =>
cy.get('.cvat-issue-dialog-input').type(resolveText);
cy.get('.cvat-issue-dialog-footer').within(() => {
cy.contains('button', 'Comment').click();
reopen
? cy.contains('button', 'Reopen').click()
: cy.contains('button', 'Resolve').click();
reopen ? cy.contains('button', 'Reopen').click() : cy.contains('button', 'Resolve').click();
});
if (reopen) cy.get('.cvat-issue-dialog-header').find('[aria-label="close"]').click();
cy.wait('@postComment').its('response.statusCode').should('equal', 201);
Expand All @@ -157,7 +155,7 @@ Cypress.Commands.add('submitReview', (decision, user) => {
cy.get('.cvat-submit-review-dialog').within(() => {
cy.contains(new RegExp(`^${decision}$`, 'g')).click();
if (decision === 'Review next') {
cy.intercept('GET', `/api/v1/users?is_active=true&search=${user}&limit=10`).as('searchUsers');
cy.intercept('GET', `/api/v1/users?search=${user}&limit=10&is_active=true`).as('searchUsers');
cy.get('.cvat-user-search-field').within(() => {
cy.get('input[type="search"]').clear().type(`${user}`);
cy.wait('@searchUsers').its('response.statusCode').should('equal', 200);
Expand Down

0 comments on commit 8a64394

Please sign in to comment.