diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index cebffca..e4f4c80 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -26,6 +26,7 @@ import {ProfileComponent} from './profile/profile.component'; import {ListAllPeopleComponent} from './list-all-people/list-all-people.component'; import {ListIncomeComponent} from './list-income/list-income.component'; import {UploadDetailComponent} from './upload-detail/upload-detail.component'; +import {LoansAllComponent} from './loans-all/loans-all.component'; const routes: Routes = [ @@ -35,7 +36,7 @@ const routes: Routes = [ {path : 'login', component: AuthComponent}, {path : 'transaction', component: TransactionComponent, canActivate: [AuthGuard]}, {path : 'transaction-list', component: TransactionListComponent, canActivate: [AuthGuard]}, - {path : 'list-all-loans', component: ListAllLoansComponent, canActivate: [AuthGuard]}, + {path : 'list-all-loans', component: LoansAllComponent, canActivate: [AuthGuard]}, {path : 'edit-loan/:id', component: LoanEditComponent, canActivate: [AuthGuard]}, {path : 'edit-loan', component: LoanEditComponent, canActivate: [AuthGuard]}, {path : 'uploads', component: LenderUploadsComponent, canActivate: [AuthGuard]}, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 66f9e91..2af5f3a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -99,6 +99,7 @@ import {AppConfig} from './app.config'; import { UploadingProgressCardComponent } from './uploading-progress-card/uploading-progress-card.component'; import { LoanSelectComponent } from './loan-select/loan-select.component'; import {PopupModule} from '@progress/kendo-angular-popup'; +import { LoansAllComponent } from './loans-all/loans-all.component'; @@ -167,7 +168,8 @@ export function initializeApp(appConfig: AppConfig): () => Promise { PopupIncomeFilterComponent, LoanCardComponent, UploadingProgressCardComponent, - LoanSelectComponent + LoanSelectComponent, + LoansAllComponent ], imports: [ BrowserModule, diff --git a/src/app/list-all-loans/list-all-loans.component.html b/src/app/list-all-loans/list-all-loans.component.html index 52525bb..f4570e8 100644 --- a/src/app/list-all-loans/list-all-loans.component.html +++ b/src/app/list-all-loans/list-all-loans.component.html @@ -22,13 +22,13 @@ -
+
-
+
{{SelectedLoans.length}}/ {{MaxSelect}}
diff --git a/src/app/list-all-loans/list-all-loans.component.ts b/src/app/list-all-loans/list-all-loans.component.ts index f34c8a5..c8c6534 100644 --- a/src/app/list-all-loans/list-all-loans.component.ts +++ b/src/app/list-all-loans/list-all-loans.component.ts @@ -44,6 +44,7 @@ export class ListAllLoansComponent implements OnInit { public pageSize = 10; public skip = 0; @Output() LoanSelected: EventEmitter = new EventEmitter(); + @Output() LoanClicked: EventEmitter = new EventEmitter(); @Input() EnableExportExcel = false; @Input() EnableExportPdf = false; @@ -140,7 +141,7 @@ export class ListAllLoansComponent implements OnInit { } public onCellClick(event: CellCloseEvent): void { - // this.LoanSelected.emit(event.dataItem); + this.LoanClicked.emit(event.dataItem); } public AddLoanToSelection(loan: LoanModel): void{ diff --git a/src/app/loan-select/loan-select.component.ts b/src/app/loan-select/loan-select.component.ts index 088679a..e10efec 100644 --- a/src/app/loan-select/loan-select.component.ts +++ b/src/app/loan-select/loan-select.component.ts @@ -37,7 +37,7 @@ export class LoanSelectComponent implements OnInit, ControlValueAccessor { constructor() { } ngOnInit(): void { - console.log('init loan-select', this); + // console.log('init loan-select', this); } writeValue(loan: LoanModel): void { diff --git a/src/app/loans-all/loans-all.component.html b/src/app/loans-all/loans-all.component.html new file mode 100644 index 0000000..91f81ff --- /dev/null +++ b/src/app/loans-all/loans-all.component.html @@ -0,0 +1,8 @@ +
+ +
diff --git a/src/app/loans-all/loans-all.component.scss b/src/app/loans-all/loans-all.component.scss new file mode 100644 index 0000000..8352705 --- /dev/null +++ b/src/app/loans-all/loans-all.component.scss @@ -0,0 +1,8 @@ +div.wrapper.all-loans { + width: 100vw; + height: calc(100vh - 48px); + + app-list-all-loans{ + height: 100%; + } +} diff --git a/src/app/loans-all/loans-all.component.spec.ts b/src/app/loans-all/loans-all.component.spec.ts new file mode 100644 index 0000000..0cba50d --- /dev/null +++ b/src/app/loans-all/loans-all.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoansAllComponent } from './loans-all.component'; + +describe('LoansAllComponent', () => { + let component: LoansAllComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ LoansAllComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(LoansAllComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/loans-all/loans-all.component.ts b/src/app/loans-all/loans-all.component.ts new file mode 100644 index 0000000..afca27b --- /dev/null +++ b/src/app/loans-all/loans-all.component.ts @@ -0,0 +1,20 @@ +import { Component, OnInit } from '@angular/core'; +import {LoanModel} from '../models/loan.model'; +import {Router} from '@angular/router'; + +@Component({ + selector: 'app-loans-all', + templateUrl: './loans-all.component.html', + styleUrls: ['./loans-all.component.scss'] +}) +export class LoansAllComponent implements OnInit { + + constructor(private router: Router) { } + + ngOnInit(): void { + } + + onClick(loan: LoanModel): void{ + this.router.navigate(['edit-loan/', loan.Id]); + } +} diff --git a/src/app/pay-in/pay-in.component.ts b/src/app/pay-in/pay-in.component.ts index 07d4868..e4b4c8d 100644 --- a/src/app/pay-in/pay-in.component.ts +++ b/src/app/pay-in/pay-in.component.ts @@ -86,7 +86,7 @@ export class PayInComponent implements OnInit { this.filter.UploadIds = [ value.Id.toString() ]; } this.debouncedLoadFilteredData(); - console.log('upload filter changed', value, this.filter); + //console.log('upload filter changed', value, this.filter); } get uploadMeta(): UploadMetaModel { @@ -102,7 +102,7 @@ export class PayInComponent implements OnInit { this.filter.LoanIds = [ value.Id ]; } this.debouncedLoadFilteredData(); - console.log('filter loanId changed', value, this.filter); + // console.log('filter loanId changed', value, this.filter); } get Loan(): LoanModel { @@ -129,7 +129,7 @@ export class PayInComponent implements OnInit { this.showOffsetBalance = offsetBalance >= 0 ; this.incomeFormGroup = this.createFormGroup(new PayInModelEx({})); - console.log(this.incomeFormGroup); + // console.log(this.incomeFormGroup); sender.addRow(this.incomeFormGroup); } @@ -139,9 +139,9 @@ export class PayInComponent implements OnInit { return new FormGroup({ Id: new FormControl({value: dataItem.Id, disabled: true}, Validators.required), - Lender: new FormControl(dataItem.Lender), + Lender: new FormControl({value: dataItem.Lender, disabled: Loan.Id !== '' }, Validators.required), Amount: new FormControl(dataItem.Amount), - LoanNumber: new FormControl(dataItem.LoanNumber), + LoanNumber: new FormControl(dataItem.LoanNumber, Validators.required), IncomeAmount: new FormControl(dataItem.IncomeAmount, Validators.required), IncomeType: new FormControl(dataItem.IncomeType, Validators.required), Ts: new FormControl(dataItem.Ts, Validators.required), @@ -164,7 +164,7 @@ export class PayInComponent implements OnInit { } public cancelHandler({ sender, rowIndex }): void { - console.log(sender); + // console.log(sender); this.closeEditor(sender, rowIndex); } @@ -228,7 +228,7 @@ export class PayInComponent implements OnInit { } public removeHandler({ dataItem }): void { - console.log('delete', dataItem); + // console.log('delete', dataItem); this.Loan.PayIn = this.Loan.PayIn.filter(v => v.Id !== dataItem.Id ); this.gridData.data = this.gridData.data.filter(v => v.Id !== dataItem.Id) ;