Fix create source (#370)

This commit is contained in:
Rinat Arsaev 2024-06-25 17:37:51 +05:00 committed by GitHub
parent 87a9feddea
commit 2fbf4d8d82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 15 additions and 12 deletions

8
package-lock.json generated
View File

@ -23,7 +23,7 @@
"@vality/deanonimus-proto": "2.0.1-2a02d87.0",
"@vality/domain-proto": "2.0.1-b04aba8.0",
"@vality/dominator-proto": "1.0.1-41bee97.0",
"@vality/fistful-proto": "2.0.1-6600be9.0",
"@vality/fistful-proto": "2.0.1-88e69a5.0",
"@vality/machinegun-proto": "1.0.0",
"@vality/magista-proto": "2.0.2-28d11b9.0",
"@vality/ng-core": "18.0.1-pr-63-9e315a6.0",
@ -6634,9 +6634,9 @@
}
},
"node_modules/@vality/fistful-proto": {
"version": "2.0.1-6600be9.0",
"resolved": "https://registry.npmjs.org/@vality/fistful-proto/-/fistful-proto-2.0.1-6600be9.0.tgz",
"integrity": "sha512-ULrAg0V7GpvdMaIBUgI8WX9m+qoaOPgPFEYF/bqoe+XHh4ktmv8LiCm2La35Wzy6NTdm/1kanT69AxJUtsy7VA=="
"version": "2.0.1-88e69a5.0",
"resolved": "https://registry.npmjs.org/@vality/fistful-proto/-/fistful-proto-2.0.1-88e69a5.0.tgz",
"integrity": "sha512-fsMqJbOZa2GesbP2OEmPlyPfV236VN+JRxke7HO79ujC4i8TwHeejV55DTfUbrFO7Q/d2Wwj8BtMcQF/c4KYGA=="
},
"node_modules/@vality/machinegun-proto": {
"version": "1.0.0",

View File

@ -31,7 +31,7 @@
"@vality/deanonimus-proto": "2.0.1-2a02d87.0",
"@vality/domain-proto": "2.0.1-b04aba8.0",
"@vality/dominator-proto": "1.0.1-41bee97.0",
"@vality/fistful-proto": "2.0.1-6600be9.0",
"@vality/fistful-proto": "2.0.1-88e69a5.0",
"@vality/machinegun-proto": "1.0.0",
"@vality/magista-proto": "2.0.2-28d11b9.0",
"@vality/ng-core": "18.0.1-pr-63-9e315a6.0",

View File

@ -6,7 +6,7 @@ import {
} from '@vality/fistful-proto';
import { Deposit } from '@vality/fistful-proto/deposit';
import { DepositParams } from '@vality/fistful-proto/fistful_admin';
import { SourceParams } from '@vality/fistful-proto/internal/source';
import { SourceParams } from '@vality/fistful-proto/internal/fistful_admin';
import { combineLatest, from, map, Observable, switchMap } from 'rxjs';
import { KeycloakTokenInfoService, toWachterHeaders } from '@cc/app/shared/services';

View File

@ -1,7 +1,7 @@
<v-dialog title="Create Source">
<cc-fistful-thrift-form
[formControl]="control"
namespace="source"
namespace="fistful_admin"
type="SourceParams"
></cc-fistful-thrift-form>
<v-dialog-actions>

View File

@ -18,7 +18,7 @@ export function formatCashVolumes(c: CashVolume[]) {
return c.sort(compareCashVolumes).map(formatCashVolume).join(' + ');
}
export function formatCashVolume(d: CashVolume) {
export function formatCashVolume(d: CashVolume): string {
switch (getUnionKey(d)) {
case 'fixed':
return formatCurrency(d?.fixed?.cash?.amount, d?.fixed?.cash?.currency?.symbolic_code);
@ -33,10 +33,13 @@ export function formatCashVolume(d: CashVolume) {
if (products.length === 1) {
return formatCashVolume(products[0]);
}
return `${getUnionKey(d.product).slice(0, -3)}(${products
const childrenCashVolumes = products
.sort(compareCashVolumes)
.map((c) => formatCashVolume(c))
.join(', ')})`;
.map((c) => formatCashVolume(c));
if (getUnionKey(d.product) === 'sum_of') {
return childrenCashVolumes.join(' + ');
}
return `${getUnionKey(d.product).slice(0, -3)}(${childrenCashVolumes.join(', ')})`;
}
}
}

View File

@ -21,7 +21,7 @@ export function formatPredicate(predicate: Predicate, level = 0) {
}
const res = Array.from(predicatesSet)
.map((p) => formatPredicate(p, level + 1))
.join(type === 'all_of' ? ' & ' : ' OR ');
.join(type === 'all_of' ? ' & ' : ' ');
return level === 0 ? `(${res})` : res;
}
case 'condition': {