Skip to content

Commit

Permalink
chore(octra): update Nx to 16.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoemp committed Sep 21, 2023
1 parent c49fd0c commit 0787107
Show file tree
Hide file tree
Showing 43 changed files with 7,836 additions and 7,681 deletions.
11 changes: 5 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -24,21 +24,20 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {
}
"rules": {}
}
]
}
2 changes: 1 addition & 1 deletion apps/octra-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'cypress';
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';

export default defineConfig({
e2e: nxE2EPreset(__dirname),
Expand Down
4 changes: 2 additions & 2 deletions apps/octra-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/octra-e2e/cypress.config.ts",
"devServerTarget": "octra:serve:development",
Expand All @@ -21,7 +21,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/octra-e2e/**/*.{js,ts}"]
Expand Down
4 changes: 2 additions & 2 deletions apps/octra/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
]
},
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
]
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
Expand Down
6 changes: 3 additions & 3 deletions apps/octra/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/octra/**/*.ts", "apps/octra/**/*.html"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/octra/jest.config.ts",
Expand All @@ -137,7 +137,7 @@
}
},
"serve-static": {
"executor": "@nrwl/web:file-server",
"executor": "@nx/web:file-server",
"options": {
"buildTarget": "octra:build"
}
Expand Down
9 changes: 2 additions & 7 deletions apps/octra/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ import { ApplicationEffects } from './core/store/application/application.effects
import { ModalsModule } from './core/modals/modals.module';
import { AppSharedModule } from './app.shared.module';
import { OctraComponentsModule } from '@octra/ngx-components';
import {
TranslocoConfigProvider,
TranslocoLoaderProvider,
} from './app.transloco';
import { NgxOctraApiModule, OctraAPIService } from '@octra/ngx-octra-api';
import {
NgbCollapseModule,
Expand All @@ -68,6 +64,7 @@ import { APIEffects } from './core/store/api';
import { PagesModule } from './core/pages/pages.module';
import { OctraUtilitiesModule } from '@octra/ngx-utilities';
import { AsrEffects } from './core/store/asr/asr.effects.service';
import { TranslocoRootModule } from './app.transloco';

@NgModule({
declarations: [AppComponent, NavigationComponent],
Expand Down Expand Up @@ -121,7 +118,7 @@ import { AsrEffects } from './core/store/asr/asr.effects.service';
NgbTooltipModule,
NgbCollapseModule,
ModalsModule,
TranslocoModule,
TranslocoRootModule,
NgxOctraApiModule,
OctraComponentsModule,
OctraUtilitiesModule,
Expand All @@ -145,8 +142,6 @@ import { AsrEffects } from './core/store/asr/asr.effects.service';
BugReportService,
CompatibilityService,
MultiThreadingService,
TranslocoConfigProvider,
TranslocoLoaderProvider,
],
exports: [],
})
Expand Down
8 changes: 1 addition & 7 deletions apps/octra/src/app/app.shared.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TranslocoModule } from '@ngneat/transloco';
import {
TranslocoConfigProvider,
TranslocoLoaderProvider,
} from './app.transloco';
import { AsrOptionsComponent } from './core/component/asr-options/asr-options.component';
import { TranscriptionFeedbackComponent } from './core/component/transcription-feedback/transcription-feedback.component';
import { ClipTextPipe } from './core/shared/clip-text.pipe';
Expand All @@ -21,6 +16,7 @@ import { AlertComponent, DropZoneComponent } from './core/component';
import { OctraComponentsModule } from '@octra/ngx-components';
import { OctraUtilitiesModule } from '@octra/ngx-utilities';
import { SignupComponent } from './core/component/authentication-component/signup/signup.component';
import { TranslocoModule } from '@ngneat/transloco';

