Commit 4285c131 authored by Gert Paimla's avatar Gert Paimla

refactor modules

parent 1f799a7f
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {UserSettingsComponent} from './user-settings/user-settings.component';
import {PreloadAllModules, RouterModule, Routes} from '@angular/router';
import {AuthGuard} from './core/auth/auth.guard';
import {HomeComponent} from './home/home.component';
import {LexiconMinerComponent} from './lexicon-miner/lexicon-miner.component';
import {USERROLES} from './shared/types/UserAuth';
const routes: Routes = [
......@@ -11,17 +8,17 @@ const routes: Routes = [
path: '',
pathMatch: 'full',
canActivate: [AuthGuard],
component: HomeComponent,
loadChildren: () => import('./home/home.module').then(m => m.HomeModule)
},
{
path: 'lexicon-miner',
path: 'settings',
canActivate: [AuthGuard],
component: LexiconMinerComponent,
loadChildren: () => import('./user-settings/user-settings.module').then(m => m.UserSettingsModule)
},
{
path: 'settings',
path: 'lexicon-miner',
canActivate: [AuthGuard],
component: UserSettingsComponent,
loadChildren: () => import('./lexicon-miner/lexicon-miner.module').then(m => m.LexiconMinerModule)
},
{
path: 'management',
......@@ -29,6 +26,41 @@ const routes: Routes = [
data: {role: USERROLES.SUPERUSER},
loadChildren: () => import('./management/management.module').then(m => m.ManagementModule)
},
{
path: 'torchtaggers',
canActivate: [AuthGuard],
loadChildren: () => import('./models/torch-tagger/torch-tagger.module').then(m => m.TorchTaggerModule)
},
{
path: 'tagger-groups',
canActivate: [AuthGuard],
loadChildren: () => import('./models/tagger-group/tagger-group.module').then(m => m.TaggerGroupModule)
},
{
path: 'taggers',
canActivate: [AuthGuard],
loadChildren: () => import('./models/tagger/tagger.module').then(m => m.TaggerModule)
},
{
path: 'regex-tagger',
canActivate: [AuthGuard],
loadChildren: () => import('./models/regex-tagger/regex-tagger.module').then(m => m.RegexTaggerModule)
},
{
path: 'embeddings',
canActivate: [AuthGuard],
loadChildren: () => import('./models/embedding/embedding.module').then(m => m.EmbeddingModule)
},
{
path: 'clustering',
canActivate: [AuthGuard],
loadChildren: () => import('./models/clustering/cluster.module').then(m => m.ClusterModule)
},
{
path: 'searcher',
canActivate: [AuthGuard],
loadChildren: () => import('./searcher/searcher.module').then(m => m.SearcherModule)
},
{
path: '**',
redirectTo: ''
......@@ -36,7 +68,10 @@ const routes: Routes = [
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes,
{
preloadingStrategy: PreloadAllModules
})],
exports: [RouterModule]
})
export class AppRoutingModule {
......
import { BrowserModule } from '@angular/platform-browser';
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
......@@ -8,27 +7,12 @@ import {SharedModule} from './shared/shared.module';
import {HTTP_INTERCEPTORS, HttpClientModule, HttpClientXsrfModule} from '@angular/common/http';
import {HttpAuthInterceptor} from './core/auth/http-auth.interceptor';
import {NavbarComponent} from './navbar/navbar.component';
import {UserSettingsComponent} from './user-settings/user-settings.component';
import {HomeComponent} from './home/home.component';
import {LexiconMinerComponent} from './lexicon-miner/lexicon-miner.component';
import {TaggerModule} from './models/tagger/tagger.module';
import {EmbeddingModule} from './models/embedding/embedding.module';
import {ProjectModule} from './home/project/project.module';
import {LexiconBuilderComponent} from './lexicon-miner/lexicon-builder/lexicon-builder.component';
import {SearcherModule} from './searcher/searcher.module';
import {ToolsModule} from './tools/tools.module';
import {TorchTaggerModule} from './models/torch-tagger/torch-tagger.module';
import {ClusterModule} from './models/clustering/cluster.module';
@NgModule({
declarations: [
AppComponent,
NavbarComponent,
UserSettingsComponent,
HomeComponent,
LexiconMinerComponent,
LexiconBuilderComponent,
],
imports: [
BrowserModule,
......@@ -39,13 +23,6 @@ import {ClusterModule} from './models/clustering/cluster.module';
cookieName: 'XSRF-TOKEN',
headerName: 'X-XSRF-TOKEN',
}),
TaggerModule,
EmbeddingModule,
ProjectModule,
SearcherModule,
TorchTaggerModule,
ClusterModule,
ToolsModule,
AppRoutingModule,
],
providers: [
......
import { NgModule } from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {AuthGuard} from '../core/auth/auth.guard';
import {HomeComponent} from './home.component';
const routes: Routes = [
{
path: '',
canActivate: [AuthGuard],
component: HomeComponent,
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class HomeRoutingModule { }
......@@ -5,7 +5,7 @@ import {SharedModule} from '../shared/shared.module';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {ProjectModule} from './project/project.module';
import {ProjectModule} from '../project/project.module';
describe('HomeComponent', () => {
let component: HomeComponent;
......
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {HomeComponent} from './home.component';
import {SharedModule} from '../shared/shared.module';
import {ProjectModule} from '../project/project.module';
import {HomeRoutingModule} from './home-routing.module';
@NgModule({
declarations: [
HomeComponent
],
imports: [
CommonModule,
HomeRoutingModule,
SharedModule,
ProjectModule
]
})
export class HomeModule {
}
import {NgModule} from '@angular/core';
import {AuthGuard} from '../core/auth/auth.guard';
import {LexiconMinerComponent} from './lexicon-miner.component';
import {RouterModule, Routes} from '@angular/router';
const routes: Routes = [
{
path: '',
canActivate: [AuthGuard],
component: LexiconMinerComponent,
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class LexiconMinerRoutingModule {
}
import {NgModule} from '@angular/core';
import {SharedModule} from '../shared/shared.module';
import {LexiconMinerComponent} from './lexicon-miner.component';
import {LexiconBuilderComponent} from './lexicon-builder/lexicon-builder.component';
import {LexiconMinerRoutingModule} from './lexicon-miner-routing.module';
@NgModule({
declarations: [
LexiconMinerComponent,
LexiconBuilderComponent,
],
imports: [
SharedModule,
LexiconMinerRoutingModule,
],
})
export class LexiconMinerModule {
}
......@@ -7,7 +7,7 @@ import {ViewClusterDocumentsComponent} from './clusters/view-cluster/view-cluste
const routes: Routes = [
{
path: 'clustering',
path: '',
canActivate: [AuthGuard],
data: {breadcrumb: 'clustering', tooltip: 'Clustering list'},
children: [
......
......@@ -2,21 +2,13 @@ import {NgModule} from '@angular/core';
import {AuthGuard} from '../../core/auth/auth.guard';
import {RouterModule, Routes} from '@angular/router';
import {EmbeddingComponent} from './embedding/embedding.component';
// import {EmbeddingGroupComponent} from './embedding-group/embedding-group.component';
const routes: Routes = [
{
path: 'embeddings',
path: '',
canActivate: [AuthGuard],
component: EmbeddingComponent,
},
// Embedding Clusters disabled until more functionality for them is added
// {
// path: 'embedding-groups',
// canActivate: [AuthGuard],
// component: EmbeddingGroupComponent,
// },
];
@NgModule({
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CreateRegexTaggerDialogComponent } from './create-regex-tagger-dialog.component';
import {SharedModule} from '../../../../shared/shared.module';
import {SharedModule} from '../../../shared/shared.module';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
......
import {Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
import {MatDialogRef} from '@angular/material/dialog';
import {LogService} from '../../../../core/util/log.service';
import {ProjectStore} from '../../../../core/projects/project.store';
import {RegexTaggerService} from '../../../../core/models/taggers/regex-tagger.service';
import {LogService} from '../../../core/util/log.service';
import {ProjectStore} from '../../../core/projects/project.store';
import {RegexTaggerService} from '../../../core/models/taggers/regex-tagger.service';
import {FormControl, FormGroup, Validators} from '@angular/forms';
import {ErrorStateMatcher} from '@angular/material/core';
import {LiveErrorStateMatcher} from '../../../../shared/CustomerErrorStateMatchers';
import {Lexicon} from '../../../../shared/types/Lexicon';
import {LiveErrorStateMatcher} from '../../../shared/CustomerErrorStateMatchers';
import {Lexicon} from '../../../shared/types/Lexicon';
import {MatMenuTrigger} from '@angular/material/menu';
import {LexiconService} from '../../../../core/lexicon/lexicon.service';
import {LexiconService} from '../../../core/lexicon/lexicon.service';
import {switchMap, takeUntil} from 'rxjs/operators';
import {Project} from '../../../../shared/types/Project';
import {Project} from '../../../shared/types/Project';
import {of, Subject} from 'rxjs';
import {HttpErrorResponse} from '@angular/common/http';
......
......@@ -2,7 +2,7 @@ import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {MultiTagTextDialogComponent} from './multi-tag-text-dialog.component';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import {SharedModule} from '../../../../shared/shared.module';
import {SharedModule} from '../../../shared/shared.module';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
......
import {Component, Inject, OnDestroy, OnInit} from '@angular/core';
import {RegexTagger} from '../../../../shared/types/tasks/RegexTagger';
import {RegexTagger} from '../../../shared/types/tasks/RegexTagger';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import {RegexTaggerService} from '../../../../core/models/taggers/regex-tagger.service';
import {LogService} from '../../../../core/util/log.service';
import {LexiconService} from '../../../../core/lexicon/lexicon.service';
import {ProjectStore} from '../../../../core/projects/project.store';
import {RegexTaggerService} from '../../../core/models/taggers/regex-tagger.service';
import {LogService} from '../../../core/util/log.service';
import {LexiconService} from '../../../core/lexicon/lexicon.service';
import {ProjectStore} from '../../../core/projects/project.store';
import {takeUntil} from 'rxjs/operators';
import {Project} from '../../../../shared/types/Project';
import {Project} from '../../../shared/types/Project';
import {Subject} from 'rxjs';
import {HttpErrorResponse} from '@angular/common/http';
......
import { NgModule } from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {AuthGuard} from '../../core/auth/auth.guard';
import {RegexTaggerComponent} from './regex-tagger.component';
const routes: Routes = [
{
path: '',
canActivate: [AuthGuard],
component: RegexTaggerComponent,
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class RegexTaggerRoutingModule { }
@import "../../../../variables/variables";
@import "src/variables/variables";
table {
width: 100%;
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RegexTaggerComponent } from './regex-tagger.component';
import {SharedModule} from '../../../shared/shared.module';
import {SharedModule} from '../../shared/shared.module';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
......
......@@ -3,16 +3,16 @@ import {merge, of, Subject} from 'rxjs';
import {MatSort} from '@angular/material/sort';
import {MatPaginator} from '@angular/material/paginator';
import {debounceTime, switchMap, takeUntil} from 'rxjs/operators';
import {RegexTagger} from '../../../shared/types/tasks/RegexTagger';
import {ProjectStore} from '../../../core/projects/project.store';
import {RegexTagger} from '../../shared/types/tasks/RegexTagger';
import {ProjectStore} from '../../core/projects/project.store';
import {MatDialog} from '@angular/material/dialog';
import {LogService} from '../../../core/util/log.service';
import {Project} from '../../../shared/types/Project';
import {LogService} from '../../core/util/log.service';
import {Project} from '../../shared/types/Project';
import {MatTableDataSource} from '@angular/material/table';
import {expandRowAnimation} from '../../../shared/animations';
import {ConfirmDialogComponent} from '../../../shared/components/dialogs/confirm-dialog/confirm-dialog.component';
import {expandRowAnimation} from '../../shared/animations';
import {ConfirmDialogComponent} from '../../shared/components/dialogs/confirm-dialog/confirm-dialog.component';
import {SelectionModel} from '@angular/cdk/collections';
import {RegexTaggerService} from '../../../core/models/taggers/regex-tagger.service';
import {RegexTaggerService} from '../../core/models/taggers/regex-tagger.service';
import {CreateRegexTaggerDialogComponent} from './create-regex-tagger-dialog/create-regex-tagger-dialog.component';
import {MultiTagTextDialogComponent} from './multi-tag-text-dialog/multi-tag-text-dialog.component';
import {HttpErrorResponse} from '@angular/common/http';
......
import {NgModule} from '@angular/core';
import {SharedModule} from '../../shared/shared.module';
import {RegexTaggerRoutingModule} from './regex-tagger-routing.module';
import {CreateRegexTaggerDialogComponent} from './create-regex-tagger-dialog/create-regex-tagger-dialog.component';
import {MultiTagTextDialogComponent} from './multi-tag-text-dialog/multi-tag-text-dialog.component';
import {RegexTaggerComponent} from './regex-tagger.component';
@NgModule({
declarations: [
CreateRegexTaggerDialogComponent,
MultiTagTextDialogComponent,
RegexTaggerComponent
],
imports: [
SharedModule,
RegexTaggerRoutingModule,
],
})
export class RegexTaggerModule {
}
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {CreateTaggerGroupDialogComponent} from './create-tagger-group-dialog.component';
import {SharedModule} from '../../../../shared/shared.module';
import {SharedModule} from '../../../shared/shared.module';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
......
import {AfterViewInit, Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
import {Field, Project, ProjectFact, ProjectIndex} from '../../../../shared/types/Project';
import {Field, Project, ProjectFact, ProjectIndex} from '../../../shared/types/Project';
import {mergeMap, switchMap, take, takeUntil} from 'rxjs/operators';
import {LogService} from '../../../../core/util/log.service';
import {TaggerOptions} from '../../../../shared/types/tasks/TaggerOptions';
import {LogService} from '../../../core/util/log.service';
import {TaggerOptions} from '../../../shared/types/tasks/TaggerOptions';
import {ErrorStateMatcher} from '@angular/material/core';
import {MatDialogRef} from '@angular/material/dialog';
import {HttpErrorResponse} from '@angular/common/http';
import {FormControl, FormGroup, Validators} from '@angular/forms';
import {ProjectService} from '../../../../core/projects/project.service';
import {ProjectStore} from '../../../../core/projects/project.store';
import {LiveErrorStateMatcher} from '../../../../shared/CustomerErrorStateMatchers';
import {EmbeddingsService} from '../../../../core/models/embeddings/embeddings.service';
import {Embedding} from '../../../../shared/types/tasks/Embedding';
import {TaggerService} from '../../../../core/models/taggers/tagger.service';
import {ProjectService} from '../../../core/projects/project.service';
import {ProjectStore} from '../../../core/projects/project.store';
import {LiveErrorStateMatcher} from '../../../shared/CustomerErrorStateMatchers';
import {EmbeddingsService} from '../../../core/models/embeddings/embeddings.service';
import {Embedding} from '../../../shared/types/tasks/Embedding';
import {TaggerService} from '../../../core/models/taggers/tagger.service';
import {forkJoin, of, Subject} from 'rxjs';
import {TaggerGroupService} from '../../../../core/models/taggers/tagger-group.service';
import {TaggerGroup} from '../../../../shared/types/tasks/Tagger';
import {UtilityFunctions} from '../../../../shared/UtilityFunctions';
import {TaggerGroupService} from '../../../core/models/taggers/tagger-group.service';
import {TaggerGroup} from '../../../shared/types/tasks/Tagger';
import {UtilityFunctions} from '../../../shared/UtilityFunctions';
import {MatSelect} from '@angular/material/select';
@Component({
......
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {EditTaggerGroupDialogComponent} from './edit-tagger-group-dialog.component';
import {SharedModule} from '../../../../shared/shared.module';
import {SharedModule} from '../../../shared/shared.module';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import {TaggerGroup} from '../../../../shared/types/tasks/Tagger';
import {TaggerGroup} from '../../../shared/types/tasks/Tagger';
describe('EditTaggerGroupDialogComponent', () => {
let component: EditTaggerGroupDialogComponent;
......
import {Component, Inject, OnInit} from '@angular/core';
import {ErrorStateMatcher} from '@angular/material/core';
import {LiveErrorStateMatcher} from '../../../../shared/CustomerErrorStateMatchers';
import {LiveErrorStateMatcher} from '../../../shared/CustomerErrorStateMatchers';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import {TaggerGroup} from '../../../../shared/types/tasks/Tagger';
import {ProjectStore} from '../../../../core/projects/project.store';
import {TaggerGroup} from '../../../shared/types/tasks/Tagger';
import {ProjectStore} from '../../../core/projects/project.store';
import {mergeMap, take} from 'rxjs/operators';
import {of} from 'rxjs';
import {TaggerGroupService} from '../../../../core/models/taggers/tagger-group.service';
import {TaggerGroupService} from '../../../core/models/taggers/tagger-group.service';
@Component({
selector: 'app-edit-tagger-group-dialog',
......
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {ModelsListDialogComponent} from './models-list-dialog.component';
import {SharedModule} from '../../../../shared/shared.module';
import {SharedModule} from '../../../shared/shared.module';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
......
import {NgModule} from '@angular/core';
import {AuthGuard} from '../../core/auth/auth.guard';
import {RouterModule, Routes} from '@angular/router';
import {ProjectComponent} from './project.component';
import {AuthGuard} from '../../core/auth/auth.guard';
import {TaggerGroupComponent} from './tagger-group.component';
const routes: Routes = [
{
path: 'projects',
path: '',
canActivate: [AuthGuard],
component: ProjectComponent,
component: TaggerGroupComponent,
},
];
......@@ -16,6 +16,5 @@ const routes: Routes = [
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ProjectRoutingModule {
export class TaggerGroupRoutingModule {
}
......@@ -5,8 +5,8 @@ import {MAT_DIALOG_DATA} from '@angular/material/dialog';
import {LogService} from 'src/app/core/util/log.service';
import {HttpErrorResponse} from '@angular/common/http';
import {take} from 'rxjs/operators';
import {ProjectStore} from '../../../../core/projects/project.store';
import {ProjectIndex} from '../../../../shared/types/Project';
import {ProjectStore} from '../../../core/projects/project.store';
import {ProjectIndex} from '../../../shared/types/Project';
interface TaggerGroupRandomDocTag {
ner_match: boolean;
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TaggerGroupTagTextDialogComponent } from './tagger-group-tag-text-dialog.component';
import {Tagger} from '../../../../shared/types/tasks/Tagger';
import {Tagger} from '../../../shared/types/tasks/Tagger';
import {TagDocDialogComponent} from '../../tagger/tag-doc-dialog/tag-doc-dialog.component';
import {SharedModule} from '../../../../shared/shared.module';
import {SharedModule} from '../../../shared/shared.module';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
......