From 17aa2c412cf410de0d03f1ca35a3ef4ae03e7ac0 Mon Sep 17 00:00:00 2001 From: JWittmeyer <91723236+JWittmeyer@users.noreply.github.com> Date: Sat, 16 Jul 2022 17:33:15 +0200 Subject: [PATCH 01/51] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 261eeb9e..8b17cbd9 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2022 onetask.ai GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From c3a086bad7cbe31cd3115662c8fd70ca4a85640f Mon Sep 17 00:00:00 2001 From: Lina Date: Mon, 18 Jul 2022 12:04:18 +0200 Subject: [PATCH 02/51] Documentation link on tokenizer fixed --- .../projects/components/project-new/project-new.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/projects/components/project-new/project-new.component.html b/src/app/projects/components/project-new/project-new.component.html index cd78cbe5..f768ec01 100644 --- a/src/app/projects/components/project-new/project-new.component.html +++ b/src/app/projects/components/project-new/project-new.component.html @@ -41,7 +41,7 @@
From a4017b1574ba920f26d32f7a72b0bb60f46c3701 Mon Sep 17 00:00:00 2001 From: Lina Date: Mon, 18 Jul 2022 17:05:32 +0200 Subject: [PATCH 03/51] Links to public repos --- src/app/record-ide/components/record-ide.component.ts | 2 +- .../weak-source-details/weak-source-details.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/record-ide/components/record-ide.component.ts b/src/app/record-ide/components/record-ide.component.ts index b75ba66b..f20164a8 100644 --- a/src/app/record-ide/components/record-ide.component.ts +++ b/src/app/record-ide/components/record-ide.component.ts @@ -171,7 +171,7 @@ export class RecordIDEComponent implements OnInit { } navigateToLibraries() { - window.open("https://github.com/code-kern-ai/record-ide/blob/dev/requirements.txt", "_blank"); + window.open("https://github.com/code-kern-ai/refinery-lf-exec-env/blob/dev/requirements.txt", "_blank"); } } diff --git a/src/app/weak-supervision/components/weak-source-details/weak-source-details.component.ts b/src/app/weak-supervision/components/weak-source-details/weak-source-details.component.ts index f7b0db81..e2e3c185 100644 --- a/src/app/weak-supervision/components/weak-source-details/weak-source-details.component.ts +++ b/src/app/weak-supervision/components/weak-source-details/weak-source-details.component.ts @@ -595,7 +595,7 @@ export class WeakSourceDetailsComponent } navigateToLibraries() { - window.open("https://github.com/code-kern-ai/lf-execution-environment/blob/dev/requirements.txt", "_blank"); + window.open("https://github.com/code-kern-ai/refinery-lf-exec-env/blob/dev/requirements.txt", "_blank"); } getBackground(color) { From 407a3a282a21782c3c89147d999941fa542524be Mon Sep 17 00:00:00 2001 From: JWittmeyer Date: Mon, 25 Jul 2022 12:23:51 +0200 Subject: [PATCH 04/51] Removes retry from http failure --- src/app/base/interceptors/exception.interceptor.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/base/interceptors/exception.interceptor.ts b/src/app/base/interceptors/exception.interceptor.ts index 023973e0..9719b3c0 100644 --- a/src/app/base/interceptors/exception.interceptor.ts +++ b/src/app/base/interceptors/exception.interceptor.ts @@ -9,17 +9,15 @@ import { import { Observable, throwError } from 'rxjs'; import { catchError, retry } from 'rxjs/operators'; import { NotificationService } from '../services/notification.service'; - @Injectable() export class ExceptionInterceptor implements HttpInterceptor { - constructor(private notificationService: NotificationService) {} + constructor(private notificationService: NotificationService) { } intercept( request: HttpRequest, next: HttpHandler ): Observable> { return next.handle(request).pipe( - retry(1), catchError((error: HttpErrorResponse) => { let message = ''; if (error.error instanceof ErrorEvent) { From 66bfa53ebe079c810da0e130527aa9db9acba6e1 Mon Sep 17 00:00:00 2001 From: JWittmeyer Date: Mon, 25 Jul 2022 16:03:15 +0200 Subject: [PATCH 05/51] Adds check for demo application --- src/app/app.component.ts | 11 +++++- src/app/app.module.ts | 4 ++- .../components/header/header.component.html | 2 +- .../components/header/header.component.ts | 4 ++- src/app/base/interceptors/DemoError.ts | 15 ++++++++ .../global-exception.interceptor.ts | 14 ++++++++ src/app/base/services/base/apollo-checker.ts | 36 +++++++++++++++++++ src/app/base/services/config-service.ts | 35 ++++++++++++++++++ .../services/config/config-apollo.service.ts | 32 ++++++++++++++++- .../base/services/config/config-queries.ts | 15 ++++++++ .../knowledge-bases-apollo.service.ts | 4 ++- .../notification-apollo.service.ts | 4 ++- .../organization-apollo.service.ts | 4 ++- .../project/project-apollo.service.ts | 4 ++- .../services/record/record-apollo.service.ts | 4 ++- .../weak-source/weak-source-apollo.service.ts | 4 ++- 16 files changed, 181 insertions(+), 11 deletions(-) create mode 100644 src/app/base/interceptors/DemoError.ts create mode 100644 src/app/base/interceptors/global-exception.interceptor.ts create mode 100644 src/app/base/services/base/apollo-checker.ts diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 237978d0..9a41aa8f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -38,7 +38,7 @@ export class AppComponent implements OnDestroy, OnInit { ) { } ngOnInit(): void { - this.configService.isManaged().pipe(first()).subscribe((v) => ConfigManager.initConfigManager(this.http, this.configService, v)); + this.initalRequests(); NotificationService.subscribeToNotification(this, { whitelist: ['notification_created', 'project_deleted', 'config_updated'], func: this.handleWebsocketNotification @@ -46,6 +46,15 @@ export class AppComponent implements OnDestroy, OnInit { this.initializeNotificationService(); this.initWithConfigManager(); } + + initalRequests() { + this.configService.isManaged().pipe(first()).subscribe((v) => ConfigManager.initConfigManager(this.http, this.configService, v)); + this.configService.isDemo().pipe(first()).subscribe((v) => ConfigManager.setIsDemo(v)); + this.configService.isAdmin().pipe(first()).subscribe((v) => ConfigManager.setIsAdmin(v)); + this.configService.getBlackWhiteDemo().pipe(first()).subscribe((v) => ConfigManager.setBlackWhiteListDemo(v)); + } + + initWithConfigManager() { if (!ConfigManager.isInit()) { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9a00f549..87573ec5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,10 +1,11 @@ import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; -import { NgModule } from '@angular/core'; +import { ErrorHandler, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { BaseModule } from './base/base.module'; import { ExceptionInterceptor } from './base/interceptors/exception.interceptor'; +import { GlobalErrorHandler } from './base/interceptors/global-exception.interceptor'; import { NotificationService } from './base/services/notification.service'; import { DataModule } from './data/data.module'; import { ProjectsModule } from './projects/projects.module'; @@ -50,6 +51,7 @@ import { RecordIDEModule } from './record-ide/record-ide.module'; ], providers: [ { provide: HTTP_INTERCEPTORS, useClass: ExceptionInterceptor, multi: true }, + { provide: ErrorHandler, useClass: GlobalErrorHandler }, NotificationService, ], bootstrap: [AppComponent], diff --git a/src/app/base/components/header/header.component.html b/src/app/base/components/header/header.component.html index cca0133f..fef9fddd 100644 --- a/src/app/base/components/header/header.component.html +++ b/src/app/base/components/header/header.component.html @@ -59,7 +59,7 @@
-