Skip to content

Commit e22eb51

Browse files
committed
chore: format
1 parent b7eed68 commit e22eb51

54 files changed

Lines changed: 2227 additions & 2127 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

carrental-web/src/angular/carrental/package-lock.json

Lines changed: 852 additions & 1070 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

carrental-web/src/angular/carrental/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"extract-i18n": "ng extract-i18n --format=json",
1414
"lint": "ng lint",
1515
"e2e": "ng e2e",
16-
"postinstall": "ngcc"
16+
"postinstall": "ngcc",
17+
"prettier": "npx prettier --write 'src/**/*.{ts,html,scss,json}'"
1718
},
1819
"private": true,
1920
"dependencies": {

carrental-web/src/angular/carrental/src/app/app-routing.module.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import { NgModule } from '@angular/core';
17-
import { Routes, RouterModule } from '@angular/router';
18-
import { CrlistComponent } from './crlist/crlist.component';
19-
import { CrdetailComponent } from './crdetail/crdetail.component';
20-
import { AppComponent } from './app.component';
21-
import { CrrootComponent } from './crroot/crroot.component';
16+
import { NgModule } from "@angular/core";
17+
import { Routes, RouterModule } from "@angular/router";
18+
import { CrlistComponent } from "./crlist/crlist.component";
19+
import { CrdetailComponent } from "./crdetail/crdetail.component";
20+
import { AppComponent } from "./app.component";
21+
import { CrrootComponent } from "./crroot/crroot.component";
2222

2323
const routes: Routes = [
24-
{path: 'crdetail/mietenr/:mnr/jahr/:jahr', component: CrdetailComponent},
25-
{path: 'crlist/mietenr/:mnr', component: CrlistComponent},
26-
{path: 'crroot', component: CrrootComponent},
27-
{path: '**', redirectTo: '/crroot', pathMatch: 'full'},
24+
{ path: "crdetail/mietenr/:mnr/jahr/:jahr", component: CrdetailComponent },
25+
{ path: "crlist/mietenr/:mnr", component: CrlistComponent },
26+
{ path: "crroot", component: CrrootComponent },
27+
{ path: "**", redirectTo: "/crroot", pathMatch: "full" },
2828
];
2929

3030
@NgModule({
3131
imports: [RouterModule.forRoot(routes, {})],
3232
exports: [RouterModule],
33-
providers: []
33+
providers: [],
3434
})
35-
export class AppRoutingModule { }
35+
export class AppRoutingModule {}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<h1>{{title}}</h1>
1+
<h1>{{ title }}</h1>
22
<a id="myRoot" [routerLink]="['/']" i18n>Link zu crroot</a>
3-
<a id="myDetail" [routerLink]="['/crdetail/mietenr/1/jahr/2015']" i18n>Link
4-
zu crdetail</a>
5-
<a id="myList" [routerLink]="['/crlist/mietenr/1']" i18n>Link zu
6-
crlist</a>
7-
<router-outlet></router-outlet>
3+
<a id="myDetail" [routerLink]="['/crdetail/mietenr/1/jahr/2015']" i18n
4+
>Link zu crdetail</a
5+
>
6+
<a id="myList" [routerLink]="['/crlist/mietenr/1']" i18n>Link zu crlist</a>
7+
<router-outlet></router-outlet>

carrental-web/src/angular/carrental/src/app/app.component.spec.ts

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,25 @@
1515
*/
1616
/* eslint-disable @typescript-eslint/no-unused-vars */
1717

18-
import { TestBed, waitForAsync } from '@angular/core/testing';
19-
import { AppComponent } from './app.component';
20-
import { AppRoutingModule } from './app-routing.module';
21-
import { CrlistComponent } from './crlist/crlist.component';
22-
import { CrdetailComponent } from './crdetail/crdetail.component';
23-
import { CrValuesComponent } from './crvalues/crvalues.component';
24-
import { CrvaluesdComponent } from './crvaluesd/crvaluesd.component';
25-
import { CrdateComponent } from './crdate/crdate.component';
26-
import { CrrootComponent } from './crroot/crroot.component';
27-
import { CruploadComponent } from './crupload/crupload.component';
18+
import { TestBed, waitForAsync } from "@angular/core/testing";
19+
import { AppComponent } from "./app.component";
20+
import { AppRoutingModule } from "./app-routing.module";
21+
import { CrlistComponent } from "./crlist/crlist.component";
22+
import { CrdetailComponent } from "./crdetail/crdetail.component";
23+
import { CrValuesComponent } from "./crvalues/crvalues.component";
24+
import { CrvaluesdComponent } from "./crvaluesd/crvaluesd.component";
25+
import { CrdateComponent } from "./crdate/crdate.component";
26+
import { CrrootComponent } from "./crroot/crroot.component";
27+
import { CruploadComponent } from "./crupload/crupload.component";
2828

29-
import { BrowserModule } from '@angular/platform-browser';
30-
import { FormsModule,ReactiveFormsModule } from '@angular/forms';
31-
import { HttpClientModule } from '@angular/common/http';
32-
import {APP_BASE_HREF} from '@angular/common';
33-
import {HttpTestingController} from '@angular/common/http/testing';
34-
import { NumberSeparatorPipe } from './shared/number-separator.pipe';
29+
import { BrowserModule } from "@angular/platform-browser";
30+
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
31+
import { HttpClientModule } from "@angular/common/http";
32+
import { APP_BASE_HREF } from "@angular/common";
33+
import { HttpTestingController } from "@angular/common/http/testing";
34+
import { NumberSeparatorPipe } from "./shared/number-separator.pipe";
3535

36-
37-
describe('AppComponent', () => {
36+
describe("AppComponent", () => {
3837
beforeEach(() => {
3938
TestBed.configureTestingModule({
4039
declarations: [
@@ -46,36 +45,38 @@ describe('AppComponent', () => {
4645
CrvaluesdComponent,
4746
CrdateComponent,
4847
NumberSeparatorPipe,
49-
CruploadComponent
48+
CruploadComponent,
5049
],
5150
imports: [
5251
BrowserModule,
5352
FormsModule,
5453
ReactiveFormsModule,
5554
HttpClientModule,
56-
AppRoutingModule
55+
AppRoutingModule,
5756
],
58-
providers: [{provide: APP_BASE_HREF, useValue : '/' }]
57+
providers: [{ provide: APP_BASE_HREF, useValue: "/" }],
5958
});
6059
TestBed.compileComponents();
6160
});
6261

63-
it('should create the app', waitForAsync(() => {
62+
it("should create the app", waitForAsync(() => {
6463
const fixture = TestBed.createComponent(AppComponent);
6564
const app = fixture.debugElement.componentInstance;
6665
expect(app).toBeTruthy();
6766
}));
6867

6968
it(`should have as title 'app works!'`, waitForAsync(() => {
70-
const fixture = TestBed.createComponent(AppComponent);
69+
const fixture = TestBed.createComponent(AppComponent);
7170
const app = fixture.debugElement.componentInstance;
72-
expect(app.title).toEqual('carrental works!');
71+
expect(app.title).toEqual("carrental works!");
7372
}));
7473

75-
it('should render title in a h1 tag', waitForAsync(() => {
74+
it("should render title in a h1 tag", waitForAsync(() => {
7675
const fixture = TestBed.createComponent(AppComponent);
7776
fixture.detectChanges();
7877
const compiled = fixture.debugElement.nativeElement;
79-
expect(compiled.querySelector('h1').textContent).toContain('carrental works!');
78+
expect(compiled.querySelector("h1").textContent).toContain(
79+
"carrental works!"
80+
);
8081
}));
8182
});

carrental-web/src/angular/carrental/src/app/app.component.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,15 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import { Component } from '@angular/core';
17-
16+
import { Component } from "@angular/core";
1817

1918
@Component({
20-
selector: 'app-root',
21-
templateUrl: './app.component.html',
22-
styleUrls: ['./app.component.scss']
19+
selector: "app-root",
20+
templateUrl: "./app.component.html",
21+
styleUrls: ["./app.component.scss"],
2322
})
2423
export class AppComponent {
25-
protected title = 'carrental works!';
26-
27-
constructor() {
24+
protected title = "carrental works!";
2825

29-
}
26+
constructor() {}
3027
}

carrental-web/src/angular/carrental/src/app/app.module.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import { BrowserModule } from '@angular/platform-browser';
17-
import { NgModule,ErrorHandler } from '@angular/core';
18-
import { FormsModule,ReactiveFormsModule } from '@angular/forms';
19-
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
20-
import { AppComponent } from './app.component';
21-
import { CrlistComponent } from './crlist/crlist.component';
22-
import { CrdetailComponent } from './crdetail/crdetail.component';
23-
import { CrValuesComponent } from './crvalues/crvalues.component';
24-
import { CrRestService } from './services/crrest.service';
25-
import { AppRoutingModule } from './app-routing.module';
26-
import { CrvaluesdComponent } from './crvaluesd/crvaluesd.component';
27-
import { CrdateComponent } from './crdate/crdate.component';
28-
import { NumberSeparatorPipe } from './shared/number-separator.pipe';
29-
import { NumberseparatorDirective } from './shared/numberseparator.directive';
30-
import { CrrootComponent } from './crroot/crroot.component';
31-
import { CruploadComponent } from './crupload/crupload.component';
16+
import { BrowserModule } from "@angular/platform-browser";
17+
import { NgModule, ErrorHandler } from "@angular/core";
18+
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
19+
import { HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http";
20+
import { AppComponent } from "./app.component";
21+
import { CrlistComponent } from "./crlist/crlist.component";
22+
import { CrdetailComponent } from "./crdetail/crdetail.component";
23+
import { CrValuesComponent } from "./crvalues/crvalues.component";
24+
import { CrRestService } from "./services/crrest.service";
25+
import { AppRoutingModule } from "./app-routing.module";
26+
import { CrvaluesdComponent } from "./crvaluesd/crvaluesd.component";
27+
import { CrdateComponent } from "./crdate/crdate.component";
28+
import { NumberSeparatorPipe } from "./shared/number-separator.pipe";
29+
import { NumberseparatorDirective } from "./shared/numberseparator.directive";
30+
import { CrrootComponent } from "./crroot/crroot.component";
31+
import { CruploadComponent } from "./crupload/crupload.component";
3232
//import { MyErrorHandler } from './shared/my-error-handler';
33-
import { BaseHrefInterceptor } from './services/base-href-interceptor';
33+
import { BaseHrefInterceptor } from "./services/base-href-interceptor";
3434

3535
@NgModule({
3636
declarations: [
@@ -50,12 +50,12 @@ import { BaseHrefInterceptor } from './services/base-href-interceptor';
5050
FormsModule,
5151
ReactiveFormsModule,
5252
HttpClientModule,
53-
AppRoutingModule
53+
AppRoutingModule,
5454
],
5555
providers: [
56-
//{provide: ErrorHandler, useClass: MyErrorHandler},
57-
{ provide: HTTP_INTERCEPTORS, useClass: BaseHrefInterceptor, multi: true },
58-
],
59-
bootstrap: [AppComponent]
56+
//{provide: ErrorHandler, useClass: MyErrorHandler},
57+
{ provide: HTTP_INTERCEPTORS, useClass: BaseHrefInterceptor, multi: true },
58+
],
59+
bootstrap: [AppComponent],
6060
})
61-
export class AppModule { }
61+
export class AppModule {}
Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
<div class='input-group date' id='datetimepicker1'>
2-
<input type="date" class="form-control"
3-
[value]="newDate | date:'yyyy-MM-dd'" (input)="convertToDate($event)"
4-
*ngIf="!mytype" /> <input type="text" class="form-control"
5-
[value]="newString" (input)="setStr($event)" *ngIf="mytype" />
6-
</div>
1+
<div class="input-group date" id="datetimepicker1">
2+
<input
3+
type="date"
4+
class="form-control"
5+
[value]="newDate | date : 'yyyy-MM-dd'"
6+
(input)="convertToDate($event)"
7+
*ngIf="!mytype"
8+
/>
9+
<input
10+
type="text"
11+
class="form-control"
12+
[value]="newString"
13+
(input)="setStr($event)"
14+
*ngIf="mytype"
15+
/>
16+
</div>
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
1+
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
22

3-
import { CrdateComponent } from './crdate.component';
3+
import { CrdateComponent } from "./crdate.component";
44

5-
describe('CrdateComponent', () => {
5+
describe("CrdateComponent", () => {
66
let component: CrdateComponent;
77
let fixture: ComponentFixture<CrdateComponent>;
88

99
beforeEach(waitForAsync(() => {
1010
TestBed.configureTestingModule({
11-
declarations: [ CrdateComponent ]
12-
})
13-
.compileComponents();
11+
declarations: [CrdateComponent],
12+
}).compileComponents();
1413
}));
1514

1615
beforeEach(() => {
@@ -19,7 +18,7 @@ describe('CrdateComponent', () => {
1918
fixture.detectChanges();
2019
});
2120

22-
it('should create', () => {
21+
it("should create", () => {
2322
expect(component).toBeTruthy();
2423
});
2524
});

carrental-web/src/angular/carrental/src/app/crdate/crdate.component.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,48 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import { Component, Input, OnInit} from '@angular/core';
16+
import { Component, Input, OnInit } from "@angular/core";
1717

1818
@Component({
19-
selector: 'app-crdate',
20-
templateUrl: './crdate.component.html',
21-
styleUrls: ['./crdate.component.scss']
19+
selector: "app-crdate",
20+
templateUrl: "./crdate.component.html",
21+
styleUrls: ["./crdate.component.scss"],
2222
})
2323
export class CrdateComponent implements OnInit {
24-
25-
constructor() { }
24+
constructor() {}
2625
@Input() myobject: any;
2726
@Input() myvalue: string;
2827
@Input() mytype: string;
2928
protected newDate: number;
3029
protected newString: string;
3130

3231
ngOnInit() {
33-
if(!this.myobject) {return;} //for the tests
34-
if(!this.mytype) {
35-
this.newDate = this.myobject[this.myvalue];
36-
} else {
37-
this.newString = this.myobject[this.myvalue];
38-
// console.log(this.newString);
39-
}
32+
if (!this.myobject) {
33+
return;
34+
} //for the tests
35+
if (!this.mytype) {
36+
this.newDate = this.myobject[this.myvalue];
37+
} else {
38+
this.newString = this.myobject[this.myvalue];
39+
// console.log(this.newString);
40+
}
4041
}
4142

4243
setStr(event: any): void {
43-
this.myobject[this.myvalue] = event.target.value;
44-
//console.log(event.target.value);
44+
this.myobject[this.myvalue] = event.target.value;
45+
//console.log(event.target.value);
4546
}
4647

4748
convertToDate(event: any): void {
48-
const myDate = this.myobject[this.myvalue];
49-
console.log(this.myvalue+': '+myDate);
50-
const dateStr = event.target.value;
51-
const dtStr = dateStr.split('-');
52-
const newStr = dtStr[1]+'/'+dtStr[2]+'/'+dtStr[0];
53-
const newDate = new Date(newStr);
54-
//console.log(newStr);
55-
//console.log(newDate.getTime());
56-
this.myobject[this.myvalue] = newDate.getTime();
57-
this.newDate = newDate.getTime();
49+
const myDate = this.myobject[this.myvalue];
50+
console.log(this.myvalue + ": " + myDate);
51+
const dateStr = event.target.value;
52+
const dtStr = dateStr.split("-");
53+
const newStr = dtStr[1] + "/" + dtStr[2] + "/" + dtStr[0];
54+
const newDate = new Date(newStr);
55+
//console.log(newStr);
56+
//console.log(newDate.getTime());
57+
this.myobject[this.myvalue] = newDate.getTime();
58+
this.newDate = newDate.getTime();
5859
}
59-
6060
}

0 commit comments

Comments
 (0)