mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
committed by
Eugenio Romano
parent
f3a513ca72
commit
f606149344
@@ -18,13 +18,12 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { DiagramsModule } from '../diagram/diagram.module';
|
||||
import { MaterialModule } from '../material.module';
|
||||
|
||||
import { ChartsModule } from 'ng2-charts';
|
||||
|
||||
import { ToolbarModule, ButtonsMenuModule } from '@alfresco/adf-core';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { AnalyticsGeneratorComponent } from './components/analytics-generator.component';
|
||||
import { AnalyticsReportHeatMapComponent } from './components/analytics-report-heat-map.component';
|
||||
import { AnalyticsReportListComponent } from './components/analytics-report-list.component';
|
||||
@@ -37,7 +36,6 @@ import { DropdownWidgetAanalyticsComponent } from './components/widgets/dropdown
|
||||
import { DurationWidgetComponent } from './components/widgets/duration/duration.widget';
|
||||
import { NumberWidgetAanlyticsComponent } from './components/widgets/number/number.widget';
|
||||
|
||||
import { AnalyticsService } from './services/analytics.service';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
|
||||
@NgModule({
|
||||
@@ -48,10 +46,8 @@ import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
ChartsModule,
|
||||
DiagramsModule,
|
||||
MaterialModule,
|
||||
TranslateModule,
|
||||
ToolbarModule,
|
||||
FlexLayoutModule,
|
||||
ButtonsMenuModule
|
||||
CoreModule.forChild()
|
||||
],
|
||||
declarations: [
|
||||
AnalyticsComponent,
|
||||
@@ -65,9 +61,6 @@ import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
CheckboxWidgetAanalyticsComponent,
|
||||
DateRangeWidgetComponent
|
||||
],
|
||||
providers: [
|
||||
AnalyticsService
|
||||
],
|
||||
exports: [
|
||||
AnalyticsComponent,
|
||||
AnalyticsReportListComponent,
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { DiagramEndEventComponent } from './components/events/diagram-end-event.component';
|
||||
import { DiagramEventComponent } from './components/events/diagram-event.component';
|
||||
@@ -83,11 +82,6 @@ import { DiagramLanesComponent } from './components/swimlanes/diagram-lanes.comp
|
||||
|
||||
import { DiagramTooltipComponent } from './components/tooltip/diagram-tooltip.component';
|
||||
|
||||
import { DiagramColorService } from './services/diagram-color.service';
|
||||
import { DiagramsService } from './services/diagrams.service';
|
||||
|
||||
import { RaphaelService } from './components/raphael/raphael.service';
|
||||
|
||||
import { RaphaelCircleDirective } from './components/raphael/raphael-circle.component';
|
||||
import { RaphaelCrossDirective } from './components/raphael/raphael-cross.component';
|
||||
import { RaphaelFlowArrowDirective } from './components/raphael/raphael-flow-arrow.component';
|
||||
@@ -115,11 +109,12 @@ import { RaphaelIconServiceDirective } from './components/raphael/icons/raphael-
|
||||
import { RaphaelIconSignalDirective } from './components/raphael/icons/raphael-icon-signal.component';
|
||||
import { RaphaelIconTimerDirective } from './components/raphael/icons/raphael-icon-timer.component';
|
||||
import { RaphaelIconUserDirective } from './components/raphael/icons/raphael-icon-user.component';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
TranslateModule
|
||||
CoreModule.forChild()
|
||||
],
|
||||
declarations: [
|
||||
DiagramComponent,
|
||||
@@ -202,11 +197,6 @@ import { RaphaelIconUserDirective } from './components/raphael/icons/raphael-ico
|
||||
RaphaelIconSignalDirective,
|
||||
RaphaelIconMessageDirective
|
||||
],
|
||||
providers: [
|
||||
DiagramsService,
|
||||
DiagramColorService,
|
||||
RaphaelService
|
||||
],
|
||||
exports: [
|
||||
DiagramComponent,
|
||||
DiagramEventComponent,
|
||||
|
@@ -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 {}
|
||||
|
@@ -24,11 +24,16 @@ import {
|
||||
AppConfigService,
|
||||
AppConfigServiceMock,
|
||||
TranslationService,
|
||||
TranslationMock
|
||||
TranslationMock,
|
||||
CoreModule
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
@NgModule({
|
||||
imports: [NoopAnimationsModule, InsightsModule],
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot(),
|
||||
InsightsModule.forRoot()
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
|
Reference in New Issue
Block a user