RED-4718: update api path interceptor & help-mode module
This commit is contained in:
parent
c7de2dab42
commit
5668e36236
@ -5,17 +5,14 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common/http';
|
||||
import { BaseScreenComponent } from '@components/base-screen/base-screen.component';
|
||||
import { ApiPathInterceptor } from '@utils/api-path-interceptor';
|
||||
import { MissingTranslationHandler, TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
AuthModule as IqserAuthModule,
|
||||
BASE_HREF,
|
||||
CachingModule,
|
||||
CommonUiModule,
|
||||
HELP_DOCS,
|
||||
IqserHelpModeModule,
|
||||
LanguageService,
|
||||
MANUAL_BASE_URL,
|
||||
MAX_RETRIES_ON_SERVER_ERROR,
|
||||
SERVER_ERROR_SKIP_PATHS,
|
||||
ServerErrorInterceptor,
|
||||
@ -91,6 +88,7 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
existingRoleGuard: RedRoleGuard,
|
||||
}),
|
||||
CachingModule.forRoot(UI_CACHES),
|
||||
IqserHelpModeModule.forRoot(links),
|
||||
PdfViewerModule,
|
||||
ToastrModule.forRoot({
|
||||
closeButton: true,
|
||||
@ -159,11 +157,6 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
provide: ErrorHandler,
|
||||
useClass: GlobalErrorHandler,
|
||||
},
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
multi: true,
|
||||
useClass: ApiPathInterceptor,
|
||||
},
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
multi: true,
|
||||
@ -191,15 +184,6 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
provide: MissingTranslationHandler,
|
||||
useClass: REDMissingTranslationHandler,
|
||||
},
|
||||
{
|
||||
provide: HELP_DOCS,
|
||||
useValue: links,
|
||||
},
|
||||
{
|
||||
provide: MANUAL_BASE_URL,
|
||||
useFactory: (configService: ConfigService) => configService.values.MANUAL_BASE_URL,
|
||||
deps: [ConfigService],
|
||||
},
|
||||
{
|
||||
provide: MAX_RETRIES_ON_SERVER_ERROR,
|
||||
useFactory: (configService: ConfigService) => configService.values.MAX_RETRIES_ON_SERVER_ERROR,
|
||||
|
||||
@ -6,13 +6,14 @@ import { TableItemComponent } from './components/table-item/table-item.component
|
||||
import { SharedModule } from '@shared/shared.module';
|
||||
import { ConfigService } from './services/config.service';
|
||||
import { SharedDossiersModule } from '../shared-dossiers/shared-dossiers.module';
|
||||
import { IqserHelpModeModule } from '@iqser/common-ui';
|
||||
|
||||
const components = [TableItemComponent];
|
||||
const screens = [ArchivedDossiersScreenComponent];
|
||||
|
||||
@NgModule({
|
||||
declarations: [...components, ...screens],
|
||||
imports: [CommonModule, ArchiveRoutingModule, SharedModule, SharedDossiersModule],
|
||||
imports: [CommonModule, ArchiveRoutingModule, SharedModule, SharedDossiersModule, IqserHelpModeModule],
|
||||
providers: [ConfigService],
|
||||
})
|
||||
export class ArchiveModule {}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { IqserIconsModule } from '@iqser/common-ui';
|
||||
import { IqserHelpModeModule, IqserIconsModule } from '@iqser/common-ui';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { DossiersListingScreenComponent } from './screen/dossiers-listing-screen.component';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
@ -32,6 +32,14 @@ const routes: Routes = [
|
||||
DossierDocumentsStatusComponent,
|
||||
],
|
||||
providers: [ConfigService],
|
||||
imports: [RouterModule.forChild(routes), CommonModule, SharedModule, SharedDossiersModule, IqserIconsModule, TranslateModule],
|
||||
imports: [
|
||||
RouterModule.forChild(routes),
|
||||
CommonModule,
|
||||
SharedModule,
|
||||
SharedDossiersModule,
|
||||
IqserIconsModule,
|
||||
TranslateModule,
|
||||
IqserHelpModeModule,
|
||||
],
|
||||
})
|
||||
export class DossiersListingModule {}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { IqserIconsModule } from '@iqser/common-ui';
|
||||
import { IqserHelpModeModule, IqserIconsModule } from '@iqser/common-ui';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { SharedModule } from '@shared/shared.module';
|
||||
@ -93,6 +93,7 @@ const components = [
|
||||
IqserIconsModule,
|
||||
TranslateModule,
|
||||
OverlayModule,
|
||||
IqserHelpModeModule,
|
||||
],
|
||||
providers: [FilePreviewDialogService, ManualRedactionService, DocumentUnloadedGuard],
|
||||
})
|
||||
|
||||
@ -13,6 +13,7 @@ import { EditDossierTeamComponent } from './dialogs/edit-dossier-dialog/edit-dos
|
||||
import { DateColumnComponent } from './components/date-column/date-column.component';
|
||||
import { FileAssignService } from './services/file-assign.service';
|
||||
import { DictionaryDetailsDialogComponent } from './dialogs/edit-dossier-dialog/dictionary/dictionary-details-dialog/dictionary-details-dialog.component';
|
||||
import { IqserHelpModeModule } from '@iqser/common-ui';
|
||||
|
||||
const components = [
|
||||
FileActionsComponent,
|
||||
@ -31,6 +32,6 @@ const services = [DossiersDialogService, FileAssignService];
|
||||
declarations: [...components, ...dialogs],
|
||||
exports: [...components, ...dialogs],
|
||||
providers: [...services],
|
||||
imports: [CommonModule, SharedModule],
|
||||
imports: [CommonModule, SharedModule, IqserHelpModeModule],
|
||||
})
|
||||
export class SharedDossiersModule {}
|
||||
|
||||
@ -10,7 +10,7 @@ import { IconsModule } from '../icons/icons.module';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { AnnotationIconComponent } from './components/annotation-icon/annotation-icon.component';
|
||||
import { DonutChartComponent } from './components/donut-chart/donut-chart.component';
|
||||
import { CommonUiModule } from '@iqser/common-ui';
|
||||
import { CommonUiModule, IqserHelpModeModule } from '@iqser/common-ui';
|
||||
import { SelectComponent } from './components/select/select.component';
|
||||
import { NavigateLastDossiersScreenDirective } from './directives/navigate-last-dossiers-screen.directive';
|
||||
import { DictionaryManagerComponent } from './components/dictionary-manager/dictionary-manager.component';
|
||||
@ -72,7 +72,7 @@ const modules = [MatConfigModule, ScrollingModule, IconsModule, FormsModule, Rea
|
||||
|
||||
@NgModule({
|
||||
declarations: [...components, ...utils, EditorComponent],
|
||||
imports: [CommonModule, CommonUiModule, ...modules, MonacoEditorModule, TranslateModule, RouterModule],
|
||||
imports: [CommonModule, CommonUiModule, ...modules, MonacoEditorModule, TranslateModule, RouterModule, IqserHelpModeModule],
|
||||
exports: [...modules, CommonUiModule, ...components, ...utils],
|
||||
providers: [
|
||||
...services,
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
||||
import { Inject, Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { BASE_HREF } from '@iqser/common-ui';
|
||||
|
||||
@Injectable()
|
||||
export class ApiPathInterceptor implements HttpInterceptor {
|
||||
constructor(@Inject(BASE_HREF) private readonly _baseHref: string, private readonly _configService: ConfigService) {}
|
||||
|
||||
intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||
if (!req.url.startsWith('/assets')) {
|
||||
const apiUrl = `${this._configService.values.API_URL}${req.url}`;
|
||||
return next.handle(req.clone({ url: apiUrl }));
|
||||
}
|
||||
const url = this._baseHref + req.url;
|
||||
return next.handle(req.clone({ url }));
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
export * from './sorters/redaction-filter-sorter';
|
||||
export * from './sorters/super-type-sorter';
|
||||
|
||||
export * from './api-path-interceptor';
|
||||
export * from './configuration.initializer';
|
||||
export * from './date-inputs-utils';
|
||||
export * from './file-download-utils';
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 91777db7fb4e69dad013e724e1ce88ecef7f16c1
|
||||
Subproject commit 6bd4b7e934b4c77a1b9a873b3e26e3e926996fbb
|
||||
Loading…
x
Reference in New Issue
Block a user