Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename files to kebab case #1264

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ https://prettier.io/
If you get a does not match pattern error, it is likely because of the custom words for the OKR tool
here is a regex101 project that showcases how the regex works:
https://regex101.com/r/VUyAt6/1

## Test Coverage

For generating the coverage of our frontend specs (jest), you can use following command:
Expand All @@ -53,16 +54,16 @@ Open the html file in browser and you get a beautiful overview
## Cypress Tests

- local setup
- start local Docker `docker-compose up`
- start local Server: `OkrApplication-E2E`
- start local Client: `npm run start`
- start local Docker `docker-compose up`
- start local Server: `OkrApplication-E2E`
- start local Client: `npm run start`
- run selected Tests
- npm run `npm run cypress:open`
- in Cypress App, select `E2E Testing` and `Chrome` as Browser
- npm run `npm run cypress:open`
- in Cypress App, select `E2E Testing` and `Chrome` as Browser
- run all tests
- npm run `npm run cypress:run`
- in Cypress App, select `E2E Testing` and `Chrome` as Browser
- npm run `npm run cypress:run`
- in Cypress App, select `E2E Testing` and `Chrome` as Browser
- in case of failing Tests:
- stop and restart local Server
- stop and restart local Client
- re-run Cypress Tests
- stop and restart local Server
- stop and restart local Client
- re-run Cypress Tests
2 changes: 1 addition & 1 deletion frontend/cypress/e2e/check-in.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as users from '../fixtures/users.json';
import { uniqueSuffix } from '../support/helper/utils';
import CyOverviewPage from '../support/helper/dom-helper/pages/overviewPage';
import { Unit } from '../../src/app/shared/types/enums/Unit';
import { Unit } from '../../src/app/shared/types/enums/unit';
import KeyResultDetailPage from '../support/helper/dom-helper/pages/keyResultDetailPage';
import CheckInDialog from '../support/helper/dom-helper/dialogs/checkInDialog';
import CheckInHistoryDialog from '../support/helper/dom-helper/dialogs/checkInHistoryDialog';
Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress/e2e/key-result.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as users from '../fixtures/users.json';
import CyOverviewPage from '../support/helper/dom-helper/pages/overviewPage';
import KeyResultDetailPage from '../support/helper/dom-helper/pages/keyResultDetailPage';
import { Unit } from '../../src/app/shared/types/enums/Unit';
import { Unit } from '../../src/app/shared/types/enums/unit';
import KeyResultDialog from '../support/helper/dom-helper/dialogs/keyResultDialog';

