diff --git a/package-lock.json b/package-lock.json index 41f92b472..0c47af833 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "@angular/router": "^22.0.1", "@ngneat/input-mask": "^6.1.0", "@tailwindcss/postcss": "^4.3.1", - "@vality/domain-proto": "^2.0.2-c529750.0", + "@vality/domain-proto": "^2.0.2-b07c077.0", "@vality/fistful-proto": "^2.0.1-9864622.0", "@vality/machinegun-proto": "^1.0.1-273f2f3.0", "@vality/magista-proto": "^2.0.2-bd58cea.0", @@ -34,7 +34,7 @@ "keycloak-js": "^26.2.4", "lodash-es": "^4.18.1", "monaco-editor": "^0.55.1", - "ngx-monaco-editor-v2": "^21.1.4", + "ngx-monaco-editor-v2": "^22.0.4", "postcss": "^8.5.15", "rxjs": "~7.8.2", "short-uuid": "^6.0.3", @@ -3804,27 +3804,28 @@ } }, "node_modules/@ng-matero/extensions": { - "version": "21.3.1", - "resolved": "https://registry.npmjs.org/@ng-matero/extensions/-/extensions-21.3.1.tgz", - "integrity": "sha512-ZNKlNKhQ911AcYu/PENBXIFA+G6vBDtoVMRlcfP1UkRlr4Iq0XOQ8Verlgchry61AYBxYDHyOYFmJpkVnWdy1Q==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/@ng-matero/extensions/-/extensions-22.0.0.tgz", + "integrity": "sha512-nS9cBhrI5r5+/vCvs11oOYEFjJMyF8sYHPYzzcWH1xmFq0KnH5zb3+WhSiDcy6lOQgHbveD2CRPJulJWB7/gwg==", "license": "MIT", "dependencies": { "@acrodata/color-picker": "^1.4.0", - "@ng-matero/ng-select": "^0.6.0", + "@ng-matero/ng-select": "^1.2.0", "photoviewer": "^3.11.0", "tslib": "^2.4.0" }, "peerDependencies": { - "@angular/cdk": ">=21.0.0", - "@angular/common": ">=21.0.0", - "@angular/core": ">=21.0.0", - "@angular/material": ">=21.0.0" + "@angular/cdk": ">=22.0.0", + "@angular/common": ">=22.0.0", + "@angular/core": ">=22.0.0", + "@angular/forms": ">=22.0.0", + "@angular/material": ">=22.0.0" } }, "node_modules/@ng-matero/ng-select": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/@ng-matero/ng-select/-/ng-select-0.6.3.tgz", - "integrity": "sha512-cXpbIobcoFl7pHGGa2YkACU16fJaQ00AXWFrrWFWg8o7UNmqWKeMex8iC5jVvpbX50gtMR/HclvDXXthpL+U1A==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@ng-matero/ng-select/-/ng-select-1.2.1.tgz", + "integrity": "sha512-wL3Rf5wAJqro6OYi5MGHBFuQ39ja620A7Zfi4EYZ8AJ98eHOo8ZAERHMCVA+DsK2ERKPT9MEUZCLoNncXjMbqA==", "license": "MIT", "dependencies": { "tslib": "^2.3.0" @@ -6135,9 +6136,9 @@ ] }, "node_modules/@vality/domain-proto": { - "version": "2.0.2-c529750.0", - "resolved": "https://registry.npmjs.org/@vality/domain-proto/-/domain-proto-2.0.2-c529750.0.tgz", - "integrity": "sha512-VheZVAGXfWGjxYlNORwnHJAY3f+41/HIPW+swgMolpiSHH57gc9RNYooKZSQkKTrTSH/jMzoNtZrSgm1iXtoTw==", + "version": "2.0.2-b07c077.0", + "resolved": "https://registry.npmjs.org/@vality/domain-proto/-/domain-proto-2.0.2-b07c077.0.tgz", + "integrity": "sha512-NE4TM+lOKQPP6ZLQ03w+BYA2lvutxnqhcoyyMj+P0sqaPQee3RaiCDNfZj0PTMqtejOVDKH1xolqwJEN5a4EgQ==", "license": "Apache-2.0" }, "node_modules/@vality/fistful-proto": { @@ -11645,16 +11646,16 @@ } }, "node_modules/ngx-monaco-editor-v2": { - "version": "21.1.4", - "resolved": "https://registry.npmjs.org/ngx-monaco-editor-v2/-/ngx-monaco-editor-v2-21.1.4.tgz", - "integrity": "sha512-dZu3dY3D1YXPTIDRn9zOERdtDtGy1SOztpWG6gJlaj6NMSV59kNR/hfzaP+L3BukP6Ve07f3bIyvsx6Pz7uOaA==", + "version": "22.0.4", + "resolved": "https://registry.npmjs.org/ngx-monaco-editor-v2/-/ngx-monaco-editor-v2-22.0.4.tgz", + "integrity": "sha512-59PaWmzp8OuKwfTEwFpgaIdzyu/sKeSohGc7l2dj+dD2TMKMTkeyFhRWUGbZD71VnZAft8zFx+GXL2M571nd9w==", "license": "MIT", "dependencies": { "tslib": "^2.8.1" }, "peerDependencies": { - "@angular/common": "^21.1.4", - "@angular/core": "^21.1.4", + "@angular/common": "^22.0.4", + "@angular/core": "^22.0.4", "monaco-editor": "^0.55.1" } }, @@ -14948,7 +14949,7 @@ "name": "@vality/matez", "version": "22.0.0", "dependencies": { - "@ng-matero/extensions": "^21.3.1", + "@ng-matero/extensions": "^22.0.0", "@s-libs/js-core": "^21.0.0", "@s-libs/micro-dash": "^21.0.0", "@s-libs/ng-core": "^21.0.0", @@ -14991,7 +14992,7 @@ "@vality/thrift-ts": "*", "lodash-es": "^4.18.1", "monaco-editor": "^0.55.1", - "ngx-monaco-editor-v2": "^21.1.4", + "ngx-monaco-editor-v2": "^22.0.4", "rxjs": "^7.8.2", "utility-types": "^3.11.0" } diff --git a/package.json b/package.json index 0b6d5f02c..f2060cfd9 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "@angular/router": "^22.0.1", "@ngneat/input-mask": "^6.1.0", "@tailwindcss/postcss": "^4.3.1", - "@vality/domain-proto": "^2.0.2-c529750.0", + "@vality/domain-proto": "^2.0.2-b07c077.0", "@vality/fistful-proto": "^2.0.1-9864622.0", "@vality/machinegun-proto": "^1.0.1-273f2f3.0", "@vality/magista-proto": "^2.0.2-bd58cea.0", @@ -49,7 +49,7 @@ "keycloak-js": "^26.2.4", "lodash-es": "^4.18.1", "monaco-editor": "^0.55.1", - "ngx-monaco-editor-v2": "^21.1.4", + "ngx-monaco-editor-v2": "^22.0.4", "postcss": "^8.5.15", "rxjs": "~7.8.2", "short-uuid": "^6.0.3", diff --git a/projects/matez/package.json b/projects/matez/package.json index 62191d812..9e50d7218 100644 --- a/projects/matez/package.json +++ b/projects/matez/package.json @@ -28,7 +28,7 @@ "utility-types": "^3.11.0" }, "dependencies": { - "@ng-matero/extensions": "^21.3.1", + "@ng-matero/extensions": "^22.0.0", "@s-libs/js-core": "^21.0.0", "@s-libs/micro-dash": "^21.0.0", "@s-libs/ng-core": "^21.0.0", diff --git a/projects/ng-thrift/package.json b/projects/ng-thrift/package.json index a792ec390..54504705d 100644 --- a/projects/ng-thrift/package.json +++ b/projects/ng-thrift/package.json @@ -18,7 +18,7 @@ "@vality/thrift-ts": "*", "lodash-es": "^4.18.1", "monaco-editor": "^0.55.1", - "ngx-monaco-editor-v2": "^21.1.4", + "ngx-monaco-editor-v2": "^22.0.4", "rxjs": "^7.8.2", "utility-types": "^3.11.0" } diff --git a/projects/ng-thrift/src/lib/components/thrift-editor/components/complex-form/complex-form.component.ts b/projects/ng-thrift/src/lib/components/thrift-editor/components/complex-form/complex-form.component.ts index 42b51b186..837afb516 100644 --- a/projects/ng-thrift/src/lib/components/thrift-editor/components/complex-form/complex-form.component.ts +++ b/projects/ng-thrift/src/lib/components/thrift-editor/components/complex-form/complex-form.component.ts @@ -117,15 +117,14 @@ export class ComplexFormComponent }); } - handleIncomingValue(value: ComplexType) { - if (this.isKeyValue) { - const keys = Array.from((value as Map)?.keys() || []); - updateFormArray(this.keyControls, keys); + handleIncomingValue(value: ComplexType | [K, V][]) { + if (!this.isKeyValue) { + updateFormArray(this.valueControls, Array.from((value as V[]) || [])); } - const values = this.isKeyValue - ? Array.from(value?.values() || []) - : Array.from((value as V[]) || []); - updateFormArray(this.valueControls, values); + // When toggling between JSON and form representations, the value might arrive as an array instead of Map + const mapValue = Array.isArray(value) ? new Map(value as [K, V][]) : (value as Map); + updateFormArray(this.keyControls, Array.from(mapValue?.keys() || [])); + updateFormArray(this.valueControls, Array.from(mapValue?.values() || [])); } override validate(): ValidationErrors | null { diff --git a/src/api/payment-processing/stores/parties-store.service.ts b/src/api/payment-processing/stores/parties-store.service.ts index f06c4da9c..a2899f3a9 100644 --- a/src/api/payment-processing/stores/parties-store.service.ts +++ b/src/api/payment-processing/stores/parties-store.service.ts @@ -1,4 +1,3 @@ -import { cloneDeep } from 'lodash-es'; import { MemoizeExpiring } from 'typescript-memoize'; import { Injectable, inject } from '@angular/core'; @@ -11,6 +10,7 @@ import { WalletID, } from '@vality/domain-proto/domain'; import { VersionedObjectInfo } from '@vality/domain-proto/domain_config_v2'; +import { getNoTimeZoneIsoString } from '@vality/matez'; import { DomainObjectsStoreService, DomainService } from '../../domain-config'; @@ -85,14 +85,22 @@ export class PartiesStoreService { } blockShop(shop: ShopConfigObject, reason: string) { - const newShopConfig = cloneDeep(shop); - newShopConfig.data.block = { blocked: { reason, since: new Date().toISOString() } }; - return this.domainService.commit([ { update: { object: { - shop_config: newShopConfig, + shop_config: { + ref: shop.ref, + data: { + ...shop.data, + block: { + blocked: { + reason, + since: getNoTimeZoneIsoString(new Date()), + }, + }, + }, + }, }, }, }, @@ -100,14 +108,22 @@ export class PartiesStoreService { } unblockShop(shop: ShopConfigObject, reason: string) { - const newShopConfig = cloneDeep(shop); - newShopConfig.data.block = { unblocked: { reason, since: new Date().toISOString() } }; - return this.domainService.commit([ { update: { object: { - shop_config: newShopConfig, + shop_config: { + ref: shop.ref, + data: { + ...shop.data, + block: { + unblocked: { + reason, + since: getNoTimeZoneIsoString(new Date()), + }, + }, + }, + }, }, }, }, @@ -115,14 +131,19 @@ export class PartiesStoreService { } suspendShop(shop: ShopConfigObject) { - const newShopConfig = cloneDeep(shop); - newShopConfig.data.suspension = { suspended: { since: new Date().toISOString() } }; - return this.domainService.commit([ { update: { object: { - shop_config: newShopConfig, + shop_config: { + ref: shop.ref, + data: { + ...shop.data, + suspension: { + suspended: { since: getNoTimeZoneIsoString(new Date()) }, + }, + }, + }, }, }, }, @@ -130,14 +151,19 @@ export class PartiesStoreService { } activateShop(shop: ShopConfigObject) { - const newShopConfig = cloneDeep(shop); - newShopConfig.data.suspension = { active: { since: new Date().toISOString() } }; - return this.domainService.commit([ { update: { object: { - shop_config: newShopConfig, + shop_config: { + ref: shop.ref, + data: { + ...shop.data, + suspension: { + active: { since: getNoTimeZoneIsoString(new Date()) }, + }, + }, + }, }, }, }, @@ -145,14 +171,22 @@ export class PartiesStoreService { } blockWallet(wallet: WalletConfigObject, reason: string) { - const newWalletConfig = cloneDeep(wallet); - newWalletConfig.data.block = { blocked: { reason, since: new Date().toISOString() } }; - return this.domainService.commit([ { update: { object: { - wallet_config: newWalletConfig, + wallet_config: { + ref: wallet.ref, + data: { + ...wallet.data, + block: { + blocked: { + reason, + since: getNoTimeZoneIsoString(new Date()), + }, + }, + }, + }, }, }, }, @@ -160,14 +194,22 @@ export class PartiesStoreService { } unblockWallet(wallet: WalletConfigObject, reason: string) { - const newWalletConfig = cloneDeep(wallet); - newWalletConfig.data.block = { unblocked: { reason, since: new Date().toISOString() } }; - return this.domainService.commit([ { update: { object: { - wallet_config: newWalletConfig, + wallet_config: { + ref: wallet.ref, + data: { + ...wallet.data, + block: { + unblocked: { + reason, + since: getNoTimeZoneIsoString(new Date()), + }, + }, + }, + }, }, }, }, @@ -175,14 +217,21 @@ export class PartiesStoreService { } suspendWallet(wallet: WalletConfigObject) { - const newWalletConfig = cloneDeep(wallet); - newWalletConfig.data.suspension = { suspended: { since: new Date().toISOString() } }; - return this.domainService.commit([ { update: { object: { - wallet_config: newWalletConfig, + wallet_config: { + ref: wallet.ref, + data: { + ...wallet.data, + suspension: { + suspended: { + since: getNoTimeZoneIsoString(new Date()), + }, + }, + }, + }, }, }, }, @@ -190,14 +239,21 @@ export class PartiesStoreService { } activateWallet(wallet: WalletConfigObject) { - const newWalletConfig = cloneDeep(wallet); - newWalletConfig.data.suspension = { active: { since: new Date().toISOString() } }; - return this.domainService.commit([ { update: { object: { - wallet_config: newWalletConfig, + wallet_config: { + ref: wallet.ref, + data: { + ...wallet.data, + suspension: { + active: { + since: getNoTimeZoneIsoString(new Date()), + }, + }, + }, + }, }, }, },