Skip to content
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

Add weekly working hours field for users #5981

Merged
merged 2 commits into from
Aug 3, 2023
Merged

Add weekly working hours field for users #5981

merged 2 commits into from
Aug 3, 2023

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Aug 2, 2023

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 and UserProfile components. It updates the UI, the form validation, and the API integration to handle the new weekly_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

  • Add a new feature to allow users to update their weekly working hours in the manage users and user profile pages (link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Import the Submit and TextFormField components from ButtonV2 and FormFields to use them for the working hours form (link, link, link)
  • Add two new state variables expandWorkingHours and weeklyHours to control the visibility and value of the working hours slide over in ManageUsers.tsx (link)
  • Add a new function handleWorkingHourSubmit to dispatch a partial update user action, show notifications, and reset the state variables and fetch the data in ManageUsers.tsx (link)
  • Fix a formatting issue with the flex-wrap class name and add a closing </div> tag in ManageUsers.tsx (link)
  • Add a new UserDetails component to display the weekly working hours and move the buttons to the bottom of the user card in ManageUsers.tsx (link)
  • Add a margin between the facility and skill buttons in ManageUsers.tsx (link)
  • Add a new button to open the working hours slide over and pass the selected user and the current working hours value to the state variables in ManageUsers.tsx (link)
  • Add an optional chaining operator to the users array to avoid errors if it is undefined in ManageUsers.tsx (link)
  • Add a new 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 in ManageUsers.tsx (link)
  • Add a new property weekly_working_hours to the EditForm type and initialize it to undefined in the initForm value or function in UserProfile.tsx (link, link)
  • Assign the weekly_working_hours property to the response data in the fetchData function in UserProfile.tsx (link)
  • Add a new case for the weekly_working_hours property in the validateForm function, and check if it is required, and if it is a valid number between 0 and 168 in UserProfile.tsx (link)
  • Add the weekly_working_hours property to the payload of the partialUpdateUser action in the handleSubmit function in UserProfile.tsx (link)
  • Add a new div to display the weekly working hours of the user in the user profile details section in UserProfile.tsx (link)
  • Add a new TextFormField component to render the weekly working hours input in the user profile edit section in UserProfile.tsx (link)

@Ashesh3 Ashesh3 requested a review from a team August 2, 2023 04:10
@Ashesh3 Ashesh3 requested a review from a team as a code owner August 2, 2023 04:10
@vercel
Copy link

vercel bot commented Aug 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 2, 2023 4:58pm

@netlify
Copy link

netlify bot commented Aug 2, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit d22c85b
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/64ca8b0988358b0008b791c9
😎 Deploy Preview https://deploy-preview-5981--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nihal467
Copy link
Member

nihal467 commented Aug 2, 2023

LGTM

@khavinshankar khavinshankar merged commit 9249158 into develop Aug 3, 2023
24 checks passed
@khavinshankar khavinshankar deleted the fix-5956 branch August 3, 2023 07:59
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

@Ashesh3 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Understanding time contributed by doctors
3 participants