Skip to content

Commit dbb58e7

Browse files
committed
refactor(frontend): enforce performance of sort & filter
1 parent 9da2b21 commit dbb58e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+523
-1185
lines changed

packages/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@domifa/backend",
33
"private": true,
4-
"version": "2.173.26",
4+
"version": "2.186.0",
55
"description": "",
66
"author": "",
77
"license": "MIT",

packages/backend/src/_migrations/1731349672897-manual-migration.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { MigrationInterface, QueryRunner } from "typeorm";
22

33
import { domifaConfig } from "../config";
4-
import { appLogger, normalizeString } from "../util";
4+
import { appLogger } from "../util";
5+
import { normalizeString } from "@domifa/common";
56

67
const batchSize = 5000;
78
export class ManualMigration1731349672897 implements MigrationInterface {

packages/backend/src/database/entities/usager/UsagerSubscriber.typeorm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
InsertEvent,
55
UpdateEvent,
66
} from "typeorm";
7-
import { normalizeString } from "../../../util";
7+
import { normalizeString } from "@domifa/common";
88
import { UsagerTable } from "./UsagerTable.typeorm";
99

1010
@EventSubscriber()

packages/backend/src/usagers/controllers/usagers.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
usagerEntretienRepository,
3333
} from "../../database";
3434

35-
import { cleanPath, normalizeString } from "../../util";
35+
import { cleanPath } from "../../util";
3636
import {
3737
UserStructureAuthenticated,
3838
USER_STRUCTURE_ROLE_ALL,
@@ -59,6 +59,7 @@ import {
5959
CerfaDocType,
6060
UsagerDecision,
6161
getUsagerDeadlines,
62+
normalizeString,
6263
} from "@domifa/common";
6364
import { UsagerHistoryStateService } from "../services/usagerHistoryState.service";
6465
import { domifaConfig } from "../../config";

packages/backend/src/util/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ export * from "./file-manager";
66
export * from "./functions";
77
export * from "./logs";
88
export * from "./phone";
9-
export * from "./search";
109
export * from "./sentry";
1110
export * from "./territoires";

packages/common/jest.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import type { Config } from "jest";
22

33
const jestConfig: Config = {
4-
collectCoverage: false,
5-
coverageReporters: ["cobertura"],
6-
coverageDirectory: "./coverage/",
74
modulePathIgnorePatterns: ["<rootDir>/dist/"],
85
preset: "ts-jest/presets/js-with-ts",
96
};

packages/common/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"lint-staged": "^15.2.10",
3535
"prettier": "2.8.8",
3636
"ts-jest": "^29.1.1",
37+
"ts-node": "^10.9.2",
3738
"typescript": "^4.3.5"
3839
},
3940
"dependencies": {
File renamed without changes.

packages/backend/src/util/search/normalize-string.spec.ts renamed to packages/common/src/search/functions/normalize-string.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import { normalizeString } from "./normalize-string";
23

34
// Tests de tous les cas possibles
@@ -50,7 +51,8 @@ describe("normalizeString", () => {
5051
test("cas limites", () => {
5152
expect(normalizeString("")).toBe("");
5253
expect(normalizeString(" ")).toBe(" ");
53-
expect(normalizeString(null)).toBe("");
54-
expect(normalizeString(undefined)).toBe("");
54+
// skipcq: JS-0323
55+
expect(normalizeString(null as any)).toBe("");
56+
expect(normalizeString(undefined as any)).toBe("");
5557
});
5658
});
File renamed without changes.

0 commit comments

Comments
 (0)