From 683447980d8052f57770b22a50f97cb4c39e2f41 Mon Sep 17 00:00:00 2001 From: kurilova Date: Thu, 1 Aug 2024 08:57:02 +0000 Subject: [PATCH 1/3] Change tooltip --- .../profile-item/profile-item.component.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ui/src/app/pages/risk-assessment/profile-item/profile-item.component.html b/modules/ui/src/app/pages/risk-assessment/profile-item/profile-item.component.html index 5d1b86514..1384226fc 100644 --- a/modules/ui/src/app/pages/risk-assessment/profile-item/profile-item.component.html +++ b/modules/ui/src/app/pages/risk-assessment/profile-item/profile-item.component.html @@ -22,7 +22,11 @@ class="profile-item-info" role="button" tabindex="0" - matTooltip="{{ profile.status }}" + matTooltip="{{ + profile.status === ProfileStatus.EXPIRED + ? 'Expired. Please, create a new Risk profile.' + : profile.status + }}" (click)="profileClicked.emit(profile)" (keydown.enter)="profileClicked.emit(profile)"> Date: Mon, 29 Jul 2024 11:33:23 +0000 Subject: [PATCH 2/3] Text changes --- modules/ui/src/app/app.component.html | 8 +++++--- modules/ui/src/app/app.component.spec.ts | 10 +++++----- .../app/components/snack-bar/snack-bar.component.html | 5 +++-- .../ui/src/app/interceptors/error.interceptor.spec.ts | 10 +++++++--- modules/ui/src/app/interceptors/error.interceptor.ts | 8 +++++--- .../ui/src/app/pages/settings/settings.component.html | 2 +- 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/modules/ui/src/app/app.component.html b/modules/ui/src/app/app.component.html index a5e14e9bd..122e8b129 100644 --- a/modules/ui/src/app/app.component.html +++ b/modules/ui/src/app/app.component.html @@ -127,7 +127,8 @@

Testrun

error.devicePortMissed && error.internetPortMissed; else onePortMissed "> - No ports are detected. Please define a valid ones using + No ports detected. Please connect and configure network and device + connections in the Selected port is missing! Please define a valid one using @@ -213,7 +214,8 @@

Testrun

vm.systemStatus === StatusOfTestrun.InProgress && isRiskAssessmentRoute === false "> - Congratulations, the device is under test now! Do not forget to fill + The device is now being tested. Why not take the time to complete the + device Testrun role="link" class="message-link" >Risk Assessment questionnaire. It is required to complete verification process. + >? diff --git a/modules/ui/src/app/app.component.spec.ts b/modules/ui/src/app/app.component.spec.ts index 2cfb60aed..b626123d7 100644 --- a/modules/ui/src/app/app.component.spec.ts +++ b/modules/ui/src/app/app.component.spec.ts @@ -522,12 +522,12 @@ describe('AppComponent', () => { fixture.detectChanges(); }); - it('should have callout component with "Congratulations" text', () => { + it('should have callout component with "The device is now being tested" text', () => { const callout = compiled.querySelector('app-callout'); const calloutContent = callout?.innerHTML.trim(); expect(callout).toBeTruthy(); - expect(calloutContent).toContain('Congratulations'); + expect(calloutContent).toContain('The device is now being tested'); }); it('should have callout component with "Risk Assessment" link', () => { @@ -554,12 +554,12 @@ describe('AppComponent', () => { fixture.detectChanges(); }); - it('should have callout component with "Congratulations" text', () => { + it('should have callout component with "The device is now being tested" text', () => { const callout = compiled.querySelector('app-callout'); const calloutContent = callout?.innerHTML.trim(); expect(callout).toBeTruthy(); - expect(calloutContent).toContain('Congratulations'); + expect(calloutContent).toContain('The device is now being tested'); }); it('should have callout component with "Risk Assessment" link', () => { @@ -740,7 +740,7 @@ describe('AppComponent', () => { const calloutContent = callout?.innerHTML.trim(); expect(callout).toBeTruthy(); - expect(calloutContent).toContain('No ports are detected.'); + expect(calloutContent).toContain('No ports detected.'); }); }); diff --git a/modules/ui/src/app/components/snack-bar/snack-bar.component.html b/modules/ui/src/app/components/snack-bar/snack-bar.component.html index 716198299..539623d4b 100644 --- a/modules/ui/src/app/components/snack-bar/snack-bar.component.html +++ b/modules/ui/src/app/components/snack-bar/snack-bar.component.html @@ -15,9 +15,10 @@ -->
-

The Waiting for Device stage is taking more than one minute.

+

It is taking longer than expected to find your device on the network.

- Please check device connection or stop and update system configuration. + Please check the connection to the device or stop and update your system + configuration.

