-
Notifications
You must be signed in to change notification settings - Fork 3k
[WEB-5454] fix: optimize date validation logic in CycleCreateUpdateModal #8394
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
Conversation
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
WalkthroughUpdated date validation logic in the cycle modal component to conditionally check dates during updates only when start_date or end_date values have changed compared to the original data. Creation behavior for new cycles remains unchanged, with validation always performed. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (4)**/*.{ts,tsx,mts,cts}📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{js,jsx,ts,tsx,json,css}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (1)📓 Common learnings🧬 Code graph analysis (1)apps/web/core/components/cycles/modal.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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 PR optimizes the date validation logic in the cycle update flow to avoid unnecessary API calls. Previously, every cycle update would validate dates even when they hadn't changed. Now, date validation only occurs when dates are actually modified.
Key changes:
- Added date comparison logic to detect if start_date or end_date have changed
- Skips
dateCheckerAPI call when updating a cycle with unchanged dates - Maintains existing validation behavior for new cycle creation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
This PR refactors the logic of cycle updation to only validate the date when dates are changed.
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.