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

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

Merged
merged 3 commits into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dvkruchinin
Cypress tests failed because of this line. We do not really control the order of query parameters in these URLs (and probably we do not want to control it). Does cypress require exact order or maybe do you have ideas on how to improve it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the order must be followed. But in this case I think it can be processed through wildcard

cy.intercept('GET', '/api/v1/users*').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