Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/path-to-regexp-8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ethangardner authored Dec 6, 2024
2 parents 5f079c9 + 7af78d4 commit 1a24a34
Show file tree
Hide file tree
Showing 133 changed files with 4,561 additions and 435 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 10x Access to Justice Tooling
# 10x Forms Platform

Test bed for ATJ platform tooling, completed as part of the [10x Digital Access to Justice Platform](https://trello.com/c/25Jl6NwJ/207-digital-access-to-justice-platform) project.
Test bed for 10x forms tooling, completed as part of the [10x Forms Platform](https://github.com/orgs/GSA-TTS/projects/38?pane=issue&itemId=58755590&issue=GSA-TTS%7C10x-projects%7C29) project.

## Overview

Expand All @@ -17,13 +17,13 @@ The platform is made up of the following high-level terms.

### Key personas

- Content authors: legal experts who craft guided interview experiences via a "no code" interface
- Self-represented litigants (SREs): end-users who interact with the court via guided interviews created by content authors
- Form Builders: government program office staff or UX experts who create and publish "guided interview" web experiences for members of the public and fellow government staff via a friendly browser-based app, no coding necessary. For examples of "guided interview" style web experiences, check out [IRS Direct File](https://coforma.io/case-studies/irs-direct-file#results) (filing your taxes), [GetCalFresh](https://codeforamerica.org/news/overcoming-barriers-setting-expectations-for-calfresh-eligibility/) (Applying for food benefits) and [Court Forms Online](https://courtformsonline.org/) (filing court documents).
- Form Fillers: folks who provide info to the government via guided interviews created by Form Builders

### Things

- **Blueprint**: produced by a content author, the blueprint defines the structure of an interactive session between a court and an SRL
- **Conversation**: one instance of a blueprint; the interactive session between a court and an SRL. Other terms for this concept include dialogue or session.
- **Blueprint**: produced by a form builder, the blueprint defines the structure of an interactive session between a government office and a form filler.
- **Conversation**: one instance of a blueprint; the interactive session between a government office and a form filler. Other terms for this concept include dialogue or session.
- **Pattern/template**: the building blocks of a blueprint, patterns implement UX best-practices, defining the content and behavior of the user interface.
- **Prompt**: produced by a pattern, the prompt defines what is presented to the end user at single point in a conversation.
- **Component**: user interface component that acts as the building block of prompts.
Expand Down Expand Up @@ -61,6 +61,7 @@ To start developing with hot reloading, use:
```bash
pnpm build
```

then run:

```bash
Expand Down
2 changes: 2 additions & 0 deletions apps/spotlight/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
type FormConfig,
type FormService,
createFormService,
parsePdf,
} from '@atj/forms';
import { defaultFormConfig } from '@atj/forms';
import { BrowserFormRepository } from '@atj/forms/context';
Expand Down Expand Up @@ -43,6 +44,7 @@ const createAppFormService = () => {
repository,
config: defaultFormConfig,
isUserLoggedIn: () => true,
parsePdf,
});
} else {
return createTestBrowserFormService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const getFormSession: GetFormSession = async (ctx, opts) => {
},
});
} else {
console.log('using session', result.data.data);
ctx.setState({
formSessionResponse: {
status: 'loaded',
Expand Down
4 changes: 2 additions & 2 deletions apps/spotlight/src/lib/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type GithubRepository = {

export const DEFAULT_REPOSITORY: GithubRepository = {
owner: 'gsa-tts',
repository: 'atj-platform',
repository: 'forms',
branch: 'main',
commit: 'main',
};
Expand All @@ -28,7 +28,7 @@ export const getGithubRepository = async (
const { execSync } = await import('child_process');
return {
owner: env.OWNER || 'gsa-tts',
repository: env.REPOSITORY || 'atj-platform',
repository: env.REPOSITORY || 'forms',
branch: env.BRANCH || 'main',
commit: execSync('git rev-parse HEAD').toString().trim(),
};
Expand Down
4 changes: 0 additions & 4 deletions documents/podman-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export TESTCONTAINERS_RYUK_DISABLED=true

After adding the above lines to your shell configuration file, apply the changes by reloading your shell configuration:


For Zsh:
```bash
source ~/.zshrc
Expand All @@ -86,7 +85,6 @@ pnpm test

If you're new to the team and need to start with Podman, follow these steps:


### Step 1: Install Podman

Install Podman using Homebrew:
Expand Down Expand Up @@ -122,7 +120,6 @@ export TESTCONTAINERS_RYUK_DISABLED=true

After adding the above lines to your shell configuration file, apply the changes by reloading your shell configuration:


For Zsh:
```bash
source ~/.zshrc
Expand Down Expand Up @@ -187,7 +184,6 @@ export PATH="$PNPM_HOME:$PATH"

Save the file and close the editor. Apply the changes by reloading your shell configuration:


For Zsh:
```bash
source ~/.zshrc
Expand Down
2 changes: 1 addition & 1 deletion infra/cdktf/__tests__/main-test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'cdktf/lib/testing/adapters/jest';

describe('atj-platform app stack', () => {
describe('Forms Platform app stack', () => {
it.todo('should be tested');
});
2 changes: 1 addition & 1 deletion infra/cdktf/src/lib/cloud.gov/node-astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class AstroService extends Construct {
new cloudfoundry.app.App(this, `${id}-app`, {
name: `${id}-app`,
space: spaceId,
dockerImage: `ghcr.io/gsa-tts/atj-platform/${imageName}`,
dockerImage: `ghcr.io/gsa-tts/forms/${imageName}`,
memory: 1024,
diskQuota: 4096,
healthCheckType: 'http',
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Result<T, E = string> = Success<T> | Failure<E>;
export type VoidResult<E = string> = VoidSuccess | Failure<E>;

export const success = <T>(data: T): Success<T> => ({ success: true, data });
export const voidSuccess: VoidSuccess = { success: true };
export const failure = <E>(error: E): Failure<E> => ({ success: false, error });

export { en as enLocale } from './locales/en/app.js';
39 changes: 34 additions & 5 deletions packages/common/src/locales/en/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ const defaults = {

export const en = {
patterns: {
attachment: {
...defaults,
displayName: 'Attachment',
maxAttachmentsLabel: 'Max attachments',
allowedFileTypesLabel: 'Allowable file types',
errorTextMustContainChar: 'String must contain at least 1 character(s)',
errorUnsupportedFileType: 'Invalid file type found.',
},
checkbox: {
...defaults,
displayName: 'Checkbox',
Expand All @@ -31,7 +39,7 @@ export const en = {
fieldLabel: 'Page title',
},
paragraph: {
fieldLabel: 'Paragraph Text',
fieldLabel: 'Paragraph text',
displayName: 'Paragraph',
errorTextMustContainChar: 'String must contain at least 1 character(s)',
},
Expand All @@ -48,17 +56,38 @@ export const en = {
},
selectDropdown: {
...defaults,
displayName: 'Select Dropdown label',
fieldLabel: 'Select Dropdown label',
displayName: 'Select dropdown label',
fieldLabel: 'Select dropdown label',
errorTextMustContainChar: 'String must contain at least 1 character(s)',
},
dateOfBirth: {
...defaults,
displayName: 'Date of Birth label',
fieldLabel: 'Date Of Birth label',
displayName: 'Date of birth label',
fieldLabel: 'Date of birth label',
hintLabel: 'Date of Birth Hint label',
hint: 'For example: January 19 2000',
errorTextMustContainChar: 'String must contain at least 1 character(s)',
},
emailInput: {
...defaults,
displayName: 'Email Input label',
fieldLabel: 'Email Input label',
errorTextMustContainChar: 'String must contain at least 1 character(s)',
},
phoneNumber: {
...defaults,
displayName: 'Phone number label',
fieldLabel: 'Phone number label',
hintLabel: 'Phone number hint label',
hint: '10-digit, U.S. only, for example 999-999-9999',
},
ssn: {
...defaults,
displayName: 'Social Security Number label',
fieldLabel: 'Social Security Number label',
hintLabel: 'Social Security Number hint label',
hint: 'For example, 555-11-0000',
errorTextMustContainChar: 'String must contain at least 1 character(s)',
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
export async function up(knex) {
await knex.schema.createTable('form_documents', table => {
table.uuid('id').primary();
table.string('type').notNullable();
table.string('file_name').notNullable();
table.binary('data').notNullable();
table.string('extract').notNullable();
});
}

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
export async function down(knex) {
await knex.schema.dropTableIfExists('form_documents');
}
16 changes: 14 additions & 2 deletions packages/database/src/clients/kysely/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {
ColumnType,
Generated,
Insertable,
Kysely,
Expand All @@ -14,7 +15,9 @@ export interface Database<T extends Engine = Engine> {
sessions: SessionsTable<T>;
forms: FormsTable;
form_sessions: FormSessionsTable;
form_documents: FormDocumentsTable;
}
export type DatabaseClient = Kysely<Database>;

interface UsersTable {
id: string;
Expand Down Expand Up @@ -48,8 +51,6 @@ export type FormsTableSelectable = Selectable<FormsTable>;
export type FormsTableInsertable = Insertable<FormsTable>;
export type FormsTableUpdateable = Updateable<FormsTable>;

export type DatabaseClient = Kysely<Database>;

interface FormSessionsTable {
id: string;
form_id: string;
Expand All @@ -60,3 +61,14 @@ interface FormSessionsTable {
export type FormSessionsTableSelectable = Selectable<FormSessionsTable>;
export type FormSessionsTableInsertable = Insertable<FormSessionsTable>;
export type FormSessionsTableUpdateable = Updateable<FormSessionsTable>;

interface FormDocumentsTable {
id: string;
type: string;
data: ColumnType<Buffer, Buffer, Buffer>;
file_name: string;
extract: string;
}
export type FormDocumentsTableSelectable = Selectable<FormDocumentsTable>;
export type FormDocumentsTableInsertable = Insertable<FormDocumentsTable>;
export type FormDocumentsTableUpdateable = Updateable<FormDocumentsTable>;
Loading

0 comments on commit 1a24a34

Please sign in to comment.