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

Requests page #7537

Open
wants to merge 163 commits into
base: develop
Choose a base branch
from
Open

Requests page #7537

wants to merge 163 commits into from

Conversation

klakhov
Copy link
Contributor

@klakhov klakhov commented Feb 29, 2024

Motivation and context

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced progress tracking for dataset export and backup operations.
    • Improved import dataset progress visibility with dynamic messages.
  • Bug Fixes

    • Fixed navigation flow in multiple Cypress test scripts by adding cy.goBack() after export operations.
    • Corrected notification handling in various test cases.
  • Refactor

    • Removed unused state properties and hooks related to importing and backupIsActive across multiple components.
    • Restructured state management in reducers for export and import actions.
  • Tests

    • Updated Cypress commands for downloading exports and verifying downloads.
    • Added new commands for better test flow management in Cypress scripts.
  • Documentation

    • Updated copyright year in various components.
  • Chores

    • Added new error handling and notification messages for request-related actions.

@bsekachev
Copy link
Member

bsekachev commented May 29, 2024

Something does not work when I am testing the feature with organization. I see three problems:

  1. In organization I can't see request for creating a task within the same organization
  2. But I see request for creating a task that was initiated outside the organization
  3. In personal workspace, I see export annotation requests, made within the organization

@Marishka17 they are probably server-side issues.

cvat-core/src/api.ts Outdated Show resolved Hide resolved
cvat-ui/src/components/requests-page/requests-page.tsx Outdated Show resolved Hide resolved
Comment on lines +25 to +32
const updatedQuery = { ...query };
const queryParams = new URLSearchParams(history.location.search);
for (const key of Object.keys(updatedQuery)) {
(updatedQuery as Indexable)[key] = queryParams.get(key) || null;
if (key === 'page') {
updatedQuery.page = updatedQuery.page ? +updatedQuery.page : 1;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

We only have one query parameter, the code may be significantly simpler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes but its our general approach. We do the same on other pages, I dont see the reason not to use it here. We can add another params later

cvat-ui/src/components/requests-page/styles.scss Outdated Show resolved Hide resolved
Comment on lines 7 to 23
.cvat-requests-scrollbar {
&::-webkit-scrollbar {
background-color: #fff;
width: 16px;
}

&::-webkit-scrollbar-track {
background-color: #fff;
}

&::-webkit-scrollbar-thumb {
background-color: #babac0;
border-radius: 16px;
border: 6px solid #fff;
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Why did you decide to use vendor-specific css selectors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe we cant make pretty scrollbar with standard selectors. It works fine in chrome as its our main supported browser

cvat-ui/src/components/requests-page/styles.scss Outdated Show resolved Hide resolved
cvat-ui/src/components/requests-page/styles.scss Outdated Show resolved Hide resolved
cvat-ui/src/components/requests-page/requests-list.tsx Outdated Show resolved Hide resolved
cvat-ui/src/components/requests-page/requests-list.tsx Outdated Show resolved Hide resolved
Comment on lines 58 to 61
dispatch(getRequestsAsync({
...query,
page: newPage,
}));
Copy link
Member

Choose a reason for hiding this comment

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

serverProxy:getRequestsAsync uses fetchAll. By the way, why???

If it already fetched all list, why do you call getRequestsAsync?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed that call.
Dont we need to check for all requests status? There can be more than 10 in progress. We want notifications for those when they are completed

cvat-ui/src/components/requests-page/requests-list.tsx Outdated Show resolved Hide resolved
cvat-core/src/config.ts Outdated Show resolved Hide resolved
cvat-core/src/requests-manager.ts Outdated Show resolved Hide resolved
@@ -495,3 +495,26 @@ export interface SerializedAPISchema {
url: string;
};
}

export interface SerializedRequest {
id?: string;
Copy link
Member

Choose a reason for hiding this comment

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

why having id is not guaranteed?

tha same about created_date and owner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. When we create task, we use the same request callback, so we create fake Request instances. We dont have an ID while uploading data, also it wouldnt be pretty to construct a created_date and owner here.

@bsekachev
Copy link
Member

  • The card shows a link to a task that has been deleted
    image

  • One more found problem is that in develop if you try to create a task and creating thread will be failed (for example try to upload a text file as data, or broken image file), UI will send a request to remove the task after failing. However with this patch - it will not, so, we may see failed tasks in the list.

@bsekachev
Copy link
Member

I already mentioned this, but did not get answer.
image

Why is TTL 20 minutes for exports???
Now downloading does not start automatically anymore, so, it will not work.
If a user does not catch manually a finished job in 20 minutes, will it be necessary to export from scratch?

@klakhov
Copy link
Contributor Author

klakhov commented May 31, 2024

  • Fixed links to deleted tasks
  • Added back deleting of tasks failed to create
    Concerning TTL for exports, its not actually 20mins, its just a visual bug. It seems we get timestamp for expire from server in wrong format so its displayed incorrecty. I beleive Maria is already working on this.

@Marishka17 Marishka17 requested a review from mdacoca as a code owner June 9, 2024 07:03
Copy link

sonarcloud bot commented Jun 9, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

field_name=StorageType.TARGET,
)
except ValueError as ex:
raise serializers.ValidationError(str(ex)) from ex

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants