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

DT-6182 New designs for scooters #5073

Merged
merged 15 commits into from
Sep 16, 2024
Merged

DT-6182 New designs for scooters #5073

merged 15 commits into from
Sep 16, 2024

Conversation

sharhio
Copy link
Contributor

@sharhio sharhio commented Sep 13, 2024

Proposed Changes

  • disclaimer styles updated & configurable for instances
  • scooter info link styles (new accessible shade of blue)
  • scooter settings moved to the end of the list
  • scooter plans limited to 60 min in the future
  • direct scooter only journeys configurable for instances
  • rental vehicles layer fault tolerance
  • unnecessary kela config removed

Pull Request Check List

  • A reasonable set of unit tests is included
  • Console does not show new warnings/errors
  • Changes are documented or they are self explanatory
  • This pull request does not have any merge conflicts
  • All existing tests pass in CI build

Review

  • Read and verify the code changes
  • Test the functionality by running the UI locally with all popular browsers available in your platform
  • Check that the implementation matches the design, when such one is defined in a Jira issue
  • Merge the pull request

@sharhio sharhio changed the title DT- 6182 New designs for scooteres DT- 6182 New designs for scooters Sep 13, 2024
@sharhio sharhio changed the title DT- 6182 New designs for scooters DT-6182 New designs for scooters Sep 13, 2024
moment(parseDateTime(arriveBy, time).earliestDeparture).diff(
moment(),
'minutes',
) < config.vehicleRental.maxMinutesToRentalJourneyStart
Copy link
Member

Choose a reason for hiding this comment

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

Does this work correctly when arriveBy== true? Code seems to compare moment(undefined) with current time. Maybe arriveBy case needs different logic. If time is tomorrow, scooters surely should not be used.

Also, use of parseDateTime here seems totally unnecessary as that only converts unix time to a string and then you convert it back to moment object. Please use Date.now() to get epoch ms and compare it to time prop which is epoch seconds using simple math computation. We are trying to get rid of moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ArriveBy was accidentally overlooked. Also forgot that we are getting rid of moment. The arriveBy limit is a little hard to define as a journey could take a long time but a scooter journey might be relevant in the beginning, although there is no guarantee that the suggestion would be in the beginning of the journey. I added another configuration for the arriveBy time constraint.

@vesameskanen
Copy link
Member

Some suggestions:

  • Please rename parseDateTime, it does not parse anything but does the opposite, or maybe move code back inline.
  • Should after and before thresholds both use either minutes or hours? Somehow different unit looks strange.

@vesameskanen vesameskanen merged commit 9badd9f into v3 Sep 16, 2024
6 checks passed
@vesameskanen vesameskanen deleted the DT-6182-new-design branch September 16, 2024 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants