Skip to content

Commit b61321b

Browse files
committed
reduce TSLint warnings
1 parent 4ae202a commit b61321b

19 files changed

+284
-304
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
$output.file("web/src/app/app.component.html")##
2+
<p-growl [value]="msgs"></p-growl>
3+
4+
<div class="ui-g layout">
5+
<div class="ui-g-12 ui-md-1">The West...</div>
6+
<div class="ui-g-12 ui-md-11 ui-g-nopad">
7+
<div class="ui-g-12 ui-g-nopad" style="font-size: 14px;">
8+
<p-menubar [model]="items"></p-menubar>
9+
</div>
10+
<div class="ui-g-12">
11+
<router-outlet></router-outlet>
12+
</div>
13+
<div class="ui-g-12" style="text-align: center;">
14+
<i class="fa fa-twitter"></i> <a href="https://twitter.com/jaxiosoft">@jaxiosoft</a> -
15+
<i class="fa fa-github-alt"></i> <a href="https://github.com/jaxio/celerio-angular-quickstart">https://github.com/jaxio/celerio-angular-quickstart</a>
16+
</div>
17+
</div>
18+
</div>
19+
<p-dialog header="Please login" [visible]="displayLoginDialog" [responsive]="true" showEffect="fade" [modal]="true" [closable]="false" *ngIf="!authenticated">
20+
<p>When using the sample database, use admin/admin</p>
21+
<div ngForm class="ui-g">
22+
<div class="ui-g-12" *ngIf="loginFailed">
23+
<div class="ui-message ui-messages-error ui-corner-all">
24+
Invalid login or password
25+
</div>
26+
</div>
27+
<div class="ui-g-12">
28+
<div class="ui-g-4">
29+
<label for="j_username">Username</label>
30+
</div>
31+
<div class="ui-g-8">
32+
<input pInputText id="j_username" [(ngModel)]="j_username" name="username"/>
33+
</div>
34+
</div>
35+
<div class="ui-g-12">
36+
<div class="ui-g-4">
37+
<label for="j_password">Password</label>
38+
</div>
39+
<div class="ui-g-8">
40+
<input type="password" pPassword id="j_password" [(ngModel)]="j_password" name="password"/>
41+
</div>
42+
</div>
43+
</div>
44+
<footer>
45+
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
46+
<button pButton (click)="login()" icon="fa-sign-in" label="Login"></button>
47+
</div>
48+
</footer>
49+
</p-dialog>

pack-angular/celerio/pack-angular/web/src/app/app.component.ts.p.vm

