-
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.
Merge branch 'main' of https://github.com/DSACMS/iv-cbv-payroll into …
…wmg/2464-multi-modal
- Loading branch information
Showing
57 changed files
with
287 additions
and
404 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
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
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
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
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,23 @@ | ||
class PagesController < ApplicationController | ||
def home | ||
end | ||
|
||
def error_404 | ||
# When in development environment, you'll need to set | ||
# config.consider_all_requests_local = false | ||
# in config/development.rb for these pages to actually show up. | ||
@cbv_flow = if session[:cbv_flow_id] | ||
CbvFlow.find(session[:cbv_flow_id]) | ||
end | ||
|
||
render status: :not_found, formats: %i[html] | ||
end | ||
|
||
def error_500 | ||
# When in development environment, you'll need to set | ||
# config.consider_all_requests_local = false | ||
# in config/development.rb for these pages to actually show up. | ||
|
||
render status: :internal_server_error, formats: %i[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
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,40 +1,24 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
import { trackUserAction } from "../utilities/api" | ||
import { Controller } from "@hotwired/stimulus"; | ||
import { trackUserAction } from "../utilities/api"; | ||
|
||
export default class extends Controller { | ||
static targets = ["iframe"] | ||
static targets = ["content"]; | ||
|
||
connect() { | ||
this.handleClick = (event) => { | ||
if (event.target.href?.includes("#help-modal")) { | ||
trackUserAction("ApplicantOpenedHelpModal", { source: event.target.dataset.source }) | ||
} | ||
handleClick(event) { | ||
if (event.target.href?.includes("#help-modal")) { | ||
trackUserAction("ApplicantOpenedHelpModal", { | ||
source: event.target.dataset.source, | ||
}); | ||
// reset the help modal src on mousedown to ensure the help modal src is reset to "/help" | ||
document.querySelector("#help_modal_content").src = "/help"; | ||
} | ||
|
||
document.addEventListener("click", this.handleClick) | ||
} | ||
|
||
disconnect() { | ||
document.removeEventListener("click", this.handleClick) | ||
connect() { | ||
document.addEventListener("click", this.handleClick); | ||
} | ||
|
||
/** | ||
* This function is used to prepare the next URL for the iframe. | ||
* It generates a new random parameter and updates the iframe src | ||
* so that when the modal is opened, the iframe will load the | ||
* default help topics rather than the last viewed topic. | ||
*/ | ||
prepareNextUrl() { | ||
const iframe = this.iframeTarget | ||
const currentSrc = new URL(iframe.src) | ||
|
||
// Generate a new random parameter | ||
const randomHex = Array.from(crypto.getRandomValues(new Uint8Array(2))) | ||
.map(b => b.toString(16).padStart(2, "0")) | ||
.join("") | ||
|
||
// Update the iframe src with new random parameter | ||
currentSrc.searchParams.set("r", randomHex) | ||
iframe.src = currentSrc.toString() | ||
disconnect() { | ||
document.removeEventListener("click", this.handleClick); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -23,4 +23,4 @@ export const fetchArgyleToken = () => { | |
return fetchInternal(ARGYLE_TOKENS_GENERATE, { | ||
method: 'post', | ||
}) | ||
}; | ||
}; |
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
2 changes: 1 addition & 1 deletion
2
app/app/models/pinwheel_account.rb → app/app/models/payroll_account.rb
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<%= link_to help_topic_path(topic: topic, locale: I18n.locale), | ||
class: "usa-button margin-bottom-1 height-5 text-left display-block" do %> | ||
class: "usa-button margin-bottom-1 height-5 text-left display-block", | ||
data: { turbo_frame: "help_modal_content" } do %> | ||
<%= text %> | ||
<% end %> |
Oops, something went wrong.