-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from mbta/dr-subscription-select-mode
Add first Create New Subscription page for Subway flow
- Loading branch information
Showing
21 changed files
with
481 additions
and
5 deletions.
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
218 changes: 218 additions & 0 deletions
218
apps/alert_processor/test/fixture/custom_cassettes/get_alerts.json
Large diffs are not rendered by default.
Oops, something went wrong.
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,14 @@ | ||
$cerulean: #0061cb; | ||
$gray-lightest: #e9eaed; | ||
$pale-blue: #cde0f5; | ||
|
||
$link-color: $cerulean; | ||
$link-hover-color: $pale-blue; | ||
$link-hover-decoration: none; | ||
$border-color: $gray-lightest; | ||
|
||
$brand-bus: #ffce0c; | ||
$brand-commuter-rail: #a00a78; | ||
$brand-ferry: #5da9e8; | ||
$brand-purple: #3324ae; | ||
$brand-subway: #494f5c; |
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,27 @@ | ||
html { | ||
@include media-breakpoint-up(xxl) { | ||
font-size: $base-font-size-xxl; | ||
} | ||
} | ||
|
||
h1, | ||
.h1 { | ||
border-bottom-color: $brand-purple; | ||
border-bottom-style: solid; | ||
border-bottom-width: $base-spacing / 4; | ||
font-family: $font-family-base; | ||
font-weight: $headings-font-weight; | ||
margin-bottom: 2.875rem; | ||
padding: 1.75rem 0 0.5rem; | ||
|
||
@include media-breakpoint-up(xxl) { | ||
font-size: $font-size-h1-xxl; | ||
} | ||
} | ||
|
||
h2, | ||
.h2 { | ||
@include media-breakpoint-up(xxl) { | ||
font-size: $font-size-h2-xxl; | ||
} | ||
} |
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,92 @@ | ||
.select-service { | ||
@include make-col(8); | ||
@include make-col-offset(2); | ||
|
||
text-align: center; | ||
} | ||
|
||
.select-service-header { | ||
font-weight: $headings-font-weight; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.select-service-subheader { | ||
margin-bottom: 2.25rem; | ||
} | ||
|
||
.service-options-container { | ||
border: $border-width solid $gray-lightest; | ||
} | ||
|
||
.service-option { | ||
display: block; | ||
padding: 1rem 0; | ||
position: relative; | ||
} | ||
|
||
.service-option:not(:last-child) { | ||
border-bottom: $border-width solid $gray-lightest; | ||
} | ||
|
||
.service-option:hover { | ||
color: $link-color; | ||
background-color: $link-hover-color; | ||
} | ||
|
||
.subscription-icon { | ||
border-radius: 100%; | ||
height: 1.5rem; | ||
left: 1.25rem; | ||
position: absolute; | ||
top: 1.125rem; | ||
width: 1.5rem; | ||
|
||
img { | ||
position: relative; | ||
} | ||
} | ||
|
||
.subway-icon { | ||
background-color: $brand-subway; | ||
|
||
img { | ||
height: 1rem; | ||
} | ||
} | ||
|
||
.commuter-rail-icon { | ||
background-color: $brand-commuter-rail; | ||
|
||
img { | ||
bottom: .03125rem; | ||
height: 1.125rem; | ||
} | ||
} | ||
|
||
|
||
.bus-icon { | ||
background-color: $brand-bus; | ||
|
||
img { | ||
height: 1rem; | ||
left: .0625rem; | ||
} | ||
} | ||
|
||
|
||
.ferry-icon { | ||
background-color: $brand-ferry; | ||
|
||
img { | ||
bottom: .0625rem; | ||
height: 1rem; | ||
} | ||
} | ||
|
||
|
||
.mbta-icon { | ||
|
||
img { | ||
bottom: .1875rem; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
@import 'node_modules/bootstrap/scss/variables'; | ||
$fa-font-path: "../fonts"; | ||
$font-family-base: 'LatoLatinWeb', $font-family-sans-serif; | ||
@import "colors"; | ||
|
||
$base-spacing: 1rem; | ||
$base-font-size: 16px; | ||
$base-font-size-xxl: 18px; | ||
$headings-font-weight: bold; | ||
$headings-line-height: 1.5; | ||
$font-size-h1-xxl: 1.875rem; | ||
$font-size-h2-xxl: 1.625rem; | ||
$font-family-base: 'LatoLatinWeb', sans-serif; |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
/* This file is for your main application css. */ | ||
@import "variables"; | ||
@import "font-awesome"; | ||
@import "bootstrap"; | ||
@import "font-sizes"; | ||
@import "font-awesome"; | ||
@import "lato"; | ||
@import "subscription"; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion
7
apps/concierge_site/lib/controllers/subscription_controller.ex
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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
defmodule ConciergeSite.SubscriptionController do | ||
use ConciergeSite.Web, :controller | ||
use Guardian.Phoenix.Controller | ||
|
||
def index(conn, _params) do | ||
def index(conn, _params, _user, _claims) do | ||
render conn, "index.html" | ||
end | ||
|
||
def new(conn, _params, _user, _claims) do | ||
render conn, "new.html" | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
apps/concierge_site/lib/controllers/subway_subscription_controller.ex
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,8 @@ | ||
defmodule ConciergeSite.SubwaySubscriptionController do | ||
use ConciergeSite.Web, :controller | ||
use Guardian.Phoenix.Controller | ||
|
||
def new(conn, _params, _user, _claims) do | ||
render conn, "new.html" | ||
end | ||
end |
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
6 changes: 6 additions & 0 deletions
6
apps/concierge_site/lib/templates/subscription/_service_option.html.eex
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,6 @@ | ||
<%= link to: @link_to, class: "service-option" do %> | ||
<div class="<%= @icon_class %> subscription-icon"> | ||
<img src="<%= @icon_src %>" /> | ||
</div> | ||
<div><%= @name %></div> | ||
<% end %> |
37 changes: 37 additions & 0 deletions
37
apps/concierge_site/lib/templates/subscription/new.html.eex
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,37 @@ | ||
<h1>Create New Subscription</h1> | ||
<div class="select-service"> | ||
<h2 class="select-service-header">Select a service:</h2> | ||
<p class="select-service-subheader">What mode of transportation do you take?</p> | ||
|
||
<div class="service-options-container"> | ||
<%= render "_service_option.html", | ||
link_to: subway_subscription_path(@conn, :new), | ||
icon_class: "subway-icon", | ||
icon_src: static_url(@conn, "/images/subway.svg"), | ||
name: "Subway" %> | ||
|
||
<%= render "_service_option.html", | ||
link_to: "#", | ||
icon_class: "commuter-rail-icon", | ||
icon_src: static_url(@conn, "/images/commuter-rail.svg"), | ||
name: "Commuter Rail" %> | ||
|
||
<%= render "_service_option.html", | ||
link_to: "#", | ||
icon_class: "bus-icon", | ||
icon_src: static_url(@conn, "/images/bus.svg"), | ||
name: "Bus" %> | ||
|
||
<%= render "_service_option.html", | ||
link_to: "#", | ||
icon_class: "ferry-icon", | ||
icon_src: static_url(@conn, "/images/ferry.svg"), | ||
name: "Ferry" %> | ||
|
||
<%= render "_service_option.html", | ||
link_to: "#", | ||
icon_class: "mbta-icon", | ||
icon_src: static_url(@conn, "/images/m-b-t-a.svg"), | ||
name: "Station Amenities (elevators, escalators, etc.)" %> | ||
</div> | ||
</div> |
1 change: 1 addition & 0 deletions
1
apps/concierge_site/lib/templates/subway_subscription/new.html.eex
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 @@ | ||
Subway |
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,3 @@ | ||
defmodule ConciergeSite.SubwaySubscriptionView do | ||
use ConciergeSite.Web, :view | ||
end |
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
28 changes: 28 additions & 0 deletions
28
apps/concierge_site/test/web/controllers/subway_subscription_controller_test.exs
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,28 @@ | ||
defmodule ConciergeSite.SubwaySubscriptionControllerTest do | ||
use ConciergeSite.ConnCase | ||
|
||
@password "password1" | ||
@encrypted_password Comeonin.Bcrypt.hashpwsalt(@password) | ||
|
||
alias AlertProcessor.{Model.User, Repo} | ||
|
||
describe "authorized" do | ||
test "GET /subscriptions/subway/new", %{conn: conn} do | ||
user = Repo.insert!(%User{email: "test@email.com", | ||
role: "user", | ||
encrypted_password: @encrypted_password}) | ||
conn = user | ||
|> guardian_login(conn) | ||
|> get("/subscriptions/subway/new") | ||
|
||
assert html_response(conn, 200) =~ "Subway" | ||
end | ||
end | ||
|
||
describe "unauthorized" do | ||
test "GET /subscriptions/subway/new", %{conn: conn} do | ||
conn = get(conn, "/subscriptions/subway/new") | ||
assert html_response(conn, 302) =~ "/login" | ||
end | ||
end | ||
end |