Refactor user data mutation logic#22
Draft
google-labs-jules[bot] wants to merge 8 commits intofix/I25-161-lintingfrom
Draft
Refactor user data mutation logic#22google-labs-jules[bot] wants to merge 8 commits intofix/I25-161-lintingfrom
google-labs-jules[bot] wants to merge 8 commits intofix/I25-161-lintingfrom
Conversation
Replaced separate, specific mutation handlers for `field_training` and `employment_companies` with a single, generic `useHandleUserMutation` hook. This new hook can handle `add`, `update`, and `delete` operations for any user-related data, making the codebase more consistent, maintainable, and easier to understand. The `StudentDetail.tsx` component was refactored to use this new generic hook, simplifying the data submission logic. The old, redundant files (`handleFieldTraining.ts` and `handleEmployment.ts`) have been removed.
Author
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll acknowledge your comments with a 👀 emoji and then get to work. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! I will automatically address your feedback. For any comments you don't want me to act on, just include (aside). For security, I will only act on instructions from the user who triggered this task for this pull request. |
This commit includes two main changes: 1. Updates `react-day-picker` from v8 to v9 and applies the necessary migration changes to the `Calendar` component. This resolves previous dependency conflicts. 2. Refactors the data mutation logic by replacing separate handlers with a single, generic `useHandleUserMutation` hook. This improves code consistency and maintainability. Also includes a fix for a routing conflict and adds tests for the new generic mutation service.
This commit addresses two issues that arose after the recent refactoring and library update:
1. Fixes a database error (`time zone "gmt+0900" not recognized`) by removing the `created_at` field from the request payload when adding new records. The database handles this field automatically.
2. Fixes several bugs in the Calendar component:
- The UI is restored to the correct shadcn/ui appearance by overwriting the component with the official v9 compatible code.
- An off-by-one-day date selection bug is fixed by implementing a date formatting function that correctly handles timezones, preventing the date from being shifted when converted to a string.
This commit fixes several UI and functionality issues with the Calendar component that appeared after the `react-day-picker` v9 upgrade. - Adjusts the calendar's cell size and button padding to improve the overall layout and usability. - Fixes a color contrast issue where the selected date's text was not visible against the background in dark mode.
This commit fixes several UI and functionality issues with the Calendar component that appeared after the `react-day-picker` v9 upgrade. - Adjusts the calendar's cell size and button padding to improve the overall layout and usability. - Fixes a color contrast issue where the selected date's text was not visible against the background in dark mode. - Fixes an issue where the selected date range was not being colored correctly.
This commit addresses the final set of UI feedback for the Calendar component: - Differentiates the styling for the start, end, and middle of a selected date range. Start/end dates now use the primary color for the background, while the middle dates use the accent color. - Normalizes the size of the date cells on hover and selection to provide a more consistent user experience.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change addresses the user's request to refactor the data handling logic in
StudentDetail.tsx. The previous implementation was inconsistent and hard to follow. The new implementation uses a generic mutation handler that can be reused for different types of user data. This improves the overall code quality and maintainability. Tests were not added due to dependency conflicts in the project, as discussed with the user.