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
const Ajv = require("ajv"); | |
const ajvKeywords = require("ajv-keywords"); | |
// This is an export of all of your JSON Schema files | |
const schemas = require("../schemas"); | |
// EXAMPLE: | |
// This could live in a ApplicationError.js file and be shared with other files | |
const ApplicationError = class ApplicationError { | |
/** |
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
{ | |
"Records": [ | |
{ | |
"eventVersion": "2.0", | |
"eventTime": "1970-01-01T00:00:00.000Z", | |
"requestParameters": { | |
"sourceIPAddress": "127.0.0.1" | |
}, | |
"s3": { | |
"configurationId": "testConfigRule", |
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
import path from "path"; | |
import recursiveReadSync from "recursive-readdir-sync"; | |
type RelativeFilePath = string; | |
type AbsoluteFilePath = string; | |
const SRC_DIR = "../src/"; | |
const STORIES_DIR = "../storybook/stories/"; | |
/** |
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
import { getNextPathname, goTo } from "router"; | |
import { updateApplication } from "api"; | |
function IncomePage() { | |
// This is within the page for example purposes, but | |
// could be abstracted for a multi-page form. | |
const handleFormSubmit = (event) => { | |
event.preventDefault(); | |
const formData = new FormData(event.target); |
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
// router.js | |
import { routingMachine } from "machine"; | |
export function getNextPathname(event, context) { | |
const currentPathname = window.location.pathname; | |
const nextPathname = routingMachine | |
.withContext(context) // https://xstate.js.org/docs/guides/context.html | |
.transition(currentPathname, event); // https://xstate.js.org/api/interfaces/statemachine.html#transition | |
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
// machine.js | |
import { Machine } from "xstate"; | |
// Conditions for some of our transitions | |
const guards = { | |
hasJobIncome: (context) => context.has_job_income === true, | |
}; | |
export const routingMachine = Machine({ | |
// Initial state is mostly useful for visualizations, for our purposes. |
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
const routes = { | |
auth: { | |
login: "/auth/login", | |
reset: "/auth/reset-password" | |
}, | |
apply: { | |
documents: "/apply/upload-docs", | |
income: "/apply/income", | |
name: "/apply/name", | |
review: "/apply/review", |
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
// routes.js | |
export const routes = { | |
apply: { | |
documents: "/apply/upload-docs", | |
household: "/apply/household", | |
income: "/apply/income", | |
name: "/apply/name", | |
review: "/apply/review", | |
success: "/apply/success" |
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
var names = [ | |
"patricia", "aakhus", "atia", "abawi", "edward", "abbey", "lynn", "belle", "kendrick", "abbott", "eleanor", "hallowell", "hailey", "megan", "shana", "abé", "louise", "abeita", "robert", "abel", "aberjhani", "walter", "abish", "abiola", "abrams", "diana", "susan", "abulhawa", "kathy", "acker", "cherry", "adair", "alice", "adams", "henry", "yda", "addis", "kim", "addonizio", "george", "ade", "renata", "adler", "warren", "james", "agee", "charlotte", "agell", "kelli", "russell", "agodon", "conrad", "aiken", "hiag", "akmakjian", "mitch", "albom", "kathleen", "alcalá", "louisa", "may", "alcott", "isabella", "macdonald", "alden", "clifford", "lindsey", "alderman", "thomas", "bailey", "aldrich", "malin", "alegria", "lloyd", "alexander", "sherman", "alexie", "horatio", "nelson", "algren", "hervey", "allen", "isabel", "allende", "dorothy", "allison", "lisa", "alther", "joseph", "altsheler", "julia", "alvarez", "rudolfo", "anaya", "laurie", "halse", "anderson", "poul", "sherwood", "eliza", "frances", "a |
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
InputPii | |
Empty* | |
onFocus -> Unmasked & Focused | |
Unmasked & Focused | |
onBlur -> Unmasked | |
Submit -> Masked | |
Unmasked | |
onFocus -> Unmasked & Focused | |
Masked | |
onFocus -> Masked & Focused |
NewerOlder