diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index b1568432d..06c6da3f4 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -12,6 +12,7 @@ jobs: - uses: codespell-project/actions-codespell@master with: check_filenames: true + ignore_words_list: MapPin # skip git, yarn, pixel test script and HAR file, and all i18n resources. # Also, the a11y test file has a false positive and the ignore list does not work # see https://github.com/opentripplanner/otp-react-redux/pull/436/checks?check_run_id=3369380014 diff --git a/__tests__/components/viewers/__snapshots__/nearby-view.js.snap b/__tests__/components/viewers/__snapshots__/nearby-view.js.snap index 82a1f7065..3c60f41c2 100644 --- a/__tests__/components/viewers/__snapshots__/nearby-view.js.snap +++ b/__tests__/components/viewers/__snapshots__/nearby-view.js.snap @@ -45,7 +45,7 @@ exports[`components > viewers > nearby view renders nothing on a blank page 1`] className="nearby-view base-color-bg" >
viewers > nearby view renders nothing on a blank page 1`] } >
    viewers > nearby view renders proper scooter dates 1`] = ` className="nearby-view base-color-bg" >
    viewers > nearby view renders proper scooter dates 1`] = ` } >
      viewers > nearby view renders proper scooter dates 1`] = ` >

      viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

      viewers > nearby view renders proper scooter dates 1`] = `

      viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >

      viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

      viewers > nearby view renders proper scooter dates 1`] = `

      viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >

      viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

      viewers > nearby view renders proper scooter dates 1`] = `

      viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
      viewers > nearby view renders proper scooter dates 1`] = ` >

      Roosevelt Station - Bay 2 @@ -10030,7 +10030,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = ` >

      viewers > nearby view renders proper scooter dates 1`] = `

      viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
        viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >
      • viewers > nearby view renders proper scooter dates 1`] = ` title="45" > viewers > nearby view renders proper scooter dates 1`] = `

          viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

        1. viewers > nearby view renders proper scooter dates 1`] = ` title="62" > viewers > nearby view renders proper scooter dates 1`] = `

            viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

          1. viewers > nearby view renders proper scooter dates 1`] = ` title="79" > viewers > nearby view renders proper scooter dates 1`] = `

              viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

              viewers > nearby view renders proper scooter dates 1`] = ` >

              Roosevelt @@ -16849,7 +16849,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = ` >

              viewers > nearby view renders proper scooter dates 1`] = `

              viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
                viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >
              • viewers > nearby view renders proper scooter dates 1`] = ` title="1 Line" > viewers > nearby view renders proper scooter dates 1`] = `

                  viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                1. viewers > nearby view renders proper scooter dates 1`] = ` title="1 Line" > viewers > nearby view renders proper scooter dates 1`] = `

                    viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                  1. viewers > nearby view renders proper scooter dates 1`] = ` title="1 Line" > viewers > nearby view renders proper scooter dates 1`] = `

                      viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                      viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                      viewers > nearby view renders proper scooter dates 1`] = `

                      viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >

                      viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                      viewers > nearby view renders proper scooter dates 1`] = `

                      viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >

                      viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                      viewers > nearby view renders proper scooter dates 1`] = `

                      viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
                      viewers > nearby view renders proper scooter dates 1`] = ` >

                      Roosevelt Station - Bay 1 @@ -26336,7 +26336,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = ` >

                      viewers > nearby view renders proper scooter dates 1`] = `

                      viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
                        viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >
                      • viewers > nearby view renders proper scooter dates 1`] = ` title="45" > viewers > nearby view renders proper scooter dates 1`] = `

                          viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                        1. viewers > nearby view renders proper scooter dates 1`] = ` title="62" > viewers > nearby view renders proper scooter dates 1`] = `

                            viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                          1. viewers > nearby view renders proper scooter dates 1`] = ` title="79" > viewers > nearby view renders proper scooter dates 1`] = `

                              viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                            1. viewers > nearby view renders proper scooter dates 1`] = ` title="988" > viewers > nearby view renders proper scooter dates 1`] = `

                                viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                                viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                                viewers > nearby view renders proper scooter dates 1`] = `

                                viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >

                                viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                                viewers > nearby view renders proper scooter dates 1`] = `

                                viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >

                                viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                                viewers > nearby view renders proper scooter dates 1`] = `

                                viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >

                                viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                                viewers > nearby view renders proper scooter dates 1`] = `

                                viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >

                                viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                                viewers > nearby view renders proper scooter dates 1`] = `

                                viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
                                viewers > nearby view renders proper scooter dates 1`] = ` >

                                Roosevelt Station Bay 5 - Bay 5 @@ -35850,7 +35850,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = ` >

                                viewers > nearby view renders proper scooter dates 1`] = `

                                viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
                                  viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >
                                • viewers > nearby view renders proper scooter dates 1`] = ` title="67" > viewers > nearby view renders proper scooter dates 1`] = `

                                    viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                                  1. viewers > nearby view renders proper scooter dates 1`] = ` title="73" > viewers > nearby view renders proper scooter dates 1`] = `

                                      viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                                    1. viewers > nearby view renders proper scooter dates 1`] = ` title="984" > viewers > nearby view renders proper scooter dates 1`] = `

                                        viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                                        viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                                        viewers > nearby view renders proper scooter dates 1`] = `

                                        viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
                                        viewers > nearby view renders proper scooter dates 1`] = ` >

                                        Roosevelt @@ -43656,7 +43656,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = ` >

                                        viewers > nearby view renders proper scooter dates 1`] = `

                                        viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
                                          viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >
                                        • viewers > nearby view renders proper scooter dates 1`] = ` title="1 Line" > viewers > nearby view renders proper scooter dates 1`] = `

                                            viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                                            viewers > nearby view renders proper scooter dates 1`] = ` >

                                            Roosevelt Station - Bay 3 @@ -51198,7 +51198,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = ` >

                                            viewers > nearby view renders proper scooter dates 1`] = `

                                            viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
                                              viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >
                                            • viewers > nearby view renders proper scooter dates 1`] = ` title="522" > viewers > nearby view renders proper scooter dates 1`] = `

                                                viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                                              1. viewers > nearby view renders proper scooter dates 1`] = ` title="67" > viewers > nearby view renders proper scooter dates 1`] = `

                                                  viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                                                1. viewers > nearby view renders proper scooter dates 1`] = ` title="522" > viewers > nearby view renders proper scooter dates 1`] = `

                                                    viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                                                  1. viewers > nearby view renders proper scooter dates 1`] = ` title="73" > viewers > nearby view renders proper scooter dates 1`] = `

                                                      viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                                                    1. viewers > nearby view renders proper scooter dates 1`] = ` title="322" > viewers > nearby view renders proper scooter dates 1`] = `

                                                        viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                                                      1. viewers > nearby view renders proper scooter dates 1`] = ` title="322" > viewers > nearby view renders proper scooter dates 1`] = `

                                                          viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                                                          viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` >

                                                          viewers > nearby view renders proper scooter dates 1`] = `

                                                          viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
                                                          viewers > nearby view renders proper scooter dates 1`] = ` >

                                                          NE 65th St & 14th Ave NE @@ -62309,7 +62309,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = ` >

                                                          viewers > nearby view renders proper scooter dates 1`] = `

                                                          viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` size="0.9em" > viewers > nearby view renders proper scooter dates 1`] = ` >
                                                            viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >
                                                          • viewers > nearby view renders proper scooter dates 1`] = ` title="45" > viewers > nearby view renders proper scooter dates 1`] = `

                                                              viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                                                            1. viewers > nearby view renders proper scooter dates 1`] = ` title="62" > viewers > nearby view renders proper scooter dates 1`] = `

                                                                viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` roundedTop={false} >

                                                              1. viewers > nearby view renders proper scooter dates 1`] = ` title="79" > viewers > nearby view renders proper scooter dates 1`] = `

                                                                  viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.realtime" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` iconViewBox="0 0 448 512" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > nearby view renders proper scooter dates 1`] = ` title="components.StopTimeCell.scheduled" > viewers > nearby view renders proper scooter dates 1`] = ` > viewers > stop viewer should render with initial stop id a > viewers > stop viewer should render with initial stop id a

                                                          - diff --git a/i18n/es.yml b/i18n/es.yml index 31c17586c..986cf7037 100644 --- a/i18n/es.yml +++ b/i18n/es.yml @@ -511,7 +511,6 @@ components: shortTitle: Ver rutas stopsInDirectionOfTravel: "Paradas en este sentido de la marcha:" title: Visor de rutas - toggleRouteOnMap: Cambiar la ruta en el mapa SaveTripButton: cantSaveText: No se puede guardar cantSaveTooltip: >- diff --git a/i18n/fr.yml b/i18n/fr.yml index ad2a17b26..ff8f6deaf 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -519,7 +519,6 @@ components: shortTitle: Index des lignes stopsInDirectionOfTravel: "Arrêts dans cette direction :" title: Index des lignes - toggleRouteOnMap: Afficher ou masquer la ligne sur la carte SaveTripButton: cantSaveText: Impossible d'enregistrer cantSaveTooltip: >- diff --git a/i18n/ko.yml b/i18n/ko.yml index 33d3dcbc9..e83ad24a5 100644 --- a/i18n/ko.yml +++ b/i18n/ko.yml @@ -428,7 +428,6 @@ components: shortTitle: 경로 보기 stopsInDirectionOfTravel: "이동편 이 방향의 정류장:" title: 경로 뷰어 - toggleRouteOnMap: 지도에서 경로 토글 SaveTripButton: cantSaveText: 저장할 수 없음 cantSaveTooltip: 대중교통을 포함하고 렌트 또는 차량 호출을 포함하지 않는 트립 일정만 모니터링할 수 있습니다. diff --git a/i18n/ru.yml b/i18n/ru.yml index c76c0406a..6fefb7846 100644 --- a/i18n/ru.yml +++ b/i18n/ru.yml @@ -469,7 +469,6 @@ components: shortTitle: Просмотр маршрутов stopsInDirectionOfTravel: "Остановки в этом направлении движения:" title: Средство просмотра маршрутов - toggleRouteOnMap: Переключить маршрут на карте SaveTripButton: cantSaveText: Невозможно сохранить cantSaveTooltip: >- diff --git a/i18n/tl.yml b/i18n/tl.yml index 24c16d44e..363b5d212 100644 --- a/i18n/tl.yml +++ b/i18n/tl.yml @@ -476,7 +476,6 @@ components: shortTitle: Tingnan ang Mga Ruta stopsInDirectionOfTravel: "Mga hintuan sa direksyong ito ng paglalakbay:" title: Viewer ng Ruta - toggleRouteOnMap: I-toggle ang ruta sa mapa SaveTripButton: cantSaveText: Hindi ma-save cantSaveTooltip: >- diff --git a/i18n/vi.yml b/i18n/vi.yml index dba6ed8fd..28e814180 100644 --- a/i18n/vi.yml +++ b/i18n/vi.yml @@ -471,7 +471,6 @@ components: shortTitle: Xem các tuyến đường stopsInDirectionOfTravel: "Các trạm dừng trong hướng di chuyển này:" title: Xem tuyến đường - toggleRouteOnMap: Chuyển đổi tuyến đường trên bản đồ SaveTripButton: cantSaveText: Không thể tiết kiệm cantSaveTooltip: >- diff --git a/i18n/zh.yml b/i18n/zh.yml index 7c822d921..e065ded22 100644 --- a/i18n/zh.yml +++ b/i18n/zh.yml @@ -427,7 +427,6 @@ components: shortTitle: 查看路线 stopsInDirectionOfTravel: 行程此方向上的公车站: title: 路线查看器 - toggleRouteOnMap: 在地图上切换路线 SaveTripButton: cantSaveText: 无法保存 cantSaveTooltip: 只有包括交通的行程而没有租车或叫车的行程可以被监控. diff --git a/lib/actions/apiV2.js b/lib/actions/apiV2.js index fd0042f3d..623c80269 100644 --- a/lib/actions/apiV2.js +++ b/lib/actions/apiV2.js @@ -1005,6 +1005,10 @@ export function routingQuery(searchId = null, updateSearchInReducer) { // This is likely due to the fact that BICYCLE_RENT is treated as a transit submode. const combinations = modes ? [baseQuery] : generateCombinations(baseQuery) + if (combinations.length === 0) { + return RoutingQueryCallResult.INVALID_MODE_SELECTION + } + dispatch( routingRequest({ activeItinerary, @@ -1105,17 +1109,16 @@ export function routingQuery(searchId = null, updateSearchInReducer) { returned even if trips were returned, since it is on a mode-by-mode basis. there is a chance for user confusion! - By checking if itineraries exist, we can hide this error when it is - not applicable. */ + We'll reintroduce this error later once all the results are compiled */ + + response.data.plan.routingErrors = + response.data?.plan?.routingErrors.filter( + (re) => re?.code !== 'NO_TRANSIT_CONNECTION' + ) if ( getActiveItineraries(getState())?.length > 0 && response?.data?.plan ) { - response.data.plan.routingErrors = - response.data?.plan?.routingErrors.filter( - (re) => re?.code !== 'NO_TRANSIT_CONNECTION' - ) - // Add accessibility error, if it is turned on const state = getState() const { displayA11yError } = state.otp.config?.itinerary @@ -1135,14 +1138,6 @@ export function routingQuery(searchId = null, updateSearchInReducer) { } } - // If there are no itineraries, generate an error - // so we're not left with an empty results container. - if (withCollapsedShortNames.length === 0) { - response.data.plan.routingErrors.push({ - code: 'NO_TRANSIT_CONNECTION' - }) - } - return { index, response: { @@ -1171,9 +1166,7 @@ export function routingQuery(searchId = null, updateSearchInReducer) { dispatch(updateOtpUrlParams(state, searchId)) } - return combinations.length === 0 - ? RoutingQueryCallResult.INVALID_MODE_SELECTION - : RoutingQueryCallResult.SUCCESS + return RoutingQueryCallResult.SUCCESS } } diff --git a/lib/actions/map.js b/lib/actions/map.js index 17cb19a69..933457b2f 100644 --- a/lib/actions/map.js +++ b/lib/actions/map.js @@ -22,7 +22,7 @@ export function setMapCenter(map /* MapRef */, location) { const { lat, lon } = location if (map && !isNaN(lat) && !isNaN(lon)) { const center = [lon, lat] - map.panTo(center) + map.panTo(center, { speed: 0.8 }) } } } diff --git a/lib/components/app/responsive-webapp.js b/lib/components/app/responsive-webapp.js index 74fea9add..dc7d26f72 100644 --- a/lib/components/app/responsive-webapp.js +++ b/lib/components/app/responsive-webapp.js @@ -58,10 +58,12 @@ class ResponsiveWebapp extends Component { componentDidUpdate(prevProps) { const { activeSearchId, + autoFly, currentPosition, formChanged, intl, location, + mainPanelContent, map, matchContentToUrl, query, @@ -98,15 +100,17 @@ class ResponsiveWebapp extends Component { setLocationToCurrent({ locationType: 'from' }, intl) setMapCenter(map, pt) } - } else if (query.from && query.to) { - map?.fitBounds([query.from, query.to], { - duration: 500, - padding: getFitBoundsPadding(map, 0.2) - }) - } else if (query.from && !query.to) { - setMapCenter(map, query.from) - } else if (query.to && !query.from) { - setMapCenter(map, query.to) + } else if (mainPanelContent === null && autoFly !== false) { + if (query.from && query.to) { + map?.fitBounds([query.from, query.to], { + duration: 600, + padding: getFitBoundsPadding(map, 0.2) + }) + } else if (query.from && !query.to) { + setMapCenter(map, query.from) + } else if (query.to && !query.from) { + setMapCenter(map, query.to) + } } // If the path changes (e.g., via a back button press) check whether the @@ -259,6 +263,7 @@ const mapStateToProps = (state) => { activeSearchId: state.otp.activeSearchId, currentPosition: state.otp.location.currentPosition, locale: state.otp.ui.locale, + mainPanelContent: state.otp.ui.mainPanelContent, mobileScreen: state.otp.ui.mobileScreen, modeGroups: state.otp.config.modeGroups, popupContent: state.otp.ui.popup, @@ -415,9 +420,10 @@ class RouterWrapperWithAuth0 extends Component { } const mapStateToWrapperProps = (state) => { - const { homeTimezone, persistence, reactRouter } = state.otp.config + const { homeTimezone, map, persistence, reactRouter } = state.otp.config return { auth0Config: getAuth0Config(persistence), + autoFly: map.autoFlyOnTripFormUpdate, defaultLocale: getDefaultLocale(state.otp.config, state.user.loggedInUser), homeTimezone, locale: state.otp.ui.locale, diff --git a/lib/components/map/point-popup.tsx b/lib/components/map/point-popup.tsx index b13e3ce3a..6b7c4c24f 100644 --- a/lib/components/map/point-popup.tsx +++ b/lib/components/map/point-popup.tsx @@ -1,15 +1,15 @@ import { connect } from 'react-redux' +import { FocusTrapWrapper } from '@opentripplanner/map-popup/lib' import { Popup } from '@opentripplanner/base-map' import { Search } from '@styled-icons/fa-solid/Search' import { useIntl, WrappedComponentProps } from 'react-intl' import { useMap } from 'react-map-gl' import FromToLocationPicker from '@opentripplanner/from-to-location-picker' -import React, { useCallback, useMemo } from 'react' +import React, { useCallback } from 'react' import styled from 'styled-components' import type { Location } from '@opentripplanner/types' import * as mapActions from '../../actions/map' -import { getEntryRelativeTo } from '../util/get-entry-relative-to' import { Icon } from '../util/styledIcon' import { renderCoordinates } from '../../util/i18n' import { SetLocationHandler, ZoomToPlaceHandler } from '../util/types' @@ -51,49 +51,6 @@ function MapPopup({ const intl = useIntl() const { current: map } = useMap() - /** - * Creates a focus trap within map popup that can be dismissed with esc. - * https://medium.com/cstech/achieving-focus-trapping-in-a-react-modal-component-3f28f596f35b - */ - - /** - * Check to see which keys are down by tracking keyUp and keyDown events - * in order to see when "tab" and "shift" are pressed at the same time. - */ - let keysDown: string[] = useMemo(() => [], []) - - // Argument for document.querySelectorAll to target focusable elements. - const queryId = 'button#zoom-btn, #from-to button' - - const _handleKeyDown = useCallback( - (e) => { - keysDown.push(e.key) - const element = e.target as HTMLElement - switch (e.key) { - case 'Escape': - clearMapPopupLocation() - break - case 'Tab': - if (keysDown.includes('Shift')) { - e.preventDefault() - getEntryRelativeTo(queryId, element, -1)?.focus() - } else { - e.preventDefault() - getEntryRelativeTo(queryId, element, 1)?.focus() - } - break - case ' ': - break - default: - } - }, - [clearMapPopupLocation, keysDown] - ) - - const _handleKeyUp = (e: any) => { - keysDown = keysDown.filter((key) => key !== e.key) - } - // Memoize callbacks that shouldn't change from one render to the next. const onSetLocationFromPopup = useCallback( (payload) => { @@ -116,16 +73,16 @@ function MapPopup({ }) return ( -
                                                          - + + {typeof popupName === 'string' && popupName.split(',').length > 3 @@ -148,8 +105,8 @@ function MapPopup({ setLocation={onSetLocationFromPopup} />
                                                          - -

                                                          + + ) } diff --git a/lib/components/map/route-preview-overlay.tsx b/lib/components/map/route-preview-overlay.tsx index 77aa5fa96..1e071c0c3 100644 --- a/lib/components/map/route-preview-overlay.tsx +++ b/lib/components/map/route-preview-overlay.tsx @@ -15,6 +15,7 @@ import { type Props = { from: Location geometries: string[] + mainPanelContent: number | null to: Location visible?: boolean } @@ -22,17 +23,23 @@ type Props = { * This overlay will display thin gray lines for a set of geometries. It's to be used * as a stopgap until we make full use of Transitive! */ -const RoutePreviewOverlay = ({ from, geometries, to, visible }: Props) => { +const RoutePreviewOverlay = ({ + from, + geometries, + mainPanelContent, + to, + visible +}: Props) => { // Center the map over the endpoints when this overlay is shown. const { current: map } = useMap() useEffect(() => { - if (visible) { + if (visible && mainPanelContent === null) { map?.fitBounds([from, to], { - duration: 500, + duration: 600, padding: getFitBoundsPadding(map, 0.2) }) } - }, [map, visible, from, to]) + }, [map, visible, from, to, mainPanelContent]) if (!geometries || !visible) return <> @@ -77,7 +84,7 @@ const RoutePreviewOverlay = ({ from, geometries, to, visible }: Props) => { // TODO: Typescript state const mapStateToProps = (state: any) => { - const { activeSearchId, config } = state.otp + const { activeSearchId, config, ui } = state.otp // Only show this overlay if the metro UI is explicitly enabled if (config.itinerary?.showFirstResultByDefault !== false) { return {} @@ -103,6 +110,7 @@ const mapStateToProps = (state: any) => { return { from, geometries, + mainPanelContent: ui.mainPanelContent, to, visible: // We need an explicit check for undefined and null because 0 diff --git a/lib/components/narrative/narrative-itineraries.js b/lib/components/narrative/narrative-itineraries.js index 4b7c14b45..06e5adaf9 100644 --- a/lib/components/narrative/narrative-itineraries.js +++ b/lib/components/narrative/narrative-itineraries.js @@ -12,8 +12,8 @@ import Skeleton, { SkeletonTheme } from 'react-loading-skeleton' import * as uiActions from '../../actions/ui' import { ComponentContext } from '../../util/contexts' -import { firstTransitLegIsRealtime } from '../../util/viewer' import { + createNoItinerariesErr, getActiveItineraries, getActiveSearch, getRealtimeEffects, @@ -21,6 +21,7 @@ import { getVisibleItineraryIndex, sortItinerariesInPlaceIfNeeded } from '../../util/state' +import { firstTransitLegIsRealtime } from '../../util/viewer' import { getFirstLegStartTime, itinerariesAreEqual, @@ -604,6 +605,12 @@ const mapStateToProps = (state) => { // Sort the merged (displayed) itineraries if needed sortItinerariesInPlaceIfNeeded(mergedItineraries, state) + const errorsWithNoItineraries = createNoItinerariesErr( + state, + activeSearch?.response?.reduce(reduceErrorsFromResponse, {}), + pending + ) + return { // swap out realtime itineraries with non-realtime depending on boolean activeItinerary, @@ -616,7 +623,7 @@ const mapStateToProps = (state) => { errorMessages, errors: getResponsesWithErrors(state), // TODO: Destroy otp1 errors and rename this - errorsOtp2: activeSearch?.response?.reduce(reduceErrorsFromResponse, {}), + errorsOtp2: errorsWithNoItineraries, groupItineraries, groupTransitModes, itineraries: allItineraries, diff --git a/lib/components/util/types.ts b/lib/components/util/types.ts index fb08c83ae..9b21030fa 100644 --- a/lib/components/util/types.ts +++ b/lib/components/util/types.ts @@ -58,8 +58,8 @@ export interface Time { } export interface ViewedRouteState { - patternId?: string - routeId: string + patternId?: string | null + routeId: string | null } export interface RouteVehicle { diff --git a/lib/components/viewers/RouteRow.js b/lib/components/viewers/route-row.tsx similarity index 57% rename from lib/components/viewers/RouteRow.js rename to lib/components/viewers/route-row.tsx index d6d40a059..6e1aebe98 100644 --- a/lib/components/viewers/RouteRow.js +++ b/lib/components/viewers/route-row.tsx @@ -1,7 +1,5 @@ -// TODO: Typescript, which doesn't make sense to do in this file until common types are established -/* eslint-disable react/prop-types */ import { ArrowRight } from '@styled-icons/fa-solid' -import { Button } from 'react-bootstrap' +import { IntlShape } from 'react-intl' import React, { PureComponent } from 'react' import styled from 'styled-components' @@ -10,11 +8,22 @@ import { ComponentContext } from '../../util/contexts' import { getFormattedMode } from '../../util/i18n' import { getModeFromRoute } from '../../util/viewer' import { Icon } from '../util/styledIcon' -import InvisibleA11yLabel from '../util/invisible-a11y-label' +import { TransitOperatorConfig } from '../../util/config-types' +import { ViewedRouteObject } from '../util/types' +import Link from '../util/link' import OperatorLogo from '../util/operator-logo' import RouteName from './route-name' +interface Props { + findRouteIfNeeded: ({ routeId }: { routeId: string }) => void + initialRender?: boolean + intl: IntlShape + isActive?: boolean + operator: TransitOperatorConfig + route?: ViewedRouteObject +} + export const StyledRouteRow = styled.li` align-items: center; background-color: transparent; @@ -26,25 +35,26 @@ export const StyledRouteRow = styled.li` position: relative; ` // Route Row Button sits invisible on top of the route name and info. -export const RouteRowButton = styled(Button)` +export const RouteRowLink = styled(Link)` align-items: center; + border-radius: 10px; + color: inherit !important; display: flex; min-height: 50px; padding: 5px; // Make sure route details always leaves enough room for pattern button padding-right: 55px; + text-decoration: none !important; transition: all ease-out 0.1s; width: 100%; - &:before { - background-color: ${(props) => (props.patternActive ? blue[50] : 'white')}; - border-radius: 4px; - content: ''; - height: 100%; - position: absolute; - top: 0; - width: 100%; - z-index: -4; + &:hover { + outline: 2px solid ${blue[200]}; + outline-offset: -2px; + } + + &.active { + background-color: ${blue[50]}; } ` @@ -68,23 +78,25 @@ const RouteDetailsContainer = styled.div` overflow: hidden; ` -const PatternButton = styled.button` +const PatternViewerLink = styled(Link)` background: transparent; border: none; border-radius: 50%; color: ${blue[900]}; height: 40px; + line-height: 40px; margin-right: 8px; position: absolute; right: 5px; + text-align: center; transition: all ease-out 0.1s; - z-index: ${(props) => (props.display ? 2 : -2)}; width: 40px; + z-index: -2; svg { height: 22px !important; margin-top: -3px; - opacity: ${(props) => (props.display ? '80%' : 0)}; + opacity: 0; width: 22px !important; } @@ -97,99 +109,96 @@ const PatternButton = styled.button` background: #fff; transition: all ease-out 0.1s; } + + ${RouteRowLink}.active + & { + z-index: 2; + + svg { + opacity: 80%; + } + } ` -export class RouteRow extends PureComponent { +export class RouteRow extends PureComponent { + activeRef: React.RefObject + static contextType = ComponentContext - constructor(props) { + constructor(props: Props) { super(props) // Create a ref used to scroll to - this.activeRef = React.createRef() + this.activeRef = React.createRef() } - componentDidMount = () => { + componentDidMount = (): void => { const { isActive, route } = this.props if (isActive && route?.id) { // This is fired when coming back from the route details view - this.activeRef.current.scrollIntoView() + this.activeRef.current?.scrollIntoView() } } - componentDidUpdate() { + componentDidUpdate(): void { /* If the initial route row list is being rendered and there is an active route, scroll to it. The initialRender prop prohibits the row being scrolled to if the user has clicked on a route */ if (this.props.isActive && this.props.initialRender) { - this.activeRef.current.scrollIntoView() + this.activeRef.current?.scrollIntoView() } } - _onFocusOrEnter = () => { + _onFocusOrEnter = (): void => { const { findRouteIfNeeded, route } = this.props - findRouteIfNeeded({ routeId: route.id }) - } - - _onClick = () => { - const { isActive, route, setViewedRoute } = this.props - if (isActive) { - // Deselect current route if active. - setViewedRoute({ patternId: null, routeId: null }) - } else { - // Otherwise, set active and fetch route patterns. - setViewedRoute({ routeId: route.id }) + const id = route?.id + if (id) { + findRouteIfNeeded({ routeId: id }) } } - _patternButtonClicked = () => { - const { route, setViewedRoute } = this.props - const { id, patterns } = route - const firstPattern = route && patterns && Object.values(patterns)?.[0]?.id - setViewedRoute({ patternId: firstPattern, routeId: id }) - } - - render() { + render(): JSX.Element | null { const { intl, isActive, operator, route } = this.props const { ModeIcon, RouteRenderer } = this.context - const patternViewerButtonText = intl.formatMessage({ + if (!route) return null + + const { id, longName, mode, patterns, shortName } = route + const modeFromRoute = getModeFromRoute(route) + const routePath = `/route/${id}` + const firstPattern = patterns && Object.values(patterns)?.[0]?.id + + const patternViewerLinkText = intl.formatMessage({ description: 'identifies the purpose of the pattern viewer button', id: 'components.RouteViewer.openPatternViewer' }) - const routeMapToggleText = intl.formatMessage({ - description: 'identifies the behavior of the route viewer button', - id: 'components.RouteViewer.toggleRouteOnMap' - }) return ( - - {route.mode && operator.routeIcons !== false && ( + {mode && operator.routeIcons !== false && ( @@ -197,21 +206,19 @@ export class RouteRow extends PureComponent { )} - ({routeMapToggleText}) - - + - + ) } diff --git a/lib/components/viewers/route-viewer.tsx b/lib/components/viewers/route-viewer.tsx index 0a5cbbf32..4520ae837 100644 --- a/lib/components/viewers/route-viewer.tsx +++ b/lib/components/viewers/route-viewer.tsx @@ -3,13 +3,14 @@ import { Button } from 'react-bootstrap' import { connect } from 'react-redux' import { Filter } from '@styled-icons/fa-solid/Filter' import { FormattedMessage, injectIntl, IntlShape } from 'react-intl' -import { Route, TransitOperator } from '@opentripplanner/types' +import { Route } from '@opentripplanner/types' import { Search } from '@styled-icons/fa-solid/Search' import coreUtils from '@opentripplanner/core-utils' import React, { Component, FormEvent } from 'react' import * as apiActions from '../../actions/api' import * as uiActions from '../../actions/ui' +import { AppReduxState } from '../../util/state-types' import { getAgenciesFromRoutes, getModesForActiveAgencyFilter, @@ -17,15 +18,12 @@ import { } from '../../util/state' import { getFormattedMode } from '../../util/i18n' import { getRouteOrPatternViewerTitle } from '../../util/viewer' -import { - SetViewedRouteHandler, - ViewedRouteObject, - ViewedRouteState -} from '../util/types' import { StyledIconWrapper } from '../util/styledIcon' +import { TransitOperatorConfig } from '../../util/config-types' +import { ViewedRouteObject, ViewedRouteState } from '../util/types' import PageTitle from '../util/page-title' -import { RouteRow } from './RouteRow' +import { RouteRow } from './route-row' import VehiclePositionRetriever from './vehicle-position-retriever' interface FilterProps { @@ -47,8 +45,7 @@ interface Props { routes: Route[] setMainPanelContent: (panelId: number | null) => void setRouteViewerFilter: (filter: FilterProps) => void - setViewedRoute: SetViewedRouteHandler - transitOperators: TransitOperator[] + transitOperators: TransitOperatorConfig[] viewedRoute?: ViewedRouteState viewedRouteObject?: ViewedRouteObject } @@ -125,7 +122,6 @@ class RouteViewer extends Component { intl, modes, routes: sortedRoutes, - setViewedRoute, transitOperators, viewedRoute, viewedRouteObject @@ -254,7 +250,6 @@ class RouteViewer extends Component { key={route.id} operator={operator} route={route} - setViewedRoute={setViewedRoute} /> ) })} @@ -272,14 +267,14 @@ class RouteViewer extends Component { // connect to redux store -const mapStateToProps = (state: any) => { +const mapStateToProps = (state: AppReduxState) => { const { viewedRoute } = state.otp.ui return { agencies: getAgenciesFromRoutes(state), filter: state.otp.ui.routeViewer.filter, modes: getModesForActiveAgencyFilter(state), routes: getSortedFilteredRoutes(state), - transitOperators: state.otp.config.transitOperators, + transitOperators: state.otp.config.transitOperators || [], viewedRoute, viewedRouteObject: state.otp.transitIndex.routes?.[viewedRoute?.routeId] } @@ -289,8 +284,7 @@ const mapDispatchToProps = { findRouteIfNeeded: apiActions.findRouteIfNeeded, findRoutesIfNeeded: apiActions.findRoutesIfNeeded, setMainPanelContent: uiActions.setMainPanelContent, - setRouteViewerFilter: uiActions.setRouteViewerFilter, - setViewedRoute: uiActions.setViewedRoute + setRouteViewerFilter: uiActions.setRouteViewerFilter } export default connect( diff --git a/lib/reducers/create-otp-reducer.js b/lib/reducers/create-otp-reducer.js index a2c39ddc2..69b33584d 100644 --- a/lib/reducers/create-otp-reducer.js +++ b/lib/reducers/create-otp-reducer.js @@ -16,7 +16,7 @@ import { getISOLikeTimestamp } from '../util/state' import { MainPanelContent, MobileScreens } from '../actions/ui-constants' const { filterProfileOptions } = coreUtils.profile -const { getDefaultQuery } = coreUtils.query +const { getDefaultQuery, getUrlParams } = coreUtils.query const { getItem } = coreUtils.storage const { getUserTimezone } = coreUtils.time @@ -153,6 +153,8 @@ export function getInitialState(userDefinedConfig) { ...(transitModeSettings || []) ] + const sessionId = new URLSearchParams(getUrlParams()).get('sessionId') + return { activeSearchId: 0, config, @@ -164,7 +166,9 @@ export function getInitialState(userDefinedConfig) { type: config.itinerary?.defaultSort || 'BEST' } }, - initialUrl: window.location.pathname, + initialUrl: `${window.location.pathname}${ + sessionId ? `?sessionId=${sessionId}` : '' + }`, lastActionMillis: 0, location: { currentPosition: { diff --git a/lib/util/config-types.ts b/lib/util/config-types.ts index 18b2940f8..e8008d9eb 100644 --- a/lib/util/config-types.ts +++ b/lib/util/config-types.ts @@ -221,6 +221,7 @@ export type SupportedOverlays = | MapTileLayerConfig export interface MapConfig { + autoFlyOnTripFormUpdate?: boolean baseLayers?: BaseLayerConfig[] initLat?: number initLon?: number diff --git a/lib/util/state.js b/lib/util/state.js index 47a777ed6..9ceb2b350 100644 --- a/lib/util/state.js +++ b/lib/util/state.js @@ -118,6 +118,18 @@ export const getActiveItineraries = createSelector( } ) +/** + * If there are no itineraries, generate an error + * so we're not left with an empty results container. + */ +export const createNoItinerariesErr = (state, errors, pending) => { + const itineraries = getActiveItineraries(state) + if (errors && itineraries.length === 0 && !pending) { + errors.NO_TRANSIT_CONNECTION = new Set() + } + return errors +} + /** * Helper method to sort itineraries. * As the name indicates, it will mutate the order in the specified array. diff --git a/package.json b/package.json index 9e33a58a0..bf546fa3c 100644 --- a/package.json +++ b/package.json @@ -50,10 +50,10 @@ "@opentripplanner/geocoder": "^2.2.2", "@opentripplanner/humanize-distance": "^1.2.0", "@opentripplanner/icons": "^2.0.10", - "@opentripplanner/itinerary-body": "^5.2.8", + "@opentripplanner/itinerary-body": "^5.3.0", "@opentripplanner/location-field": "^2.0.17", "@opentripplanner/location-icon": "^1.4.1", - "@opentripplanner/map-popup": "^3.0.3", + "@opentripplanner/map-popup": "^3.1.0", "@opentripplanner/otp2-tile-overlay": "^1.0.12", "@opentripplanner/park-and-ride-overlay": "^2.0.8", "@opentripplanner/printable-itinerary": "^2.0.20", diff --git a/yarn.lock b/yarn.lock index 78e072aa4..2cddcde2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2434,7 +2434,7 @@ "@opentripplanner/location-icon" "^1.4.1" flat "^5.0.2" -"@opentripplanner/geocoder@^2.0.1", "@opentripplanner/geocoder@^2.2.2": +"@opentripplanner/geocoder@^2.2.2": version "2.2.2" resolved "https://registry.yarnpkg.com/@opentripplanner/geocoder/-/geocoder-2.2.2.tgz#8ddc669287ccdfff1a5cce14d1fa8049421c6480" integrity sha512-tJIOOE5N9kpMj0ji1YyVfWwg4yAFVs7Ks+EET67acql768bXwRE6rHoX6oaHvKhbCDjaQ7kuPIwi1BYWHQgg0Q== @@ -2458,14 +2458,14 @@ "@opentripplanner/core-utils" "^11.2.3" prop-types "^15.7.2" -"@opentripplanner/itinerary-body@^5.2.6", "@opentripplanner/itinerary-body@^5.2.8": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@opentripplanner/itinerary-body/-/itinerary-body-5.2.8.tgz#12cb356dc3c203af9603541d46b2c30f0cc8dbe1" - integrity sha512-D/gH80BlTR/J4XYyhVG234J5qVatzYwEjObHUY01u17X+uUgRcl05zv9vNSLx9Va0UDxPc7oR+Ro5VnkW+QkKA== +"@opentripplanner/itinerary-body@^5.2.6", "@opentripplanner/itinerary-body@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@opentripplanner/itinerary-body/-/itinerary-body-5.3.0.tgz#1a611dc6c49438666e58c34d0f1f88ab6ff48f2d" + integrity sha512-yNMluEX4jJMEdvObGcivnJCS8wMqzZ1j+zJ/40oE9uK9XNyT6o3ascpcsDPN45ZJTIUBoj1FVhItvrfLxaRYMA== dependencies: - "@opentripplanner/core-utils" "^11.2.3" + "@opentripplanner/core-utils" "^11.3.1" "@opentripplanner/humanize-distance" "^1.2.0" - "@opentripplanner/icons" "^2.0.9" + "@opentripplanner/icons" "^2.0.10" "@opentripplanner/location-icon" "^1.4.1" "@styled-icons/fa-solid" "^10.34.0" "@styled-icons/foundation" "^10.34.0" @@ -2497,14 +2497,14 @@ "@styled-icons/fa-regular" "^10.34.0" "@styled-icons/fa-solid" "^10.34.0" -"@opentripplanner/map-popup@^3.0.2", "@opentripplanner/map-popup@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@opentripplanner/map-popup/-/map-popup-3.0.3.tgz#4ded505bcf23f505b07abfe5d24142eb2faa483a" - integrity sha512-AvXLUfnEj5PoDHd8eFdpMXsXqmLyreSPPeiVIggNvZUDTm6uHpCAovSrSOOoFT3nOIEaUw4TCcjamJeV0gaNJw== +"@opentripplanner/map-popup@^3.0.2", "@opentripplanner/map-popup@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@opentripplanner/map-popup/-/map-popup-3.1.0.tgz#51627e4d4c902d10bec6fffa2c3e3eed0994a42c" + integrity sha512-UzQ9OYOslNqDxvGWIPOZ4KyIJ7R0CO2riC56AJeHz5EI0JSv1Rlt1b6JTz0BtJ9cbHksB2QB43x8bJs6if7mfg== dependencies: - "@opentripplanner/base-map" "^3.0.16" - "@opentripplanner/core-utils" "^11.2.3" - "@opentripplanner/from-to-location-picker" "^2.1.11" + "@opentripplanner/base-map" "^3.1.0" + "@opentripplanner/core-utils" "^11.3.1" + "@opentripplanner/from-to-location-picker" "^2.1.12" flat "^5.0.2" "@opentripplanner/otp2-tile-overlay@^1.0.12":