mirror of
https://github.com/valitydev/dashboard.git
synced 2024-11-06 02:25:23 +00:00
MI-9: Fix wallet reports identity filter (#139)
This commit is contained in:
parent
4a5ef4595a
commit
0e34106c13
@ -8,9 +8,9 @@ import { Report } from '@vality/swag-wallet';
|
||||
import isEqual from 'lodash-es/isEqual';
|
||||
import moment from 'moment';
|
||||
import { Observable } from 'rxjs';
|
||||
import { startWith, distinctUntilChanged, filter, map } from 'rxjs/operators';
|
||||
import { startWith, distinctUntilChanged, filter, map, first } from 'rxjs/operators';
|
||||
|
||||
import { WalletDictionaryService } from '@dsh/app/api/wallet';
|
||||
import { WalletDictionaryService, IdentitiesService } from '@dsh/app/api/wallet';
|
||||
import { mapToTimestamp } from '@dsh/app/custom-operators';
|
||||
import { QueryParamsService } from '@dsh/app/shared';
|
||||
import { Column, ExpandedFragment } from '@dsh/app/shared/components/accordion-table';
|
||||
@ -84,10 +84,16 @@ export class ReportsComponent implements OnInit {
|
||||
private qp: QueryParamsService<Partial<Form>>,
|
||||
private dialog: MatDialog,
|
||||
private transloco: TranslocoService,
|
||||
private walletDictionaryService: WalletDictionaryService
|
||||
private walletDictionaryService: WalletDictionaryService,
|
||||
private identitiesService: IdentitiesService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.identitiesService.identities$.pipe(first(), untilDestroyed(this)).subscribe((identities) => {
|
||||
if (!this.form.value.identityID && identities.length === 1) {
|
||||
this.form.patchValue({ identityID: identities[0].id });
|
||||
}
|
||||
});
|
||||
this.form.valueChanges
|
||||
.pipe(startWith(this.form.value), distinctUntilChanged(isEqual), untilDestroyed(this))
|
||||
.subscribe((value) => {
|
||||
|
@ -2,7 +2,7 @@
|
||||
<dsh-filter
|
||||
[active]="isActive"
|
||||
[label]="t('label')"
|
||||
[activeLabel]="t('label', { name: (identity$ | async)?.name || '#' + savedValue })"
|
||||
[activeLabel]="t('activeLabel', { name: (identity$ | async)?.name || '#' + savedValue })"
|
||||
[content]="content"
|
||||
(save)="save()"
|
||||
(clear)="clear()"
|
||||
|
@ -175,7 +175,8 @@
|
||||
"showAllStatuses": "Show all statuses"
|
||||
},
|
||||
"identityFilter": {
|
||||
"label": "Wallet holder: {{name}}"
|
||||
"activeLabel": "Wallet holder: {{name}}",
|
||||
"label": "Wallet holder"
|
||||
},
|
||||
"inputs": {
|
||||
"identityField": {
|
||||
|
@ -175,7 +175,8 @@
|
||||
"showAllStatuses": "Показать все статусы"
|
||||
},
|
||||
"identityFilter": {
|
||||
"label": "Владелец кошелька: {{name}}"
|
||||
"activeLabel": "Владелец кошелька: {{name}}",
|
||||
"label": "Владелец кошелька"
|
||||
},
|
||||
"inputs": {
|
||||
"identityField": {
|
||||
|
Loading…
Reference in New Issue
Block a user