...
 
Commits (2)
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
......@@ -3,7 +3,7 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"TEXTA": {
"texta": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
......@@ -11,18 +11,22 @@
"schematics": {
"@schematics/angular:component": {
"style": "scss"
},
"@schematics/angular:application": {
"strict": true
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"allowedCommonJsDependencies": ["linkify-it"],
"aot": true,
"outputPath": "dist/TEXTA",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
......@@ -32,7 +36,6 @@
"src/styles.scss"
],
"scripts": [],
"es5BrowserSupport": true,
"webWorkerTsConfig": "tsconfig.worker.json"
},
"configurations": {
......@@ -55,12 +58,13 @@
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
"maximumWarning": "1.5mb",
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
"maximumWarning": "2kb",
"maximumError": "4kb"
}
]
},
......@@ -97,18 +101,18 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "TEXTA:build"
"browserTarget": "texta:build"
},
"configurations": {
"production": {
"browserTarget": "TEXTA:build:production"
"browserTarget": "texta:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "TEXTA:build"
"browserTarget": "texta:build"
}
},
"test": {
......@@ -116,7 +120,7 @@
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
......@@ -133,8 +137,8 @@
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json",
"tsconfig.app.json",
"tsconfig.spec.json",
"tsconfig.worker.json"
],
"exclude": [
......@@ -144,7 +148,7 @@
}
}
},
"TEXTA-e2e": {
"texta-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
......@@ -153,11 +157,11 @@
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "TEXTA:serve"
"devServerTarget": "texta:serve"
},
"configurations": {
"production": {
"devServerTarget": "TEXTA:serve:production"
"devServerTarget": "texta:serve:production"
}
}
},
......@@ -173,5 +177,5 @@
}
}
},
"defaultProject": "TEXTA"
"defaultProject": "texta"
}
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
#
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11
\ No newline at end of file
......@@ -45,14 +45,19 @@ describe('/health and project table tests', function () {
cy.get('.mat-option-text:first').contains('texta_test_index').should('be.visible').click(); // todo texta test index
cy.closeCurrentCdkOverlay();
}));
cy.get('[data-cy=appProjectCreateDialogSubmit]').should('be.visible').click();
cy.route('GET', 'projects').as('getProjects');
cy.route('DELETE', '**/projects/**').as('deleteProjects');
cy.route('POST', 'projects').as('postProjects');
cy.get('[data-cy=appProjectCreateDialogSubmit]').should('be.visible').click();
cy.wait('@postProjects');
cy.wait('@getProjects');
cy.wait(1000); // projectStore, update table
cy.wait(100); // projectStore, update table
cy.get('tbody > :nth-child(1) > .cdk-column-title').contains('testProject');
cy.get(':nth-child(1) > .cdk-column-Modify > .mat-focus-indicator > .mat-button-wrapper > .mat-icon').click();
cy.get(':nth-child(1) > .mat-focus-indicator.ng-star-inserted').should('be.visible').contains('Delete').click();
cy.get('[data-cy=appConfirmDialogSubmit]').should('be.visible').click();
cy.wait('@getProjects');
cy.wait('@deleteProjects').then(x=>{
cy.wait('@getProjects');
});
});
});
......@@ -64,11 +64,11 @@ describe('searching and search related activities should be working correctly',
cy.get('[data-cy=appSearcherSideBarBuildSearchConstraintSelect]').click();
cy.get('mat-option').contains('@timestamp').scrollIntoView().click();
cy.closeCurrentCdkOverlay();
cy.get('[data-cy=appSearcherSideBarBuildSearchDateConstraint] mat-form-field:first()')
cy.get('[data-cy=appSearcherSideBarBuildSearchDateConstraintStart]')
.should('be.visible')
.click()
.type('1/3/2016');
cy.get('[data-cy=appSearcherSideBarBuildSearchDateConstraint] mat-form-field:not(:first())')
cy.get('[data-cy=appSearcherSideBarBuildSearchDateConstraintEnd]')
.should('be.visible')
.click()
.type('3/24/2020');
......
......@@ -31,7 +31,7 @@ describe('dataset-importer should work', function () {
cy.get('[data-cy=appDatasetImporterCreateDialogName]').click().then((name => {
cy.wrap(name).should('have.class', 'mat-focused').type('asd').find('input').clear();
cy.matFormFieldShouldHaveError(name, 'required');
cy.wrap(name).type('newIndex');
cy.wrap(name).type('new_index');
}));
cy.get('input[type=file]').attachFile({
filePath: "testSample.csv",
......
......@@ -70,7 +70,6 @@ describe('mlp should work', function () {
cy.get('[data-cy=appMLPApplyDialogSubmit]').should('be.visible').click();
cy.wait('@MLPTexts').then(created => {
expect(created.status).to.eq(200);
assert.equal(created.response.body.task.status, 'ok');
});
});
});
......@@ -102,6 +102,8 @@ describe('reindexer should work', function () {
headers: {'Authorization': 'Token ' + JSON.parse(localStorage.getItem('user')).key}
}).then(x => {
initReindexerPage();
cy.wait('@getIndices');
// delete reindex task
cy.get('.cdk-column-Modify:nth(1)').should('be.visible').click();
cy.get('[data-cy=appReindexerMenuDelete]').should('be.visible').click();
......
{
"extends": "../tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
......
This diff is collapsed.
......@@ -19,51 +19,52 @@
},
"private": true,
"dependencies": {
"@angular-devkit/build-angular": "^0.901.9",
"@angular/animations": "~9.1.6",
"@angular/cdk": "^9.2.3",
"@angular/common": "~9.1.6",
"@angular/compiler": "~9.1.6",
"@angular/core": "~9.1.6",
"@angular/flex-layout": "^9.0.0-beta.30",
"@angular/forms": "~9.1.6",
"@angular/material": "^9.2.3",
"@angular/platform-browser": "~9.1.6",
"@angular/platform-browser-dynamic": "~9.1.6",
"@angular/router": "~9.1.6",
"@angular-devkit/build-angular": "^0.1000.3",
"@angular/animations": "~10.0.4",
"@angular/cdk": "^10.0.2",
"@angular/common": "~10.0.4",
"@angular/compiler": "~10.0.4",
"@angular/core": "~10.0.4",
"@angular/flex-layout": "^10.0.0-beta.32",
"@angular/forms": "~10.0.4",
"@angular/material": "^10.0.2",
"@angular/platform-browser": "~10.0.4",
"@angular/platform-browser-dynamic": "~10.0.4",
"@angular/router": "~10.0.4",
"@swimlane/ngx-charts": "^14.0.0",
"@types/linkify-it": "^2.1.0",
"angular-plotly.js": "^2.0.0",
"core-js": "^2.6.11",
"http-server": "^0.12.3",
"linkify-it": "^2.2.0",
"ngx-infinite-scroll": "^8.0.2",
"ngx-mat-select-search": "^2.2.0",
"ngx-mat-select-search": "^3.0.1",
"ngx-material-file-input": "^2.1.1",
"npm-run-all": "^4.1.5",
"plotly.js": "^1.54.5",
"rxjs": "^6.5.5",
"tslib": "^1.11.2",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular/cli": "~9.1.5",
"@angular/compiler-cli": "~9.1.6",
"@angular/language-service": "~9.1.6",
"@angular/cli": "~10.0.3",
"@angular/compiler-cli": "~10.0.4",
"@angular/language-service": "~10.0.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "^2.0.8",
"@types/node": "^12.12.38",
"codelyzer": "^5.2.2",
"codelyzer": "^6.0.0",
"cypress": "^4.10.0",
"cypress-file-upload": "^4.0.6",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^2.0.6",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.7.5"
"tslint": "~6.1.0",
"typescript": "~3.9.6"
}
}
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,42 @@ 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],
data: {breadcrumb: 'clustering', tooltip: 'Clustering list'},
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 +69,10 @@ const routes: Routes = [
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes,
{
preloadingStrategy: PreloadAllModules
})],
exports: [RouterModule]
})
export class AppRoutingModule {
......
import {BrowserModule, HammerModule} 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,44 +7,24 @@ 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,
BrowserAnimationsModule,
SharedModule,
ToolsModule,
HttpClientModule,
HttpClientXsrfModule.withOptions({
cookieName: 'XSRF-TOKEN',
headerName: 'X-XSRF-TOKEN',
}),
TaggerModule,
EmbeddingModule,
ProjectModule,
SearcherModule,
TorchTaggerModule,
ClusterModule,
ToolsModule,
AppRoutingModule,
],
providers: [
......
......@@ -83,7 +83,7 @@ export class AuthGuard implements CanActivate, CanActivateChild, CanLoad {
}
checkPermissions(user, route, state?): boolean {
checkPermissions(user: UserProfile, route: ActivatedRouteSnapshot, state?: RouterStateSnapshot): boolean {
if (route.data.role === USERROLES.SUPERUSER) {
return user.is_superuser;
}
......
import { Injectable } from '@angular/core';
import {Injectable} from '@angular/core';
import {environment} from '../../environments/environment';
import {HttpClient, HttpErrorResponse} from '@angular/common/http';
import {LogService} from './util/log.service';
......@@ -7,6 +7,7 @@ import {Health} from '../shared/types/Project';
import {catchError, tap} from 'rxjs/operators';
import {Index} from '../shared/types/Index';
import {ResultsWrapper} from '../shared/types/Generic';
import {CoreVariables} from '../shared/types/CoreVariables';
@Injectable({
providedIn: 'root'
......@@ -14,6 +15,7 @@ import {ResultsWrapper} from '../shared/types/Generic';
export class CoreService {
apiUrl = environment.apiHost + environment.apiBasePath;
constructor(private http: HttpClient,
private logService: LogService) {
}
......@@ -49,13 +51,13 @@ export class CoreService {
catchError(this.logService.handleError<{ message: string }>('editElasticIndex')));
}
getCoreVariables(): Observable<any[] | HttpErrorResponse> {
return this.http.get<any[]>(`${this.apiUrl}/core_variables/`).pipe(
getCoreVariables(): Observable<CoreVariables[] | HttpErrorResponse> {
return this.http.get<CoreVariables[]>(`${this.apiUrl}/core_variables/`).pipe(
tap(e => this.logService.logStatus(e, 'getCoreVariables')),
catchError(this.logService.handleError<any[]>('getCoreVariables')));
catchError(this.logService.handleError<CoreVariables[]>('getCoreVariables')));
}
patchCoreVariables(body, url): Observable<{ message: string } | HttpErrorResponse> {
patchCoreVariables(body: unknown, url: string): Observable<{ message: string } | HttpErrorResponse> {
return this.http.patch<{ message: string }>(url, body).pipe(
tap(e => this.logService.logStatus(e, 'patchCoreVariables')),
catchError(this.logService.handleError<{ message: string }>('patchCoreVariables')));
......
......@@ -33,7 +33,8 @@ export class ClusterService {
catchError(this.logService.handleError<unknown>('retrainCluster')));
}
createCluster(body, projectId): Observable<Cluster | HttpErrorResponse> {
// tslint:disable-next-line:no-any
createCluster(body: any, projectId: number): Observable<Cluster | HttpErrorResponse> {
return this.http.post<Cluster>(
`${this.apiUrl}/projects/${projectId}/clustering/`, body
).pipe(
......@@ -41,7 +42,8 @@ export class ClusterService {
catchError(this.logService.handleError<Cluster>('createCluster')));
}
editCluster(projectId, clusterId, body: any): Observable<Cluster | HttpErrorResponse> {
// tslint:disable-next-line:no-any
editCluster(projectId: number, clusterId: number, body: any): Observable<Cluster | HttpErrorResponse> {
return this.http.patch<Cluster>(
`${this.apiUrl}/projects/${projectId}/clustering/${clusterId}/`, body
).pipe(
......@@ -49,49 +51,51 @@ export class ClusterService {
catchError(this.logService.handleError<Cluster>('editCluster')));
}
bulkDeleteClusterings(projectId: number, body) {
bulkDeleteClusterings(projectId: number, body: { ids: number[]; }) {
return this.http.post<{ 'num_deleted': number, 'deleted_types': { string: number }[] }>
(`${this.apiUrl}/projects/${projectId}/clustering/bulk_delete/`, body).pipe(
tap(e => this.logService.logStatus(e, 'bulkDeleteClusterings')),
catchError(this.logService.handleError<unknown>('bulkDeleteClusterings')));
}
bulkDeleteClusters(projectId: number, clusteringId: number, body) {
bulkDeleteClusters(projectId: number, clusteringId: number, body: { ids: number[]; }) {
return this.http.post<{ 'num_deleted': number, 'deleted_types': { string: number }[] }>
(`${this.apiUrl}/projects/${projectId}/clustering/${clusteringId}/bulk_delete_clusters/`, body).pipe(
tap(e => this.logService.logStatus(e, 'bulkDeleteClusters')),
catchError(this.logService.handleError<unknown>('bulkDeleteClusters')));
}
bulkDeleteClusterDocuments(projectId: number, clusteringId: number, clusterId: number, body) {
bulkDeleteClusterDocuments(projectId: number, clusteringId: number, clusterId: number, body: { ids: number[]; }) {
return this.http.post<{ 'num_deleted': number, 'deleted_types': { string: number }[] }>
(`${this.apiUrl}/projects/${projectId}/clustering/${clusteringId}/clusters/${clusterId}/remove_documents/`, body).pipe(
tap(e => this.logService.logStatus(e, 'bulkDeleteClusterDocuments')),
catchError(this.logService.handleError<unknown>('bulkDeleteClusterDocuments')));
}
addDocumentsToCluster(projectId: number, clusteringId: number, clusterId: number, body) {
// tslint:disable-next-line:no-any
addDocumentsToCluster(projectId: number, clusteringId: number, clusterId: number, body: any) {
return this.http.post<unknown>
(`${this.apiUrl}/projects/${projectId}/clustering/${clusteringId}/clusters/${clusterId}/add_documents/`, body).pipe(
tap(e => this.logService.logStatus(e, 'addDocumentsToCluster')),
catchError(this.logService.handleError<unknown>('addDocumentsToCluster')));
}
expandCluster(projectId: number, clusteringId: number, clusterId: number, body) {
expandCluster(projectId: number, clusteringId: number, clusterId: number, body: { ids: string[]; }) {
return this.http.post<unknown>
(`${this.apiUrl}/projects/${projectId}/clustering/${clusteringId}/clusters/${clusterId}/expand_cluster/`, body).pipe(
tap(e => this.logService.logStatus(e, 'expandCluster')),
catchError(this.logService.handleError<unknown>('expandCluster')));
}
tagCluster(projectId: number, clusteringId: number, clusterId: number, body) {
tagCluster(projectId: number, clusteringId: number, clusterId: number, body: { fact: string; str_val: string; doc_path: string; }) {
return this.http.post<unknown>
(`${this.apiUrl}/projects/${projectId}/clustering/${clusteringId}/clusters/${clusterId}/tag_cluster/`, body).pipe(
tap(e => this.logService.logStatus(e, 'tagCluster')),
catchError(this.logService.handleError<unknown>('tagCluster')));
}
moreLikeCluster(projectId: number, clusteringId: number, clusterId: number, body): Observable<ClusterMoreLikeThis[] | HttpErrorResponse> {
moreLikeCluster(projectId: number, clusteringId: number, clusterId: number,
body: { size: number; include_meta: boolean; }): Observable<ClusterMoreLikeThis[] | HttpErrorResponse> {
return this.http.post<ClusterMoreLikeThis[]>
(`${this.apiUrl}/projects/${projectId}/clustering/${clusteringId}/clusters/${clusterId}/more_like_cluster/`, body).pipe(
tap(e => this.logService.logStatus(e, 'moreLikeCluster')),
......
......@@ -53,7 +53,7 @@ export class EmbeddingsGroupService {
catchError(this.logService.handleError<unknown>('getBrowseClustersOptions')));
}
browseClusters(projectId: number, clusterId: number, payload) {
browseClusters(projectId: number, clusterId: number, payload: unknown) {
return this.http.post(`${this.apiUrl}/projects/${projectId}/${this.apiEndpoint}/${clusterId}/browse_clusters/`, payload).pipe(
tap(e => this.logService.logStatus(e, 'browseClusters')),
catchError(this.logService.handleError<unknown>('browseClusters')));
......
......@@ -26,7 +26,7 @@ export class EmbeddingsService {
catchError(this.logService.handleError<ResultsWrapper<Embedding>>('getEmbeddings')));
}
createEmbedding(body, projectId): Observable<Embedding | HttpErrorResponse> {
createEmbedding(body: unknown, projectId: number): Observable<Embedding | HttpErrorResponse> {
return this.http.post<Embedding>(
`${this.apiUrl}/projects/${projectId}/embeddings/`, body
).pipe(
......@@ -34,7 +34,7 @@ export class EmbeddingsService {
catchError(this.logService.handleError<Embedding>('getEmbeddings')));
}
editEmbedding(body: {}, projectId, embeddingId): Observable<Embedding | HttpErrorResponse> {
editEmbedding(body: unknown, projectId: number, embeddingId: number): Observable<Embedding | HttpErrorResponse> {
return this.http.patch<Embedding>(
`${this.apiUrl}/projects/${projectId}/embeddings/${embeddingId}/`, body
).pipe(
......@@ -42,7 +42,7 @@ export class EmbeddingsService {
catchError(this.logService.handleError<Embedding>('editEmbedding')));
}
predict(body, projectId, embeddingId): Observable<EmbeddingPrediction[] | HttpErrorResponse> {
predict(body: unknown, projectId: number, embeddingId: number): Observable<EmbeddingPrediction[] | HttpErrorResponse> {
return this.http.post<EmbeddingPrediction[]>(
`${this.apiUrl}/projects/${projectId}/embeddings/${embeddingId}/predict_similar/`, body
).pipe(
......@@ -56,7 +56,7 @@ export class EmbeddingsService {
catchError(this.logService.handleError<string>('phrase')));
}
bulkDeleteEmbeddings(projectId: number, body) {
bulkDeleteEmbeddings(projectId: number, body: unknown) {
return this.http.post<{ 'num_deleted': number, 'deleted_types': { string: number }[] }>
(`${this.apiUrl}/projects/${projectId}/embeddings/bulk_delete/`, body).pipe(
tap(e => this.logService.logStatus(e, 'bulkDeleteEmbeddings')),
......
......@@ -23,14 +23,14 @@ export class RegexTaggerService {
catchError(this.logService.handleError<ResultsWrapper<RegexTagger>>('getRegexTaggers')));
}
bulkDeleteRegexTaggers(projectId: number, body) {
bulkDeleteRegexTaggers(projectId: number, body: unknown) {
return this.http.post<{ 'num_deleted': number, 'deleted_types': { string: number }[] }>
(`${this.apiUrl}/projects/${projectId}/regex_taggers/bulk_delete/`, body).pipe(
tap(e => this.logService.logStatus(e, 'bulkDeleteRegexTaggers')),
catchError(this.logService.handleError<unknown>('bulkDeleteRegexTaggers')));
}
createRegexTagger(projectId: number, body: {}): Observable<RegexTagger | HttpErrorResponse> {
createRegexTagger(projectId: number, body: unknown): Observable<RegexTagger | HttpErrorResponse> {
return this.http.post<RegexTagger>(
`${this.apiUrl}/projects/${projectId}/regex_taggers/`,
body
......@@ -39,7 +39,7 @@ export class RegexTaggerService {
catchError(this.logService.handleError<RegexTagger>('createRegexTagger')));
}
multiTagText(projectId: number, body: {}): Observable<unknown | HttpErrorResponse> {
multiTagText(projectId: number, body: unknown): Observable<unknown | HttpErrorResponse> {
return this.http.post<unknown>(
`${this.apiUrl}/projects/${projectId}/regex_taggers/multitag_text/`,
body
......
......@@ -25,7 +25,7 @@ export class TaggerGroupService {
catchError(this.logService.handleError<{count: number, results: TaggerGroup[]}>('getTaggerGroups')));
}
createTaggerGroup(body: {}, projectId: number): Observable<TaggerGroup | HttpErrorResponse> {
createTaggerGroup(body: unknown, projectId: number): Observable<TaggerGroup | HttpErrorResponse> {
return this.http.post<TaggerGroup>(
`${this.apiUrl}/projects/${projectId}/${this.apiEndpoint}/`,
body
......@@ -34,7 +34,7 @@ export class TaggerGroupService {
catchError(this.logService.handleError<TaggerGroup>('createTaggerGroup')));
}
editTaggerGroup(body: {}, projectId, taggerId): Observable<TaggerGroup | HttpErrorResponse> {
editTaggerGroup(body: unknown, projectId: number, taggerId: number): Observable<TaggerGroup | HttpErrorResponse> {
return this.http.patch<TaggerGroup>(
`${this.apiUrl}/projects/${projectId}/${this.apiEndpoint}/${taggerId}/`, body
).pipe(
......@@ -58,7 +58,7 @@ export class TaggerGroupService {
catchError(this.logService.handleError<HttpErrorResponse>('getModelsList')));
}
tagText(body: {}, projectId: number, taggerId):
tagText(body: unknown, projectId: number, taggerId: number):
Observable<{ probability: number, tag: string, tagger_id: number }[] | HttpErrorResponse> {
return this.http.post<{ probability: number, tag: string, tagger_id: number }[]>(
`${this.apiUrl}/projects/${projectId}/${this.apiEndpoint}/${taggerId}/tag_text/`,
......@@ -68,7 +68,7 @@ export class TaggerGroupService {
catchError(this.logService.handleError<{ probability: number, tag: string, tagger_id: number }[]>('tagText')));
}
tagDoc(body: {}, projectId: number, taggerId):
tagDoc(body: unknown, projectId: number, taggerId: number):
Observable<{ probability: number, tag: string, tagger_id: number }[] | HttpErrorResponse> {
return this.http.post<{ probability: number, tag: string, tagger_id: number }[]>(
`${this.apiUrl}/projects/${projectId}/${this.apiEndpoint}/${taggerId}/tag_doc/`,
......@@ -78,14 +78,14 @@ export class TaggerGroupService {
catchError(this.logService.handleError<{ probability: number, tag: string, tagger_id: number }[]>('tagDoc')));
}
tagRandomDocument(projectId: number, taggerId: number, body): Observable<unknown | HttpErrorResponse> {
tagRandomDocument(projectId: number, taggerId: number, body: unknown): Observable<unknown | HttpErrorResponse> {
return this.http.post(`${this.apiUrl}/projects/${projectId}/${this.apiEndpoint}/${taggerId}/tag_random_doc/`, body
).pipe(
tap(e => this.logService.logStatus(e, 'tagRandomDocument')),
catchError(this.logService.handleError('tagRandomDocument')));
}
bulkDeleteTaggerGroups(projectId: number, body: { ids: any[]; }) {
bulkDeleteTaggerGroups(projectId: number, body: unknown) {
return this.http.post<{'num_deleted': number, 'deleted_types': {string: number}[] }>
(`${this.apiUrl}/projects/${projectId}/${this.apiEndpoint}/bulk_delete/`, body).pipe(
tap(e => this.logService.logStatus(e, 'bulkDeleteTaggerGroups')),
......
......@@ -24,7 +24,7 @@ export class TaggerService {
catchError(this.logService.handleError<{ count: number, results: Tagger[] }>('getTaggers')));
}
createTagger(body: {}, projectId: number): Observable<Tagger | HttpErrorResponse> {
createTagger(body: unknown, projectId: number): Observable<Tagger | HttpErrorResponse> {
return this.http.post<Tagger>(
`${this.apiUrl}/projects/${projectId}/taggers/`,
body
......@@ -33,7 +33,7 @@ export class TaggerService {
catchError(this.logService.handleError<Tagger>('makeTagger')));
}
editTagger(body: {}, projectId, taggerId): Observable<Tagger | HttpErrorResponse> {
editTagger(body: unknown, projectId: number, taggerId: number): Observable<Tagger | HttpErrorResponse> {
return this.http.patch<Tagger>(
`${this.apiUrl}/projects/${projectId}/taggers/${taggerId}/`, body
).pipe(
......@@ -68,7 +68,7 @@ export class TaggerService {
catchError(this.logService.handleError<ListFeaturesResponse>('listFeatures')));
}
postStopWords(projectId: number, taggerId: number, payload): Observable<{ 'stop_words': string } | HttpErrorResponse> {
postStopWords(projectId: number, taggerId: number, payload: unknown): Observable<{ 'stop_words': string } | HttpErrorResponse> {
return this.http.post<{ 'stop_words': string }>(`${this.apiUrl}/projects/${projectId}/taggers/${taggerId}/stop_words/`, payload).pipe(
tap(e => this.logService.logStatus(e, 'postStopWords')),
catchError(this.logService.handleError<{ 'stop_words': string }>('postStopWords')));
......@@ -83,14 +83,14 @@ export class TaggerService {
catchError(this.logService.handleError<TaggerOptions>('getTaggerOptions')));
}
tagRandomDocument(projectId: number, taggerId: number, body: any): Observable<unknown | HttpErrorResponse> {
tagRandomDocument(projectId: number, taggerId: number, body: unknown): Observable<unknown | HttpErrorResponse> {
return this.http.post(`${this.apiUrl}/projects/${projectId}/taggers/${taggerId}/tag_random_doc/`, body
).pipe(
tap(e => this.logService.logStatus(e, 'tagRandomDocument')),
catchError(this.logService.handleError('tagRandomDocument')));
}
tagDocument(body: {}, projectId: number, taggerId): Observable<unknown | HttpErrorResponse> {
tagDocument(body: unknown, projectId: number, taggerId: number): Observable<unknown | HttpErrorResponse> {
return this.http.post<unknown>(
`${this.apiUrl}/projects/${projectId}/taggers/${taggerId}/tag_doc/`,
body
......@@ -99,7 +99,7 @@ export class TaggerService {
catchError(this.logService.handleError<unknown>('tagDocument')));
}
tagText(body: {}, projectId: number, taggerId): Observable<unknown | HttpErrorResponse> {
tagText(body: unknown, projectId: number, taggerId: number): Observable<unknown | HttpErrorResponse> {
return this.http.post<unknown>(
`${this.apiUrl}/projects/${projectId}/taggers/${taggerId}/tag_text/`,
body
......@@ -108,7 +108,7 @@ export class TaggerService {
catchError(this.logService.handleError<unknown>('tagText')));
}
taggerListFeatures(body: {}, projectId: number, taggerId: number): Observable<unknown | HttpErrorResponse> {
taggerListFeatures(body: unknown, projectId: number, taggerId: number): Observable<unknown | HttpErrorResponse> {
return this.http.post<unknown>(
`${this.apiUrl}/projects/${projectId}/taggers/${taggerId}/list_features/`,
body
......@@ -123,7 +123,7 @@ export class TaggerService {
catchError(this.logService.handleError<unknown>('deleteTagger')));
}
bulkDeleteTaggers(projectId: number, body) {
bulkDeleteTaggers(projectId: number, body: unknown) {
return this.http.post<{ 'num_deleted': number, 'deleted_types': { string: number }[] }>
(`${this.apiUrl}/projects/${projectId}/taggers/bulk_delete/`, body).pipe(
tap(e => this.logService.logStatus(e, 'bulkDeleteTaggers')),
......
......@@ -5,6 +5,7 @@ import {LogService} from '../../util/log.service';
import {Observable} from 'rxjs';
import {HttpClient, HttpErrorResponse} from '@angular/common/http';
import {catchError, tap} from 'rxjs/operators';
import {ResultsWrapper} from '../../../shared/types/Generic';
@Injectable({
providedIn: 'root'
......@@ -15,14 +16,14 @@ export class TorchTaggerService {
constructor(private http: HttpClient, private logService: LogService) {
}
getTorchTaggers(projectId: number, params = ''): Observable<{ count: number, results: TorchTagger[] } | HttpErrorResponse> {
return this.http.get<{ count: number, results: TorchTagger[] }>(`${this.apiUrl}/projects/${projectId}/torchtaggers/?${params}`,
getTorchTaggers(projectId: number, params = ''): Observable<ResultsWrapper<TorchTagger> | HttpErrorResponse> {
return this.http.get<ResultsWrapper<TorchTagger>>(`${this.apiUrl}/projects/${projectId}/torchtaggers/?${params}`,
).pipe(
tap(e => this.logService.logStatus(e, 'getTorchTaggers')),
catchError(this.logService.handleError<{ count: number, results: TorchTagger[] }>('getTorchTaggers')));
catchError(this.logService.handleError<ResultsWrapper<TorchTagger>>('getTorchTaggers')));
}
editTorchTagger(body: {}, projectId, taggerId): Observable<TorchTagger | HttpErrorResponse> {
editTorchTagger(body: unknown, projectId: number, taggerId: number): Observable<TorchTagger | HttpErrorResponse> {
return this.http.patch<TorchTagger>(
`${this.apiUrl}/projects/${projectId}/torchtaggers/${taggerId}/`, body
).pipe(
......@@ -30,7 +31,7 @@ export class TorchTaggerService {
catchError(this.logService.handleError<TorchTagger>('editTorchTagger')));
}
bulkDeleteTorchTaggers(projectId: number, body: { ids: number[]; }) {
bulkDeleteTorchTaggers(projectId: number, body: unknown) {
return this.http.post<{ 'num_deleted': number, 'deleted_types': { string: number }[] }>
(`${this.apiUrl}/projects/${projectId}/torchtaggers/bulk_delete/`, body).pipe(
tap(e => this.logService.logStatus(e, 'bulkDeleteTorchTaggers')),
......@@ -50,15 +51,15 @@ export class TorchTaggerService {
catchError(this.logService.handleError<unknown>('getTorchTaggerOptions')));
}
createTorchTagger(projectId: number, payload): Observable<TorchTagger> {
createTorchTagger(projectId: number, payload: unknown): Observable<TorchTagger> {
return this.http.post<TorchTagger>(`${this.apiUrl}/projects/${projectId}/torchtaggers/`, payload).pipe(
tap(e => this.logService.logStatus(e, 'createTorchTagger')),
catchError(this.logService.handleError<TorchTagger>('createTorchTagger')));
}
tagText(body: {}, projectId: number, taggerId): Observable<unknown | HttpErrorResponse> {
return this.http.post<unknown>(`${this.apiUrl}/projects/${projectId}/torchtaggers/${taggerId}/tag_text/`, body).pipe(
tagText(body: unknown, projectId: number, taggerId: number): Observable<{ result: boolean, probability: number } | HttpErrorResponse> {
return this.http.post<{ result: boolean, probability: number } >(`${this.apiUrl}/projects/${projectId}/torchtaggers/${taggerId}/tag_text/`, body).pipe(
tap(e => this.logService.logStatus(e, 'tagTorchText')),
catchError(this.logService.handleError<unknown>('tagTorchText')));
catchError(this.logService.handleError<{ result: boolean, probability: number } >('tagTorchText')));
}
}
......@@ -22,7 +22,7 @@ export class ProjectService {
catchError(this.logService.handleError<Project[]>('getProjects')));
}
createProject(body: {}): Observable<Project | HttpErrorResponse> {
createProject(body: unknown): Observable<Project | HttpErrorResponse> {
return this.http.post<Project>(
`${this.apiUrl}/projects/`,
body
......@@ -31,7 +31,7 @@ export class ProjectService {
catchError(this.logService.handleError<Project>('createProject')));
}
editProject(body: {}, projectId): Observable<Project | HttpErrorResponse> {
editProject(body: unknown, projectId: number): Observable<Project | HttpErrorResponse> {
return this.http.patch<Project>(
`${this.apiUrl}/projects/${projectId}/`,
body
......@@ -69,7 +69,7 @@ export class ProjectService {
catchError(this.logService.handleError<string[]>('projectFactValueAutoComplete')));
}
getProjectFacts(id: number, indices: any): Observable<ProjectFact[] | HttpErrorResponse> {
getProjectFacts(id: number, indices: unknown): Observable<ProjectFact[] | HttpErrorResponse> {
return this.http.post<ProjectFact[]>(
`${this.apiUrl}/projects/${id}/get_facts/`, {indices, output_type: false}
).pipe(
......
......@@ -15,11 +15,17 @@ import {UtilityFunctions} from '../../shared/UtilityFunctions';
providedIn: 'root'
})
export class ProjectStore {
// @ts-ignore
private projects$: BehaviorSubject<Project[] | null> = new BehaviorSubject(null);
// @ts-ignore
private selectedProject$: BehaviorSubject<Project | null> = new BehaviorSubject(null);
// @ts-ignore
private projectIndices$: BehaviorSubject<ProjectIndex[] | null> = new BehaviorSubject(null);
// @ts-ignore
private selectedProjectIndices$: BehaviorSubject<ProjectIndex[] | null> = new BehaviorSubject(null);
// @ts-ignore
private currentIndicesFacts$: BehaviorSubject<ProjectFact[] | null> = new BehaviorSubject(null);
// tslint:disable-next-line:variable-name
private _selectedProject: Project | null;
constructor(private projectService: ProjectService,
......@@ -36,11 +42,11 @@ export class ProjectStore {
}
refreshProjects() {
this.projectService.getProjects().subscribe((resp: Project[] | HttpErrorResponse) => {
this.projectService.getProjects().subscribe(resp => {
if (resp && !(resp instanceof HttpErrorResponse)) {
this.getLocalStorageProjectSelection(resp);
this.projects$.next(resp);
} else if (resp instanceof HttpErrorResponse) {
} else {
this.logService.snackBarError(resp, 5000);
}
});
......@@ -110,7 +116,7 @@ export class ProjectStore {
// side effects
private loadProjectFieldsAndFacts() {
this.getCurrentProject().pipe(skip(1), switchMap((project: Project) => {
this.getCurrentProject().pipe(skip(1), switchMap(project => {
this._selectedProject = project;
this.localStorageService.setCurrentlySelectedProject(project);
this.currentIndicesFacts$.next(null);
......@@ -120,7 +126,7 @@ export class ProjectStore {
return this.projectService.getProjectIndices(project.id);
}
return of(null);
})).subscribe((resp: any | HttpErrorResponse) => {
})).subscribe(resp => {
if (resp && !(resp instanceof HttpErrorResponse)) {
this.getLocalStorageIndicesSelection(this._selectedProject || 0, resp);
this.projectIndices$.next(UtilityFunctions.sortByStringProperty<ProjectIndex>(resp, y => y.index));
......@@ -128,7 +134,7 @@ export class ProjectStore {
this.logService.snackBarError(resp, 2000);
}
});
// todo distinct pipe ???
// todo distinct pipe ???
this.getSelectedProjectIndices().pipe(skip(1), distinctUntilChanged(), switchMap(projectIndices => {
if (this._selectedProject && projectIndices) {
this.setIndicesSelectionLocalStorage(this._selectedProject, projectIndices);
......@@ -136,7 +142,7 @@ export class ProjectStore {
} else {
return of(null);
}
})).subscribe((resp: any | HttpErrorResponse) => {
})).subscribe(resp => {
if (resp && !(resp instanceof HttpErrorResponse)) {
this.currentIndicesFacts$.next(resp);
} else if (resp instanceof HttpErrorResponse) {
......
......@@ -7,7 +7,6 @@ import {Constraint, ElasticsearchQueryStructure} from '../../searcher/searcher-s
import {catchError, tap} from 'rxjs/operators';
import {Observable} from 'rxjs';
import {SavedSearch} from '../../shared/types/SavedSearch';
import {ResultsWrapper} from '../../shared/types/Generic';
import {UtilityFunctions} from '../../shared/UtilityFunctions';
@Injectable({
......@@ -42,20 +41,20 @@ export class SearcherService {
catchError(this.logService.handleError<unknown>('saveSearch')));
}
search(body, projectId: number): Observable<ResultsWrapper<{ highlight: any, doc: any }> | HttpErrorResponse> {
return this.http.post<ResultsWrapper<{ highlight: any, doc: any }> | HttpErrorResponse>(`${this.apiUrl}/projects/${projectId}/search_by_query/`, body).pipe(
search(body: unknown, projectId: number): Observable<{ results: { highlight: unknown, doc: unknown }[], count: number, aggs?: unknown } | HttpErrorResponse> {
return this.http.post<{ results: { highlight: unknown, doc: unknown }[], count: number, aggs?: unknown }>(`${this.apiUrl}/projects/${projectId}/search_by_query/`, body).pipe(
tap(e => this.logService.logStatus(e, 'search')),
catchError(this.logService.handleError<ResultsWrapper<{ highlight: any, doc: any }> | HttpErrorResponse>('search')));
catchError(this.logService.handleError<{ results: { highlight: unknown, doc: unknown }[], count: number, aggs?: unknown }>('search')));
}
bulkDeleteSavedSearches(projectId: number, body) {
bulkDeleteSavedSearches(projectId: number, body: unknown) {
return this.http.post<{ 'num_deleted': number, 'deleted_types': { string: number }[] }>
(`${this.apiUrl}/projects/${projectId}/searches/bulk_delete/`, body).pipe(
tap(e => this.logService.logStatus(e, 'bulkDeleteSavedSearches')),
catchError(this.logService.handleError<unknown>('bulkDeleteSavedSearches')));
}
editSavedSearch(projectId: number, searchId: number, body): Observable<SavedSearch | HttpErrorResponse> {
editSavedSearch(projectId: number, searchId: number, body: unknown): Observable<SavedSearch | HttpErrorResponse> {
return this.http.patch<SavedSearch | HttpErrorResponse>
(`${this.apiUrl}/projects/${projectId}/searches/${searchId}/`, body).pipe(
tap(e => this.logService.logStatus(e, 'editSavedSearch')),
......
......@@ -4,6 +4,8 @@ import {catchError, tap} from 'rxjs/operators';
import {HttpClient, HttpErrorResponse, HttpEvent, HttpRequest} from '@angular/common/http';
import {LogService} from '../../util/log.service';
import {environment} from '../../../../environments/environment';
import {ResultsWrapper} from '../../../shared/types/Generic';
import {DatasetImport} from '../../../shared/types/tasks/DatasetImport';
@Injectable({
providedIn: 'root'
......@@ -15,19 +17,19 @@ export class DatasetImporterService {
private logService: LogService) {
}
getIndices(projectId: number, params = ''): Observable<{ count: number, results: unknown[] } | HttpErrorResponse> {
return this.http.get<{ count: number, results: unknown[] }>(`${this.apiUrl}/projects/${projectId}/dataset_imports/?${params}`).pipe(
getDatasetImports(projectId: number, params = ''): Observable<ResultsWrapper<DatasetImport> | HttpErrorResponse> {
return this.http.get<ResultsWrapper<DatasetImport>>(`${this.apiUrl}/projects/${projectId}/dataset_imports/?${params}`).pipe(
tap(e => this.logService.logStatus(e, 'getIndices')),
catchError(this.logService.handleError<{ count: number, results: unknown[] }>('getIndices')));
catchError(this.logService.handleError<ResultsWrapper<DatasetImport>>('getIndices')));
}
createIndex(body, projectId): Observable<HttpEvent<any>> {
createIndex(body: FormData, projectId: number): Observable<HttpEvent<unknown> | HttpErrorResponse> {
const request = new HttpRequest('POST', `${this.apiUrl}/projects/${projectId}/dataset_imports/`, body, {reportProgress: true});
return this.http.request(request).pipe(
catchError(this.logService.handleError<HttpEvent<any>>('createIndex')));
catchError(this.logService.handleError<HttpEvent<unknown>>('createIndex')));
}
bulkDeleteIndices(projectId: number, body) {
bulkDeleteIndices(projectId: number, body: { ids: number[]; }) {
return this.http.post<{ 'num_deleted': number, 'deleted_types': { string: number }[] }>
(`${this.apiUrl}/projects/${projectId}/dataset_imports/bulk_delete/`, body).pipe(
tap(e => this.logService.logStatus(e, 'bulkDeleteIndices')),
......@@ -39,10 +41,4 @@ export class DatasetImporterService {
tap(e => this.logService.logStatus(e, 'deleteIndex')),
catchError(this.logService.handleError<unknown>('deleteIndex')));
}
getImporterOptions(projectId: number) {
return this.http.options<any>(`${this.apiUrl}/projects/${projectId}/dataset_imports/`).pipe(
tap(e => this.logService.logStatus(e, 'getImporterOptions')),
catchError(this.logService.handleError<any>('getImporterOptions')));
}
}
......@@ -34,19 +34,19 @@ export class MLPService {
catchError(this.logService.handleError<ResultsWrapper<MLP>>('getMLPTasks')));
}
createMLPTask(projectId, body): Observable<MLP | HttpErrorResponse> {
createMLPTask(projectId: number, body: unknown): Observable<MLP | HttpErrorResponse> {
return this.http.post<MLP>(`${this.apiUrl}/projects/${projectId}/mlp_index/`, body).pipe(
tap(e => this.logService.logStatus(e, 'createMLPTask')),
catchError(this.logService.handleError<MLP>('createMLPTask')));
}
applyMLPText( body): Observable<unknown | HttpErrorResponse> {
applyMLPText(body: unknown): Observable<unknown | HttpErrorResponse> {
return this.http.post<unknown>(`${this.apiUrl}/mlp/texts/`, body).pipe(
tap(e => this.logService.logStatus(e, 'applyMLPText')),
catchError(this.logService.handleError<unknown>('applyMLPText')));
}
bulkDeleteMLPTasks(projectId: number, body) {
bulkDeleteMLPTasks(projectId: number, body: unknown) {
return this.http.post<{ 'num_deleted': number, 'deleted_types': { string: number }[] }>
(`${this.apiUrl}/projects/${projectId}/mlp_index/bulk_delete/`, body).pipe(
tap(e => this.logService.logStatus(e, 'bulkDeleteMLPTasks')),
......
......@@ -2,9 +2,10 @@ import {Injectable} from '@angular/core';
import {environment} from 'src/environments/environment';
import {LogService} from 'src/app/core/util/log.service';
import {Observable} from 'rxjs';
import {HttpErrorResponse, HttpClient} from '@angular/common/http';
import {HttpClient, HttpErrorResponse} from '@angular/common/http';
import {Reindexer} from 'src/app/shared/types/tools/Elastic';
import {tap, catchError} from 'rxjs/operators';
import {catchError, tap} from 'rxjs/operators';
import {ResultsWrapper} from '../../../shared/types/Generic';
@Injectable({