diff --git a/brewman/brewman/routers/attendance_report.py b/brewman/brewman/routers/attendance_report.py index 2ae91d56..dd55f585 100644 --- a/brewman/brewman/routers/attendance_report.py +++ b/brewman/brewman/routers/attendance_report.py @@ -41,7 +41,7 @@ def get_report( output, db, ) - headers = {"Content-Disposition": "attachment; filename = 'attendance-record.csv'"} + headers = {"Content-Disposition": "attachment; filename = attendance-record.csv"} output.seek(0) return StreamingResponse(output, media_type="text/csv", headers=headers) finally: diff --git a/overlord/.eslintrc.json b/overlord/.eslintrc.json index 2f27844e..2251fbc2 100644 --- a/overlord/.eslintrc.json +++ b/overlord/.eslintrc.json @@ -37,6 +37,13 @@ "style": "camelCase" } ], + "@typescript-eslint/lines-between-class-members": [ + "error", + "always", + { + "exceptAfterSingleLine": true + } + ], "import/order": [ "error", { @@ -46,6 +53,9 @@ ], "@typescript-eslint/naming-convention": [ "off" + ], + "@typescript-eslint/no-explicit-any": [ + "error" ] } }, diff --git a/overlord/src/app/attendance/attendance.service.ts b/overlord/src/app/attendance/attendance.service.ts index 4ab12b49..ca34d6b6 100644 --- a/overlord/src/app/attendance/attendance.service.ts +++ b/overlord/src/app/attendance/attendance.service.ts @@ -19,7 +19,7 @@ export class AttendanceService { return this.http .get(getUrl) .pipe( - catchError(this.log.handleError(serviceName, `get date as Observable=${date}`)), + catchError(this.log.handleError(serviceName, `get date=${date}`)), ) as Observable; } diff --git a/overlord/src/app/client/client.service.ts b/overlord/src/app/client/client.service.ts index 7d2b6dca..5359f59f 100644 --- a/overlord/src/app/client/client.service.ts +++ b/overlord/src/app/client/client.service.ts @@ -20,7 +20,7 @@ export class ClientService { const getUrl: string = id === null ? url : `${url}/${id}`; return this.http .get(getUrl) - .pipe(catchError(this.log.handleError(serviceName, `get id as Observable=${id}`))) as Observable; + .pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable; } list(): Observable { diff --git a/overlord/src/app/core/account.service.ts b/overlord/src/app/core/account.service.ts index e48cfdce..bdc2e8a2 100644 --- a/overlord/src/app/core/account.service.ts +++ b/overlord/src/app/core/account.service.ts @@ -18,7 +18,7 @@ export class AccountService { const getUrl: string = id === null ? `${url}` : `${url}/${id}`; return this.http .get(getUrl) - .pipe(catchError(this.log.handleError(serviceName, `get id as Observable=${id}`))) as Observable; + .pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable; } list(): Observable { diff --git a/overlord/src/app/core/voucher.service.ts b/overlord/src/app/core/voucher.service.ts index d3751203..7b353d82 100644 --- a/overlord/src/app/core/voucher.service.ts +++ b/overlord/src/app/core/voucher.service.ts @@ -60,7 +60,7 @@ export class VoucherService { post(id: string): Observable { return this.http - .post(`${url}/post as Observable-voucher/${id}`, {}) + .post(`${url}/post-voucher/${id}`, {}) .pipe(catchError(this.log.handleError(serviceName, 'Post Voucher'))) as Observable; } diff --git a/overlord/src/app/cost-centre/cost-centre.service.ts b/overlord/src/app/cost-centre/cost-centre.service.ts index 257a9ab8..75f905c2 100644 --- a/overlord/src/app/cost-centre/cost-centre.service.ts +++ b/overlord/src/app/cost-centre/cost-centre.service.ts @@ -20,7 +20,7 @@ export class CostCentreService { return this.http .get(getUrl) .pipe( - catchError(this.log.handleError(serviceName, `get id as Observable=${id}`)), + catchError(this.log.handleError(serviceName, `get id=${id}`)), ) as Observable; } diff --git a/overlord/src/app/employee-attendance/employee-attendance.service.ts b/overlord/src/app/employee-attendance/employee-attendance.service.ts index ec4d998b..1de20def 100644 --- a/overlord/src/app/employee-attendance/employee-attendance.service.ts +++ b/overlord/src/app/employee-attendance/employee-attendance.service.ts @@ -31,7 +31,7 @@ export class EmployeeAttendanceService { .get(getUrl, options) .pipe( catchError( - this.log.handleError(serviceName, `get id as Observable=${id}`), + this.log.handleError(serviceName, `get id=${id}`), ), ) as Observable; } diff --git a/overlord/src/app/employee/employee.service.ts b/overlord/src/app/employee/employee.service.ts index 19844bc9..35a3ac4d 100644 --- a/overlord/src/app/employee/employee.service.ts +++ b/overlord/src/app/employee/employee.service.ts @@ -18,7 +18,7 @@ export class EmployeeService { const getUrl: string = id === null ? `${url}` : `${url}/${id}`; return this.http .get(getUrl) - .pipe(catchError(this.log.handleError(serviceName, `get id as Observable=${id}`))) as Observable; + .pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable; } list(): Observable { diff --git a/overlord/src/app/product-group/product-group.service.ts b/overlord/src/app/product-group/product-group.service.ts index ec08113e..0e8633bf 100644 --- a/overlord/src/app/product-group/product-group.service.ts +++ b/overlord/src/app/product-group/product-group.service.ts @@ -20,7 +20,7 @@ export class ProductGroupService { return this.http .get(getUrl) .pipe( - catchError(this.log.handleError(serviceName, `get id as Observable=${id}`)), + catchError(this.log.handleError(serviceName, `get id=${id}`)), ) as Observable; } diff --git a/overlord/src/app/product/product.service.ts b/overlord/src/app/product/product.service.ts index c582a015..10f7ea84 100644 --- a/overlord/src/app/product/product.service.ts +++ b/overlord/src/app/product/product.service.ts @@ -17,7 +17,7 @@ export class ProductService { const getUrl: string = id === null ? `${url}` : `${url}/${id}`; return this.http .get(getUrl) - .pipe(catchError(this.log.handleError(serviceName, `get id as Observable=${id}`))) as Observable; + .pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable; } list(): Observable { diff --git a/overlord/src/app/role/role.service.ts b/overlord/src/app/role/role.service.ts index b020c2b9..0f9b1995 100644 --- a/overlord/src/app/role/role.service.ts +++ b/overlord/src/app/role/role.service.ts @@ -20,7 +20,7 @@ export class RoleService { const getUrl: string = id === null ? `${url}` : `${url}/${id}`; return this.http .get(getUrl) - .pipe(catchError(this.log.handleError(serviceName, `get id as Observable=${id}`))) as Observable; + .pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable; } list(): Observable { diff --git a/overlord/src/test.ts b/overlord/src/test.ts index e94b4bd6..e103ada1 100644 --- a/overlord/src/test.ts +++ b/overlord/src/test.ts @@ -7,7 +7,16 @@ import { platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing'; -declare const require: any; +declare const require: { + context( + path: string, + deep?: boolean, + filter?: RegExp, + ): { + keys(): string[]; + (id: string): T; + }; +}; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());