From 2efc131622b9ea483b4edac838f64c43cdabfe5a Mon Sep 17 00:00:00 2001
From: ddamiron <ddamiron@sii.fr>
Date: Thu, 1 Aug 2019 17:43:29 +0200
Subject: [PATCH] add auto open first errors and infos

---
 src/app/app.module.ts                                       | 1 -
 .../report/logs-error/logs-error.component.ts               | 6 ++++++
 .../logs-dashboard/report/logs-info/logs-info.component.ts  | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index d84b2e5..100a37d 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -13,7 +13,6 @@ import { UserService } from './user/services';
 import { AppDirectives } from './directives';
 import { FilterPipe } from './components/logs-dashboard/logs-slugs/filter.pipe';
 
-
 // Function used by APP_INITIALIZER before the app start: init user info / statut (expect a promise)
 export function initUserService(authService: UserService) {
   return (): Promise<any> => {
diff --git a/src/app/components/logs-dashboard/report/logs-error/logs-error.component.ts b/src/app/components/logs-dashboard/report/logs-error/logs-error.component.ts
index 6cbd7ce..fa41091 100644
--- a/src/app/components/logs-dashboard/report/logs-error/logs-error.component.ts
+++ b/src/app/components/logs-dashboard/report/logs-error/logs-error.component.ts
@@ -90,6 +90,12 @@ export class LogsErrorComponent implements OnChanges {
         this.childSessionId,
       ).subscribe((results) => {
         this.allStepsData = results;
+        for (const result of results) {
+          if (result.counts.ERROR > 0) {
+            this.getLogsSelector(result._id.step, result.counts);
+            break;
+          }
+        }
       },
       );
     }
diff --git a/src/app/components/logs-dashboard/report/logs-info/logs-info.component.ts b/src/app/components/logs-dashboard/report/logs-info/logs-info.component.ts
index b9caf07..dfd2a95 100644
--- a/src/app/components/logs-dashboard/report/logs-info/logs-info.component.ts
+++ b/src/app/components/logs-dashboard/report/logs-info/logs-info.component.ts
@@ -85,6 +85,7 @@ export class LogsInfoComponent implements OnChanges {
         this.childSessionId,
       ).subscribe((results) => {
         this.allStepsData = results;
+        this.getLogsSelector(results[0]._id.step, results[0].counts);
       },
       );
     }
-- 
GitLab