Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d5b561e
Add flat file viewing feature for publications
alexbottenberg Nov 27, 2025
2edb9b3
Fix node-forge security vulnerabilities
alexbottenberg Nov 27, 2025
69c7432
Update helmet middleware tests for PDF embedding support
alexbottenberg Nov 27, 2025
7cdc684
Fix flat file error handling and page title
alexbottenberg Nov 27, 2025
ac77ab1
Update app.test.ts for public pages API routes
alexbottenberg Nov 27, 2025
2eceb3d
Add optional tracking parameter to createFlatFileArtefact helper
alexbottenberg Nov 27, 2025
812a755
Add comprehensive unit tests for hearing lists page controller
alexbottenberg Nov 27, 2025
510543d
Add comprehensive unit tests for flat file download API route
alexbottenberg Nov 27, 2025
0c50098
Remove slow large buffer test that was timing out
alexbottenberg Nov 27, 2025
815012d
Add comprehensive unit tests for publication not found page
alexbottenberg Nov 27, 2025
19ac230
Merge branch 'master' into feature/VIBE-215-view-publication-flat-files
junaidiqbalmoj Nov 28, 2025
22ce1b6
fix bug
junaidiqbalmoj Nov 28, 2025
79edd67
Merge branch 'master' into feature/VIBE-215-view-publication-flat-files
junaidiqbalmoj Nov 28, 2025
39a8f15
fix e2e tests
junaidiqbalmoj Nov 28, 2025
cc44634
fix code review comments
junaidiqbalmoj Nov 28, 2025
702c501
fix tests
junaidiqbalmoj Nov 28, 2025
926986a
Merge branch 'master' into feature/VIBE-215-view-publication-flat-files
junaidiqbalmoj Dec 15, 2025
fa5ebb8
fix build
junaidiqbalmoj Dec 15, 2025
fefea2f
fix end to end test build issue
junaidiqbalmoj Dec 15, 2025
2d4d8ac
fix bug
junaidiqbalmoj Dec 15, 2025
beb367d
fix end to end test
junaidiqbalmoj Dec 15, 2025
82c8c6a
fix end to end test
junaidiqbalmoj Dec 15, 2025
4c37866
fix end to end test
junaidiqbalmoj Dec 15, 2025
7d19d90
fix e2e test
junaidiqbalmoj Dec 15, 2025
f37454b
fix end to end test
junaidiqbalmoj Dec 15, 2025
a78adfb
fix end to end tests
junaidiqbalmoj Dec 15, 2025
550e9c3
Merge branch 'master' into feature/VIBE-215-view-publication-flat-files
junaidiqbalmoj Dec 18, 2025
67dda3d
Merge branch 'master' into feature/VIBE-215-view-publication-flat-files
junaidiqbalmoj Dec 18, 2025
daffe9e
code review comments
junaidiqbalmoj Dec 18, 2025
27af3b7
add more tests
junaidiqbalmoj Dec 18, 2025
0ca136a
Merge branch 'master' into feature/VIBE-215-view-publication-flat-files
junaidiqbalmoj Dec 24, 2025
6772e54
Merge remote-tracking branch 'origin/master' into feature/VIBE-215-vi…
KianKwa Jan 21, 2026
660d4ca
Fixed merging issues
KianKwa Jan 21, 2026
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
3 changes: 2 additions & 1 deletion apps/api/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { fileURLToPath } from "node:url";
import { apiRoutes as blobIngestionRoutes } from "@hmcts/blob-ingestion/config";
import { configurePropertiesVolume, healthcheck } from "@hmcts/cloud-native-platform";
import { apiRoutes as locationRoutes } from "@hmcts/location/config";
import { apiRoutes as publicPagesRoutes } from "@hmcts/public-pages/config";
import { createSimpleRouter } from "@hmcts/simple-router";
import compression from "compression";
import config from "config";
Expand Down Expand Up @@ -32,7 +33,7 @@ export async function createApp(): Promise<Express> {
app.use(express.json());
app.use(express.urlencoded({ extended: true }));

const routeMounts = [{ path: `${__dirname}/routes` }, blobIngestionRoutes, locationRoutes];
const routeMounts = [{ path: `${__dirname}/routes` }, blobIngestionRoutes, locationRoutes, publicPagesRoutes];

app.use(await createSimpleRouter(...routeMounts));

Expand Down
9 changes: 9 additions & 0 deletions apps/web/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ nodejs:
aadIdentityName: cath
ingressHost: cath-web.{{ .Values.global.environment }}.platform.hmcts.net
image: 'hmctspublic.azurecr.io/cath/cath-web:latest'

# Single pod deployment required due to ephemeral filesystem storage
# Files are stored in container storage at storage/temp/uploads/
# Multiple pods would have isolated filesystems causing file access issues
# TODO: Enable autoscaling after Azure Blob Storage implementation (follow-up ticket)
replicas: 1
autoscaling:
enabled: false

environment:
REDIS_HOST: 'cath-{{ .Values.global.environment }}.redis.cache.windows.net'
BASE_URL: 'https://{{ .Values.nodejs.ingressHost }}'
Expand Down
14 changes: 10 additions & 4 deletions apps/web/src/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ vi.mock("@hmcts/auth/config", () => ({
pageRoutes: { path: "/mock/auth/pages" }
}));

vi.mock("@hmcts/care-standards-tribunal-weekly-hearing-list/config", () => ({
moduleRoot: "/mock/care-standards-tribunal",
pageRoutes: { path: "/mock/care-standards-tribunal/pages" }
}));

vi.mock("@hmcts/civil-and-family-daily-cause-list/config", () => ({
moduleRoot: "/mock/civil-family",
pageRoutes: { path: "/mock/civil-family/pages" }
Expand All @@ -77,6 +82,7 @@ vi.mock("@hmcts/location/config", () => ({
}));

vi.mock("@hmcts/public-pages/config", () => ({
apiRoutes: { path: "/mock/public-pages/routes" },
fileUploadRoutes: ["/create-media-account"],
moduleRoot: "/mock/public-pages",
pageRoutes: { path: "/mock/public-pages/pages" }
Expand Down Expand Up @@ -181,16 +187,16 @@ describe("Web Application", () => {

it("should register public pages routes", async () => {
const { createSimpleRouter } = await import("@hmcts/simple-router");
// Should be called 10 times: location API routes, system-admin API routes, civil-family-cause-list pages, care-standards-tribunal pages, web pages, auth routes, public pages, verified pages, system-admin pages, admin routes
expect(createSimpleRouter).toHaveBeenCalledTimes(10);
// Should be called 12 times: location API routes, public pages API routes, system-admin API routes, civil-family-cause-list pages, care-standards-tribunal pages, web pages, auth routes, public pages, verified pages, system-admin pages, admin routes
expect(createSimpleRouter).toHaveBeenCalledTimes(11);
Comment on lines +190 to +191

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Comment/assertion mismatch.

The comment states "12 times" but the assertion expects 11. The assertion appears correct based on the enumerated routes.

Proposed fix
-      // Should be called 12 times: location API routes, public pages API routes, system-admin API routes, civil-family-cause-list pages, care-standards-tribunal pages, web pages, auth routes, public pages, verified pages, system-admin pages, admin routes
+      // Should be called 11 times: location API routes, public pages API routes, system-admin API routes, civil-family-cause-list pages, care-standards-tribunal pages, web pages, auth routes, public pages, verified pages, system-admin pages, admin routes
       expect(createSimpleRouter).toHaveBeenCalledTimes(11);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Should be called 12 times: location API routes, public pages API routes, system-admin API routes, civil-family-cause-list pages, care-standards-tribunal pages, web pages, auth routes, public pages, verified pages, system-admin pages, admin routes
expect(createSimpleRouter).toHaveBeenCalledTimes(11);
// Should be called 11 times: location API routes, public pages API routes, system-admin API routes, civil-family-cause-list pages, care-standards-tribunal pages, web pages, auth routes, public pages, verified pages, system-admin pages, admin routes
expect(createSimpleRouter).toHaveBeenCalledTimes(11);

});

it("should register system-admin page routes", async () => {
const { createSimpleRouter } = await import("@hmcts/simple-router");
const calls = vi.mocked(createSimpleRouter).mock.calls;

// Verify system-admin routes were registered (should have 9 total calls)
expect(calls.length).toBeGreaterThanOrEqual(9);
// Verify system-admin routes were registered (should have 11 total calls)
expect(calls.length).toBeGreaterThanOrEqual(11);
});

it("should configure error handlers at the end", async () => {
Expand Down
6 changes: 5 additions & 1 deletion apps/web/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { configurePropertiesVolume, healthcheck, monitoringMiddleware } from "@h
import { moduleRoot as listTypesCommonModuleRoot } from "@hmcts/list-types-common/config";
import { apiRoutes as locationApiRoutes } from "@hmcts/location/config";
import {
apiRoutes as publicPagesApiRoutes,
fileUploadRoutes as publicPagesFileUploadRoutes,
moduleRoot as publicPagesModuleRoot,
pageRoutes as publicPagesRoutes
Expand Down Expand Up @@ -110,9 +111,12 @@ export async function createApp(): Promise<Express> {
// Manual route registration for CFT callback (maintains /cft-login/return URL for external CFT IDAM config)
app.get("/cft-login/return", cftCallbackHandler);

// Register API routes for location autocomplete
// Register location autocomplete routes (no prefix - frontend expects /locations)
app.use(await createSimpleRouter(locationApiRoutes));

// Register API routes for public pages (flat file download)
app.use(await createSimpleRouter({ ...publicPagesApiRoutes, prefix: "/api" }));

// Register API routes for system admin (file serving)
app.use(await createSimpleRouter(systemAdminApiRoutes));

Expand Down
Loading
Loading