-
Notifications
You must be signed in to change notification settings - Fork 2
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
Demo draft #4
Merged
Demo draft #4
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,4 +1,4 @@ | ||
class PagesController < ApplicationController | ||
def home | ||
def welcome | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class ProvidersController < ApplicationController | ||
ENDPOINT = 'https://sampleapps.argyle.com/employer-search/api/search?q='; | ||
|
||
def index | ||
end | ||
|
||
def search | ||
# sample endpoint — let's replace with a real sandbox | ||
# https://sampleapps.argyle.com/employer-search/api/search?q=nava | ||
# results = Net::HTTP.get(URI.parse("#{ENDPOINT}#{params.q}")) | ||
end | ||
|
||
def confirm | ||
@employer = employer_params[:employer] | ||
@payments = [ | ||
{ amount: 810, start: 'March 25', end: 'June 15', hours: 54, rate: 15 }, | ||
{ amount: 195, start: 'January 1', end: 'February 23', hours: 13, rate: 15 } | ||
] | ||
end | ||
|
||
private | ||
|
||
def employer_params | ||
params.permit(:employer) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module ProvidersHelper | ||
end |
This file was deleted.
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
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,44 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
function toOptionHTML({ value }) { | ||
return `<option value='${value}'>${value}</option>`; | ||
} | ||
|
||
const DEFAULT_OPTIONS = [ | ||
{ | ||
value: 'Uber' | ||
}, | ||
{ | ||
value: 'Instacart' | ||
}, | ||
{ | ||
value: 'Walmart' | ||
}, | ||
{ | ||
value: 'Lyft' | ||
} | ||
].map(toOptionHTML); | ||
|
||
export default class extends Controller { | ||
static targets = ["options", "continue"]; | ||
|
||
selection = null; | ||
|
||
connect() { | ||
if (this.hasOptionsTarget) { | ||
this.optionsTarget.innerHTML = DEFAULT_OPTIONS; | ||
} | ||
} | ||
|
||
search(event) { | ||
const input = event.target.value; | ||
this.optionsTarget.innerHTML = [...DEFAULT_OPTIONS, toOptionHTML({ value: input })].join(''); | ||
} | ||
|
||
select(event) { | ||
console.log(event.detail); | ||
this.selection = event.detail; | ||
|
||
this.continueTarget.disabled = false; | ||
} | ||
} |
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
This file was deleted.
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,16 @@ | ||
<h1>Hello, Matt</h1> | ||
<h2>Let's verify your payment information.</h2> | ||
|
||
<p>We'll connect to your payment records to get proof of payments to your caseworker and get benfits faster.</p> | ||
|
||
<div class="usa-alert usa-alert--info margin-bottom-3"> | ||
<div class="usa-alert__body"> | ||
<p class="usa-alert__text"> | ||
Your information is secure. We will not share or keep your log in information. You will be able to preview and approve everything that is shared with your caseworker. | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<%= link_to '/providers' do %> | ||
<button class="usa-button usa-button--outline" type="button">Get Started</button> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<h2>Review payment information from <%= @employer %></h2> | ||
<p>Below is payment information from <%= @employer %> for the past 90 days.</p> | ||
|
||
<h3 class="site-preview-heading">Total Payments: $<%= @payments.reduce(0) { |sum, payment| sum + payment[:amount] } %></h3> | ||
<div class="usa-accordion margin-bottom-4"> | ||
<% @payments.each_with_index do |payment, index| %> | ||
<div class="usa-accordion__heading"> | ||
<button | ||
type="button" | ||
class="usa-accordion__button" | ||
aria-expanded="false" | ||
aria-controls="<%= index %>" | ||
> | ||
Payment of $<%= payment[:amount] %>, <%= payment[:start] %> to <%= payment[:end] %> | ||
</button> | ||
</div> | ||
<div id="<%= index %>" class="usa-accordion__content usa-prose"> | ||
<p> | ||
<%= payment[:hours] %> hours at $<%= payment[:rate] %> per hour. | ||
</p> | ||
</div> | ||
<% end %> | ||
</div> | ||
|
||
<button class="usa-button margin-top-3 usa-button--outline" type="button">Share payment information</button> |
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,11 @@ | ||
<h2>Get payment info from your employer.</h2> | ||
|
||
<form data-controller="providers" action="/providers/confirm" method="get"> | ||
<label class="usa-label" for="employer">Search for an employer</label> | ||
<div class="usa-combo-box margin-bottom-3" data-action="input->providers#search"> | ||
<select class="usa-select" name="employer" id="employer" data-providers-target="options" data-action="change->providers#select"> | ||
<option value>Select an employer</option> | ||
</select> | ||
</div> | ||
<button class="usa-button usa-button--outline" disabled="disabled" type="submit" data-providers-target="continue">Continue</button> | ||
</form> |
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
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
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,15 @@ | ||
require 'rails_helper' | ||
|
||
# Specs in this file have access to a helper object that includes | ||
# the ProvidersHelper. For example: | ||
# | ||
# describe ProvidersHelper do | ||
# describe "string concat" do | ||
# it "concats two strings with spaces" do | ||
# expect(helper.concat_strings("this","that")).to eq("this that") | ||
# end | ||
# end | ||
# end | ||
RSpec.describe ProvidersHelper, type: :helper do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe "Providers", type: :request do | ||
describe "GET /index" do | ||
pending "add some examples (or delete) #{__FILE__}" | ||
end | ||
end |
4 changes: 2 additions & 2 deletions
4
spec/views/pages/home.html.erb_spec.rb → spec/views/pages/welcome.html.erb_spec
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,8 +1,8 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "pages/home.html.erb", type: :view do | ||
RSpec.describe "pages/welcome.html.erb", type: :view do | ||
it "displays the gov banner" do | ||
render template: "pages/home", layout: "layouts/application" | ||
render template: "pages/welcome", layout: "layouts/application" | ||
expect(rendered).to match "An official website of the United States government" | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Did you figure all this out this morning? Nice. I guess this prevents us from needing to bring in React on the frontend, so that's kind of neat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! The Hotwire stuff is kinda nice. It sorta plays well with the USWDS stuff? Thanks to event bubbling. We may start to push up against some UX jank, though.