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

[feature] Pre-fare alert 2.0 frontend left screen #1787

Merged

Conversation

hannahpurcell
Copy link
Contributor

@hannahpurcell hannahpurcell commented Jun 15, 2023

Asana task: Pre-Fare Alerts: Frontend for single-page

The files changed diff is HUGE, but the diff is actually much more manageable!

  • The last 3 files in the diff related to backend stuff: this is a GH glitch. I did not make these changes, and all these changes are already in the prefare-alerts branch from this merge. I don't know why they are appearing in the diff.
  • 18 of the files are just svgs

So there are 6 (big) files to review.

1 known bug: the font resizing doesn't work immediately in the case where an SVG is counted in the area being measured. I'll be working on a task to improve SVG loading. So let's revisit this bug.

Note: I made a new scss file for the single page alert, but it could overlap a lot with the takeover alert stuff, just fyi to whoever takes that on.

Example serialized data:

    %{
      issue: "Trains may be delayed up to 15 minutes",
      location: "location string",
      cause: :power_issue,
      remedy: "Red Line Braintree branch has resumed service between JFK/UMass and Wollaston after a signal issue was fixed. Expect delays of about 15 minutes while our crews work to get service back on schedule.",
      # array of svg names!
      routes: [
       "rl-ashmont"
      ],
      # unaffected_routes: [
      #   "gl-c", "green-c-circle"
      # ],
      effect: :delay,
      region: :here,
      updated_at: "Wednesday, 8:23 pm"
    }

@github-actions
Copy link

Coverage of commit ab5f63e

Summary coverage rate:
  lines......: 41.3% (2248 of 5437 lines)
  functions..: 42.7% (1025 of 2401 functions)
  branches...: no data found

Files changed coverage rate:
                                                                           |Lines       |Functions  |Branches    
  Filename                                                                 |Rate     Num|Rate    Num|Rate     Num
  ===============================================================================================================
  lib/screens/v2/candidate_generator/widgets/reconstructed_alert.ex        |84.6%     91|81.8%    22|    -      0
  lib/screens/v2/widget_instance/reconstructed_alert.ex                    |90.2%    164|95.7%    23|    -      0

Download coverage report

@github-actions
Copy link

Coverage of commit 0e0a6d9

Summary coverage rate:
  lines......: 41.3% (2248 of 5437 lines)
  functions..: 42.7% (1025 of 2401 functions)
  branches...: no data found

Files changed coverage rate:
                                                                           |Lines       |Functions  |Branches    
  Filename                                                                 |Rate     Num|Rate    Num|Rate     Num
  ===============================================================================================================
  lib/screens/v2/candidate_generator/widgets/reconstructed_alert.ex        |84.6%     91|81.8%    22|    -      0
  lib/screens/v2/widget_instance/reconstructed_alert.ex                    |90.2%    164|95.7%    23|    -      0

Download coverage report

@hannahpurcell hannahpurcell changed the base branch from master to prefare-alerts June 22, 2023 14:17
@hannahpurcell hannahpurcell requested review from a team, PaulJKim and jzimbel-mbta and removed request for a team and PaulJKim June 22, 2023 14:39
@hannahpurcell hannahpurcell changed the title WIP: pre-fare alert 2.0 frontend left screen [featurae] Pre-fare alert 2.0 frontend left screen Jun 22, 2023
@hannahpurcell hannahpurcell changed the title [featurae] Pre-fare alert 2.0 frontend left screen [feature] Pre-fare alert 2.0 frontend left screen Jun 22, 2023
@hannahpurcell hannahpurcell requested review from cmaddox5 and removed request for jzimbel-mbta June 26, 2023 13:37
Copy link
Contributor

@cmaddox5 cmaddox5 left a comment

Choose a reason for hiding this comment

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

Ok, I think I was able to test most cases. I tested them with on my backend branch with these changes merged in so I didn't have to set up dummy data. A lot of my comments are integration related.

assets/src/components/v2/pre_fare_single_screen_alert.tsx Outdated Show resolved Hide resolved
assets/src/util/util.tsx Show resolved Hide resolved
assets/src/components/v2/pre_fare_single_screen_alert.tsx Outdated Show resolved Hide resolved
assets/src/components/v2/pre_fare_single_screen_alert.tsx Outdated Show resolved Hide resolved
assets/src/components/v2/pre_fare_single_screen_alert.tsx Outdated Show resolved Hide resolved
@cmaddox5 cmaddox5 assigned hannahpurcell and unassigned cmaddox5 Jun 26, 2023
@github-actions
Copy link

Coverage of commit 1db1d91

