From 16a3024d96c6d9f81cc2138443b933a429f08eac Mon Sep 17 00:00:00 2001 From: Yanick Minder Date: Fri, 13 Dec 2024 13:39:22 +0100 Subject: [PATCH] apply formatter --- frontend/cypress/e2e/scoring.cy.ts | 12 ++++-- frontend/cypress/support/helper/utils.ts | 12 ++++-- frontend/src/app/app.component.ts | 6 +-- .../action-plan/action-plan.component.ts | 10 ++--- .../key-result-form.component.spec.ts | 4 +- .../key-result-form.component.ts | 10 ++--- .../keyresult-dialog.component.spec.ts | 4 +- .../keyresult-type.component.ts | 4 +- .../objective-filter.component.ts | 6 +-- .../objective/ObjectiveMenuActions.ts | 6 +-- .../objective/ObjectiveMenuAfterActions.ts | 6 +-- .../overview/overview.component.spec.ts | 4 +- .../quarter-filter.component.spec.ts | 16 ++++++-- .../src/app/components/team/team.component.ts | 6 +-- .../interceptors/error-interceptor.service.ts | 6 +-- .../interceptors/error.interceptor.spec.ts | 8 +++- .../src/app/services/customization.service.ts | 6 +-- frontend/src/app/services/dialog.service.ts | 6 +-- frontend/src/app/services/quarter.service.ts | 4 +- frontend/src/app/shared/common.spec.ts | 4 +- .../complete-dialog.component.ts | 6 +-- .../confirm-dialog.component.ts | 6 +-- .../example-dialog.component.ts | 6 +-- .../objective-form.component.spec.ts | 20 +++++++--- .../objective-form.component.ts | 4 +- .../shared/sidepanel/sidepanel.component.ts | 6 +-- frontend/src/app/shared/testData.ts | 40 ++++++++++++++----- .../src/app/shared/types/model/Quarter.ts | 4 +- .../add-edit-team-dialog.component.ts | 4 +- .../add-member-to-team-dialog.component.ts | 6 +-- .../delete-user/delete-user.component.ts | 6 +-- .../member-list-table.component.ts | 6 +-- .../search-team-management.component.ts | 4 +- .../show-edit-role.component.ts | 6 +-- .../team-list/team-list.component.ts | 6 +-- ...team-management-mobile-filter.component.ts | 6 +-- 36 files changed, 157 insertions(+), 119 deletions(-) diff --git a/frontend/cypress/e2e/scoring.cy.ts b/frontend/cypress/e2e/scoring.cy.ts index ec9ab26fdf..fc3972091a 100644 --- a/frontend/cypress/e2e/scoring.cy.ts +++ b/frontend/cypress/e2e/scoring.cy.ts @@ -31,7 +31,9 @@ describe("Scoring component e2e tests", () => { stretchgoal, value]) => { it("Create metric checkin and validate value of scoring component", () => { - setupMetricKR(`Metric kr with check-in value ${value}`, baseline, stretchgoal, value); + setupMetricKR( + `Metric kr with check-in value ${value}`, baseline, stretchgoal, value + ); const percentage = getPercentageMetric(baseline, stretchgoal, value); cy.validateScoring(false, percentage); cy.get(".keyResult-detail-attribute-show") @@ -59,7 +61,9 @@ describe("Scoring component e2e tests", () => { stretchgoal, value]) => { it("show indicator that value is negative", () => { - setupMetricKR(`Check indicator with value ${value}`, baseline, stretchgoal, value); + setupMetricKR( + `Check indicator with value ${value}`, baseline, stretchgoal, value + ); cy.validateScoring(false, 0); cy.get(".keyResult-detail-attribute-show") .contains("Aktuell") @@ -107,7 +111,9 @@ describe("Scoring component e2e tests", () => { }); }); -function setupMetricKR (name: string, baseline: number, stretchgoal: number, value: number) { +function setupMetricKR ( + name: string, baseline: number, stretchgoal: number, value: number +) { CyOverviewPage.do() .addKeyResult() .fillKeyResultTitle(name) diff --git a/frontend/cypress/support/helper/utils.ts b/frontend/cypress/support/helper/utils.ts index 9f19de586f..a9593f20e4 100644 --- a/frontend/cypress/support/helper/utils.ts +++ b/frontend/cypress/support/helper/utils.ts @@ -10,10 +10,14 @@ export function pressUntilContains (text: string, key: keyof typeof keyCodeDefin pressUntil(key, condition); } -export function doUntilSelector (selector: string, tab: () => void, limit = 100, count = 0) { +export function doUntilSelector ( + selector: string, tab: () => void, limit = 100, count = 0 +) { const condition = (element: HTMLElement) => Cypress.$(element) .is(selector); - doUntil(condition, tab, limit, count); + doUntil( + condition, tab, limit, count + ); } function pressUntil (key: keyof typeof keyCodeDefinitions, condition: (elem: HTMLElement) => boolean) { @@ -34,7 +38,9 @@ function doUntil ( return; } else { tab(); - doUntil(condition, tab, limit, count + 1); + doUntil( + condition, tab, limit, count + 1 + ); } }); } diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index a9afd494f0..f15d5ecf62 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -11,10 +11,8 @@ import { DomSanitizer } from "@angular/platform-browser"; export class AppComponent { readonly PATH_PREFIX = "../assets/icons/"; - constructor ( - private matIconRegistry: MatIconRegistry, - private domSanitizer: DomSanitizer - ) { + constructor (private matIconRegistry: MatIconRegistry, + private domSanitizer: DomSanitizer) { this.matIconRegistry.addSvgIcon("pz-search", this.domSanitizer.bypassSecurityTrustResourceUrl(this.PATH_PREFIX + "search-icon.svg")); this.matIconRegistry.addSvgIcon("pz-menu-icon", this.domSanitizer.bypassSecurityTrustResourceUrl(this.PATH_PREFIX + "three-dot-menu-icon.svg")); } diff --git a/frontend/src/app/components/action-plan/action-plan.component.ts b/frontend/src/app/components/action-plan/action-plan.component.ts index 47e0707486..48f0f440d1 100644 --- a/frontend/src/app/components/action-plan/action-plan.component.ts +++ b/frontend/src/app/components/action-plan/action-plan.component.ts @@ -21,10 +21,8 @@ export class ActionPlanComponent { @ViewChildren("listItem") listItems!: QueryList; - constructor ( - private actionService: ActionService, - public dialogService: DialogService - ) {} + constructor (private actionService: ActionService, + public dialogService: DialogService) {} handleKeyDown (event: Event, currentIndex: number) { let newIndex = currentIndex; @@ -79,7 +77,9 @@ export class ActionPlanComponent { if (event.previousContainer === event.container) { moveItemInArray(event.container.data!, event.previousIndex, event.currentIndex); } else { - transferArrayItem(event.previousContainer.data!, event.container.data!, event.previousIndex, event.currentIndex); + transferArrayItem( + event.previousContainer.data!, event.container.data!, event.previousIndex, event.currentIndex + ); } this.adjustPriorities(); this.activeItem = event.currentIndex; diff --git a/frontend/src/app/components/key-result-form/key-result-form.component.spec.ts b/frontend/src/app/components/key-result-form/key-result-form.component.spec.ts index 6c90ba9f6a..2ef2bedce9 100644 --- a/frontend/src/app/components/key-result-form/key-result-form.component.spec.ts +++ b/frontend/src/app/components/key-result-form/key-result-form.component.spec.ts @@ -74,7 +74,9 @@ describe("KeyResultFormComponent", () => { const keyResultObjective: KeyResultObjective = { id: 2, state: State.ONGOING, - quarter: new Quarter(1, "GJ 22/23-Q2", new Date(), new Date()) + quarter: new Quarter( + 1, "GJ 22/23-Q2", new Date(), new Date() + ) }; const keyResultFormGroup = new FormGroup({ diff --git a/frontend/src/app/components/key-result-form/key-result-form.component.ts b/frontend/src/app/components/key-result-form/key-result-form.component.ts index c34b35452f..0846dfa2b9 100644 --- a/frontend/src/app/components/key-result-form/key-result-form.component.ts +++ b/frontend/src/app/components/key-result-form/key-result-form.component.ts @@ -36,11 +36,9 @@ export class KeyResultFormComponent implements OnInit, OnDestroy { @Input() keyResult!: KeyResult | null; - constructor ( - public userService: UserService, + constructor (public userService: UserService, private oauthService: OAuthService, - private translate: TranslateService - ) {} + private translate: TranslateService) {} ngOnInit (): void { this.users$ = this.userService.getUsers(); @@ -118,7 +116,9 @@ export class KeyResultFormComponent implements OnInit, OnDestroy { return this.keyResultForm.get(name)?.dirty || this.keyResultForm.get(name)?.touched; } - getErrorMessage (error: string, field: string, firstNumber: number | null, secondNumber: number | null): string { + getErrorMessage ( + error: string, field: string, firstNumber: number | null, secondNumber: number | null + ): string { return field + this.translate.instant("DIALOG_ERRORS." + error) .format(firstNumber, secondNumber); } diff --git a/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.spec.ts b/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.spec.ts index 8104995dfc..0dd1cebb56 100644 --- a/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.spec.ts +++ b/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.spec.ts @@ -61,7 +61,9 @@ describe("KeyresultDialogComponent", () => { const keyResultObjective: KeyResultObjective = { id: 2, state: State.ONGOING, - quarter: new Quarter(1, "GJ 22/23-Q2", new Date(), new Date()) + quarter: new Quarter( + 1, "GJ 22/23-Q2", new Date(), new Date() + ) }; const fullKeyResultMetric = { diff --git a/frontend/src/app/components/keyresult-type/keyresult-type.component.ts b/frontend/src/app/components/keyresult-type/keyresult-type.component.ts index ed33e4e2de..4287b80a6c 100644 --- a/frontend/src/app/components/keyresult-type/keyresult-type.component.ts +++ b/frontend/src/app/components/keyresult-type/keyresult-type.component.ts @@ -106,7 +106,9 @@ export class KeyresultTypeComponent implements OnInit { } } - getErrorMessage (error: string, field: string, firstNumber: number | null, secondNumber: number | null): string { + getErrorMessage ( + error: string, field: string, firstNumber: number | null, secondNumber: number | null + ): string { return field + this.translate.instant("DIALOG_ERRORS." + error) .format(firstNumber, secondNumber); } diff --git a/frontend/src/app/components/objective-filter/objective-filter.component.ts b/frontend/src/app/components/objective-filter/objective-filter.component.ts index b69df7ee10..ec268b6654 100644 --- a/frontend/src/app/components/objective-filter/objective-filter.component.ts +++ b/frontend/src/app/components/objective-filter/objective-filter.component.ts @@ -14,10 +14,8 @@ export class ObjectiveFilterComponent implements OnInit { query = ""; - constructor ( - private router: Router, - private route: ActivatedRoute - ) { + constructor (private router: Router, + private route: ActivatedRoute) { this.refresh.pipe(debounceTime(300)) .subscribe(() => this.updateURL()); } diff --git a/frontend/src/app/components/objective/ObjectiveMenuActions.ts b/frontend/src/app/components/objective/ObjectiveMenuActions.ts index 2e47a9e896..54fece4414 100644 --- a/frontend/src/app/components/objective/ObjectiveMenuActions.ts +++ b/frontend/src/app/components/objective/ObjectiveMenuActions.ts @@ -11,11 +11,9 @@ import { import { ObjectiveMenuAfterActions } from "./ObjectiveMenuAfterActions"; export class ObjectiveMenuActions { - constructor ( - private readonly dialogService: DialogService, + constructor (private readonly dialogService: DialogService, private readonly refreshDataService: RefreshDataService, - private readonly afterActions: ObjectiveMenuAfterActions - ) {} + private readonly afterActions: ObjectiveMenuAfterActions) {} releaseFromQuarterAction (objective: ObjectiveMin): ObjectiveMenuEntry { const action: ObjectiveMenuAction = () => this.dialogService.openConfirmDialog("CONFIRMATION.RELEASE"); diff --git a/frontend/src/app/components/objective/ObjectiveMenuAfterActions.ts b/frontend/src/app/components/objective/ObjectiveMenuAfterActions.ts index 8420802227..b2d0fc06c8 100644 --- a/frontend/src/app/components/objective/ObjectiveMenuAfterActions.ts +++ b/frontend/src/app/components/objective/ObjectiveMenuAfterActions.ts @@ -7,11 +7,9 @@ import { ObjectiveMin } from "../../shared/types/model/ObjectiveMin"; import { CompletedService } from "../../services/completed.servce"; export class ObjectiveMenuAfterActions { - constructor ( - private readonly objectiveService: ObjectiveService, + constructor (private readonly objectiveService: ObjectiveService, private readonly completedService: CompletedService, - private readonly refreshDataService: RefreshDataService - ) {} + private readonly refreshDataService: RefreshDataService) {} completeObjective (objectiveMin: ObjectiveMin, result: { endState: string; comment: string | null; diff --git a/frontend/src/app/components/overview/overview.component.spec.ts b/frontend/src/app/components/overview/overview.component.spec.ts index a48ac46001..5a1379416a 100644 --- a/frontend/src/app/components/overview/overview.component.spec.ts +++ b/frontend/src/app/components/overview/overview.component.spec.ts @@ -149,7 +149,9 @@ describe("OverviewComponent", () => { [], "a a" ] - ])("should load overview based on queryparams", async (query: string, quarterParam?: number, teamsParam?: number[], objectiveQueryParam?: string) => { + ])("should load overview based on queryparams", async ( + query: string, quarterParam?: number, teamsParam?: number[], objectiveQueryParam?: string + ) => { jest.spyOn(overviewService, "getOverview"); jest.spyOn(component, "loadOverview"); const routerHarness = await RouterTestingHarness.create(); diff --git a/frontend/src/app/components/quarter-filter/quarter-filter.component.spec.ts b/frontend/src/app/components/quarter-filter/quarter-filter.component.spec.ts index 419f4b5c2f..7a5d41186b 100644 --- a/frontend/src/app/components/quarter-filter/quarter-filter.component.spec.ts +++ b/frontend/src/app/components/quarter-filter/quarter-filter.component.spec.ts @@ -20,10 +20,18 @@ const overviewService = { }; const quarters = [ - new Quarter(999, "Backlog", null, null), - new Quarter(2, "23.02.2025", new Date(), new Date()), - new Quarter(5, "23.02.2025", new Date(), new Date()), - new Quarter(7, "23.02.2025", new Date(), new Date()) + new Quarter( + 999, "Backlog", null, null + ), + new Quarter( + 2, "23.02.2025", new Date(), new Date() + ), + new Quarter( + 5, "23.02.2025", new Date(), new Date() + ), + new Quarter( + 7, "23.02.2025", new Date(), new Date() + ) ]; const quarterService = { diff --git a/frontend/src/app/components/team/team.component.ts b/frontend/src/app/components/team/team.component.ts index d5b28a6287..022afe1b05 100644 --- a/frontend/src/app/components/team/team.component.ts +++ b/frontend/src/app/components/team/team.component.ts @@ -22,11 +22,9 @@ export class TeamComponent { addIconSrc = new BehaviorSubject("assets/icons/new-icon.svg"); - constructor ( - private dialogService: DialogService, + constructor (private dialogService: DialogService, private refreshDataService: RefreshDataService, - private configService: ConfigService - ) { + private configService: ConfigService) { this.configService.config$.pipe(first()) .subscribe((config: ClientConfig) => { const configuredIconSrc = config.customStyles["okr-add-objective-icon"]; diff --git a/frontend/src/app/interceptors/error-interceptor.service.ts b/frontend/src/app/interceptors/error-interceptor.service.ts index 1fb317e13d..b462435dfa 100644 --- a/frontend/src/app/interceptors/error-interceptor.service.ts +++ b/frontend/src/app/interceptors/error-interceptor.service.ts @@ -16,11 +16,9 @@ import { ToasterType } from "../shared/types/enums/ToasterType"; @Injectable() export class ErrorInterceptor implements HttpInterceptor { - constructor ( - private router: Router, + constructor (private router: Router, private toasterService: ToasterService, - private translate: TranslateService - ) {} + private translate: TranslateService) {} intercept (request: HttpRequest, next: HttpHandler): Observable> { return next.handle(request) diff --git a/frontend/src/app/interceptors/error.interceptor.spec.ts b/frontend/src/app/interceptors/error.interceptor.spec.ts index e8e57f9bf2..f3fba4d646 100644 --- a/frontend/src/app/interceptors/error.interceptor.spec.ts +++ b/frontend/src/app/interceptors/error.interceptor.spec.ts @@ -97,7 +97,9 @@ describe("ErrorInterceptor", () => { "KEYRESULT", ToasterType.SUCCESS, "Keyresult wurde gelöscht" - ]])("handleSuccessToaster should show toaster ", (url: string, code: number, method: HttpType, key: string, toasterType: ToasterType, message: string) => { + ]])("handleSuccessToaster should show toaster ", ( + url: string, code: number, method: HttpType, key: string, toasterType: ToasterType, message: string + ) => { const SUCCESS_PREFIX = "SUCCESS."; jest.spyOn(translator, "instant") .mockReturnValue(message); @@ -283,7 +285,9 @@ describe("ErrorInterceptor", () => { HttpType.DELETE, undefined ] - ])("getSuccessMessageKey should work", (url: string, code: number, method: HttpType, result: any) => { + ])("getSuccessMessageKey should work", ( + url: string, code: number, method: HttpType, result: any + ) => { const successMessageKey = interceptor.getSuccessMessageKey(url, code, method); expect(successMessageKey) .toStrictEqual(result); diff --git a/frontend/src/app/services/customization.service.ts b/frontend/src/app/services/customization.service.ts index ee0b6a457e..149667be74 100644 --- a/frontend/src/app/services/customization.service.ts +++ b/frontend/src/app/services/customization.service.ts @@ -9,10 +9,8 @@ import { ConfigService } from "./config.service"; export class CustomizationService { private currentConfig?: CustomizationConfig; - constructor ( - configService: ConfigService, - @Inject(DOCUMENT) private document: Document - ) { + constructor (configService: ConfigService, + @Inject(DOCUMENT) private document: Document) { configService.config$.subscribe((config) => { this.updateCustomizations(config); }); diff --git a/frontend/src/app/services/dialog.service.ts b/frontend/src/app/services/dialog.service.ts index e27a766b28..3d92a92d73 100644 --- a/frontend/src/app/services/dialog.service.ts +++ b/frontend/src/app/services/dialog.service.ts @@ -27,10 +27,8 @@ export class DialogService { autoFocus: "first-tabbable" }; - constructor ( - private readonly dialog: MatDialog, - private readonly translationService: TranslateService - ) {} + constructor (private readonly dialog: MatDialog, + private readonly translationService: TranslateService) {} open(component: ComponentType, config?: MatDialogConfig): MatDialogRef { return this.dialog.open(component, { diff --git a/frontend/src/app/services/quarter.service.ts b/frontend/src/app/services/quarter.service.ts index 09afb75a3a..a4f10444b6 100644 --- a/frontend/src/app/services/quarter.service.ts +++ b/frontend/src/app/services/quarter.service.ts @@ -12,7 +12,9 @@ export class QuarterService { getAllQuarters (): Observable { return this.http .get("/api/v2/quarters") - .pipe(map((quarters) => quarters.map((quarter) => new Quarter(quarter.id, quarter.label, quarter.startDate, quarter.endDate)))); + .pipe(map((quarters) => quarters.map((quarter) => new Quarter( + quarter.id, quarter.label, quarter.startDate, quarter.endDate + )))); } getCurrentQuarter (): Observable { diff --git a/frontend/src/app/shared/common.spec.ts b/frontend/src/app/shared/common.spec.ts index 6552f4d481..a526a223f6 100644 --- a/frontend/src/app/shared/common.spec.ts +++ b/frontend/src/app/shared/common.spec.ts @@ -301,7 +301,9 @@ describe("test common functions", () => { -10, 0 ] - ])("should calculate progress correctly", async (baseline: number, stretchGoal: number, value: number, filledPercentage: number) => { + ])("should calculate progress correctly", async ( + baseline: number, stretchGoal: number, value: number, filledPercentage: number + ) => { const keyResult = { ...keyResultMetricMinScoring, baseline: baseline, diff --git a/frontend/src/app/shared/dialog/complete-dialog/complete-dialog.component.ts b/frontend/src/app/shared/dialog/complete-dialog/complete-dialog.component.ts index 0f66dc0e2e..ae385d863c 100644 --- a/frontend/src/app/shared/dialog/complete-dialog/complete-dialog.component.ts +++ b/frontend/src/app/shared/dialog/complete-dialog/complete-dialog.component.ts @@ -19,11 +19,9 @@ export class CompleteDialogComponent { protected readonly hasFormFieldErrors = hasFormFieldErrors; - constructor ( - public dialogRef: MatDialogRef, + constructor (public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: { objectiveTitle: string }, - private translate: TranslateService - ) {} + private translate: TranslateService) {} switchSuccessState (input: string) { this.removeStandardHover(); diff --git a/frontend/src/app/shared/dialog/confirm-dialog/confirm-dialog.component.ts b/frontend/src/app/shared/dialog/confirm-dialog/confirm-dialog.component.ts index 25609c90bd..5eb2edb1ff 100644 --- a/frontend/src/app/shared/dialog/confirm-dialog/confirm-dialog.component.ts +++ b/frontend/src/app/shared/dialog/confirm-dialog/confirm-dialog.component.ts @@ -19,10 +19,8 @@ export class ConfirmDialogComponent implements OnInit { closeButtonState?: ButtonState; - constructor ( - @Inject(MAT_DIALOG_DATA) public data: ConfirmDialogData, - public dialogRef: MatDialogRef - ) {} + constructor (@Inject(MAT_DIALOG_DATA) public data: ConfirmDialogData, + public dialogRef: MatDialogRef) {} ngOnInit () { this.dialogTitle = this.data.title; diff --git a/frontend/src/app/shared/dialog/example-dialog/example-dialog.component.ts b/frontend/src/app/shared/dialog/example-dialog/example-dialog.component.ts index 42096bf027..4ff965cb90 100644 --- a/frontend/src/app/shared/dialog/example-dialog/example-dialog.component.ts +++ b/frontend/src/app/shared/dialog/example-dialog/example-dialog.component.ts @@ -29,10 +29,8 @@ export class ExampleDialogComponent { hobby: new FormControl("", [Validators.required]) }); - constructor ( - public dialog: MatDialogRef, - @Inject(MAT_DIALOG_DATA) private data: any - ) {} + constructor (public dialog: MatDialogRef, + @Inject(MAT_DIALOG_DATA) private data: any) {} save () { this.dialog.close({ data: this.dialogForm.value }); diff --git a/frontend/src/app/shared/dialog/objective-dialog/objective-form.component.spec.ts b/frontend/src/app/shared/dialog/objective-dialog/objective-form.component.spec.ts index ba497da383..1a0d5ceb65 100644 --- a/frontend/src/app/shared/dialog/objective-dialog/objective-form.component.spec.ts +++ b/frontend/src/app/shared/dialog/objective-dialog/objective-form.component.spec.ts @@ -45,12 +45,20 @@ interface MatDialogDataInterface { const quarterService = { getAllQuarters (): Observable { - return of([new Quarter(1, quarter.label, quarter.startDate, quarter.endDate), - new Quarter(2, quarter.label, quarter.startDate, quarter.endDate), - new Quarter(999, "Backlog", null, null)]); + return of([new Quarter( + 1, quarter.label, quarter.startDate, quarter.endDate + ), + new Quarter( + 2, quarter.label, quarter.startDate, quarter.endDate + ), + new Quarter( + 999, "Backlog", null, null + )]); }, getCurrentQuarter (): Observable { - return of(new Quarter(2, quarter.label, quarter.startDate, quarter.endDate)); + return of(new Quarter( + 2, quarter.label, quarter.startDate, quarter.endDate + )); } }; @@ -352,7 +360,9 @@ describe("ObjectiveDialogComponent", () => { }); it("should return if option is allowed for quarter select", async () => { - const quarter: Quarter = new Quarter(1, "Backlog", null, null); + const quarter: Quarter = new Quarter( + 1, "Backlog", null, null + ); const data = { action: "duplicate", diff --git a/frontend/src/app/shared/dialog/objective-dialog/objective-form.component.ts b/frontend/src/app/shared/dialog/objective-dialog/objective-form.component.ts index 7580115dae..a36c501748 100644 --- a/frontend/src/app/shared/dialog/objective-dialog/objective-form.component.ts +++ b/frontend/src/app/shared/dialog/objective-dialog/objective-form.component.ts @@ -188,7 +188,9 @@ export class ObjectiveFormComponent implements OnInit, OnDestroy { }); } - getErrorMessage (error: string, field: string, firstNumber: number | null, secondNumber: number | null): string { + getErrorMessage ( + error: string, field: string, firstNumber: number | null, secondNumber: number | null + ): string { return field + this.translate.instant("DIALOG_ERRORS." + error) .format(firstNumber, secondNumber); } diff --git a/frontend/src/app/shared/sidepanel/sidepanel.component.ts b/frontend/src/app/shared/sidepanel/sidepanel.component.ts index 5593cf07b6..0ea6426fec 100644 --- a/frontend/src/app/shared/sidepanel/sidepanel.component.ts +++ b/frontend/src/app/shared/sidepanel/sidepanel.component.ts @@ -34,11 +34,9 @@ export class SidepanelComponent implements OnInit, AfterContentInit, OnDestroy { overlayY: "top" }]; - constructor ( - private router: Router, + constructor (private router: Router, private cd: ChangeDetectorRef, - private route: ActivatedRoute - ) {} + private route: ActivatedRoute) {} ngOnInit (): void {} diff --git a/frontend/src/app/shared/testData.ts b/frontend/src/app/shared/testData.ts index b97459a991..b9f1bcb3d4 100644 --- a/frontend/src/app/shared/testData.ts +++ b/frontend/src/app/shared/testData.ts @@ -94,13 +94,21 @@ export const addedAction: Action = { keyResultId: 1 } as Action; -export const quarterMin: Quarter = new Quarter(1, "GJ 23/24-Q1", null, null); +export const quarterMin: Quarter = new Quarter( + 1, "GJ 23/24-Q1", null, null +); -export const quarter1: Quarter = new Quarter(1, "GJ 22/23-Q4", new Date("2023-04-01"), new Date("2023-07-30")); +export const quarter1: Quarter = new Quarter( + 1, "GJ 22/23-Q4", new Date("2023-04-01"), new Date("2023-07-30") +); -export const quarter2: Quarter = new Quarter(2, "GJ 22/23-Q3", new Date("2023-01-01"), new Date("2023-03-31")); +export const quarter2: Quarter = new Quarter( + 2, "GJ 22/23-Q3", new Date("2023-01-01"), new Date("2023-03-31") +); -export const quarterBacklog: Quarter = new Quarter(999, "GJ 23/24-Q1", null, null); +export const quarterBacklog: Quarter = new Quarter( + 999, "GJ 23/24-Q1", null, null +); export const quarterList: Quarter[] = [quarter1, quarter2, @@ -308,7 +316,9 @@ export const overViewEntityResponse2: any = { export const overviews: OverviewEntity[] = [overViewEntityResponse1, overViewEntityResponse2]; -export const quarter: Quarter = new Quarter(1, "23.02.2025", new Date(), new Date()); +export const quarter: Quarter = new Quarter( + 1, "23.02.2025", new Date(), new Date() +); export const keyResultObjective: KeyResultObjective = { id: 1, @@ -428,7 +438,9 @@ export const keyResult: KeyResultOrdinal = { id: 301, version: 1, state: State.DRAFT, - quarter: new Quarter(1, "GJ 23/24-Q1", new Date(), new Date()), + quarter: new Quarter( + 1, "GJ 23/24-Q1", new Date(), new Date() + ), writeable: true } as KeyResultObjective, lastCheckIn: { @@ -462,7 +474,9 @@ export const keyResultOrdinal: KeyResultOrdinal = { id: 301, version: 1, state: State.DRAFT, - quarter: new Quarter(1, "GJ 23/24-Q1", new Date(), new Date()), + quarter: new Quarter( + 1, "GJ 23/24-Q1", new Date(), new Date() + ), writeable: true } as KeyResultObjective, lastCheckIn: { @@ -496,7 +510,9 @@ export const keyResultWriteableFalse: KeyResultOrdinal = { id: 301, version: 1, state: State.DRAFT, - quarter: new Quarter(1, "GJ 23/24-Q1", new Date(), new Date()), + quarter: new Quarter( + 1, "GJ 23/24-Q1", new Date(), new Date() + ), writeable: false } as KeyResultObjective, lastCheckIn: { @@ -530,7 +546,9 @@ export const keyResultMetric: KeyResultMetric = { id: 302, version: 1, state: State.DRAFT, - quarter: new Quarter(1, "GJ 23/24-Q1", new Date(), new Date()), + quarter: new Quarter( + 1, "GJ 23/24-Q1", new Date(), new Date() + ), writeable: true } as KeyResultObjective, lastCheckIn: { @@ -564,7 +582,9 @@ export const keyResultActions: KeyResultMetric = { objective: { id: 302, state: State.DRAFT, - quarter: new Quarter(1, "GJ 23/24-Q1", new Date(), new Date()), + quarter: new Quarter( + 1, "GJ 23/24-Q1", new Date(), new Date() + ), writeable: true } as KeyResultObjective, lastCheckIn: { diff --git a/frontend/src/app/shared/types/model/Quarter.ts b/frontend/src/app/shared/types/model/Quarter.ts index c5d06fc9c2..16a1566929 100644 --- a/frontend/src/app/shared/types/model/Quarter.ts +++ b/frontend/src/app/shared/types/model/Quarter.ts @@ -1,5 +1,7 @@ export class Quarter { - constructor (id: number, label: string, startDate: Date | null, endDate: Date | null) { + constructor ( + id: number, label: string, startDate: Date | null, endDate: Date | null + ) { this.id = id; this.label = label; this.startDate = startDate; diff --git a/frontend/src/app/team-management/add-edit-team-dialog/add-edit-team-dialog.component.ts b/frontend/src/app/team-management/add-edit-team-dialog/add-edit-team-dialog.component.ts index 0c12e0c77e..8a69c6fc12 100644 --- a/frontend/src/app/team-management/add-edit-team-dialog/add-edit-team-dialog.component.ts +++ b/frontend/src/app/team-management/add-edit-team-dialog/add-edit-team-dialog.component.ts @@ -78,7 +78,9 @@ export class AddEditTeamDialog implements OnInit { }); } - getErrorMessage (error: string, field: string, firstNumber: number | null, secondNumber: number | null): string { + getErrorMessage ( + error: string, field: string, firstNumber: number | null, secondNumber: number | null + ): string { return field + this.translate.instant("DIALOG_ERRORS." + error) .format(firstNumber, secondNumber); } diff --git a/frontend/src/app/team-management/add-member-to-team-dialog/add-member-to-team-dialog.component.ts b/frontend/src/app/team-management/add-member-to-team-dialog/add-member-to-team-dialog.component.ts index 5536b103c8..3c5e6b59f8 100644 --- a/frontend/src/app/team-management/add-member-to-team-dialog/add-member-to-team-dialog.component.ts +++ b/frontend/src/app/team-management/add-member-to-team-dialog/add-member-to-team-dialog.component.ts @@ -48,11 +48,9 @@ export class AddMemberToTeamDialogComponent implements OnInit, OnDestroy { public ngOnInit (): void { this.usersForSelection$ = combineLatest([this.userService.getUsers(), this.selectedUsers$, - this.search.valueChanges.pipe( - startWith(""), + this.search.valueChanges.pipe(startWith(""), // directly after selecting object, filtervalue is an object. - filter((searchValue) => typeof searchValue === "string") - )]) + filter((searchValue) => typeof searchValue === "string"))]) .pipe(takeUntil(this.unsubscribe$), map(([allPossibleUsers, selectedUsers, filterValue]) => { diff --git a/frontend/src/app/team-management/delete-user/delete-user.component.ts b/frontend/src/app/team-management/delete-user/delete-user.component.ts index 001d007cda..6bd8a9e26c 100644 --- a/frontend/src/app/team-management/delete-user/delete-user.component.ts +++ b/frontend/src/app/team-management/delete-user/delete-user.component.ts @@ -26,11 +26,9 @@ export class DeleteUserComponent implements OnInit, OnDestroy { unsubscribe$ = new Subject(); - constructor ( - private readonly userService: UserService, + constructor (private readonly userService: UserService, private readonly dialogService: DialogService, - private readonly location: Location - ) {} + private readonly location: Location) {} ngOnInit () { this.loadOkrUser(); diff --git a/frontend/src/app/team-management/member-list/member-list-table/member-list-table.component.ts b/frontend/src/app/team-management/member-list/member-list-table/member-list-table.component.ts index a0c65a6db0..a3188bd21a 100644 --- a/frontend/src/app/team-management/member-list/member-list-table/member-list-table.component.ts +++ b/frontend/src/app/team-management/member-list/member-list-table/member-list-table.component.ts @@ -36,11 +36,9 @@ export class MemberListTableComponent implements OnInit, OnDestroy { displayedColumns: string[] = this.allColumns; - constructor ( - private readonly teamService: TeamService, + constructor (private readonly teamService: TeamService, private readonly userService: UserService, - private readonly dialogService: DialogService - ) {} + private readonly dialogService: DialogService) {} ngOnInit () { this.selectedTeam$.pipe(takeUntil(this.unsubscribe$)) diff --git a/frontend/src/app/team-management/search-team-management/search-team-management.component.ts b/frontend/src/app/team-management/search-team-management/search-team-management.component.ts index 73c2343e30..22f8a0861a 100644 --- a/frontend/src/app/team-management/search-team-management/search-team-management.component.ts +++ b/frontend/src/app/team-management/search-team-management/search-team-management.component.ts @@ -55,7 +55,9 @@ export class SearchTeamManagementComponent { }); this.search.valueChanges - .pipe(takeUntilDestroyed(), debounceTime(200), map((v) => (v ? v.trim() : '')), distinctUntilChanged()) + .pipe( + takeUntilDestroyed(), debounceTime(200), map((v) => (v ? v.trim() : '')), distinctUntilChanged() + ) .subscribe((searchValue) => { this.searchValue$.next(searchValue); }); diff --git a/frontend/src/app/team-management/show-edit-role/show-edit-role.component.ts b/frontend/src/app/team-management/show-edit-role/show-edit-role.component.ts index ebdba08dfb..06270bb044 100644 --- a/frontend/src/app/team-management/show-edit-role/show-edit-role.component.ts +++ b/frontend/src/app/team-management/show-edit-role/show-edit-role.component.ts @@ -15,11 +15,9 @@ export class ShowEditRoleComponent { edit = false; - constructor ( - private readonly translate: TranslateService, + constructor (private readonly translate: TranslateService, private readonly elementRef: ElementRef, - private readonly cd: ChangeDetectorRef - ) {} + private readonly cd: ChangeDetectorRef) {} @HostListener("document:click", ["$event"]) clickOutside (event: MouseEvent) { diff --git a/frontend/src/app/team-management/team-list/team-list.component.ts b/frontend/src/app/team-management/team-list/team-list.component.ts index 992271ef2b..8165fd16d6 100644 --- a/frontend/src/app/team-management/team-list/team-list.component.ts +++ b/frontend/src/app/team-management/team-list/team-list.component.ts @@ -16,10 +16,8 @@ export class TeamListComponent implements OnInit, OnDestroy { private unsubscribe$ = new Subject(); - constructor ( - private readonly teamService: TeamService, - private readonly route: ActivatedRoute - ) { + constructor (private readonly teamService: TeamService, + private readonly route: ActivatedRoute) { this.teams$ = teamService.getAllTeams(); } diff --git a/frontend/src/app/team-management/team-management-mobile-filter/team-management-mobile-filter.component.ts b/frontend/src/app/team-management/team-management-mobile-filter/team-management-mobile-filter.component.ts index 74cbeed446..cfeb0d5405 100644 --- a/frontend/src/app/team-management/team-management-mobile-filter/team-management-mobile-filter.component.ts +++ b/frontend/src/app/team-management/team-management-mobile-filter/team-management-mobile-filter.component.ts @@ -17,11 +17,9 @@ export class TeamManagementMobileFilterComponent { selectedTeam: Team | undefined | "alle"; - constructor ( - private readonly teamService: TeamService, + constructor (private readonly teamService: TeamService, private readonly router: Router, - private readonly route: ActivatedRoute - ) { + private readonly route: ActivatedRoute) { combineLatest([teamService.getAllTeams(), this.route.paramMap]) .pipe(takeUntilDestroyed())