mirror of
https://github.com/valitydev/control-center.git
synced 2024-11-06 02:25:17 +00:00
IMP-183: Default all_of for "Add shop routing candidate" (#337)
This commit is contained in:
parent
e7cae6e727
commit
9299741c2c
@ -136,6 +136,7 @@ export class RoutingRulesetComponent {
|
||||
.open(DomainThriftFormDialogComponent<RoutingCandidate>, {
|
||||
type: 'RoutingCandidate',
|
||||
title: 'Add shop routing candidate',
|
||||
object: { allowed: { all_of: new Set([{ constant: true }]) } },
|
||||
action: (params) => this.routingRulesService.addShopRule(refId, params),
|
||||
})
|
||||
.afterClosed(),
|
||||
|
@ -6,7 +6,6 @@ import {
|
||||
FormControlSuperclass,
|
||||
createControlProviders,
|
||||
getValueChanges,
|
||||
compareDifferentTypes,
|
||||
} from '@vality/ng-core';
|
||||
import { ThriftType } from '@vality/thrift-ts';
|
||||
import { combineLatest, defer, ReplaySubject, switchMap, Observable } from 'rxjs';
|
||||
@ -53,7 +52,6 @@ export class PrimitiveFieldComponent<T>
|
||||
}))
|
||||
: [],
|
||||
),
|
||||
map((o) => o.sort((a, b) => compareDifferentTypes(a.value, b.value))),
|
||||
shareReplay({ refCount: true, bufferSize: 1 }),
|
||||
);
|
||||
selectedExtensionOption$ = combineLatest([
|
||||
|
@ -10,8 +10,9 @@ import { getUnionKey, getUnionValue } from '../../../../utils';
|
||||
import { DomainStoreService } from '../../../api/domain-config';
|
||||
import { PartiesStoreService } from '../../../api/payment-processing';
|
||||
import { getTerminalShopWalletDelegates } from '../../../sections/terminals/utils/get-terminal-shop-wallet-delegates';
|
||||
import { SidenavInfoService } from '../sidenav-info';
|
||||
import { CardComponent } from '../sidenav-info/components/card/card.component';
|
||||
import { DomainThriftViewerComponent } from '../thrift-api-crud';
|
||||
import { DomainThriftViewerComponent, DomainObjectCardComponent } from '../thrift-api-crud';
|
||||
|
||||
@Component({
|
||||
selector: 'cc-terminal-delegates-card',
|
||||
@ -32,11 +33,21 @@ export class TerminalDelegatesCardComponent implements OnChanges {
|
||||
header: 'Routing Rule',
|
||||
field: 'terminalRule.data.name',
|
||||
description: 'terminalRule.ref.id',
|
||||
click: (d) => {
|
||||
this.sidenavInfoService.toggle(DomainObjectCardComponent, {
|
||||
ref: { routing_rules: { id: d.terminalRule.ref.id } },
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
header: 'Ruleset',
|
||||
field: 'rule.data.name',
|
||||
description: 'rule.ref.id',
|
||||
click: (d) => {
|
||||
this.sidenavInfoService.toggle(DomainObjectCardComponent, {
|
||||
ref: { routing_rules: { id: d.rule.ref.id } },
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'party',
|
||||
@ -102,6 +113,7 @@ export class TerminalDelegatesCardComponent implements OnChanges {
|
||||
constructor(
|
||||
private partiesStoreService: PartiesStoreService,
|
||||
private domainStoreService: DomainStoreService,
|
||||
private sidenavInfoService: SidenavInfoService,
|
||||
) {}
|
||||
|
||||
ngOnChanges(changes: ComponentChanges<TerminalDelegatesCardComponent>) {
|
||||
|
@ -5,6 +5,7 @@ import { MatButtonModule } from '@angular/material/button';
|
||||
import { DialogSuperclass, DialogModule, DEFAULT_DIALOG_CONFIG } from '@vality/ng-core';
|
||||
import { ValueType } from '@vality/thrift-ts';
|
||||
import { Observable } from 'rxjs';
|
||||
import { DeepPartial } from 'utility-types';
|
||||
|
||||
import { DomainThriftFormComponent } from '../domain-thrift-form';
|
||||
|
||||
@ -20,14 +21,14 @@ export class DomainThriftFormDialogComponent<T = unknown, R = unknown> extends D
|
||||
title: string;
|
||||
action: (object: T) => Observable<R>;
|
||||
namespace?: string;
|
||||
object?: T;
|
||||
object?: T extends object ? DeepPartial<T> : T;
|
||||
actionType?: 'create' | 'update';
|
||||
},
|
||||
{ object?: T; result?: R; error?: unknown }
|
||||
> {
|
||||
static defaultDialogConfig = DEFAULT_DIALOG_CONFIG.large;
|
||||
|
||||
control = this.fb.control(this.dialogData.object ?? null);
|
||||
control = this.fb.control<T>((this.dialogData.object as T) ?? null);
|
||||
|
||||
get actionType() {
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user