-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61450d4
commit 575d405
Showing
16 changed files
with
169 additions
and
15 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
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,5 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe Provider, type: :model 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 |