-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 disabling
the requests, improved notification links
#8197
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis series of changes enhances the CVAT application's handling of requests by introducing a new action for disabling requests and updating various components to use a custom markdown renderer. The updates improve error message formatting and state management, incorporating new props for better functionality. Overall, these modifications aim to streamline request management and enhance user notifications within the application. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant RequestsActions
participant RequestsReducer
User->>App: Trigger request disable
App->>RequestsActions: Dispatch DISABLE_REQUEST
RequestsActions-->>RequestsReducer: Update state to disable request
RequestsReducer-->>App: New state with disabled request
App-->>User: Show updated request status
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/tools-control.tsx (1)
790-790
: Integration ofCVATMarkdown
is missing inopencv-control.tsx
.The
checkTrackedStates
function intools-control.tsx
is correctly updated to useCVATMarkdown
. However, theopencv-control.tsx
file does not integrateCVATMarkdown
at all. Please ensure thatCVATMarkdown
is used consistently for error handling in both files.
opencv-control.tsx
needs to be updated to useCVATMarkdown
similarly totools-control.tsx
.Analysis chain
LGTM! But verify the function usage in the codebase.
The code changes are approved.
However, ensure that all instances of
checkTrackedStates
are updated to handle the newCVATMarkdown
component correctly.
Let's correct the file type and re-run the search to verify the usage of
checkTrackedStates
.
To ensure that
CVATMarkdown
is correctly integrated withcheckTrackedStates
, let's search forCVATMarkdown
usage within theopencv-control.tsx
andtools-control.tsx
files.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `checkTrackedStates` in the codebase. # Test: Search for the function usage. Expect: Instances of `checkTrackedStates` to be updated. rg --type python -A 5 $'checkTrackedStates'Length of output: 73
Script:
#!/bin/bash # Description: Verify all instances of `checkTrackedStates` in the codebase. # Test: Search for the function usage. Expect: Instances of `checkTrackedStates` to be updated. rg --type ts -A 5 'checkTrackedStates'Length of output: 3049
Script:
#!/bin/bash # Description: Verify the usage of `CVATMarkdown` in the relevant files. # Test: Search for `CVATMarkdown` usage in the specified files. rg 'CVATMarkdown' cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/opencv-control.tsx cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/tools-control.tsxLength of output: 1414
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (13)
- cvat-ui/src/actions/requests-actions.ts (2 hunks)
- cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/tools-control.tsx (7 hunks)
- cvat-ui/src/components/common/cvat-markdown.tsx (1 hunks)
- cvat-ui/src/components/cvat-app.tsx (6 hunks)
- cvat-ui/src/components/export-backup/export-backup-modal.tsx (4 hunks)
- cvat-ui/src/components/export-dataset/export-dataset-modal.tsx (4 hunks)
- cvat-ui/src/components/import-dataset/import-dataset-modal.tsx (4 hunks)
- cvat-ui/src/components/requests-page/request-card.tsx (6 hunks)
- cvat-ui/src/components/requests-page/requests-list.tsx (1 hunks)
- cvat-ui/src/reducers/index.ts (1 hunks)
- cvat-ui/src/reducers/notifications-reducer.ts (2 hunks)
- cvat-ui/src/reducers/requests-reducer.ts (2 hunks)
- cvat-ui/src/styles.scss (1 hunks)
Files skipped from review due to trivial changes (2)
- cvat-ui/src/reducers/notifications-reducer.ts
- cvat-ui/src/styles.scss
Additional comments not posted (28)
cvat-ui/src/components/common/cvat-markdown.tsx (4)
1-4
: LGTM! Import statements are appropriate.The import statements include necessary libraries and components.
6-6
: LGTM! Type definition is clear and correct.The type alias
UseHistoryType
is defined correctly.
8-27
: LGTM! Higher-order component implementation is clear and correct.The HOC
RouterLinkHOC
correctly handles internal and external links.
29-41
: LGTM! Function implementation is clear and correct.The function
CVATMarkdown
correctly integrates custom link handling withReactMarkdown
.cvat-ui/src/reducers/requests-reducer.ts (2)
14-14
: LGTM! State changes are clear and correct.The addition of the
disabled
array indefaultState
aligns with the new functionality.
36-42
: LGTM! Reducer changes are clear and correct.The new case for
DISABLE_REQUEST
correctly updates thedisabled
array in the state.cvat-ui/src/components/requests-page/requests-list.tsx (2)
36-36
: LGTM! State usage changes are clear and correct.The
disabled
state property is correctly retrieved from the Redux store.
39-44
: LGTM! Request rendering changes are clear and correct.The
RequestCard
component correctly receives adisabled
prop based on thedisabled
state property.cvat-ui/src/actions/requests-actions.ts (2)
24-24
: LGTM! New action typeDISABLE_REQUEST
added toRequestsActionsTypes
.The addition follows the existing pattern and enhances the set of actions for request management.
48-50
: LGTM! New action creatordisableRequest
added torequestsActions
.The addition follows the existing pattern and correctly uses the
createAction
function.cvat-ui/src/components/export-backup/export-backup-modal.tsx (2)
Line range hint
8-18
:
LGTM! Import statements updated to useCVATMarkdown
anduseHistory
hook.The changes follow the existing pattern and enhance the component's functionality.
105-109
: LGTM! Notification logic updated to useCVATMarkdown
withhistory
prop.The changes follow the existing pattern and enhance the component's functionality.
cvat-ui/src/components/export-dataset/export-dataset-modal.tsx (2)
Line range hint
9-20
:
LGTM! Import statements updated to useCVATMarkdown
anduseHistory
hook.The changes follow the existing pattern and enhance the component's functionality.
126-126
: LGTM! Notification logic updated to useCVATMarkdown
withhistory
prop.The changes follow the existing pattern and enhance the component's functionality.
cvat-ui/src/components/requests-page/request-card.tsx (6)
23-23
: LGTM!The import statement for
requestsActions
is appropriate and necessary for the new functionality.
28-28
: LGTM!The addition of the
disabled
prop to theProps
interface is appropriate and aligns with the new functionality.
141-141
: LGTM!Destructuring the
disabled
prop fromprops
is necessary and correctly implemented.
156-158
: LGTM!Adjusting the
style
object based on thedisabled
state is a good approach to visually indicate the disabled state.
170-170
: LGTM!Dispatching the
requestsActions.disableRequest(request)
action after downloading is appropriate and necessary.
182-182
: LGTM!Dispatching the
requestsActions.disableRequest(request)
action after canceling is appropriate and necessary.cvat-ui/src/reducers/index.ts (1)
956-956
: LGTM!Renaming the
urls
property todisabled
in theRequestsState
interface is appropriate and aligns with the new functionality.cvat-ui/src/components/import-dataset/import-dataset-modal.tsx (3)
9-9
: LGTM!The import statements for
useHistory
andCVATMarkdown
are appropriate and necessary for the new functionality.Also applies to: 22-22
282-282
: LGTM!Using the
useHistory
hook to get thehistory
object is appropriate and necessary for navigation purposes.
471-471
: LGTM!Using the
CVATMarkdown
component to render the notification description is appropriate and likely provides additional functionality or styling specific to the CVAT application.cvat-ui/src/components/cvat-app.tsx (2)
361-369
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all instances of
showMessages
are updated to handle the newCVATMarkdown
component correctly.Verification successful
Let's correct the file type and function name, and re-run the script to verify the usage of
showMessage
in the codebase.
Let's update the script to search within both
ts
andtsx
files to verify the usage ofshowMessage
in the codebase.
The
showMessage
function is correctly used in the codebase.The function
showMessage
is defined and utilized appropriately withincvat-ui/src/components/cvat-app.tsx
. Other instances found in the codebase are related to a different function (showMessageWithPause
) and do not impact theshowMessage
function.
cvat-ui/src/components/cvat-app.tsx
cvat-core/src/annotations-actions.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `showMessages` in the codebase. # Test: Search for the function usage. Expect: Instances of `showMessages` to be updated. rg --type python -A 5 $'showMessages'Length of output: 67
Script:
#!/bin/bash # Description: Verify all instances of `showMessage` in the codebase. # Test: Search for the function usage. Expect: Instances of `showMessage` to be updated. rg --type tsx -A 5 'showMessage'Length of output: 60
Script:
#!/bin/bash # Description: Verify all instances of `showMessage` in the codebase. # Test: Search for the function usage. Expect: Instances of `showMessage` to be updated. rg --type-add 'ts:*.{ts,tsx}' -A 5 'showMessage'Length of output: 2836
Line range hint
392-408
:
LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all instances of
showErrors
are updated to handle the newCVATMarkdown
component correctly.Verification successful
LGTM! All instances of
showErrors
have been updated to handle the newCVATMarkdown
component correctly.
cvat-ui/src/components/cvat-app.tsx
: TheshowErrors
function is defined and used within this file, and it correctly utilizes theCVATMarkdown
component.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `showErrors` in the codebase. # Test: Search for the function usage. Expect: Instances of `showErrors` to be updated. rg --type python -A 5 $'showErrors'Length of output: 65
Script:
#!/bin/bash # Description: Verify all instances of `showErrors` in the codebase. # Test: Search for the function usage. Expect: Instances of `showErrors` to be updated. rg --type ts,tsx -A 5 $'showErrors'Length of output: 65
Script:
#!/bin/bash # Description: Verify all instances of `showErrors` in the codebase. # Test: Search for the function usage. Expect: Instances of `showErrors` to be updated. rg --type typescript,tsx -A 5 $'showErrors'Length of output: 81
Script:
#!/bin/bash # Description: Verify all instances of `showErrors` in the codebase. # Test: Search for the function usage. Expect: Instances of `showErrors` to be updated. rg --type ts,tsx -A 5 'showErrors'Length of output: 65
Script:
#!/bin/bash # Description: Verify all instances of `showErrors` in the codebase. # Test: Search for the function usage. Expect: Instances of `showErrors` to be updated. rg --type-add 'typescript:*.ts' --type-add 'tsx:*.tsx' -t typescript -t tsx -A 5 'showErrors'Length of output: 1049
cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/tools-control.tsx (2)
443-443
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all instances of
runInteractionRequest
are updated to handle the newCVATMarkdown
component correctly.Verification successful
Verification successful.
All instances of
runInteractionRequest
are correctly updated to handle the newCVATMarkdown
component within the same file.
cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/tools-control.tsx
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `runInteractionRequest` in the codebase. # Test: Search for the function usage. Expect: Instances of `runInteractionRequest` to be updated. rg --type python -A 5 $'runInteractionRequest'Length of output: 76
Script:
#!/bin/bash # Description: Verify all instances of `runInteractionRequest` in the codebase. # Test: Search for the function usage. Expect: Instances of `runInteractionRequest` to be updated. rg --type tsx -A 5 $'runInteractionRequest'Length of output: 70
Script:
#!/bin/bash # Description: Verify all instances of `runInteractionRequest` in the codebase. # Test: Search for the function usage. Expect: Instances of `runInteractionRequest` to be updated. rg 'runInteractionRequest' --glob '*.tsx' -A 5Length of output: 2612
536-536
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all instances of
onTracking
are updated to handle the newCVATMarkdown
component correctly.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #8197 +/- ##
===========================================
+ Coverage 83.31% 83.32% +0.01%
===========================================
Files 388 388
Lines 41348 41352 +4
Branches 3855 3856 +1
===========================================
+ Hits 34448 34458 +10
+ Misses 6900 6894 -6
|
Quality Gate passedIssues Measures |
Motivation and context
The pr adresses two problems:
<a>
tags, using which reloads the page.How has this been tested?
Manual
Checklist
develop
branch[ ] I have updated the documentation accordingly[ ] I have added tests to cover my changes[ ] I have linked related issues (see GitHub docs)(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.
Summary by CodeRabbit
New Features
CVATMarkdown
component for improved rendering of markdown content in error notifications.Enhancements
ReactMarkdown
withCVATMarkdown
across various components for consistent error message formatting.disabled
prop toRequestCard
component to manage interactive states.Bug Fixes
Styles