diff --git a/modules/ui/src/app/interceptors/error.interceptor.spec.ts b/modules/ui/src/app/interceptors/error.interceptor.spec.ts index 9fff32863..5df8ca2ac 100644 --- a/modules/ui/src/app/interceptors/error.interceptor.spec.ts +++ b/modules/ui/src/app/interceptors/error.interceptor.spec.ts @@ -42,6 +42,10 @@ describe('ErrorInterceptor', () => { interceptor = TestBed.inject(ErrorInterceptor); }); + afterEach(() => { + notificationServiceMock.notify.calls.reset(); + }); + it('should be created', () => { expect(interceptor).toBeTruthy(); }); @@ -60,7 +64,7 @@ describe('ErrorInterceptor', () => { interceptor.intercept(requestMock, next).subscribe( () => ({}), () => { - expect(notificationServiceMock.notify).toHaveBeenCalledWith('error'); + expect(notificationServiceMock.notify).toHaveBeenCalledWith('Something went wrong. Check the logs for details here /usr/local/testrun/testrun.log'); done(); } ); @@ -79,7 +83,7 @@ describe('ErrorInterceptor', () => { () => ({}), () => { expect(notificationServiceMock.notify).toHaveBeenCalledWith( - 'Back End is not responding. Please, try again later.' + 'Testrun is not responding. Please try again in a moment.' ); done(); } @@ -99,7 +103,7 @@ describe('ErrorInterceptor', () => { () => ({}), () => { expect(notificationServiceMock.notify).toHaveBeenCalledWith( - 'Back End is not responding. Please, try again later.' + 'Testrun is not responding. Please try again in a moment.' ); done(); } diff --git a/modules/ui/src/app/interceptors/error.interceptor.ts b/modules/ui/src/app/interceptors/error.interceptor.ts index 924cbde02..82f0cba2b 100644 --- a/modules/ui/src/app/interceptors/error.interceptor.ts +++ b/modules/ui/src/app/interceptors/error.interceptor.ts @@ -35,6 +35,7 @@ import { finalize } from 'rxjs/operators'; const DEFAULT_TIMEOUT_MS = 5000; const SYSTEM_STOP_TIMEOUT_MS = 60 * 1000; +const LOGS_FOLDER = '/usr/local/testrun/testrun.log'; @Injectable() export class ErrorInterceptor implements HttpInterceptor { @@ -57,17 +58,18 @@ export class ErrorInterceptor implements HttpInterceptor { catchError((error: HttpErrorResponse | TimeoutError) => { if (error instanceof TimeoutError) { this.notificationService.notify( - 'Back End is not responding. Please, try again later.' + 'Testrun is not responding. Please try again in a moment.' ); } else { if (error.status === 0) { this.notificationService.notify( - 'Back End is not responding. Please, try again later.' + 'Testrun is not responding. Please try again in a moment.' ); } else { this.notificationService.notify( - error.error?.error || error.message + `Something went wrong. Check the logs for details here ${LOGS_FOLDER}` ); + console.error(error.error?.error || error.message); } } return throwError(error); diff --git a/modules/ui/src/app/pages/settings/settings.component.html b/modules/ui/src/app/pages/settings/settings.component.html index 36849b42e..089ebd5eb 100644 --- a/modules/ui/src/app/pages/settings/settings.component.html +++ b/modules/ui/src/app/pages/settings/settings.component.html @@ -116,7 +116,7 @@

System settings

- Warning! No ports is detected. + Warning! No ports detected.
From 3a8a59e7e97af54c2c1f9d9b1450a3974354513d Mon Sep 17 00:00:00 2001 From: kurilova Date: Wed, 31 Jul 2024 09:48:18 +0000 Subject: [PATCH 3/3] Fix text for the BE error --- modules/ui/src/app/interceptors/error.interceptor.spec.ts | 4 +++- modules/ui/src/app/interceptors/error.interceptor.ts | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/ui/src/app/interceptors/error.interceptor.spec.ts b/modules/ui/src/app/interceptors/error.interceptor.spec.ts index 5df8ca2ac..bd8950993 100644 --- a/modules/ui/src/app/interceptors/error.interceptor.spec.ts +++ b/modules/ui/src/app/interceptors/error.interceptor.spec.ts @@ -64,7 +64,9 @@ describe('ErrorInterceptor', () => { interceptor.intercept(requestMock, next).subscribe( () => ({}), () => { - expect(notificationServiceMock.notify).toHaveBeenCalledWith('Something went wrong. Check the logs for details here /usr/local/testrun/testrun.log'); + expect(notificationServiceMock.notify).toHaveBeenCalledWith( + 'Something went wrong. Check the Terminal for details.' + ); done(); } ); diff --git a/modules/ui/src/app/interceptors/error.interceptor.ts b/modules/ui/src/app/interceptors/error.interceptor.ts index 82f0cba2b..cfa512a85 100644 --- a/modules/ui/src/app/interceptors/error.interceptor.ts +++ b/modules/ui/src/app/interceptors/error.interceptor.ts @@ -35,7 +35,6 @@ import { finalize } from 'rxjs/operators'; const DEFAULT_TIMEOUT_MS = 5000; const SYSTEM_STOP_TIMEOUT_MS = 60 * 1000; -const LOGS_FOLDER = '/usr/local/testrun/testrun.log'; @Injectable() export class ErrorInterceptor implements HttpInterceptor { @@ -67,7 +66,7 @@ export class ErrorInterceptor implements HttpInterceptor { ); } else { this.notificationService.notify( - `Something went wrong. Check the logs for details here ${LOGS_FOLDER}` + 'Something went wrong. Check the Terminal for details.' ); console.error(error.error?.error || error.message); }