-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fix schedule view input #1021
Merged
Merged
Fix schedule view input #1021
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9eb732c
feat(service-time-range-retriever): Introduce service time range retr…
binh-dam-ibigroup 4961f16
refactor(service-time-range-retriever): Fix import and redux update.
binh-dam-ibigroup 456810c
refactor(otp-reducer): Add logic to handle pending and error retrievi…
binh-dam-ibigroup f5ee9c2
improvement(StopViewer): Apply serviceTimeRange to date picker in sch…
binh-dam-ibigroup 19eb1e7
refactor(stop-viewer): Add TODOs for upcoming tasks [skip ci]
binh-dam-ibigroup 38dc85e
docs: Fix typos
binh-dam-ibigroup f982d0d
improvement(StopViewer): Send schedule request only with date within …
binh-dam-ibigroup 8e8edde
test(percy): Update mock.har
binh-dam-ibigroup 1098175
Merge branch 'dev' into fix-schedule-view-input
binh-dam-ibigroup 4c84ef3
refactor(StopViewer): Use the date-fns format functions correctly.
binh-dam-ibigroup 929e91d
improvement(StopViewer): Make the sched view tz code based on input d…
binh-dam-ibigroup d4c5ac2
fix(StopViewer): Compute schedule TZ only if valid date is entered.
binh-dam-ibigroup 0388ec4
docs(StopViewer): Fix typo [skip ci]
binh-dam-ibigroup 4d564a8
Merge branch 'dev' into fix-schedule-view-input
binh-dam-ibigroup 4d1e615
improvement(stop-viewer): Hide timezone warning if date is invalid.
binh-dam-ibigroup cc7e503
improvement(stop-viewer): Show message and hide schedule for invalid …
binh-dam-ibigroup 3b17891
Merge branch 'dev' into fix-schedule-view-input
binh-dam-ibigroup File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { connect } from 'react-redux' | ||
import { useEffect } from 'react' | ||
|
||
import apiActionsV2 from '../../actions/apiV2' | ||
|
||
interface Props { | ||
retrieveServiceTimeRangeIfNeeded: () => void | ||
} | ||
|
||
/** | ||
* Invisible component that retrieves the date range available | ||
* for OTP planning and schedule retrieval. | ||
*/ | ||
const ServiceTimeRangeRetriever = ({ | ||
retrieveServiceTimeRangeIfNeeded | ||
}: Props): null => { | ||
// If not already done, retrieve the OTP available date range on mount. | ||
useEffect(() => { | ||
retrieveServiceTimeRangeIfNeeded() | ||
}, [retrieveServiceTimeRangeIfNeeded]) | ||
|
||
// Component renders nothing | ||
return null | ||
} | ||
|
||
// Connect to redux | ||
const mapDispatchToProps = { | ||
retrieveServiceTimeRangeIfNeeded: | ||
apiActionsV2.retrieveServiceTimeRangeIfNeeded | ||
} | ||
|
||
export default connect(null, mapDispatchToProps)(ServiceTimeRangeRetriever) |
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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 causing the timezone code to change & update in the alert if the year starts with 0, which is a little jarring as you're typing.
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.
Good catch! Fixed in 4d1e615.