From cd94cb118da011eefc368570afd35d7431d73dd0 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 3 May 2019 21:02:17 +0200 Subject: [PATCH] add placeholder="YYYY|--|++" to date filter inputs --- .../app/entities/asset/asset.component.html | 4 +- .../membership/membership.component.html | 8 ++-- .../sepa-mandate/sepa-mandate.component.html | 44 +++++++++++++----- .../sepa-mandate/sepa-mandate.component.ts | 46 ++++++++++++++++++- .../app/entities/share/share.component.html | 4 +- 5 files changed, 86 insertions(+), 20 deletions(-) diff --git a/src/main/webapp/app/entities/asset/asset.component.html b/src/main/webapp/app/entities/asset/asset.component.html index 057db7d6..cd5499d9 100644 --- a/src/main/webapp/app/entities/asset/asset.component.html +++ b/src/main/webapp/app/entities/asset/asset.component.html @@ -26,8 +26,8 @@ - - + + - - - + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/app/entities/sepa-mandate/sepa-mandate.component.ts b/src/main/webapp/app/entities/sepa-mandate/sepa-mandate.component.ts index d7ef209a..1ca9e056 100644 --- a/src/main/webapp/app/entities/sepa-mandate/sepa-mandate.component.ts +++ b/src/main/webapp/app/entities/sepa-mandate/sepa-mandate.component.ts @@ -9,6 +9,10 @@ import { AccountService } from 'app/core'; import { ITEMS_PER_PAGE } from 'app/shared'; import { SepaMandateService } from './sepa-mandate.service'; +import { ICustomer } from 'app/shared/model/customer.model'; +import { CustomerService } from 'app/entities/customer'; +import { TableFilter, queryYearAsDateRange, queryEquals, queryContains } from 'app/shared/util/tablefilter'; +import { IMembership } from 'app/shared/model/membership.model'; @Component({ selector: 'jhi-sepa-mandate', @@ -24,9 +28,22 @@ export class SepaMandateComponent implements OnInit, OnDestroy { predicate: any; reverse: any; totalItems: number; + customers: ICustomer[]; + filter: TableFilter<{ + reference?: string; + iban?: string; + bic?: string; + grantingDocumentDate?: string; + revokationDocumentDate?: string; + validFromDate?: string; + validUntilDate?: string; + lastUsedDate?: string; + customerId?: string; + }>; constructor( protected sepaMandateService: SepaMandateService, + protected customerService: CustomerService, protected jhiAlertService: JhiAlertService, protected eventManager: JhiEventManager, protected parseLinks: JhiParseLinks, @@ -40,11 +57,29 @@ export class SepaMandateComponent implements OnInit, OnDestroy { }; this.predicate = 'id'; this.reverse = true; + this.filter = new TableFilter( + { + reference: queryContains, + iban: queryContains, + bic: queryContains, + grantingDocumentDate: queryYearAsDateRange, + revokationDocumentDate: queryYearAsDateRange, + validFromDate: queryYearAsDateRange, + validUntilDate: queryYearAsDateRange, + lastUsedDate: queryYearAsDateRange, + customerId: queryEquals + }, + 500, + () => { + this.loadAll(); + } + ); } loadAll() { this.sepaMandateService .query({ + ...this.filter.buildQueryCriteria(), page: this.page, size: this.itemsPerPage, sort: this.sort() @@ -72,13 +107,20 @@ export class SepaMandateComponent implements OnInit, OnDestroy { this.currentAccount = account; }); this.registerChangeInSepaMandates(); + this.customerService + .query() + .pipe( + filter((mayBeOk: HttpResponse) => mayBeOk.ok), + map((response: HttpResponse) => response.body) + ) + .subscribe((res: IMembership[]) => (this.customers = res), (res: HttpErrorResponse) => this.onError(res.message)); } ngOnDestroy() { this.eventManager.destroy(this.eventSubscriber); } - trackId(index: number, item: ISepaMandate) { + trackId(index: number, item: { id: number }) { return item.id; } @@ -97,6 +139,8 @@ export class SepaMandateComponent implements OnInit, OnDestroy { protected paginateSepaMandates(data: ISepaMandate[], headers: HttpHeaders) { this.links = this.parseLinks.parse(headers.get('link')); this.totalItems = parseInt(headers.get('X-Total-Count'), 10); + this.page = 0; + this.sepaMandates = []; for (let i = 0; i < data.length; i++) { this.sepaMandates.push(data[i]); } diff --git a/src/main/webapp/app/entities/share/share.component.html b/src/main/webapp/app/entities/share/share.component.html index d9f33549..5cecf8a9 100644 --- a/src/main/webapp/app/entities/share/share.component.html +++ b/src/main/webapp/app/entities/share/share.component.html @@ -26,8 +26,8 @@ - - + +