Skip to content

Commit

Permalink
Refactor code and improve configuration
Browse files Browse the repository at this point in the history
Updated variable declarations to use 'const' in seconds.pipe.ts for better immutability. Refactored string concatenation using template literals for readability. Removed unused TranslateService import in home.component.spec.ts. Added baseUrl to tsconfig.json for better module resolution.
  • Loading branch information
MichiBaum committed Nov 23, 2024
1 parent e70a799 commit f2fbf0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions website/src/app/core/pipes/seconds.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {Pipe, PipeTransform} from "@angular/core";
})
export class SecondsPipe implements PipeTransform {
transform(value: number): string {
var h = Math.floor(value / 3600);
var m = Math.floor(value % 3600 / 60);
var s = Math.floor(value % 3600 % 60);
const h = Math.floor(value / 3600);
const m = Math.floor(value % 3600 / 60);
const s = Math.floor(value % 3600 % 60);

return "" + h + "h " + m + "min " + s + "s";
return `${h}h ${m}min ${s}s`;
}
}
2 changes: 1 addition & 1 deletion website/src/app/home/home.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {RouterNavigationService} from "../core/services/router-navigation.servic
import {PermissionService} from "../core/services/permission.service";
import {AuthService} from "../core/services/auth.service";
import {Sides} from "../core/config/sides";
import {TranslateModule, TranslateService} from "@ngx-translate/core";
import {TranslateModule} from "@ngx-translate/core";

describe('HomeComponent', () => {
let component: HomeComponent;
Expand Down
1 change: 1 addition & 0 deletions website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
Expand Down

0 comments on commit f2fbf0a

Please sign in to comment.