Add weekly working hours field for users #5981
Merged
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.
Backend PR: ohcnetwork/care#1495
WHAT
🤖 Generated by Copilot at 0558e7b
This pull request adds a new feature to manage and display the weekly working hours of the users in the
ManageUsers
andUserProfile
components. It updates the UI, the form validation, and the API integration to handle the newweekly_working_hours
property. It also fixes some minor UI issues.Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
HOW
🤖 Generated by Copilot at 0558e7b
Submit
andTextFormField
components fromButtonV2
andFormFields
to use them for the working hours form (link, link, link)expandWorkingHours
andweeklyHours
to control the visibility and value of the working hours slide over inManageUsers.tsx
(link)handleWorkingHourSubmit
to dispatch a partial update user action, show notifications, and reset the state variables and fetch the data inManageUsers.tsx
(link)flex-wrap
class name and add a closing</div>
tag inManageUsers.tsx
(link)UserDetails
component to display the weekly working hours and move the buttons to the bottom of the user card inManageUsers.tsx
(link)ManageUsers.tsx
(link)ManageUsers.tsx
(link)ManageUsers.tsx
(link)SlideOverCustom
component to render the working hours form with a title, a text field, and a submit button, and handle the closing and resetting logic of the slide over inManageUsers.tsx
(link)weekly_working_hours
to theEditForm
type and initialize it to undefined in theinitForm
value or function inUserProfile.tsx
(link, link)weekly_working_hours
property to the response data in thefetchData
function inUserProfile.tsx
(link)weekly_working_hours
property in thevalidateForm
function, and check if it is required, and if it is a valid number between 0 and 168 inUserProfile.tsx
(link)weekly_working_hours
property to the payload of thepartialUpdateUser
action in thehandleSubmit
function inUserProfile.tsx
(link)div
to display the weekly working hours of the user in the user profile details section inUserProfile.tsx
(link)TextFormField
component to render the weekly working hours input in the user profile edit section inUserProfile.tsx
(link)