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

feat(IN-839) Hours display and Hours drawer #640

Merged
merged 142 commits into from
Dec 11, 2023
Merged

feat(IN-839) Hours display and Hours drawer #640

merged 142 commits into from
Dec 11, 2023

Conversation

trigal2012
Copy link
Contributor

@trigal2012 trigal2012 commented Jun 28, 2023

This PR covers refactoring the Hours display component as well as creating the Hours Drawer edit component.

Hours display component:

  • Refactored to use 'interval' json string instead of start and end date time objects
  • This component will display multiple time segments per day
  • This component will display 'Open 24 Hours' if start and end time are the same and the 'Closed' property is set to false
  • This component will display 'Closed' if the closed property is true for a specified dayIndex (ignores the interval value)
Screen Shot 2023-08-03 at 5 33 46 PM

Hours Drawer component:

  • if the organization has hours data, that data will be displayed, which includes timezone
  • The user can edit the timezone, that timezone will be applied to all day indexes and segments
  • The user can edit existing start and end times (Open time, Close time)
  • The user can add a new time segment for a day
  • The user can set the day to Open 24hours
  • The user can delete a time segment
  • If a day has no time segment, the Closed property will be set to true

Hours Drawer Logic:

  • if a user converts a day which has multi segments to 24 hours, the logic should set the first segment to 00:00, 00:00 and set the 'delete' property to true for all other segments

Validation:

  • a segment must have a start and an end time
  • if a day has multiple segments, those segments can't overlap
  • sum of segment durations should not be equal to or over 24hours, if equal to 24 hours, suggest to use the Open 24hours checkbox instead

ToDo:

  • if open 24 hours, set start and end time to be the same (hours display expects start and end to match, 00:00, 00:00)
  • find a better library for the time input fields
  • add ability to remove a time segment
  • order segments based on earliest time first when listing
  • add validation per segment
  • add validation per hours object

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Other information

@vercel
Copy link

vercel bot commented Jun 28, 2023

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

Name Status Preview Comments Updated (UTC)
inreach-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2023 8:41pm

@ghost
Copy link

ghost commented Jun 28, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@JoeKarow JoeKarow changed the title WIP: feat(IN-839) Hours display and Hours drawer feat(IN-839) Hours display and Hours drawer Dec 11, 2023
@JoeKarow JoeKarow added automerge Enable Kodiak auto-merge and removed in-progress Issue is currently being worked on by a developer. labels Dec 11, 2023
Signed-off-by: InReach [bot] <[email protected]>
JoeKarow
JoeKarow previously approved these changes Dec 11, 2023
@JoeKarow JoeKarow marked this pull request as ready for review December 11, 2023 20:36
Copy link

sonarcloud bot commented Dec 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

No Coverage information No Coverage information
1.4% 1.4% Duplication

@kodiakhq kodiakhq bot merged commit 16dee20 into dev Dec 11, 2023
21 of 24 checks passed
@kodiakhq kodiakhq bot deleted the IN-839 branch December 11, 2023 20:41
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.

3 participants