Fixed UI fails when inactive user is assigneed to a task/job (#3343)

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

* Updated changelog

* Fixed tests
main
Boris Sekachev 5 years ago committed by GitHub
parent 0d56e2923f
commit 8a64394b8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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>) - 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>) - 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>) - 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 ### Security

@ -1,6 +1,6 @@
{ {
"name": "cvat-core", "name": "cvat-core",
"version": "3.13.2", "version": "3.13.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

@ -1,6 +1,6 @@
{ {
"name": "cvat-core", "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", "description": "Part of Computer Vision Tool which presents an interface for client-side integration",
"main": "babel.config.js", "main": "babel.config.js",
"scripts": { "scripts": {

@ -126,10 +126,7 @@
users = await serverProxy.users.self(); users = await serverProxy.users.self();
users = [users]; users = [users];
} else { } else {
// get list of active users as default const searchParams = {};
const searchParams = {
is_active: true,
};
for (const key in filter) { for (const key in filter) {
if (filter[key] && key !== 'self') { if (filter[key] && key !== 'self') {
searchParams[key] = filter[key]; searchParams[key] = filter[key];

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

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

@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation // Copyright (C) 2020-2021 Intel Corporation
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@ -29,6 +29,7 @@ const searchUsers = debounce(
.get({ .get({
search: searchValue, search: searchValue,
limit: 10, limit: 10,
is_active: true,
}) })
.then((result: User[]) => { .then((result: User[]) => {
if (result) { if (result) {
@ -50,7 +51,7 @@ export default function UserSelector(props: Props): JSX.Element {
const autocompleteRef = useRef<RefSelectProps | null>(null); const autocompleteRef = useRef<RefSelectProps | null>(null);
useEffect(() => { useEffect(() => {
core.users.get({ limit: 10 }).then((result: User[]) => { core.users.get({ limit: 10, is_active: true }).then((result: User[]) => {
if (result) { if (result) {
setInitialUsers(result); setInitialUsers(result);
} }

@ -144,9 +144,7 @@ Cypress.Commands.add('resolveReopenIssue', (issueLabel, resolveText, reopen) =>
cy.get('.cvat-issue-dialog-input').type(resolveText); cy.get('.cvat-issue-dialog-input').type(resolveText);
cy.get('.cvat-issue-dialog-footer').within(() => { cy.get('.cvat-issue-dialog-footer').within(() => {
cy.contains('button', 'Comment').click(); cy.contains('button', 'Comment').click();
reopen reopen ? cy.contains('button', 'Reopen').click() : cy.contains('button', 'Resolve').click();
? cy.contains('button', 'Reopen').click()
: cy.contains('button', 'Resolve').click();
}); });
if (reopen) cy.get('.cvat-issue-dialog-header').find('[aria-label="close"]').click(); if (reopen) cy.get('.cvat-issue-dialog-header').find('[aria-label="close"]').click();
cy.wait('@postComment').its('response.statusCode').should('equal', 201); cy.wait('@postComment').its('response.statusCode').should('equal', 201);
@ -157,7 +155,7 @@ Cypress.Commands.add('submitReview', (decision, user) => {
cy.get('.cvat-submit-review-dialog').within(() => { cy.get('.cvat-submit-review-dialog').within(() => {
cy.contains(new RegExp(`^${decision}$`, 'g')).click(); cy.contains(new RegExp(`^${decision}$`, 'g')).click();
if (decision === 'Review next') { 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('.cvat-user-search-field').within(() => {
cy.get('input[type="search"]').clear().type(`${user}`); cy.get('input[type="search"]').clear().type(`${user}`);
cy.wait('@searchUsers').its('response.statusCode').should('equal', 200); cy.wait('@searchUsers').its('response.statusCode').should('equal', 200);

Loading…
Cancel
Save