Skip to content

Commit

Permalink
Merge branch 'main' into DAP-1005-format-date
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyMitch authored Nov 26, 2024
2 parents 1b8b1d2 + 2dba665 commit a1c7004
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 282 deletions.
1 change: 0 additions & 1 deletion backend/src/modules/filelist/controllers/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "./create";
export * from "./test";
81 changes: 0 additions & 81 deletions backend/src/modules/filelist/controllers/test.ts

This file was deleted.

3 changes: 1 addition & 2 deletions backend/src/modules/filelist/router.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Router } from "express";
import { create, test } from "./controllers";
import { create } from "./controllers";

const router = Router();

router.post("/", create);
router.post("/test", test);

export default router;
184 changes: 0 additions & 184 deletions backend/tests/modules/filelist/controllers/test.test.ts

This file was deleted.

10 changes: 1 addition & 9 deletions backend/tests/modules/filelist/router.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import type { Request, Response } from "express";
import express from "express";
import request from "supertest";
import router from "@/modules/filelist/router";
import { create, test } from "@/modules/filelist/controllers";
import { create } from "@/modules/filelist/controllers";

// Mock the controller functions
jest.mock("@/modules/filelist/controllers", () => ({
create: jest.fn((req: Request, res: Response) => res.status(201).send("Complete")),
test: jest.fn((req: Request, res: Response) => res.status(201).send("Complete")),
}));

// Helper function to create an Express app with the router
Expand All @@ -24,11 +23,4 @@ describe("Filelist Router", () => {
await request(app).post("/").expect(201, "Complete");
expect(create).toHaveBeenCalled();
});

// Test case for POST /test route
it("should call the create controller on POST /test route", async () => {
const app = createApp();
await request(app).post("/test").expect(201, "Complete");
expect(test).toHaveBeenCalled();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,42 @@ export const FolderDisplayGrid = ({ rows, onFolderDelete, processRowUpdate, apiR
</Box>
),
},
{ field: "folder", headerName: "Folder", width: 200 },
{ field: "schedule", headerName: "Schedule", width: 110, editable: true },
{ field: "classification", headerName: "Primary/Secondary", width: 150, editable: true },
{ field: "file", headerName: "File ID", width: 90, editable: true },
{ field: "folder", headerName: "Folder", width: 200, description: "Automatically populated." },
{
field: "schedule",
headerName: "Schedule",
description: "Information Schedule number (e.g. 100001 for ARCS).",
width: 110,
editable: true,
},
{
field: "classification",
headerName: "Classification",
description: "Classification number (e.g. 201-40 for Cabinet Submissions).",
width: 150,
editable: true,
},
{
field: "file",
headerName: "File ID",
description:
"File identifier to link multiple folders, if used (e.g. PEP for Provincial Emergency Program).",
width: 90,
editable: true,
},
{
field: "opr",
headerName: "OPR",
type: "boolean",
description: "Office of Primary Responsibility",
description:
"Office of Primary Responsibility (OPR) maintains the official copy of the records.",
width: 60,
editable: true,
},
{
field: "startDate",
headerName: "Start Date",
description: "Date the file was opened.",
width: 125,
editable: true,
renderEditCell: (params) => <GridEditDateCell {...params} />,
Expand All @@ -128,6 +149,7 @@ export const FolderDisplayGrid = ({ rows, onFolderDelete, processRowUpdate, apiR
{
field: "endDate",
headerName: "End Date",
description: "Date the file was closed.",
width: 125,
editable: true,
renderEditCell: (params) => <GridEditDateCell {...params} />,
Expand All @@ -141,6 +163,7 @@ export const FolderDisplayGrid = ({ rows, onFolderDelete, processRowUpdate, apiR
{
field: "soDate",
headerName: "SO Date",
description: "Date the file became Superseded or Obsolete (SO), if applicable.",
width: 125,
editable: true,
renderEditCell: (params) => <GridEditDateCell {...params} />,
Expand All @@ -154,6 +177,7 @@ export const FolderDisplayGrid = ({ rows, onFolderDelete, processRowUpdate, apiR
{
field: "fdDate",
headerName: "FD Date",
description: "Date the file was eligible for Final Disposition (FD).",
width: 125,
editable: true,
renderEditCell: (params) => <GridEditDateCell {...params} />,
Expand Down

0 comments on commit a1c7004

Please sign in to comment.