Improved UX in the distribution component 44/105544/2
authork.kedron <k.kedron@partner.samsung.com>
Wed, 8 Apr 2020 16:00:11 +0000 (18:00 +0200)
committerOfir Sonsino <ofir.sonsino@intl.att.com>
Thu, 16 Apr 2020 15:43:54 +0000 (15:43 +0000)
Added new logic to expand currently open tab,
after clicking the refresh button.

Issue-ID: SDC-2886
Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com>
Change-Id: Ib9d1c7cbf2ca2dd9df22f7f74ffda64144c06047

catalog-ui/src/app/ng2/pages/workspace/disribution/distribution.component.ts

index ca1b629..eb55fa1 100644 (file)
@@ -87,6 +87,16 @@ export class DistributionComponent implements OnInit {
 
   private async refreshDistributions() {
     await this.initDistributions(this.componentUuid);
+    this.openExpanded();
+  }
+
+  private openExpanded() {
+    const self = this;
+    this.distributions.forEach((row) => {
+        if (self.expanded[row.distributionID]) {
+            self.expandRow(row, false);
+        }
+    })
   }
 
   private updateFilter(event) {
@@ -113,5 +123,6 @@ export class DistributionComponent implements OnInit {
       await this.distributionService.initDistributionsStatusForDistributionID(row.distributionID);
     }
     this.table.rowDetail.toggleExpandRow(row);
+    this.expanded[row.distributionID] = !expanded;
   }
 }