diff --git a/frontend/src/app/modules/contract-engine/dialogs/retire-pools-dialog/retire-pools-dialog.component.ts b/frontend/src/app/modules/contract-engine/dialogs/retire-pools-dialog/retire-pools-dialog.component.ts index fe3fc8a000..b6b6045750 100644 --- a/frontend/src/app/modules/contract-engine/dialogs/retire-pools-dialog/retire-pools-dialog.component.ts +++ b/frontend/src/app/modules/contract-engine/dialogs/retire-pools-dialog/retire-pools-dialog.component.ts @@ -21,7 +21,7 @@ export class RetirePoolsDialogComponent implements OnInit { tokens: Token[] = []; selectedTokens: any = []; - contract: any + contract: any = {} constructor( // public dialogRef: MatDialogRef, @@ -31,7 +31,7 @@ export class RetirePoolsDialogComponent implements OnInit { public dialogRef: DynamicDialogRef, public config: DynamicDialogConfig, ) { - this.contract = this.config.data.contract; + this.contract = this.config.data ?? {}; if (this.contract) { this.syncDate = this.contract.syncPoolsDate; diff --git a/frontend/src/app/modules/contract-engine/dialogs/retire-requests-dialog/retire-requests-dialog.component.ts b/frontend/src/app/modules/contract-engine/dialogs/retire-requests-dialog/retire-requests-dialog.component.ts index 06d2c9d2e3..5da5f8a484 100644 --- a/frontend/src/app/modules/contract-engine/dialogs/retire-requests-dialog/retire-requests-dialog.component.ts +++ b/frontend/src/app/modules/contract-engine/dialogs/retire-requests-dialog/retire-requests-dialog.component.ts @@ -22,7 +22,7 @@ export class RetireRequestsDialogComponent implements OnInit { tokens: Token[] = []; selectedTokens: any = []; - contract: any + contract: any = {} constructor( // public dialogRef: MatDialogRef, @@ -32,7 +32,7 @@ export class RetireRequestsDialogComponent implements OnInit { private dialogRef: DynamicDialogRef, private config: DynamicDialogConfig, ) { - this.contract = this.config.data.contract; + this.contract = this.config.data ?? {}; this.syncDate = this.contract.syncRequestsDate; this.contractId = this.contract.contractId; diff --git a/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.html b/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.html index ee8603e800..e009106609 100644 --- a/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.html +++ b/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.html @@ -16,16 +16,46 @@ - - - {{ token.tokenSymbol }} ({{ token.tokenId }}) - - + + + + + + + + + + + + + + + + + + + + +
@@ -37,12 +67,12 @@ -
- +
+ @@ -50,9 +80,16 @@
- + + + + +
diff --git a/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.scss b/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.scss index e18af6e59f..9d0e612864 100644 --- a/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.scss +++ b/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.scss @@ -90,3 +90,22 @@ background-color: gray; } } + +.dropdown-container ::ng-deep p-overlay { + position: absolute; + top: -40px; + left: 100px; +} + +::ng-deep p-dropdown .p-placeholder { + font-size: 14px; +} + +.content__tokens.tokens .token-card svg { + width: 24px; +} + +.content__tokens.tokens .token-card__token, +.content__tokens.tokens .token-card__count{ + gap: 0; +} diff --git a/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.ts b/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.ts index a302fd73b9..e9a20dea05 100644 --- a/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.ts +++ b/frontend/src/app/modules/contract-engine/dialogs/set-pool-dialog/set-pool-dialog.component.ts @@ -79,8 +79,20 @@ export class SetPoolDialogComponent { this.dialogRef.close(null); } + get transformedFormValue() { + const formValue = this.form.value; + + return { + ...formValue, + tokens: formValue.tokens.map((item: any) => ({ + ...item, + token: item.token.tokenId, + })), + }; + } + onCreate() { - this.dialogRef.close(this.form.value); + this.dialogRef.close(this.transformedFormValue); } addToken() { @@ -130,4 +142,8 @@ export class SetPoolDialogComponent { return null; }; } + + get selectedToken(): string | null { + return this.form.get('token')?.value || null; + } }