Skip to content

Conversation

@binh-dam-ibigroup
Copy link
Collaborator

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JSDoc and code is thoroughly commented
  • [na] The description lists all applicable issues this PR seeks to resolve
  • [na] The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing

Description

This PR replaces the DateTimeSelector component with the one from OTP-UI. For the DateTimeSelector component, the bootstrap and OTP-rr CSS attributes are reproduced inside a styled-component implementation.

The PR also removes code dealing with profile routing, most of which was previously commented out.

@evansiroky evansiroky removed their assignment Mar 12, 2020
departArrive={departArrive}
onQueryParamChange={setQueryParam}
time={time}
timeFormatLegacy={timeFormatLegacy}
Copy link
Member

@landonreed landonreed Mar 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why we're using props called *Legacy? This kind of splitting of code paths within the components doesn't seem necessary -- we should not be considering the otp-react-redux project "legacy" software. I don't think I had a chance to review opentripplanner/otp-ui#32, otherwise, I wouldn't have supported the splitting of the handlers like this.

EDIT: OK, I'm seeing below that this is intended to support legacy browsers? This and the DateTimeSelector probably need more comments to document this. We may want to modify the prop names to something a little more clear. Without the comment in mapStateToProps, I would have had little idea what was going on here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree on adding more documentation to DateTimeSelector in OTP-ui. There is a tiny bit here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my adjusted the comments that are relevant to OTP-RR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added additional docs on the OTP-UI side, see opentripplanner/otp-ui#98

// form components
DateTimeModal,
DateTimePreview,
DateTimeSelector,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, do we actually want to remove this component here? Or do we want to export the styled date time selector in its place? Just trying to think through how this library and its exports might continue to be used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. @evansiroky what is your take?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it should be in the index file. But, our only real use of otp-react-redux is via trimet-mod-otp so I'm not sure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have been deleting the refactored components from index.js. See also here: https://github.com/opentripplanner/otp-react-redux/pull/147/files

@codecov-io
Copy link

codecov-io commented Mar 26, 2020

Codecov Report

Merging #139 into dev will increase coverage by 0.14%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #139      +/-   ##
==========================================
+ Coverage   10.13%   10.28%   +0.14%     
==========================================
  Files         132      131       -1     
  Lines        5861     5777      -84     
  Branches     1711     1694      -17     
==========================================
  Hits          594      594              
+ Misses       4469     4393      -76     
+ Partials      798      790       -8     
Impacted Files Coverage Δ
lib/components/form/date-time-modal.js 0.00% <0.00%> (ø)
lib/index.js 0.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 40ae6e7...87a8efb. Read the comment docs.

@binh-dam-ibigroup binh-dam-ibigroup merged commit 4e05b0b into dev Mar 27, 2020
@binh-dam-ibigroup binh-dam-ibigroup removed their assignment Mar 27, 2020
@landonreed
Copy link
Member

🎉 This PR is included in version 1.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@landonreed
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@binh-dam-ibigroup binh-dam-ibigroup deleted the otp-ui-datetimeselector branch December 18, 2023 22:11
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.

5 participants