-
Notifications
You must be signed in to change notification settings - Fork 7
Implement job cancelation feature #77
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
base: main
Are you sure you want to change the base?
Implement job cancelation feature #77
Conversation
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.
Pull request overview
This pull request implements a job cancellation feature that enables users to cancel running jobs from the job details page. The implementation includes backend API integration, UI components with loading states, and toast notifications for user feedback.
Key changes:
- Added backend API integration with a new
cancelJobfunction to handle POST requests for job cancellation - Implemented a "Cancel Job" button in the job details page with React Query mutation, conditional enabling based on job status, and loading state display
- Added global toast notification container to provide user feedback for cancellation operations
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| web/src/app/api/jobs/jobs.ts | Added cancelJob API function to send POST requests to the job cancellation endpoint |
| web/src/modules/Jobs/JobDetails/JobDetailsHeader.tsx | Integrated cancel mutation with React Query, added cancel button with conditional enabling, implemented toast notifications for success/error states, and included minor JSX formatting improvements |
| web/src/common/ClientLayout/ClientLayout.tsx | Added PatternToastContainer component to enable global toast notifications throughout the application |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Josh Diaz <joshua.michael.diaz@gmail.com>
Co-authored-by: Josh Diaz <joshua.michael.diaz@gmail.com>
This pull request adds the ability for users to cancel running jobs from the job details page and improves user feedback with toast notifications. The changes include backend API integration, UI enhancements, and improved state management for job cancellation.
Job Cancellation Feature:
cancelJobAPI function injobs.tsto send a POST request to cancel a job by its ID.JobDetailsHeader.tsx, which uses React Query's mutation to call the cancel API, disables the button unless the job is running, and displays "Cancelling..." while the request is pending.UI/UX Improvements:
PatternToastContainerto the app layout to ensure toast notifications are displayed globally.