Conversation
|
@rockingrohit9639 is attempting to deploy a commit to the Whaleagency Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
- When you open edit of a kit, the current location of the kit is not loaded in the kit
- The absolute actions of the kit edit page are not being fixed at the top. They are moving as you scroll
- Kit location should be shown in the kit.overview not in the sidebar
There was a problem hiding this comment.
Some things i missed in the previous review:
- We need to add manage-kits route, same way it works with the booking so if you are on the location page you can add kits
- update-location-drawer.tsx should be updated to handle kits
- add-assets-to-location-drawer.tsx should be updated to handle kits.
This commit implements comprehensive kit location management with automatic cascading to contained assets, addressing all requirements from PR feedback: Core Features: - Kit location updates now cascade to all assets within the kit - Consistent location management across individual, bulk, and manage-kits interfaces - User warnings about cascade behavior in all relevant dialogs - Location visibility improvements in manage-kits interface Key Changes: - Enhanced updateKitLocation() to cascade changes to kit assets using single location.update operations - Added bulkUpdateKitLocation() cascade functionality with proper handling of location assignment and removal - Fixed bulk location removal to handle empty string values correctly (locationId: null) - Implemented cascade warnings in manage-kits interface with AlertDialog confirmation - Added location column to manage-kits list for better user visibility - Created getKitLocationUpdateNoteContent() function for consistent audit trail messaging - Updated note messages to show "changed from X to Y" format instead of just "set to Y" - Added cascade notice in individual kit location update modal - Added warning message in bulk location update dialog Technical Implementation: - Uses efficient location.update with connect/disconnect operations instead of multiple asset.updateMany calls - Creates individual audit notes for each affected asset with proper cascade attribution - Maintains existing permission and validation patterns - Preserves all existing functionality while adding new cascade behavior Testing: - Kit location assignment works with cascade to assets - Kit location removal works with cascade to assets - Bulk operations handle both assignment and removal correctly - All warning dialogs display appropriate information - Note creation works consistently across all update methods
|
@carlosvirreira there is one case we need to make a decision on how to handle. |
What do you suggest? Next time you online please call me and share me the view so i can better judge it and not imagine it, the context in which this situation is being triggered is important. I am doubting on what to suggest based on your last question if this should be desirable or not. |
This commit adds comprehensive location cascade when assets are added to kits, ensuring assets inherit their parent kit's location automatically. Key Features: - Assets added to kits automatically inherit the kit's location - Assets added to kits without locations lose their current location - User warnings inform about cascade behavior before actions - Proper audit trail with notes explaining location changes via kit assignment Implementation Details: - Enhanced updateKitAssets() function with location cascade logic - Added kit location data to manage-assets page loader - Created location-aware warning dialogs for all asset-to-kit addition methods - Fixed note creation order: kit assignment notes first, then location cascade notes User Interface Changes: - Added cascade warning in bulk-add-to-kit dialog - Enhanced kit manage-assets AlertDialog with location-specific warnings - Different warning messages based on whether kit has location or not - Always show warning dialog (previously only shown for custody cases) Coverage: - Bulk add assets to kit from assets index ✓ - Add assets via kit manage-assets page ✓ - Add assets via scanner (scan-assets) ✓ - Proper note sequencing and audit trail ✓ Technical Notes: - Uses efficient batch updates for asset locations - Maintains existing permission and validation patterns - Creates individual notes for each affected asset with proper attribution - Follows same patterns as existing kit location cascade functionality
Implements comprehensive validation to prevent location updates on assets that belong to kits, enforcing consistent location management through parent kits. Frontend Protection: - Asset edit page: Location select disabled with HoverCard tooltip for kit assets - Displays clear message directing users to update kit location instead - Kit information added to asset edit loader for proper detection Backend Validation: - updateAsset: Added kit validation with descriptive error messages - bulkUpdateAssetLocation: Added kit detection and batch validation - Prevents circumvention of frontend restrictions with safety mechanisms Error Handling: - Individual updates: "This asset's location is managed by its parent kit '[Kit Name]'. Please update the kit's location instead." - Bulk updates: "Cannot update location for assets that belong to kits: [Kit Names]. Update the kit locations instead." Test Coverage: - Added kit location cascade tests to verify asset-to-kit location inheritance - Tests cover both kit-with-location and kit-without-location scenarios - All existing tests continue to pass (27/27 tests passing) Data Consistency: - Enforces kit-based location management workflow - Prevents conflicting location states between kits and their assets - Maintains audit trail integrity with proper error reporting This completes the comprehensive kit location management system ensuring all location updates flow through kit management with appropriate user guidance.
|
🧪 Kit Location Management Testing Plan Overview Complete testing checklist for the kit location management system with cascade
Individual Kit Location Updates (/kits/{kitId}/assets/update-location)
Bulk Kit Location Updates (/api/kits/bulk-actions - bulk-update-location)
Location Manage-Kits Page (/locations/{locationId}/kits/manage-kits)
Bulk Add Assets to Kit (/api/assets/bulk-add-to-kit)
Kit Manage-Assets Page (/kits/{kitId}/assets/manage-assets)
Scanner Add Assets to Kit (/kits/{kitId}/scan-assets)
Asset Removal Behavior
Asset Edit Page (/assets/{assetId}/edit)
Asset Overview Location Modal (/assets/{assetId}/overview/update-location)
Bulk Asset Location Updates (/api/assets/bulk-update-location)
Note Content Verification
Note Creation Scenarios
Warning Messages and UI
Complex Scenarios
Data Integrity
Priority Testing Order 🔥 Critical (Must Test First)
🟡 High Priority
🟢 Medium Priority
@carlosvirreira this is ready for testing and deployed to our staging environment. I made a detailed test overview with everything that should be tested. It might seem like it is a lot, but usually you can test multiple of them with a singular action so its not that bad. |
Kit Location Management Testing Results SummaryWorking CorrectlyKit Location Cascade:
Asset Location Blocking:
Asset-to-Kit Addition:
Issues Found - Medium PriorityInconsistent UI Behavior:
Backend/Frontend Mismatch:
Bugs Found - High PriorityCritical Bug:
Minor Issues:
RecommendationsImmediate Action Required:
UX Improvements:
Testing Status: Core functionality works as designed, but critical bug requires immediate attention before production deployment. |
Additional Request: Activity Log Language ImprovementsI suggest reviewing the language used in our activity logs for better user clarity. The current technical phrasing may confuse users. Suggested Changes:
Benefits:
|
Critical Bug Fixes: - Fixed bulk-add-to-kit removing existing assets by adding addOnly parameter to updateKitAssets - Fixed custody status reset bug when adding assets to kits in custody - Fixed kit edit page not cascading location updates to kit assets UX Improvements: - Replaced basic Select with advanced searchable KitSelector component - Added real-time search, keyboard navigation, and improved error handling - Standardized kit selection across all interfaces Data Integrity: - Ensured consistent location management between kit edit page and actions dropdown - Maintained backward compatibility while fixing asset removal logic - Proper custody handling in bulk operations Technical Changes: - Created reusable KitSelector component based on CurrencySelector pattern - Updated bulk-add-to-kit-dialog to use new selector component - Modified updateKitAssets to support addOnly mode for bulk operations - Enhanced kit edit action to use updateKitLocation for proper asset cascading
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 47 out of 47 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
app/routes/_layout+/locations.$locationId.scan-assets-kits.tsx:67
- [nitpick] The title mentions 'Scan assets' but this route now handles both assets and kits. Consider updating to 'Scan assets and kits for location' to be more accurate.
const title = `Scan assets for location | ${location.name}`;
app/components/kits/actions-dropdown.tsx:29
- The function parameter destructuring is missing the type annotation. Consider adding the Props interface to maintain consistency with the other ActionsDropdown component in the codebase.
export default function ActionsDropdown({
fullWidth,
}: {
|
I have found no more issues here. This can be shipped. @DonKoko |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Closes #1947