From 6754120e9e01cda46cc62abc56dbceb36c8f6ce8 Mon Sep 17 00:00:00 2001
From: Joze RIHTARSIC <joze.RIHTARSIC@ext.ec.europa.eu>
Date: Wed, 8 Jun 2022 15:02:14 +0200
Subject: [PATCH] fix table action buttons

---
 .../src/app/common/search-table/search-table.component.ts       | 2 ++
 smp-angular/src/app/user/user.component.ts                      | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/smp-angular/src/app/common/search-table/search-table.component.ts b/smp-angular/src/app/common/search-table/search-table.component.ts
index f625d6304..7419361c8 100644
--- a/smp-angular/src/app/common/search-table/search-table.component.ts
+++ b/smp-angular/src/app/common/search-table/search-table.component.ts
@@ -125,10 +125,12 @@ export class SearchTableComponent implements OnInit {
       if (this.showActionButtons) {
         console.log("show action buttons!")
         this.columnActions.showInitially = true
+
         this.columnPicker.allColumns.push(this.columnActions);
         this.columnPicker.selectedColumns.push(this.columnActions);
       }
     }
+    this.columnPicker.selectedColumns = this.columnPicker.allColumns.filter(col => col.showInitially);
   }
 
   getRowClass(row) {
diff --git a/smp-angular/src/app/user/user.component.ts b/smp-angular/src/app/user/user.component.ts
index ce676bb62..21c6a109b 100644
--- a/smp-angular/src/app/user/user.component.ts
+++ b/smp-angular/src/app/user/user.component.ts
@@ -64,7 +64,6 @@ export class UserComponent implements OnInit, AfterViewInit {
 
   ngAfterViewInit() {
     this.searchTable.tableColumnInit();
-
     // if system admin refresh trust certificate list!
     if (this.securityService.isCurrentUserSystemAdmin()) {
       this.lookups.refreshTrustedCertificateLookup();
-- 
GitLab