Lines changed: 35 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
$output.file("web/src/app/app.component.ts")##
2-
import { Component,OnInit } from '@angular/core';
3-
import { RouterModule } from '@angular/router';
4-
import { Observable } from 'rxjs/Observable';
2+
import { Component, OnInit } from '@angular/core';
53
import 'rxjs/add/observable/throw';
64
import { Message, MenuItem } from 'primeng/primeng';
75
import { AuthService} from './service/auth.service';
@@ -12,80 +10,27 @@ import { MessageService} from './service/message.service';
1210
* Defines the main layout and handles user login in a dialog.
1311
*/
1412
@Component({
15-
moduleId: module.id,
16-
selector: 'app-root',
17-
template: `
18-
<p-growl [value]="msgs"></p-growl>
19-
20-
<div class="ui-g layout">
21-
<div class="ui-g-12 ui-md-1">The West...</div>
22-
<div class="ui-g-12 ui-md-11 ui-g-nopad">
23-
<div class="ui-g-12 ui-g-nopad" style="font-size: 14px;">
24-
<p-menubar [model]="items"></p-menubar>
25-
</div>
26-
<div class="ui-g-12">
27-
<router-outlet></router-outlet>
28-
</div>
29-
<div class="ui-g-12" style="text-align: center;">
30-
<i class="fa fa-twitter"></i> <a href="https://twitter.com/jaxiosoft">@jaxiosoft</a> -
31-
<i class="fa fa-github-alt"></i> <a href="https://github.com/jaxio/celerio-angular-quickstart">https://github.com/jaxio/celerio-angular-quickstart</a>
32-
</div>
33-
</div>
34-
</div>
35-
<p-dialog header="Please login" [visible]="displayLoginDialog" [responsive]="true" showEffect="fade" [modal]="true" [closable]="false" *ngIf="!authenticated">
36-
<p>When using the sample database, use admin/admin</p>
37-
<div ngForm class="ui-g">
38-
<div class="ui-g-12" *ngIf="loginFailed">
39-
<div class="ui-message ui-messages-error ui-corner-all">
40-
Invalid login or password
41-
</div>
42-
</div>
43-
<div class="ui-g-12">
44-
<div class="ui-g-4">
45-
<label for="j_username">Username</label>
46-
</div>
47-
<div class="ui-g-8">
48-
<input pInputText id="j_username" [(ngModel)]="j_username" name="username"/>
49-
</div>
50-
</div>
51-
<div class="ui-g-12">
52-
<div class="ui-g-4">
53-
<label for="j_password">Password</label>
54-
</div>
55-
<div class="ui-g-8">
56-
<input type="password" pPassword id="j_password" [(ngModel)]="j_password" name="password"/>
57-
</div>
58-
</div>
59-
</div>
60-
<footer>
61-
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
62-
<button pButton (click)="login()" icon="fa-sign-in" label="Login"></button>
63-
</div>
64-
</footer>
65-
</p-dialog>
66-
`,
67-
styles:[`
68-
.layout div {
69-
background-color: white;
70-
border: 1px solid #f5f7f8;
71-
}
72-
`]
13+
selector: 'app-root',
14+
templateUrl: 'app.component.html',
15+
styles: [`
16+
.layout div {
17+
background-color: white;
18+
border: 1px solid #f5f7f8;
19+
}
20+
`]
7321
})
7422
export class AppComponent implements OnInit {
75-
public items : MenuItem[] = [{label: 'hello'}];
76-
msgs : Message[] = [];
23+
items: MenuItem[] = [{label: 'hello'}];
24+
msgs: Message[] = [];
7725

78-
displayLoginDialog : boolean = false;
79-
loginFailed : boolean = false;
80-
authenticated : boolean = false;
81-
j_username : string = "admin";
82-
j_password : string = "admin";
26+
displayLoginDialog = false;
27+
loginFailed = false;
28+
authenticated = false;
29+
j_username = 'admin';
30+
j_password = 'admin';
8331

8432
constructor(private authService: AuthService, private messageService: MessageService) {
85-
messageService.messageSource${d}.subscribe(
86-
msg => {
87-
this.msgs.push(msg);
88-
});
33+
messageService.messageSource${d}.subscribe(msg => this.msgs.push(msg));
8934
}
9035

9136
ngOnInit() {
@@ -94,33 +39,37 @@ export class AppComponent implements OnInit {
9439

9540
{ label: 'Entities', icon: 'fa-search', items: [
9641
#foreach($entity in $project.withoutManyToManyJoinEntities.list)
97-
{label: '${entity.model.type} Search', routerLink: ['/${entity.model.var}-list']},
98-
{label: '${entity.model.type} Create', routerLink: ['/${entity.model.var}/new']}#if($velocityHasNext),
42+
{
43+
label: '${entity.model.type}',
44+
items: [
45+
{label: 'Search', routerLink: ['/${entity.model.var}-list']},
46+
{label: 'Create', routerLink: ['/${entity.model.var}/new']}
47+
]
48+
}#if($velocityHasNext),
9949
#end
10050
#end
10151
]
10252
},
103-
{ label: 'Swagger', url : "/swagger-ui.html", icon: 'fa-gear' },
53+
{ label: 'Swagger', url : '/swagger-ui.html', icon: 'fa-gear' },
10454
{ label: 'Documentation',
10555
icon: 'fa-book',
10656
items: [
107-
{label: "Source code", icon: 'fa-github-alt', url: "https://github.com/jaxio/celerio-angular-quickstart"},
108-
{label: "Celerio Documentation", icon: 'fa-external-link', url: "http://www.jaxio.com/documentation/celerio/"},
109-
{label: "Angular Cli", icon: 'fa-external-link', url: "https://cli.angular.io/"},
110-
{label: "Angular 5", icon: 'fa-external-link', url: "https://angular.io/"},
111-
{label: "Material 5", icon: 'fa-external-link', url: "https://material.angular.io/"},
112-
{label: "PrimeNG Showcase", icon: 'fa-external-link', url: "http://www.primefaces.org/primeng"},
113-
{label: "TypeScript", icon: 'fa-external-link', url: "https://www.typescriptlang.org/"},
114-
{label: "Spring Boot", icon: 'fa-external-link', url: "http://projects.spring.io/spring-boot/"},
115-
{label: "Spring Data JPA", icon: 'fa-external-link', url: "http://projects.spring.io/spring-data-jpa/"}
57+
{label: 'Source code', icon: 'fa-github-alt', url: 'https://github.com/jaxio/celerio-angular-quickstart'},
58+
{label: 'Celerio Documentation', icon: 'fa-external-link', url: 'http://www.jaxio.com/documentation/celerio/'},
59+
{label: 'Angular Cli', icon: 'fa-external-link', url: 'https://cli.angular.io/'},
60+
{label: 'Angular 5', icon: 'fa-external-link', url: 'https://angular.io/'},
61+
{label: 'Material 5', icon: 'fa-external-link', url: 'https://material.angular.io/'},
62+
{label: 'PrimeNG Showcase', icon: 'fa-external-link', url: 'http://www.primefaces.org/primeng'},
63+
{label: 'TypeScript', icon: 'fa-external-link', url: 'https://www.typescriptlang.org/'},
64+
{label: 'Spring Boot', icon: 'fa-external-link', url: 'http://projects.spring.io/spring-boot/'},
65+
{label: 'Spring Data JPA', icon: 'fa-external-link', url: 'http://projects.spring.io/spring-data-jpa/'}
11666
]
11767
}
11868
];
11969

12070
this.authService.isAuthenticated().
12171
subscribe(
122-
resp =>
123-
{
72+
resp => {
12473
this.authenticated = resp;
12574
this.displayLoginDialog = !this.authenticated;
12675
if (this.authenticated) {

pack-angular/celerio/pack-angular/web/src/app/app.module.ts.p.vm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
44
import { NgModule } from '@angular/core';
55
import { FormsModule } from '@angular/forms';
66
import { HttpClientModule } from '@angular/common/http';
7-
import { RouterModule } from '@angular/router';
8-
import { MatDatepickerModule, MatNativeDateModule, MatDialogModule, MatCardModule, MatIconModule, MatSelectModule, MatTabsModule, MatInputModule, MatButtonModule } from '@angular/material';
7+
import { MatDatepickerModule, MatNativeDateModule, MatDialogModule, MatCardModule, MatIconModule, MatSelectModule,
8+
MatTabsModule, MatInputModule, MatButtonModule } from '@angular/material';
99
import { ConfirmDialogModule, FileUploadModule, PanelModule, GrowlModule, MenubarModule, DialogModule, ButtonModule, AutoCompleteModule, DataTableModule, SharedModule, DropdownModule,PickListModule,CheckboxModule,TriStateCheckboxModule, InputTextModule,InputTextareaModule,CalendarModule,PasswordModule,TabViewModule } from 'primeng/primeng';
1010
import { ConfirmationService } from 'primeng/primeng';
11-
import { AppComponent } from './app.component';
12-
import { HomeComponent } from './home.component';
11+
import { AppComponent } from './app.component';
12+
import { HomeComponent } from './home.component';
1313
import { AuthService } from './service/auth.service';
1414
import { MessageService } from './service/message.service';
15-
import { routing } from './app.routes';
15+
import { routing } from './app.routes';
1616
import { EmailValidator } from './support/email.validator';
1717
import { ConfirmDeleteDialogComponent } from './support/confirm-delete-dialog.component';
1818

@@ -31,13 +31,13 @@ import { ${entity.model.type}CompleteComponent } from './entities/$entity.model.
3131
AppComponent,
3232
HomeComponent,
3333
EmailValidator,
34-
ConfirmDeleteDialogComponent
34+
ConfirmDeleteDialogComponent,
3535
#foreach($entity in $project.withoutManyToManyJoinEntities.list)
36-
,
36+
3737
${entity.model.type}ListComponent,
3838
${entity.model.type}DetailComponent,
3939
${entity.model.type}LineComponent,
40-
${entity.model.type}CompleteComponent
40+
${entity.model.type}CompleteComponent,
4141
#end
4242
],
4343
imports: [

pack-angular/celerio/pack-angular/web/src/app/app.routes.ts.p.vm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$output.file("web/src/app/app.routes.ts")##
2-
import { ModuleWithProviders } from '@angular/core';
2+
import { ModuleWithProviders } from '@angular/core';
33
import { Routes, RouterModule } from '@angular/router';
44

55
import { HomeComponent } from './home.component';
@@ -10,11 +10,11 @@ import { ${entity.model.type}DetailComponent } from './entities/$entity.model.va
1010
#end
1111

1212
export const routes: Routes = [
13-
{ path : '', component: HomeComponent }
13+
{path : '', component: HomeComponent },
1414
#foreach($entity in $project.withoutManyToManyJoinEntities.list)
15-
,
16-
{path: '${entity.model.var}-list', component: ${entity.model.type}ListComponent },
17-
{path: '${entity.model.var}/:id', component: ${entity.model.type}DetailComponent }
15+
16+
{path: '${entity.model.var}-list', component: ${entity.model.type}ListComponent },
17+
{path: '${entity.model.var}/:id', component: ${entity.model.type}DetailComponent },
1818
#end
1919
];
2020

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$output.file("web/src/app/entities/${entity.model.var}/${entity.model.var}-auto-complete.component.html")##
2+
<p-autoComplete [(ngModel)]="value" [disabled]="disabled" placeholder="Hint: type to search..." field="#foreach($attr in $entity.printerAttributes.flatUp.list)${attr.var}#{break}#end" [suggestions]="suggestions" (completeMethod)="complete(${d}event)" (onSelect)="select(${d}event)">
3+
<ng-template let-$entity.model.var pTemplate="item">
4+
<app-${entity.model.var}-line [$entity.model.var]="$entity.model.var"></app-${entity.model.var}-line>
5+
</ng-template>
6+
</p-autoComplete>

pack-angular/celerio/pack-angular/web/src/app/entities/entity-auto-complete.component.ts.e.vm

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
$output.file("web/src/app/entities/${entity.model.var}/${entity.model.var}-auto-complete.component.ts")##
2-
import {Component, Input, Output, EventEmitter, forwardRef} from '@angular/core';
3-
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from "@angular/forms";
4-
import {AutoCompleteModule} from 'primeng/primeng';
2+
import {Component, Input, forwardRef} from '@angular/core';
3+
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
54
import {MessageService} from '../../service/message.service';
65
import {${entity.model.type}} from './${entity.model.var}';
76
import {${entity.service.type}} from './${entity.model.var}.service';
@@ -15,77 +14,71 @@ export const ${entity.model.type.toUpperCase()}_AUTO_COMPLETE_CONTROL_VALUE_ACCE
1514
};
1615

1716
@Component({
18-
template: `
19-
<p-autoComplete [(ngModel)]="value" [disabled]="disabled" placeholder="Hint: type to search..." field="#foreach($attr in $entity.printerAttributes.flatUp.list)${attr.var}#{break}#end" [suggestions]="suggestions" (completeMethod)="complete(${d}event)" (onSelect)="select(${d}event)">
20-
<ng-template let-$entity.model.var pTemplate="item">
21-
<${entity.model.var}-line [$entity.model.var]="$entity.model.var"></${entity.model.var}-line>
22-
</ng-template>
23-
</p-autoComplete>
24-
`,
25-
selector: '${entity.model.var}-auto-complete',
26-
providers: [${entity.model.type.toUpperCase()}_AUTO_COMPLETE_CONTROL_VALUE_ACCESSOR]
17+
templateUrl: '${entity.model.var}-auto-complete.component.html',
18+
selector: 'app-${entity.model.var}-auto-complete',
19+
providers: [${entity.model.type.toUpperCase()}_AUTO_COMPLETE_CONTROL_VALUE_ACCESSOR]
2720
})
2821
export class ${entity.model.type}CompleteComponent implements ControlValueAccessor {
29-
@Input() disabled : boolean = false;
30-
@Input() id : string;
31-
@Input() name : string;
22+
@Input() disabled = false;
23+
@Input() id: string;
24+
@Input() name: string;
3225

33-
//The internal data model
26+
// The internal data model
3427
private _value: $entity.model.type = null;
3528

36-
public suggestions : ${entity.model.type}[] = [];
29+
public suggestions: ${entity.model.type}[] = [];
3730

38-
//Placeholders for the callbacks
31+
// Placeholders for the callbacks
3932
private _onTouchedCallback: () => void = () => {};
40-
private _onChangeCallback: (_:any) => void = () => {};
33+
private _onChangeCallback: (_: any) => void = () => {};
4134

42-
constructor(private $entity.service.var : ${entity.service.type}, private messageService : MessageService) {
35+
constructor(private $entity.service.var: ${entity.service.type}, private messageService: MessageService) {
4336
}
4437

4538
@Input()
46-
get value(): any { return this._value; };
39+
get value(): any { return this._value; }
4740

48-
//set accessor including call the onchange callback
41+
// set accessor including call the onchange callback
4942
set value(v: any) {
50-
if (this._value != null && (v == null || v == "")) {
43+
if (this._value != null && !v) {
5144
this.select(null);
5245
}
5346
// nop, see writeValue and select method
5447
}
5548

56-
//Set touched on blur
57-
onTouched(){
49+
// Set touched on blur
50+
onTouched() {
5851
this._onTouchedCallback();
5952
}
6053

61-
//From ControlValueAccessor interface
54+
// From ControlValueAccessor interface
6255
writeValue(value: any) {
6356
this._value = <$entity.model.type> value;
6457
}
6558

66-
//From ControlValueAccessor interface
59+
// From ControlValueAccessor interface
6760
registerOnChange(fn: any) {
6861
this._onChangeCallback = fn;
6962
}
7063

71-
//From ControlValueAccessor interface
64+
// From ControlValueAccessor interface
7265
registerOnTouched(fn: any) {
7366
this._onTouchedCallback = fn;
7467
}
7568

76-
//From ControlValueAccessor interface
69+
// From ControlValueAccessor interface
7770
setDisabledState(isDisabled: boolean) {
7871
}
7972

80-
complete(event:any) {
73+
complete(event: any) {
8174
this.${entity.service.var}.complete(event.query).
8275
subscribe(
8376
results => this.suggestions = results,
8477
error => this.messageService.error(error, 'Error during auto-complete')
8578
);
8679
}
8780

88-
select(v : any) {
81+
select(v: any) {
8982
this._value = v;
9083
this._onChangeCallback(v);
9184
}

pack-angular/celerio/pack-angular/web/src/app/entities/entity-detail.component.html.e.vm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ $output.file("web/src/app/entities/${entity.model.var}/${entity.model.var}-detai
55
<div class="ui-g-12 ui-md-10 ui-lg-5">
66
<div class="ui-g">
77
<div class="ui-g-12 ui-md-5 ui-lg-5">
8-
<${relation.toEntity.model.var}-auto-complete [(ngModel)]="${entity.model.var}.${relation.to.var}" id="${relation.to.var}" name="${relation.to.var}" [disabled]="sub"></${relation.toEntity.model.var}-auto-complete>
8+
<app-${relation.toEntity.model.var}-auto-complete [(ngModel)]="${entity.model.var}.${relation.to.var}" id="${relation.to.var}" name="${relation.to.var}" [disabled]="sub"></app-${relation.toEntity.model.var}-auto-complete>
99
</div>
1010
<div class="ui-g-12 ui-md-2 ui-lg-2">
1111
<button pButton id="goto${relation.to.varUp}" type="button" (click)="goto${relation.to.varUp}()" *ngIf="!sub && ${entity.model.var}.${relation.to.var}" icon="fa-pencil" label="Edit"></button>

0 commit comments

Comments
 (0)