Skip to content

Commit

Permalink
apply formatter rules
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Dec 24, 2024
1 parent 9979100 commit 2b259cf
Show file tree
Hide file tree
Showing 21 changed files with 86 additions and 86 deletions.
20 changes: 10 additions & 10 deletions frontend/cypress/e2e/check-in.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('okr check-in', () => {
.fillCheckInInitiatives('Will be difficult')
.submit();
keyResultDetailPage
.showAllCheckins()
.showAllCheckIns()
.checkForAttribute('Confidence:', '5 / 10')
.checkForAttribute('Confidence:', '6 / 10')
.checkForAttribute('Veränderungen:', 'We bought a new house')
Expand Down Expand Up @@ -156,7 +156,7 @@ describe('okr check-in', () => {
.fillCheckInInitiatives('A cat would be great')
.submit();
cy.contains('Aktuell: 30 CHF');
keyResultDetailPage.showAllCheckins();
keyResultDetailPage.showAllCheckIns();
cy.contains('Check-in History');
cy.contains('Wert: 30 CHF');
CheckInHistoryDialog.do()
Expand Down Expand Up @@ -191,7 +191,7 @@ describe('okr check-in', () => {
.fillCheckInInitiatives('A cat would be great')
.submit();
cy.contains('Aktuell: 30 EUR');
keyResultDetailPage.showAllCheckins();
keyResultDetailPage.showAllCheckIns();
cy.contains('Check-in History');
cy.contains('Wert: 30 EUR');
CheckInHistoryDialog.do()
Expand All @@ -213,7 +213,7 @@ describe('okr check-in', () => {
.fillCheckInInitiatives('A cat would be great')
.submit();
cy.contains('Aktuell: 30 FTE');
keyResultDetailPage.showAllCheckins();
keyResultDetailPage.showAllCheckIns();
cy.contains('Check-in History');
cy.contains('Wert: 30 FTE');
});
Expand All @@ -233,7 +233,7 @@ describe('okr check-in', () => {
.fillCheckInCommentary('There is a new car')
.fillCheckInInitiatives('Buy now a new pool')
.submit();
keyResultDetailPage.showAllCheckins()
keyResultDetailPage.showAllCheckIns()
.editLatestCheckIn();
cy.contains('For editing ordinal checkin');
cy.contains('Confidence um Target Zone zu erreichen');
Expand Down Expand Up @@ -308,10 +308,10 @@ function getCurrentDate() {
const mm = today.getMonth() + 1; // Months start at 0!
const dd = today.getDate();

let dd_str = '' + dd;
let mm_str = '' + mm;
if (dd < 10) dd_str = '0' + dd_str;
if (mm < 10) mm_str = '0' + mm_str;
let ddStr = '' + dd;
let mmStr = '' + mm;
if (dd < 10) ddStr = '0' + ddStr;
if (mm < 10) mmStr = '0' + mmStr;

return dd_str + '.' + mm_str + '.' + yyyy;
return ddStr + '.' + mmStr + '.' + yyyy;
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class KeyResultDetailPage extends Page {
return new KeyResultDialog();
}

showAllCheckins() {
showAllCheckIns() {
this.elements.showAllCheckins()
.click();
return new CheckInHistoryDialog();
Expand Down
4 changes: 2 additions & 2 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { createRegexForWords } from './eslintHelper.mjs'

export default tsEslint.config(
{
files: ['**/*.ts'],
files: ['src/**/*.ts', 'cypress/**/*.ts'],
extends: [
eslint.configs.recommended,
...tsEslint.configs.recommended,
Expand Down Expand Up @@ -115,7 +115,7 @@ export default tsEslint.config(
},

{
files: ['**/*.spec.ts'],
files: ['src/**/*.spec.ts', 'cypress/**/*.spec.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'prefer-rest-params': 'off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TranslateModule } from '@ngx-translate/core';
import { of } from 'rxjs';
import { keyResult, keyResultWriteableFalse } from '../../shared/testData';
import { By } from '@angular/platform-browser';
import { KeyresultService } from '../../services/keyresult.service';
import { KeyResultService } from '../../services/key-result.service';
import { MatIconModule } from '@angular/material/icon';
import { ActivatedRoute } from '@angular/router';
import { ScoringComponent } from '../../shared/custom/scoring/scoring.component';
Expand Down Expand Up @@ -42,7 +42,7 @@ describe('KeyResultDetailComponent', () => {
ScoringComponent,
ConfidenceComponent],
providers: [{
provide: KeyresultService,
provide: KeyResultService,
useValue: keyResultServiceMock
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChangeDetectionStrategy, Component, Input, OnDestroy, OnInit } from '@angular/core';
import { KeyResult } from '../../shared/types/model/KeyResult';
import { KeyresultService } from '../../services/keyresult.service';
import { KeyResultService } from '../../services/key-result.service';
import { KeyResultMetric } from '../../shared/types/model/KeyResultMetric';
import { KeyResultOrdinal } from '../../shared/types/model/KeyResultOrdinal';
import { CheckInHistoryDialogComponent } from '../check-in-history-dialog/check-in-history-dialog.component';
Expand All @@ -14,7 +14,7 @@ import { DATE_FORMAT } from '../../shared/constantLibary';
import { calculateCurrentPercentage } from '../../shared/common';
import { KeyResultDialogComponent } from '../key-result-dialog/key-result-dialog.component';
import { DialogService } from '../../services/dialog.service';
import { KeyresultMin } from '../../shared/types/model/KeyresultMin';
import { KeyResultMin } from '../../shared/types/model/KeyResultMin';
import { KeyResultMetricMin } from '../../shared/types/model/KeyResultMetricMin';
import { KeyResultOrdinalMin } from '../../shared/types/model/KeyResultOrdinalMin';

Expand All @@ -36,7 +36,7 @@ export class KeyResultDetailComponent implements OnInit, OnDestroy {
protected readonly DATE_FORMAT = DATE_FORMAT;

constructor(
private keyResultService: KeyresultService,
private keyResultService: KeyResultService,
private refreshDataService: RefreshDataService,
private dialogService: DialogService,
private router: Router,
Expand Down Expand Up @@ -153,9 +153,9 @@ export class KeyResultDetailComponent implements OnInit, OnDestroy {

getKeyResultWithCorrectType(keyResult: KeyResult): KeyResultOrdinalMin | KeyResultMetricMin {
if (keyResult.keyResultType === 'metric') {
return keyResult as KeyresultMin as KeyResultMetricMin;
return keyResult as KeyResultMin as KeyResultMetricMin;
} else {
return keyResult as KeyresultMin as KeyResultOrdinalMin;
return keyResult as KeyResultMin as KeyResultOrdinalMin;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { KeyResultDialogComponent } from './key-result-dialog.component';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { KeyresultService } from '../../services/keyresult.service';
import { KeyResultService } from '../../services/key-result.service';
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatInputModule } from '@angular/material/input';
Expand Down Expand Up @@ -32,7 +32,7 @@ import { Quarter } from '../../shared/types/model/Quarter';
describe('KeyResultDialogComponent', () => {
let component: KeyResultDialogComponent;
let fixture: ComponentFixture<KeyResultDialogComponent>;
let keyResultService: KeyresultService;
let keyResultService: KeyResultService;

const oAuthMockService = {
getIdentityClaims() {
Expand Down Expand Up @@ -269,7 +269,7 @@ describe('KeyResultDialogComponent', () => {
provideRouter([]),
provideHttpClient(),
provideHttpClientTesting(),
KeyresultService,
KeyResultService,
TranslateService,
{ provide: UserService,
useValue: userService },
Expand Down Expand Up @@ -303,7 +303,7 @@ describe('KeyResultDialogComponent', () => {
userService.getCurrentUser.mockReturnValue(testUser);

fixture.detectChanges();
keyResultService = TestBed.inject(KeyresultService);
keyResultService = TestBed.inject(KeyResultService);
});

it('should create', () => {
Expand Down Expand Up @@ -436,7 +436,7 @@ describe('KeyResultDialogComponent', () => {
provideRouter([]),
provideHttpClient(),
provideHttpClientTesting(),
KeyresultService,
KeyResultService,
{
provide: MatDialogRef,
useValue: {
Expand Down Expand Up @@ -466,7 +466,7 @@ describe('KeyResultDialogComponent', () => {
fixture = TestBed.createComponent(KeyResultDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
keyResultService = TestBed.inject(KeyresultService);
keyResultService = TestBed.inject(KeyResultService);
fullKeyResultMetric.id = 3;
});

Expand Down Expand Up @@ -603,7 +603,7 @@ describe('KeyResultDialogComponent', () => {
provideRouter([]),
provideHttpClient(),
provideHttpClientTesting(),
KeyresultService,
KeyResultService,
{
provide: MatDialogRef,
useValue: matDialogRefMock
Expand Down Expand Up @@ -631,7 +631,7 @@ describe('KeyResultDialogComponent', () => {
fixture = TestBed.createComponent(KeyResultDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
keyResultService = TestBed.inject(KeyresultService);
keyResultService = TestBed.inject(KeyResultService);
});

afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { KeyResult } from '../../shared/types/model/KeyResult';
import { KeyResultMetricDTO } from '../../shared/types/DTOs/KeyResultMetricDTO';
import { KeyResultOrdinalDTO } from '../../shared/types/DTOs/KeyResultOrdinalDTO';
import { CloseState } from '../../shared/types/enums/CloseState';
import { KeyresultService } from '../../services/keyresult.service';
import { KeyResultService } from '../../services/key-result.service';
import { DialogService } from '../../services/dialog.service';

@Component({
Expand Down Expand Up @@ -37,7 +37,7 @@ export class KeyResultDialogComponent {
constructor(
@Inject(MAT_DIALOG_DATA) public data: { objective: Objective;
keyResult: KeyResult; },
private keyResultService: KeyresultService,
private keyResultService: KeyResultService,
public dialogService: DialogService,
public dialogRef: MatDialogRef<KeyResultDialogComponent>
) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { KeyresultService } from '../../services/keyresult.service';
import { KeyResultService } from '../../services/key-result.service';
import { MatDialogModule, MatDialogRef } from '@angular/material/dialog';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatInputModule } from '@angular/material/input';
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('KeyResultFormComponent', () => {
})
],
providers: [
KeyresultService,
KeyResultService,
TranslateService,
{ provide: UserService,
useValue: userService },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { KeyresultMin } from '../../shared/types/model/KeyresultMin';
import { KeyResultMin } from '../../shared/types/model/KeyResultMin';
import { Router } from '@angular/router';
import { DATE_FORMAT } from '../../shared/constantLibary';
import { KeyResultMetricMin } from '../../shared/types/model/KeyResultMetricMin';
Expand All @@ -12,7 +12,7 @@ import { KeyResultOrdinalMin } from '../../shared/types/model/KeyResultOrdinalMi
changeDetection: ChangeDetectionStrategy.OnPush
})
export class KeyResultComponent {
@Input() keyResult!: KeyresultMin;
@Input() keyResult!: KeyResultMin;

protected readonly DATE_FORMAT = DATE_FORMAT;

Expand Down
6 changes: 3 additions & 3 deletions frontend/src/app/services/dialog.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ describe('DialogService', () => {
const data: ConfirmDialogData = {
title: 'Test title',
text: 'Test description',
yesButtonState: ButtonState.VisibleEnabled,
noButtonState: ButtonState.VisibleDisabled,
closeButtonState: ButtonState.Hidden
yesButtonState: ButtonState.VISIBLE_ENABLED,
noButtonState: ButtonState.VISIBLE_DISABLED,
closeButtonState: ButtonState.HIDDEN
};

jest.spyOn(service, 'open');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import { KeyResultDTO } from '../shared/types/DTOs/KeyResultDTO';
@Injectable({
providedIn: 'root'
})
export class KeyresultService {
export class KeyResultService {
constructor(private httpClient: HttpClient) {}

getFullKeyResult(keyresultId: number): Observable<KeyResult> {
return this.httpClient.get<KeyResult>('/api/v2/keyresults/' + keyresultId)
.pipe(map((keyresult: any) => {
keyresult.objective.quarter = keyresult.objective.keyResultQuarterDto;
return keyresult;
getFullKeyResult(keyResultId: number): Observable<KeyResult> {
return this.httpClient.get<KeyResult>('/api/v2/keyresults/' + keyResultId)
.pipe(map((keyResult: any) => {
keyResult.objective.quarter = keyResult.objective.keyResultQuarterDto;
return keyResult;
}));
}

Expand Down
6 changes: 3 additions & 3 deletions frontend/src/app/services/keyresult.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { TestBed } from '@angular/core/testing';

import { KeyresultService } from './keyresult.service';
import { KeyResultService } from './key-result.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';

describe('KeyresultService', () => {
let service: KeyresultService;
let service: KeyResultService;

beforeEach(() => {
TestBed.configureTestingModule({ imports: [HttpClientTestingModule] });
service = TestBed.inject(KeyresultService);
service = TestBed.inject(KeyResultService);
});

it('should be created', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,38 @@ export class ConfirmDialogComponent implements OnInit {
ngOnInit() {
this.dialogTitle = this.data.title;
this.dialogText = this.data.text;
this.yesButtonState = this.data.yesButtonState ?? ButtonState.VisibleEnabled;
this.noButtonState = this.data.noButtonState ?? ButtonState.VisibleEnabled;
this.closeButtonState = this.data.closeButtonState ?? ButtonState.Hidden;
this.yesButtonState = this.data.yesButtonState ?? ButtonState.VISIBLE_ENABLED;
this.noButtonState = this.data.noButtonState ?? ButtonState.VISIBLE_ENABLED;
this.closeButtonState = this.data.closeButtonState ?? ButtonState.HIDDEN;
}

closeAndDelete() {
this.dialogRef.close(true);
}

isYesButtonVisible() {
return this.yesButtonState === ButtonState.VisibleEnabled || this.yesButtonState === ButtonState.VisibleDisabled;
return this.yesButtonState === ButtonState.VISIBLE_ENABLED || this.yesButtonState === ButtonState.VISIBLE_DISABLED;
}

isYesButtonDisabled() {
return this.yesButtonState === ButtonState.VisibleDisabled;
return this.yesButtonState === ButtonState.VISIBLE_DISABLED;
}

isNoButtonVisible() {
return this.noButtonState === ButtonState.VisibleEnabled || this.noButtonState === ButtonState.VisibleDisabled;
return this.noButtonState === ButtonState.VISIBLE_ENABLED || this.noButtonState === ButtonState.VISIBLE_DISABLED;
}

isNoButtonDisabled() {
return this.noButtonState === ButtonState.VisibleDisabled;
return this.noButtonState === ButtonState.VISIBLE_DISABLED;
}

isCloseButtonVisible() {
return (
this.closeButtonState === ButtonState.VisibleEnabled || this.closeButtonState === ButtonState.VisibleDisabled
this.closeButtonState === ButtonState.VISIBLE_ENABLED || this.closeButtonState === ButtonState.VISIBLE_DISABLED
);
}

isCloseButtonDisabled() {
return this.closeButtonState === ButtonState.VisibleDisabled;
return this.closeButtonState === ButtonState.VISIBLE_DISABLED;
}
}
Loading

0 comments on commit 2b259cf

Please sign in to comment.