[ADF-3380] lazy loading fixes (#3609)

* lazy loading file viewer

* fix issue with CoreModule referencing

* fix issue with app config and lazy loading

* test fixes

* fix import

* lazy loading workaround for content module

* fix providers for lazy loading

* fix tests

* lazy loading for Process Services lib

* lazy loading for Insights, module cleanup

* fix issue with Translate module, optimise imports

* lazy-load blob viewer (demo shell)

* remove duplicate pdf init

* update to more stable pdfjs

* fix license header

* fix lint issues

* fix test import

* fix pdf version
This commit is contained in:
Denys Vuika
2018-08-07 23:03:20 +01:00
committed by Eugenio Romano
parent f3a513ca72
commit f606149344
55 changed files with 498 additions and 300 deletions

View File

@@ -16,7 +16,7 @@
*/
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { NgModule, ModuleWithProviders } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CoreModule, TRANSLATION_PROVIDER } from '@alfresco/adf-core';
@@ -24,10 +24,23 @@ import { DiagramsModule } from './diagram/diagram.module';
import { AnalyticsProcessModule } from './analytics-process/analytics-process.module';
import { MaterialModule } from './material.module';
import { DiagramsService } from './diagram/services/diagrams.service';
import { DiagramColorService } from './diagram/services/diagram-color.service';
import { RaphaelService } from './diagram/components/raphael/raphael.service';
import { AnalyticsService } from './analytics-process/services/analytics.service';
export function providers() {
return [
AnalyticsService,
DiagramsService,
DiagramColorService,
RaphaelService
];
}
@NgModule({
imports: [
CoreModule,
CoreModule.forChild(),
CommonModule,
FormsModule,
ReactiveFormsModule,
@@ -36,6 +49,7 @@ import { MaterialModule } from './material.module';
AnalyticsProcessModule
],
providers: [
...providers(),
{
provide: TRANSLATION_PROVIDER,
multi: true,
@@ -46,7 +60,6 @@ import { MaterialModule } from './material.module';
}
],
exports: [
CoreModule,
CommonModule,
FormsModule,
ReactiveFormsModule,
@@ -56,4 +69,47 @@ import { MaterialModule } from './material.module';
]
})
export class InsightsModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: InsightsModule,
providers: [
...providers(),
{
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: 'adf-insights',
source: 'assets/adf-insights'
}
}
]
};
}
static forChild(): ModuleWithProviders {
return {
ngModule: InsightsModuleLazy
};
}
}
@NgModule({
imports: [
CoreModule.forChild(),
CommonModule,
FormsModule,
ReactiveFormsModule,
MaterialModule,
DiagramsModule,
AnalyticsProcessModule
],
exports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
MaterialModule,
DiagramsModule,
AnalyticsProcessModule
]
})
export class InsightsModuleLazy {}