Skip to content

Commit

Permalink
Feature/271 angular upgrade (#276)
Browse files Browse the repository at this point in the history
* Update angular core and cli

* Update rxjs

* Use default value for relativeLinkResolution

* Update bootstrap

* Update jasmine/karma

* Apply patch updates

* Apply minor updates

* Apply major updates

* Apply npm audit fix

* Format code

* Update date-fns

* Fix accordion collapse

* Re-enable husky

* Remove node-sass
  • Loading branch information
caebr authored Apr 15, 2021
1 parent d97bdda commit 166b2f5
Show file tree
Hide file tree
Showing 63 changed files with 6,300 additions and 5,308 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

lint-staged
1 change: 0 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"optimization": true,
"outputHashing": "none",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
Expand Down
2 changes: 1 addition & 1 deletion e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../tsconfig.base.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
Expand Down
9,873 changes: 5,394 additions & 4,479 deletions package-lock.json

Large diffs are not rendered by default.

89 changes: 42 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,73 +16,68 @@
"e2e": "ng e2e",
"preanalyze": "ng build --stats-json",
"analyze": "npx webpack-bundle-analyzer dist/$(ng config defaultProject)/stats.json",
"postanalyze": "rm dist/$(ng config defaultProject)/stats.json"
"postanalyze": "rm dist/$(ng config defaultProject)/stats.json",
"prepare": "husky install"
},
"private": true,
"dependencies": {
"-": "0.0.1",
"@angular/animations": "^10.0.14",
"@angular/common": "^10.0.14",
"@angular/compiler": "^10.0.14",
"@angular/core": "^10.0.14",
"@angular/forms": "^10.0.14",
"@angular/localize": "^10.0.14",
"@angular/platform-browser": "^10.0.14",
"@angular/platform-browser-dynamic": "^10.0.14",
"@angular/router": "^10.0.14",
"@ng-bootstrap/ng-bootstrap": "^7.0.0",
"@angular/animations": "^11.2.9",
"@angular/common": "^11.2.9",
"@angular/compiler": "^11.2.9",
"@angular/core": "^11.2.9",
"@angular/forms": "^11.2.9",
"@angular/localize": "^11.2.9",
"@angular/platform-browser": "^11.2.9",
"@angular/platform-browser-dynamic": "^11.2.9",
"@angular/router": "^11.2.9",
"@ng-bootstrap/ng-bootstrap": "^9.1.0",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"bootstrap": "^4.5.2",
"core-js": "~3.6.5",
"date-fns": "^2.16.0",
"fp-ts": "^2.8.2",
"io-ts": "^2.2.10",
"io-ts-types": "^0.5.10",
"lodash-es": "^4.17.15",
"monocle-ts": "^2.3.3",
"bootstrap": "^4.6.0",
"core-js": "~3.10.1",
"date-fns": "^2.20.3",
"fp-ts": "^2.9.5",
"io-ts": "^2.2.16",
"io-ts-types": "^0.5.16",
"lodash-es": "^4.17.21",
"monocle-ts": "^2.3.9",
"newtype-ts": "^0.3.4",
"ngx-infinite-scroll": "^9.0.0",
"ngx-toastr": "^13.0.0",
"rxjs": "~6.6.2",
"tslib": "^2.0.1",
"watchpack": "^1.6.1",
"zone.js": "~0.11.1"
"ngx-infinite-scroll": "^10.0.1",
"ngx-toastr": "^13.2.1",
"rxjs": "~6.6.7",
"tslib": "^2.2.0",
"watchpack": "^2.1.1",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1000.8",
"@angular/cli": "~10.0.8",
"@angular/compiler-cli": "^10.0.14",
"@angular/language-service": "^10.0.14",
"@types/jasmine": "~3.5.14",
"@angular-devkit/build-angular": "~0.1102.8",
"@angular/cli": "~11.2.8",
"@angular/compiler-cli": "^11.2.9",
"@angular/language-service": "^11.2.9",
"@types/jasmine": "~3.6.9",
"@types/jasminewd2": "~2.0.8",
"@types/lodash-es": "^4.17.3",
"@types/node": "^14.6.2",
"codelyzer": "^6.0.0",
"@types/lodash-es": "^4.17.4",
"@types/node": "^14.14.37",
"codelyzer": "^6.0.1",
"fibers": "^5.0.0",
"husky": "^4.2.5",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.2",
"karma": "~5.1.1",
"husky": "^6.0.0",
"jasmine-core": "~3.7.1",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.5.4",
"lint-staged": "~10.2.13",
"node-sass": "^4.14.1",
"prettier": "2.1.1",
"lint-staged": "~10.5.4",
"prettier": "2.2.1",
"protractor": "~7.0.0",
"ts-node": "~9.0.0",
"ts-node": "~9.1.1",
"tslint": "~6.1.3",
"tslint-config-prettier": "^1.18.0",
"tslint-jasmine-rules": "^1.6.1",
"tslint-plugin-prettier": "^2.3.0",
"typescript": "~3.9.7"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"typescript": "~4.1.5"
},
"lint-staged": {
"./src/app/**/*.ts": [
Expand Down
6 changes: 5 additions & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ const routes: Routes = [
];

@NgModule({
imports: [RouterModule.forRoot(routes, { useHash: true })],
imports: [
RouterModule.forRoot(routes, {
useHash: true,
}),
],
exports: [RouterModule],
})
export class AppRoutingModule {}
18 changes: 10 additions & 8 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TestBed, async, ComponentFixture } from '@angular/core/testing';
import { TestBed, ComponentFixture, waitForAsync } from '@angular/core/testing';

import { buildTestModuleMetadata } from 'src/spec-helpers';
import { AppComponent } from './app.component';
Expand All @@ -7,13 +7,15 @@ describe('AppComponent', () => {
let component: AppComponent;
let fixture: ComponentFixture<AppComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule(
buildTestModuleMetadata({
declarations: [AppComponent],
})
).compileComponents();
}));
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule(
buildTestModuleMetadata({
declarations: [AppComponent],
})
).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { HttpTestingController } from '@angular/common/http/testing';
import { of, Observable } from 'rxjs';
import { isEqual } from 'lodash-es';
Expand All @@ -25,93 +25,95 @@ describe('EditAbsencesEditComponent', () => {
let dispensation: PresenceType;
let halfDay: PresenceType;

beforeEach(async(() => {
absence = buildPresenceType(settings.absencePresenceTypeId, true, false);
absence.NeedsConfirmation = true;

doctor = buildPresenceType(13, true, false);
doctor.NeedsConfirmation = true;
doctor.Designation = 'Arzt';

ill = buildPresenceType(14, true, false);
ill.NeedsConfirmation = true;
ill.Designation = 'Krank';

late = buildPresenceType(settings.latePresenceTypeId, false, true);
late.Designation = 'Verspätung';

dispensation = buildPresenceType(
settings.dispensationPresenceTypeId,
false,
false
);
dispensation.IsDispensation = true;

halfDay = buildPresenceType(settings.halfDayPresenceTypeId, false, false);
halfDay.IsHalfDay = true;

TestBed.configureTestingModule(
buildTestModuleMetadata({
declarations: [EditAbsencesEditComponent],
providers: [
{
provide: EditAbsencesStateService,
useValue: {
presenceTypes$: of([]),
selected: [],
resetSelection: jasmine.createSpy('resetSelection'),
beforeEach(
waitForAsync(() => {
absence = buildPresenceType(settings.absencePresenceTypeId, true, false);
absence.NeedsConfirmation = true;

doctor = buildPresenceType(13, true, false);
doctor.NeedsConfirmation = true;
doctor.Designation = 'Arzt';

ill = buildPresenceType(14, true, false);
ill.NeedsConfirmation = true;
ill.Designation = 'Krank';

late = buildPresenceType(settings.latePresenceTypeId, false, true);
late.Designation = 'Verspätung';

dispensation = buildPresenceType(
settings.dispensationPresenceTypeId,
false,
false
);
dispensation.IsDispensation = true;

halfDay = buildPresenceType(settings.halfDayPresenceTypeId, false, false);
halfDay.IsHalfDay = true;

TestBed.configureTestingModule(
buildTestModuleMetadata({
declarations: [EditAbsencesEditComponent],
providers: [
{
provide: EditAbsencesStateService,
useValue: {
presenceTypes$: of([]),
selected: [],
resetSelection: jasmine.createSpy('resetSelection'),
},
},
},
{
provide: PresenceTypesService,
useValue: {
presenceTypes$: of([
absence,
doctor,
ill,
late,
dispensation,
halfDay,
]),
confirmationTypes$: of([absence, doctor, ill]),
incidentTypes$: of([late]),
halfDayActive$: of(true),
{
provide: PresenceTypesService,
useValue: {
presenceTypes$: of([
absence,
doctor,
ill,
late,
dispensation,
halfDay,
]),
confirmationTypes$: of([absence, doctor, ill]),
incidentTypes$: of([late]),
halfDayActive$: of(true),
},
},
},
{
provide: DropDownItemsRestService,
useValue: {
getAbsenceConfirmationStates(): Observable<
ReadonlyArray<DropDownItem>
> {
return of([
{
Key: settings.excusedAbsenceStateId,
Value: 'entschuldigt',
},
{
Key: settings.unexcusedAbsenceStateId,
Value: 'unentschuldigt',
},
{
Key: settings.unconfirmedAbsenceStateId,
Value: 'zu bestätigen',
},
{
Key: settings.checkableAbsenceStateId,
Value: 'zu kontrollieren',
},
]);
{
provide: DropDownItemsRestService,
useValue: {
getAbsenceConfirmationStates(): Observable<
ReadonlyArray<DropDownItem>
> {
return of([
{
Key: settings.excusedAbsenceStateId,
Value: 'entschuldigt',
},
{
Key: settings.unexcusedAbsenceStateId,
Value: 'unentschuldigt',
},
{
Key: settings.unconfirmedAbsenceStateId,
Value: 'zu bestätigen',
},
{
Key: settings.checkableAbsenceStateId,
Value: 'zu kontrollieren',
},
]);
},
},
},
},
],
})
).compileComponents();

httpTestingController = TestBed.inject(HttpTestingController);
state = TestBed.inject(EditAbsencesStateService);
}));
],
})
).compileComponents();

httpTestingController = TestBed.inject(HttpTestingController);
state = TestBed.inject(EditAbsencesStateService);
})
);

beforeEach(() => {
fixture = TestBed.createComponent(EditAbsencesEditComponent);
Expand Down
Loading

0 comments on commit 166b2f5

Please sign in to comment.