@NgModule({
declarations: [
Expand All @@ -36,7 +32,6 @@ import { SignupComponent } from './core/component/authentication-component/signu
CommonModule,
FormsModule,
RouterModule,
TranslocoModule,
DragDropModule,
NgbDropdownModule,
NgbPopoverModule,
Expand All @@ -45,7 +40,6 @@ import { SignupComponent } from './core/component/authentication-component/signu
TranslocoModule,
NgbToast,
],
providers: [TranslocoConfigProvider, TranslocoLoaderProvider],
exports: [
AsrOptionsComponent,
TranscriptionFeedbackComponent,
Expand Down
41 changes: 21 additions & 20 deletions apps/octra/src/app/app.transloco.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Injectable } from '@angular/core';
import { Injectable, NgModule } from '@angular/core';
import {
provideTransloco,
Translation,
TRANSLOCO_CONFIG,
TRANSLOCO_LOADER,
translocoConfig,
TranslocoLoader,
TranslocoModule,
} from '@ngneat/transloco';
import { HttpClient } from '@angular/common/http';
import { environment } from '../environments/environment';
Expand All @@ -14,22 +13,24 @@ export class TranslocoHttpLoader implements TranslocoLoader {
constructor(private http: HttpClient) {}

getTranslation(lang: string) {
return this.http.get<Translation>(`./assets/i18n/${lang}.json`);
const code = lang.replace(/-.*/g, '');
return this.http.get<Translation>(`assets/i18n/${code}.json`);
}
}

export const TranslocoConfigProvider = {
provide: TRANSLOCO_CONFIG,
useValue: translocoConfig({
availableLangs: ['en'],
defaultLang: 'en',
fallbackLang: 'en',
prodMode: environment.production,
reRenderOnLangChange: true,
}),
};

export const TranslocoLoaderProvider = {
provide: TRANSLOCO_LOADER,
useClass: TranslocoHttpLoader,
};
@NgModule({
exports: [TranslocoModule],
providers: [
provideTransloco({
config: {
availableLangs: ['en'],
defaultLang: 'en',
fallbackLang: 'en',
prodMode: environment.production,
reRenderOnLangChange: true,
},
loader: TranslocoHttpLoader,
}),
],
})
export class TranslocoRootModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { SessionFile } from '../../obj/SessionFile';
import { contains, FileSize, getFileSize } from '@octra/utilities';
import { FileProgress } from '../../obj/objects';
import {
AnnotationLevelType,
Converter,
IFile,
ImportResult,
OAnnotJSON,
OctraAnnotationSegment,
OctraAnnotationSegmentLevel,
OLabel,
OSegment,
OSegmentLevel,
} from '@octra/annotation';
import { timer } from 'rxjs';
import { SupportedFilesModalComponent } from '../../modals/supportedfiles-modal/supportedfiles-modal.component';
Expand Down Expand Up @@ -192,11 +192,10 @@ export class OctraDropzoneComponent extends DefaultComponent {
importResult.error === ''
) {
file.status = 'valid';
for (const level of importResult.annotjson.levels) {
if (
level instanceof
OctraAnnotationSegmentLevel<OctraAnnotationSegment>
) {
for (const lvl of importResult.annotjson.levels) {
if (lvl.type === AnnotationLevelType.SEGMENT) {
const level = lvl as OSegmentLevel<OSegment>;

if (level.items[0].sampleStart !== 0) {
let temp = [];
temp.push(
Expand Down Expand Up @@ -506,8 +505,8 @@ export class OctraDropzoneComponent extends DefaultComponent {

private dropFile(
filename: string,
containsTrue: boolean = false,
containsnot: boolean = false
containsTrue = false,
containsnot = false
): boolean {
for (let i = 0; i < this.files.length; i++) {
const file = this.files[i].file;
Expand Down
5 changes: 0 additions & 5 deletions apps/octra/src/app/core/modals/modals.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ import {
} from '@ngneat/transloco';
import { HttpClient } from '@angular/common/http';
import { AppSharedModule } from '../../app.shared.module';
import {
TranslocoConfigProvider,
TranslocoLoaderProvider,
} from '../../app.transloco';
import { OctraComponentsModule } from '@octra/ngx-components';
import { FormsModule } from '@angular/forms';
import { NamingDragAndDropComponent } from '../tools/naming-drag-and-drop/naming-drag-and-drop.component';
Expand Down Expand Up @@ -99,7 +95,6 @@ export class TranslocoHttpLoader implements TranslocoLoader {
NgbModalModule,
OctraUtilitiesModule,
],
providers: [TranslocoConfigProvider, TranslocoLoaderProvider],
exports: [
BugreportModalComponent,
ErrorModalComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { Injectable } from '@angular/core';

import {
ActivatedRouteSnapshot,
CanActivate,
RouterStateSnapshot,
} from '@angular/router';
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { SettingsService } from '../../../shared/service';
import { AppStorageService } from '../../../shared/service/appstorage.service';
import { Store } from '@ngrx/store';
import { AppInfo } from '../../../../app.info';
import { RoutingService } from '../../../shared/service/routing.service';

@Injectable()
export class ReloadFileGuard implements CanActivate {
export class ReloadFileGuard {
constructor(
private appStorage: AppStorageService,
private routingService: RoutingService,
Expand Down
8 changes: 2 additions & 6 deletions apps/octra/src/app/core/pages/login/login.activateguard.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { Injectable } from '@angular/core';

import {
ActivatedRouteSnapshot,
CanActivate,
RouterStateSnapshot,
} from '@angular/router';
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { map, Observable } from 'rxjs';
import { AppInfo } from '../../../app.info';
import { ApplicationStoreService } from '../../store/application/application-store.service';
import { RoutingService } from '../../shared/service/routing.service';

@Injectable()
export class ALoginGuard implements CanActivate {
export class ALoginGuard {
constructor(
private appStoreService: ApplicationStoreService,
private routingService: RoutingService
Expand Down
3 changes: 1 addition & 2 deletions apps/octra/src/app/core/pages/login/login.deactivateguard.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { CanDeactivate } from '@angular/router';
import { Observable } from 'rxjs';

export interface ComponentCanDeactivate {
canDeactivate: () => boolean | Observable<boolean>;
}

export class DeALoginGuard implements CanDeactivate<ComponentCanDeactivate> {
export class DeALoginGuard {
canDeactivate(
component: ComponentCanDeactivate
): Observable<boolean> | boolean {
Expand Down
3 changes: 1 addition & 2 deletions apps/octra/src/app/core/shared/guard/compatibility.guard.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Injectable } from '@angular/core';
import {
ActivatedRouteSnapshot,
CanActivate,
Router,
RouterStateSnapshot,
} from '@angular/router';
Expand All @@ -17,7 +16,7 @@ import { navigateTo } from '@octra/ngx-utilities';
@Injectable({
providedIn: 'root',
})
export class CompatibilityGuard implements CanActivate {
export class CompatibilityGuard {
constructor(
private router: Router,
private compatibility: CompatibilityService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ import { Injectable } from '@angular/core';

import {
ActivatedRouteSnapshot,
CanActivate,
Router,
RouterStateSnapshot,
} from '@angular/router';
import { Observable } from 'rxjs';
import { AppInfo } from '../../../app.info';
import { AppStorageService } from '../service/appstorage.service';
import { navigateTo } from '@octra/ngx-utilities';

@Injectable()
export class TranscrEndGuard implements CanActivate {
export class TranscrEndGuard {
constructor(private appStorage: AppStorageService, private router: Router) {}

canActivate(
Expand Down
Loading

0 comments on commit 0787107

Please sign in to comment.