diff --git a/src/app/machines/machines.component.html b/src/app/machines/machines.component.html index f42a96e55..af1f8b7c6 100644 --- a/src/app/machines/machines.component.html +++ b/src/app/machines/machines.component.html @@ -13,7 +13,7 @@ > Status diff --git a/src/app/parties/party/routing-rules/candidates/components/edit-candidate-dialog/edit-candidate-dialog.component.html b/src/app/parties/party/routing-rules/candidates/components/edit-candidate-dialog/edit-candidate-dialog.component.html index 314968616..ba5f672d0 100644 --- a/src/app/parties/party/routing-rules/candidates/components/edit-candidate-dialog/edit-candidate-dialog.component.html +++ b/src/app/parties/party/routing-rules/candidates/components/edit-candidate-dialog/edit-candidate-dialog.component.html @@ -1,6 +1,6 @@
- +
diff --git a/src/components/create-shop-dialog/create-shop-dialog.component.html b/src/components/create-shop-dialog/create-shop-dialog.component.html index 2b35930f6..65fa31a7a 100644 --- a/src/components/create-shop-dialog/create-shop-dialog.component.html +++ b/src/components/create-shop-dialog/create-shop-dialog.component.html @@ -11,9 +11,9 @@
diff --git a/src/components/create-wallet-dialog/create-wallet-dialog.component.html b/src/components/create-wallet-dialog/create-wallet-dialog.component.html index 79938bba8..72e53a5d3 100644 --- a/src/components/create-wallet-dialog/create-wallet-dialog.component.html +++ b/src/components/create-wallet-dialog/create-wallet-dialog.component.html @@ -11,9 +11,9 @@
diff --git a/src/components/thrift-api-crud/domain/domain-object-field/domain-object-field.component.html b/src/components/thrift-api-crud/domain/domain-object-field/domain-object-field.component.html index e24d37241..0783228a5 100644 --- a/src/components/thrift-api-crud/domain/domain-object-field/domain-object-field.component.html +++ b/src/components/thrift-api-crud/domain/domain-object-field/domain-object-field.component.html @@ -2,7 +2,7 @@ [appearance]="appearance" [formControl]="control" [hint]="hint" - [label]="label || (name | titlecase)" + [label]="label || (type | titlecase)" [multiple]="multiple()" [options]="options$ | async" [progress]="!!(progress$ | async)" diff --git a/src/components/thrift-api-crud/domain/domain-object-field/domain-object-field.component.ts b/src/components/thrift-api-crud/domain/domain-object-field/domain-object-field.component.ts index ad6c1e9dd..172f7ae07 100644 --- a/src/components/thrift-api-crud/domain/domain-object-field/domain-object-field.component.ts +++ b/src/components/thrift-api-crud/domain/domain-object-field/domain-object-field.component.ts @@ -40,7 +40,7 @@ export class DomainObjectFieldComponent extends FormC > { private fetchDomainObjectsService = inject(FetchDomainObjectsService); - @Input() name: T; + @Input() type: T; @Input() label: string; @Input({ transform: booleanAttribute }) required: boolean; @Input() size?: SelectFieldComponent['size']; @@ -63,7 +63,7 @@ export class DomainObjectFieldComponent extends FormC search(search: string) { this.fetchDomainObjectsService.load( - { type: DomainObjectType[this.name], query: search }, + { type: DomainObjectType[this.type], query: search }, { size: 1000 }, ); } diff --git a/src/components/thrift-api-crud/domain/domain-thrift-viewer/services/domain-metadata-view-extensions/domain-metadata-view-extensions.service.ts b/src/components/thrift-api-crud/domain/domain-thrift-viewer/services/domain-metadata-view-extensions/domain-metadata-view-extensions.service.ts index 7fe634080..5c9c3eeb3 100644 --- a/src/components/thrift-api-crud/domain/domain-thrift-viewer/services/domain-metadata-view-extensions/domain-metadata-view-extensions.service.ts +++ b/src/components/thrift-api-crud/domain/domain-thrift-viewer/services/domain-metadata-view-extensions/domain-metadata-view-extensions.service.ts @@ -9,14 +9,15 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { Router } from '@angular/router'; import { ThriftAstMetadata, metadata$ } from '@vality/domain-proto'; -import { PartyConfigRef, Reference, ShopID, base } from '@vality/domain-proto/domain'; +import { PartyConfigRef, Reference, base } from '@vality/domain-proto/domain'; import { ThriftData, ThriftViewExtension, isTypeWithAliases } from '@vality/ng-thrift'; import { DomainObjectsStoreService } from '~/api/domain-config'; import { PartiesStoreService } from '~/api/payment-processing'; import { SidenavInfoService } from '../../../../../sidenav-info'; -import { DomainObjectCardComponent } from '../../../../domain'; + +const DOMAIN_OBJECT_ID_TYPE_MAP = { ShopConfigObject: 'ShopID', WalletConfigObject: 'WalletID' }; @Injectable({ providedIn: 'root', @@ -49,29 +50,6 @@ export class DomainMetadataViewExtensionsService { }), ), }, - { - determinant: (data) => of(isTypeWithAliases(data, 'ShopID', 'domain')), - extension: (_, shopId: ShopID) => - this.partiesStoreService.getShop(shopId).value$.pipe( - map((p) => ({ - value: p.data.name, - tooltip: shopId, - click: () => { - this.sidenavInfoService.toggle(DomainObjectCardComponent, { - ref: { shop_config: { id: shopId } }, - }); - }, - })), - startWith({ - value: String(shopId), - click: () => { - this.sidenavInfoService.toggle(DomainObjectCardComponent, { - ref: { shop_config: { id: shopId } }, - }); - }, - }), - ), - }, { determinant: (data) => of(isTypeWithAliases(data, 'Timestamp', 'base')), extension: (_, value: base.Timestamp) => @@ -106,17 +84,21 @@ export class DomainMetadataViewExtensionsService { f.type as string, ).ast; const refType = objectFields.find((n) => n.name === 'ref').type as string; + const idType = + DOMAIN_OBJECT_ID_TYPE_MAP[f.type as keyof typeof DOMAIN_OBJECT_ID_TYPE_MAP]; return { determinant: (data) => of( - isTypeWithAliases(data, refType, 'domain') && + (isTypeWithAliases(data, refType, 'domain') && !isTypeWithAliases( data?.trueParent?.trueParent, 'DomainObject', 'domain', - ), + )) || + (!!idType && isTypeWithAliases(data, idType, 'domain')), ), - extension: (_, refId) => { + extension: (_, refIdOrId) => { + const refId = idType ? { id: refIdOrId } : refIdOrId; const ref = { [f.name]: refId }; return this.domainObjectsStoreService.getLimitedObject(ref).value$.pipe( map((obj) => {