From 62d8c991493a55e40d9929c079040029ce209eda Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Wed, 30 Apr 2025 00:05:15 +0700 Subject: [PATCH] feat(lib): add actions column to benchmark --- .../lib/benchmark/benchmark.component.html | 28 ++++++++++++++++ .../src/lib/benchmark/benchmark.component.ts | 33 +++++++++++++++++-- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/libs/ui/src/lib/benchmark/benchmark.component.html b/libs/ui/src/lib/benchmark/benchmark.component.html index 270690f35..645b0e752 100644 --- a/libs/ui/src/lib/benchmark/benchmark.component.html +++ b/libs/ui/src/lib/benchmark/benchmark.component.html @@ -113,6 +113,34 @@ + + + + @if (hasPermissionToDeleteWatchlistItem) { + + } + + + + + + (); + + public displayedColumns = [ + 'name', + 'date', + 'change', + 'marketCondition', + 'actions' + ]; public isLoading = true; public isNumber = isNumber; public resolveMarketCondition = resolveMarketCondition; @@ -58,6 +75,7 @@ export class GfBenchmarkComponent implements OnChanges, OnDestroy { public constructor( private dialog: MatDialog, + private notificationService: NotificationService, private route: ActivatedRoute, private router: Router ) { @@ -89,11 +107,20 @@ export class GfBenchmarkComponent implements OnChanges, OnDestroy { 'trend200d', 'date', 'change', - 'marketCondition' + 'marketCondition', + 'actions' ]; } } + public onDeleteWatchlistItem({ dataSource, symbol }: AssetProfileIdentifier) { + this.notificationService.confirm({ + confirmFn: () => this.watchlistItemDeleted.emit({ dataSource, symbol }), + confirmType: ConfirmationDialogType.Warn, + title: $localize`Do you really want to delete this item?` + }); + } + public onOpenBenchmarkDialog({ dataSource, symbol }: AssetProfileIdentifier) { this.router.navigate([], { queryParams: { dataSource, symbol, benchmarkDetailDialog: true }