describe('okr key-result', () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress/e2e/scoring.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as users from '../fixtures/users.json';
import { getPercentageMetric, getPercentageOrdinal } from 'cypress/support/helper/scoringSupport';
import CyOverviewPage from '../support/helper/dom-helper/pages/overviewPage';
import { Unit } from '../../src/app/shared/types/enums/Unit';
import { Unit } from '../../src/app/shared/types/enums/unit';
import KeyResultDetailPage from '../support/helper/dom-helper/pages/keyResultDetailPage';

describe('okr scoring', () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress/e2e/tab.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as users from '../fixtures/users.json';
import CyOverviewPage from '../support/helper/dom-helper/pages/overviewPage';
import { Unit } from '../../src/app/shared/types/enums/Unit';
import { Unit } from '../../src/app/shared/types/enums/unit';
import KeyResultDetailPage from '../support/helper/dom-helper/pages/keyResultDetailPage';

describe('tabbing workflows', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Dialog from './dialog';
import { Unit } from '../../../../../src/app/shared/types/enums/Unit';
import { Unit } from '../../../../../src/app/shared/types/enums/unit';
import ConfirmDialog from './confirmDialog';
import Chainable = Cypress.Chainable;

Expand Down
18 changes: 18 additions & 0 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,20 @@ import html from '@html-eslint/eslint-plugin'
import angular from 'angular-eslint'
import htmlParser from '@html-eslint/parser'
import { createRegexForWords } from './eslintHelper.mjs'
import checkFile from 'eslint-plugin-check-file'

export default tsEslint.config(
{
files: ['src/app/shared/types/**/*'],
rules: {
'check-file/filename-naming-convention': [
'error',
{
'**/*.{js,ts}': 'KEBAB_CASE',
},
],
},
},
{
ignores: ['cypress/downloads/**/*'],
},
Expand All @@ -19,6 +31,11 @@ export default tsEslint.config(
...tsEslint.configs.stylistic,
...angular.configs.tsRecommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.json', './tsconfig.spec.json'],
},
},
processor: angular.processInlineTemplates,
languageOptions: {
parserOptions: {
Expand Down Expand Up @@ -209,6 +226,7 @@ export default tsEslint.config(
'unused-imports': unusedImports,
'@stylistic': stylistic,
'@html-eslint': html,
'check-file': checkFile,
},
}
)
28 changes: 25 additions & 3 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,17 @@
"@eslint/js": "^9.15.0",
"@html-eslint/eslint-plugin": "^0.27.0",
"@html-eslint/parser": "^0.27.0",
"@stylistic/eslint-plugin": "^2.11.0",
"@types/eslint__js": "^8.42.3",
"@types/jest": "^29.5.13",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.15.0",
"angular-eslint": "19.0.2",
"browserslist": "^4.24.2",
"cypress": "^13.15.0",
"cypress-real-events": "^1.13.0",
"eslint": "^9.16.0",
"eslint-plugin-check-file": "^2.8.0",
"eslint-plugin-unused-imports": "^4.1.4",
"jest": "^29.7.0",
"jest-preset-angular": "^14.2.4",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { of } from 'rxjs';
import { SidePanelComponent } from './shared/side-panel/side-panel.component';
import { authGuard } from './guards/auth.guard';
import { UserService } from './services/user.service';
import { User } from './shared/types/model/User';
import { User } from './shared/types/model/user';
import { OAuthService } from 'angular-oauth2-oidc';
import { ObjectiveDetailComponent } from './components/objective-detail/objective-detail.component';
import { KeyResultDetailComponent } from './components/key-result-detail/key-result-detail.component';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { CdkDrag, CdkDragHandle, CdkDropList } from '@angular/cdk/drag-drop';
import { SharedModule } from './shared/shared.module';
import { OAuthInterceptor } from './interceptors/o-auth.interceptor';
import { ErrorInterceptor } from './interceptors/error.interceptor';
import { CustomRouter } from './shared/customRouter';
import { CustomRouter } from './shared/custom-router';
import { KeyResultFormComponent } from './components/key-result-form/key-result-form.component';
import { KeyResultDialogComponent } from './components/key-result-dialog/key-result-dialog.component';
import { CheckInHistoryDialogComponent } from './components/check-in-history-dialog/check-in-history-dialog.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
import { MatDialogRef } from '@angular/material/dialog';
import { CdkDrag, CdkDropList } from '@angular/cdk/drag-drop';
import { ActionService } from '../../services/action.service';
import { action1, action2, action3, addedAction } from '../../shared/testData';
import { action1, action2, action3, addedAction } from '../../shared/test-data';
import { BehaviorSubject, of } from 'rxjs';
import { Action } from '../../shared/types/model/Action';
import { Action } from '../../shared/types/model/action';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { DialogService } from '../../services/dialog.service';
import { ConfirmDialogComponent } from '../../shared/dialog/confirm-dialog/confirm-dialog.component';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, ElementRef, Input, QueryList, ViewChildren } from '@angular/core';
import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
import { Action } from '../../shared/types/model/Action';
import { Action } from '../../shared/types/model/action';
import { ActionService } from '../../services/action.service';
import { BehaviorSubject } from 'rxjs';
import { trackByFn } from '../../shared/common';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin
import { ApplicationBannerComponent } from './application-banner.component';
import { By } from '@angular/platform-browser';
import { RefreshDataService } from '../../services/refresh-data.service';
import { PUZZLE_TOP_BAR_HEIGHT } from '../../shared/constantLibary';
import { PUZZLE_TOP_BAR_HEIGHT } from '../../shared/constant-library';
import { TeamFilterComponent } from '../team-filter/team-filter.component';
import { QuarterFilterComponent } from '../quarter-filter/quarter-filter.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { RefreshDataService } from '../../services/refresh-data.service';
import { DEFAULT_HEADER_HEIGHT_PX, PUZZLE_TOP_BAR_HEIGHT } from '../../shared/constantLibary';
import { DEFAULT_HEADER_HEIGHT_PX, PUZZLE_TOP_BAR_HEIGHT } from '../../shared/constant-library';

@Component({
selector: 'app-application-banner',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatDialogModule } from '@angular/material/dialog';
import { NavigationEnd, Router } from '@angular/router';
import { of } from 'rxjs';
import { testUser } from '../../shared/testData';
import { testUser } from '../../shared/test-data';
import { UserService } from '../../services/user.service';
import { ConfigService } from '../../services/config.service';
import { DialogService } from '../../services/dialog.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BehaviorSubject, Subscription } from 'rxjs';
import { ConfigService } from '../../services/config.service';
import { NavigationEnd, Router } from '@angular/router';
import { UserService } from '../../services/user.service';
import { getFullNameOfUser } from '../../shared/types/model/User';
import { getFullNameOfUser } from '../../shared/types/model/user';

@Component({
selector: 'app-application-top-bar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CheckInHistoryDialogComponent } from './check-in-history-dialog.component';
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { checkInMetric, checkInMetricWriteableFalse, keyResult } from '../../shared/testData';
import { checkInMetric, checkInMetricWriteableFalse, keyResult } from '../../shared/test-data';
import { By } from '@angular/platform-browser';
import { DialogService } from '../../services/dialog.service';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Component, Inject, OnInit } from '@angular/core';
import { CheckInMin } from '../../shared/types/model/CheckInMin';
import { CheckInMin } from '../../shared/types/model/check-in-min';
import { CheckInService } from '../../services/check-in.service';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { DATE_FORMAT } from '../../shared/constantLibary';
import { KeyResult } from '../../shared/types/model/KeyResult';
import { DATE_FORMAT } from '../../shared/constant-library';
import { KeyResult } from '../../shared/types/model/key-result';
import { CheckInFormComponent } from '../checkin/check-in-form/check-in-form.component';
import { Observable, of } from 'rxjs';
import { KeyResultMetric } from '../../shared/types/model/KeyResultMetric';
import { KeyResultMetric } from '../../shared/types/model/key-result-metric';
import { RefreshDataService } from '../../services/refresh-data.service';
import { DialogService } from '../../services/dialog.service';
import { CheckInMetricMin } from '../../shared/types/model/CheckInMetricMin';
import { CheckInOrdinalMin } from '../../shared/types/model/CheckInOrdinalMin';
import { CheckInMetricMin } from '../../shared/types/model/check-in-metric-min';
import { CheckInOrdinalMin } from '../../shared/types/model/check-in-ordinal-min';

@Component({
selector: 'app-check-in-history-dialog',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import { CheckInFormMetricComponent } from './check-in-form-metric.component';
import { checkInMetric, keyResultMetric } from '../../../shared/testData';
import { checkInMetric, keyResultMetric } from '../../../shared/test-data';
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { MatDialogModule } from '@angular/material/dialog';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatSelectModule } from '@angular/material/select';
import { MatInputModule } from '@angular/material/input';
import { MatRadioModule } from '@angular/material/radio';
import { Unit } from '../../../shared/types/enums/Unit';
import { Unit } from '../../../shared/types/enums/unit';
import { TranslateTestingModule } from 'ngx-translate-testing';
import * as de from '../../../../assets/i18n/de.json';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
import { FormGroup, Validators } from '@angular/forms';
import { KeyResultMetric } from '../../../shared/types/model/KeyResultMetric';
import { CheckInMin } from '../../../shared/types/model/CheckInMin';
import { KeyResultMetric } from '../../../shared/types/model/key-result-metric';
import { CheckInMin } from '../../../shared/types/model/check-in-min';
import { formInputCheck, hasFormFieldErrors } from '../../../shared/common';
import { TranslateService } from '@ngx-translate/core';
import { CheckInMetricMin } from '../../../shared/types/model/CheckInMetricMin';
import { CheckInMetricMin } from '../../../shared/types/model/check-in-metric-min';

@Component({
selector: 'app-check-in-form-metric',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import { CheckInFormOrdinalComponent } from './check-in-form-ordinal.component';
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { keyResultOrdinalMin } from '../../../shared/testData';
import { KeyResultOrdinal } from '../../../shared/types/model/KeyResultOrdinal';
import { keyResultOrdinalMin } from '../../../shared/test-data';
import { KeyResultOrdinal } from '../../../shared/types/model/key-result-ordinal';
import { MatDialogModule } from '@angular/material/dialog';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatSelectModule } from '@angular/material/select';
import { MatInputModule } from '@angular/material/input';
import { MatRadioModule } from '@angular/material/radio';
import { Zone } from '../../../shared/types/enums/Zone';
import { Zone } from '../../../shared/types/enums/zone';
import { MatRadioButtonHarness } from '@angular/material/radio/testing';
import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Component, Input } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { KeyResultOrdinal } from '../../../shared/types/model/KeyResultOrdinal';
import { Zone } from '../../../shared/types/enums/Zone';
import { CheckInMin } from '../../../shared/types/model/CheckInMin';
import { KeyResultOrdinal } from '../../../shared/types/model/key-result-ordinal';
import { Zone } from '../../../shared/types/enums/zone';
import { CheckInMin } from '../../../shared/types/model/check-in-min';

@Component({
selector: 'app-check-in-form-ordinal',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
keyResultActions,
keyResultMetric,
keyResultOrdinal
} from '../../../shared/testData';
} from '../../../shared/test-data';
import { MatIconModule } from '@angular/material/icon';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { ChangeDetectionStrategy, Component, Inject, OnInit } from '@angular/core';
import { KeyResultMetric } from '../../../shared/types/model/KeyResultMetric';
import { KeyResultMetric } from '../../../shared/types/model/key-result-metric';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { KeyResult } from '../../../shared/types/model/KeyResult';
import { KeyResultOrdinal } from '../../../shared/types/model/KeyResultOrdinal';
import { CheckInMin } from '../../../shared/types/model/CheckInMin';
import { KeyResult } from '../../../shared/types/model/key-result';
import { KeyResultOrdinal } from '../../../shared/types/model/key-result-ordinal';
import { CheckInMin } from '../../../shared/types/model/check-in-min';
import { CheckInService } from '../../../services/check-in.service';
import { Action } from '../../../shared/types/model/Action';
import { Action } from '../../../shared/types/model/action';
import { ActionService } from '../../../services/action.service';
import { formInputCheck, hasFormFieldErrors } from '../../../shared/common';
import { TranslateService } from '@ngx-translate/core';
import { CheckIn } from '../../../shared/types/model/CheckIn';
import { CheckInMetricMin } from '../../../shared/types/model/CheckInMetricMin';
import { CheckInOrdinalMin } from '../../../shared/types/model/CheckInOrdinalMin';
import { CheckIn } from '../../../shared/types/model/check-in';
import { CheckInMetricMin } from '../../../shared/types/model/check-in-metric-min';
import { CheckInOrdinalMin } from '../../../shared/types/model/check-in-ordinal-min';

@Component({
selector: 'app-check-in-form',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ConfidenceComponent } from './confidence.component';
import { checkInMetric } from '../../shared/testData';
import { checkInMetric } from '../../shared/test-data';
import { MatSliderModule } from '@angular/material/slider';
import { CheckInMin } from '../../shared/types/model/CheckInMin';
import { CheckInMin } from '../../shared/types/model/check-in-min';
import { FormsModule } from '@angular/forms';
import { SimpleChange } from '@angular/core';
import { By } from '@angular/platform-browser';
Expand Down
Loading
Loading