Skip to content
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

DRAFT: Proof of concept for app.justfix.nyc/en/laletterbuilder #2308

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions frontend/lib/justfix-route-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createRentalHistoryRouteInfo } from "./rh/route-info";
import { createPasswordResetRouteInfo } from "./password-reset/route-info";
import { createEmergencyHPActionRouteInfo } from "./hpaction/emergency/route-info";
import { createAccountSettingsRouteInfo } from "./account-settings/route-info";
import { createLaLetterBuilderLocalizedRouteInfo } from "./laletterbuilder/route-info";
import { adminRouteInfo } from "./admin/route-info";

/**
Expand Down Expand Up @@ -126,6 +127,10 @@ function createLocalizedRouteInfo(prefix: string) {

rh: createRentalHistoryRouteInfo(`${prefix}/rh`),

laletterbuilder: createLaLetterBuilderLocalizedRouteInfo(
`${prefix}/laletterbuilder`
),

/** The data requests portal. */
dataRequests: createDataRequestsRouteInfo(`${prefix}/data-requests`),

Expand Down
11 changes: 11 additions & 0 deletions frontend/lib/justfix-routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ const LoadableRentalHistoryRoutes = loadable(
}
);

const LoadableLaLetterBuilderRoutes = loadable(
() => friendlyLoad(import("./laletterbuilder/site")), // Change this to routes, but need to rewrite routes
{
fallback: <LoadingPage />,
}
);

const LoadableDevRoutes = loadable(() => friendlyLoad(import("./dev/routes")), {
fallback: <LoadingPage />,
});
Expand Down Expand Up @@ -150,6 +157,10 @@ export const JustfixRouteComponent: React.FC<RouteComponentProps> = (props) => {
path={JustfixRoutes.locale.rh.prefix}
component={LoadableRentalHistoryRoutes}
/>
<Route
path={JustfixRoutes.locale.laletterbuilder.prefix}
component={LoadableLaLetterBuilderRoutes}
/>
<Route path={JustfixRoutes.dev.prefix} component={LoadableDevRoutes} />
<PLRoute
path={JustfixRoutes.locale.dataRequests.prefix}
Expand Down
4 changes: 2 additions & 2 deletions frontend/lib/laletterbuilder/route-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { ROUTE_PREFIX, createRoutesForSite } from "../util/route-util";
import { createHabitabilityRouteInfo } from "./letter-builder/habitability/route-info";

function createLocalizedRouteInfo(prefix: string) {
export function createLaLetterBuilderLocalizedRouteInfo(prefix: string) {
return {
/** The locale prefix, e.g. `/en`. */
[ROUTE_PREFIX]: prefix,
Expand Down Expand Up @@ -44,7 +44,7 @@ function createLocalizedRouteInfo(prefix: string) {
}

export const LaLetterBuilderRouteInfo = createRoutesForSite(
createLocalizedRouteInfo,
createLaLetterBuilderLocalizedRouteInfo,
{
/**
* Example pages used in integration tests, and other
Expand Down