From: maximesson Date: Thu, 7 Oct 2021 09:15:32 +0000 (+0200) Subject: Delete unnecessary red banners X-Git-Tag: 2.3.0~5 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=4210eb2e61a0f3577ac73528fa629e1a1fe30847;p=portal%2Fnonrtric-controlpanel.git Delete unnecessary red banners Change-Id: I078abbc7b27e97db8a439851f292bf4aeabcf187 Issue-ID: NONRTRIC-599 Signed-off-by: maximesson --- diff --git a/webapp-frontend/src/app/interceptor.mock.ts b/webapp-frontend/src/app/interceptor.mock.ts index 844513b..abb45ce 100644 --- a/webapp-frontend/src/app/interceptor.mock.ts +++ b/webapp-frontend/src/app/interceptor.mock.ts @@ -195,17 +195,17 @@ const urls = [ url: CONSUMER_PATH + "/info-jobs/job3/status", json: job3Status, }, - { - url: '/a1-policy/v2/configuration', - json: ricconfig - } + { + url: '/a1-policy/v2/configuration', + json: ricconfig + } ]; @Injectable() export class HttpMockRequestInterceptor implements HttpInterceptor { private toggleTypes = true; - constructor(private injector: Injector) {} + constructor(private injector: Injector) { } intercept( request: HttpRequest, @@ -229,7 +229,7 @@ export class HttpMockRequestInterceptor implements HttpInterceptor { } } - if (result) { + if (result) { console.log( "Mock answering http call :" + request.method + " " + request.url, request.method === "PUT" ? request.body : null diff --git a/webapp-frontend/src/app/interceptor.ts b/webapp-frontend/src/app/interceptor.ts index 65ce887..3bceb5e 100644 --- a/webapp-frontend/src/app/interceptor.ts +++ b/webapp-frontend/src/app/interceptor.ts @@ -27,18 +27,27 @@ import { NotificationService } from '@services/ui/notification.service'; @Injectable() export class HttpRequestInterceptor implements HttpInterceptor { - constructor(private notificationService: NotificationService) {} + constructor(private notificationService: NotificationService) { } intercept(request: HttpRequest, next: HttpHandler): Observable> { console.log('Interceptor Invoked' + request.url); - return next.handle(request).pipe( - catchError((error: HttpErrorResponse) => { - console.error("Error from error interceptor", error); + if (!request.url.includes("info-jobs")) { + return next.handle(request).pipe( + catchError((error: HttpErrorResponse) => { + console.error("Error from error interceptor", error); - // show dialog for error message - this.notificationService.error(error.message); - return throwError(error); - }) - ) as Observable>; + // show dialog for error message + this.notificationService.error(error.message); + return throwError(error); + }) + ) as Observable>; + } else { + return next.handle(request).pipe( + catchError((error: HttpErrorResponse) => { + console.error("Error from error interceptor", error); + return throwError(error); + }) + ) as Observable>; + } } }