-
Notifications
You must be signed in to change notification settings - Fork 276
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
added option to prefill break time #591
Conversation
Codecov Report
@@ Coverage Diff @@
## main #591 +/- ##
==========================================
- Coverage 69.34% 68.76% -0.58%
==========================================
Files 27 27
Lines 2107 2132 +25
Branches 295 301 +6
==========================================
+ Hits 1461 1466 +5
- Misses 579 596 +17
- Partials 67 70 +3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking pretty great already! I have left a few comments and I'll do some testing and will take another look.
Congratulations 🎉. DeepCode analyzed your code in 6.365 seconds and we found no issues. Enjoy a moment of no bugs ☀️. 👉 View analysis in DeepCode’s Dashboard | Configure the bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! Thanks!
\changelog-update |
Thank you again @Flodgar, and sorry for taking so much time to review this. |
Related issue
Closes #355
Context / Background
Added option to automatically prefill break end when punching on break start.
2 new input fields in preferences - Switch that enables this feature and text input for break time length.
Break end will be prefilled only when punching on break start. Manually typing in break start won't prefill the end time.
What change is being introduced by this PR?
Modified
punchDate
function inBaseCalendar.js
to check if we are punching for break start based on index of time input field. Then calculate break end time ( in new function_calculateBreakEnd
) based on user preference and update break end field with this value.This PR also fixes problem with time input type user preferences not saving/displaying correct value. Problem was with
initPreferencesFileIfNotExistsOrInvalid
, specifically when validating time inputs withisValidPreferenceTime
. This function tries to validate both notification interval and HH:mm time input in one condition. It's confusing and doesn't do what it is supposed to, so I just wrote new functionisNotificationInterval
and used it properly together withvalidateTime
.I also removed the function from tests and added tests for
isNotificationInterval
.I edited regex in
validateTime
. Old one allowed up to 29 hours in input.Added field in translations:
How will this be tested?
Tested only manually. Will add tests later.