Merge pull request #52 from rbkmoney/ft/fix-show-more

Add sorted field value
This commit is contained in:
Kostya 2021-04-28 09:21:53 +03:00 committed by GitHub
commit c972c8dbca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 25 additions and 15 deletions

View File

@ -15,7 +15,7 @@
fxFlex="100"
mat-button
*ngIf="hasMore$ | async"
(click)="fetchMore()"
(click)="fetchMore(references[references.length - 1].groupId)"
[disabled]="inProgress$ | async"
>
SHOW MORE

View File

@ -62,7 +62,7 @@ export class P2pReferencesComponent {
this.fetchReferencesService.search({ type: OperationType.PeerToPeer, searchValue, isGlobal: false });
}
fetchMore() {
this.fetchReferencesService.fetchMore();
fetchMore(sortFieldValue: string) {
this.fetchReferencesService.fetchMore({ type: OperationType.PeerToPeer, sortFieldValue, isGlobal: false });
}
}

View File

@ -15,7 +15,7 @@
fxFlex="100"
mat-button
*ngIf="hasMore$ | async"
(click)="fetchMore()"
(click)="fetchMore(references[references.length - 1].groupId)"
[disabled]="inProgress$ | async"
>
SHOW MORE

View File

@ -67,7 +67,7 @@ export class PaymentReferencesComponent {
this.fetchReferencesService.search({ type: OperationType.Payment, searchValue, isGlobal: false });
}
fetchMore() {
this.fetchReferencesService.fetchMore();
fetchMore(sortFieldValue: string) {
this.fetchReferencesService.fetchMore({ type: OperationType.Payment, sortFieldValue, isGlobal: false });
}
}

View File

@ -92,7 +92,7 @@ export class CreatePaymentReferenceService {
return this.fb.group({
templateId: [templateId, Validators.required],
partyId: [partyId, Validators.required],
shopId: [shopId, Validators.required],
shopId: [shopId],
isDefault: false,
isGlobal: false,
});

View File

@ -13,7 +13,7 @@
<fb-show-more-panel
*ngIf="hasMore$ | async"
[isLoading]="inProgress$ | async"
(showMore)="fetchMore()"
(showMore)="fetchMore(references[references.length - 1].templateId)"
></fb-show-more-panel>
</mat-card-content>
<mat-card-footer *ngIf="inProgress$ | async">

View File

@ -73,7 +73,12 @@ export class P2pReferencesComponent {
});
}
fetchMore() {
this.fetchReferencesService.fetchMore();
fetchMore(sortFieldValue: string) {
this.fetchReferencesService.fetchMore({
type: OperationType.PeerToPeer,
sortFieldValue,
isGlobal: false,
isDefault: false,
});
}
}

View File

@ -13,7 +13,7 @@
<fb-show-more-panel
*ngIf="hasMore$ | async"
[isLoading]="inProgress$ | async"
(showMore)="fetchMore()"
(showMore)="fetchMore(references[references.length - 1].templateId)"
></fb-show-more-panel>
</div>
</div>

View File

@ -41,8 +41,13 @@ export class PaymentReferencesComponent {
});
}
fetchMore() {
this.fetchReferencesService.fetchMore();
fetchMore(sortFieldValue: string) {
this.fetchReferencesService.fetchMore({
type: OperationType.Payment,
sortFieldValue,
isGlobal: false,
isDefault: false,
});
}
goToTemplate(id: string) {

View File

@ -75,8 +75,8 @@ export abstract class PartialFetcher<R, P> {
this.action$.next({ type: 'search' });
}
fetchMore() {
this.action$.next({ type: 'fetchMore' });
fetchMore(value?: P) {
this.action$.next(value ? { type: 'fetchMore', value } : { type: 'fetchMore' });
}
protected abstract fetch(...args: Parameters<FetchFn<P, R>>): ReturnType<FetchFn<P, R>>;