Summary coverage rate:
  lines......: 41.3% (2248 of 5437 lines)
  functions..: 42.7% (1025 of 2401 functions)
  branches...: no data found

Files changed coverage rate:
                                                                           |Lines       |Functions  |Branches    
  Filename                                                                 |Rate     Num|Rate    Num|Rate     Num
  ===============================================================================================================
  lib/screens/v2/candidate_generator/widgets/reconstructed_alert.ex        |84.6%     91|81.8%    22|    -      0
  lib/screens/v2/widget_instance/reconstructed_alert.ex                    |90.2%    164|95.7%    23|    -      0

Download coverage report

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

Coverage of commit 1d7b237

Summary coverage rate:
  lines......: 41.6% (2276 of 5468 lines)
  functions..: 42.8% (1029 of 2405 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

Coverage of commit 1d7b237

Summary coverage rate:
  lines......: 41.6% (2276 of 5468 lines)
  functions..: 42.8% (1029 of 2405 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

Copy link
Contributor

@cmaddox5 cmaddox5 left a comment

Choose a reason for hiding this comment

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

🚀

@cmaddox5 cmaddox5 assigned hannahpurcell and unassigned cmaddox5 Jul 10, 2023
@hannahpurcell hannahpurcell merged commit 24fdc60 into prefare-alerts Jul 11, 2023
2 checks passed
@hannahpurcell hannahpurcell deleted the hp/prefare-alert-2.0-frontend-left-screen branch July 11, 2023 19:56
hannahpurcell added a commit that referenced this pull request Feb 2, 2024
* feat: Pre-Fare alerts 2.0 CandidateGenerator (#1765)

* [feature] Pre-fare alert 2.0 frontend left screen (#1787)

* feat: Pre-Fare alerts 2.0 serializer (#1785)

* feat: Disruption Diagram - Frontend (#1825)

* [tweak] Disruption diagram maths (#1830)

* In LocationContext, tag stop sequences by their routes (#1832)

* tweak: PreFare simulations (#1837)

* [feature] Prefare alerts 2.0 audio (#1824)

* feat: Disruption Diagram - Backend (#1828)

* feat(WIP): Disruption diagram backend. Working for Blue Line and other basic scenarios only atm.

* fix: Update location context stop sequences field in TrainCrowdingTest (#1895)

* test: D. diagram unit test for RL trunk statio closure with home stop at Ashmont (#1894)

* Added padding-top to layout when there is no banner. (#1902)

* Cm/govt ctr gl affected pill fix (#1898)

* Cm/adjust diagram size positioning (#1896)

* Changed label to display on a single line. (#1899)

* Tweaked resizer logic so it maxHeight matches the card height on page. (#1905)

* Removed bolding of 'to' from arrow labels. (#1908)

* Fixed icon display when current stop is affected. (#1903)

* feat: Consistent description of disrupted stop ranges throughout pre-fare alerts (#1912)

* Adjusted Ashmont/Braintree destination to proper formatting (#1917)

* Refactor disruption diagram SVG (#1914)

* Log alert ID and screen's home stop when disruption diagram logic fails (#1920)

* polish: Recalculate dimensions in hook (#1921)

* Added audio column to GL & PreFare in admin table (#1916)

* Draw D. diagrams for multi-line alerts when home stop narrows it to 1 line (#1922)

* fix: PreFare Polish - Inside shuttle (#1941)

* fix: Pre-fare polish - Boundary alerts banner (#1945)

* fix: Pre-fare polish -- Text only resizes for bypassed stations (#1946)

* fix: Pre-fare polish -- Station closed takeover text wrapping (#1947)

* Downstream shuttle endpoint should be a circle (#1948)

* Label splitting logic was buggy (#1949)

* Prefare format in config is "Ashmont & Braintree" not "Ashmont/Braintree" (#1954)

* Sub-header for takeover alert is now regular weight (#1955)

* fix: Prefare alerts polish -- Fix GL headsign in various cases (#1957)

* fix: Prefare polish -- Use FreeText to prevent station text wrapping in subheaders (#1956)

* fix: Prefare polish -- Alerts that break assumptions use the fallback case (#1958)

* fix: Prefare polish -- Reorder audio with alerts before subway status (#1962)

* fix: Prefare polish -- New abbreviation rule (#1961)

* fix: Prefare Alerts polish -- RL headsigns for branch-only alerts (#1967)

* fix: Prefare alerts polish -- Screenplay sim sizing / page layout (#1966)

* fix: Prefare polish -- "via" diagram labels need abbreviating (#1968)

---------

Co-authored-by: Christian Maddox <christian.maddox93@gmail.com>
Co-authored-by: Jon Zimbel <jzimbel@mbta.com>
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.

3 participants