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
@@ -19,7 +19,6 @@ import { CommonModule } from '@angular/common';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
|
||||
import { AppsListComponent } from './apps-list.component';
|
||||
@@ -30,8 +29,7 @@ import { SelectAppsDialogComponent } from './select-apps-dialog-component';
|
||||
CommonModule,
|
||||
MaterialModule,
|
||||
FlexLayoutModule,
|
||||
TranslateModule,
|
||||
CoreModule
|
||||
CoreModule.forChild()
|
||||
],
|
||||
declarations: [
|
||||
AppsListComponent,
|
||||
|
@@ -26,7 +26,7 @@ import { CoreModule } from '@alfresco/adf-core';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CoreModule,
|
||||
CoreModule.forChild(),
|
||||
MaterialModule
|
||||
],
|
||||
declarations: [
|
||||
|
@@ -29,7 +29,7 @@ import {
|
||||
ContentService,
|
||||
setupTestBed
|
||||
} from '@alfresco/adf-core';
|
||||
import { ContentNodeDialogService, ContentNodeSelectorModule } from '@alfresco/adf-content-services';
|
||||
import { ContentNodeDialogService, ContentModule } from '@alfresco/adf-content-services';
|
||||
import { of } from 'rxjs';
|
||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||
import { ProcessTestingModule } from '../testing/process.testing.module';
|
||||
@@ -104,7 +104,10 @@ describe('AttachFileWidgetComponent', () => {
|
||||
let formService: FormService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [ProcessTestingModule, ContentNodeSelectorModule]
|
||||
imports: [
|
||||
ProcessTestingModule,
|
||||
ContentModule.forRoot()
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(async(() => {
|
||||
|
@@ -24,7 +24,7 @@ import { AttachFolderWidgetComponent } from './attach-folder-widget.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CoreModule,
|
||||
CoreModule.forChild(),
|
||||
MaterialModule
|
||||
],
|
||||
entryComponents: [
|
||||
|
@@ -17,11 +17,10 @@
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
import { DataColumnModule, DataTableModule } from '@alfresco/adf-core';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { PeopleComponent } from './components/people/people.component';
|
||||
import { PeopleListComponent } from './components/people-list/people-list.component';
|
||||
import { PeopleSearchComponent } from './components/people-search/people-search.component';
|
||||
@@ -35,11 +34,9 @@ import { PeopleSearchTitleDirective } from './directives/people-search-title.dir
|
||||
imports: [
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
DataColumnModule,
|
||||
DataTableModule,
|
||||
MaterialModule,
|
||||
CommonModule,
|
||||
TranslateModule
|
||||
CoreModule.forChild()
|
||||
],
|
||||
declarations: [
|
||||
PeopleComponent,
|
||||
|
@@ -17,23 +17,19 @@
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { DataColumnModule, DataTableModule, CommentsModule } from '@alfresco/adf-core';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
|
||||
import { ProcessCommentsComponent } from './process-comments.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
DataColumnModule,
|
||||
DataTableModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
MaterialModule,
|
||||
CommonModule,
|
||||
TranslateModule,
|
||||
CommentsModule
|
||||
CoreModule.forChild()
|
||||
],
|
||||
declarations: [
|
||||
ProcessCommentsComponent
|
||||
|
@@ -19,11 +19,9 @@ import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { ProcessCommentsModule } from '../process-comments/process-comments.module';
|
||||
import { CardViewModule, DataColumnModule, DataTableModule, DirectiveModule, PipeModule } from '@alfresco/adf-core';
|
||||
import { TaskListModule } from '../task-list/task-list.module';
|
||||
import { PeopleModule } from '../people/people.module';
|
||||
import { ContentWidgetModule } from '../content-widget/content-widget.module';
|
||||
@@ -39,18 +37,12 @@ import { StartProcessInstanceComponent } from './components/start-process.compon
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
DataTableModule,
|
||||
CoreModule,
|
||||
TaskListModule,
|
||||
MaterialModule,
|
||||
FlexLayoutModule,
|
||||
TranslateModule,
|
||||
CardViewModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
PipeModule,
|
||||
DataColumnModule,
|
||||
DirectiveModule,
|
||||
CoreModule.forChild(),
|
||||
TaskListModule,
|
||||
PeopleModule,
|
||||
ContentWidgetModule,
|
||||
ProcessCommentsModule
|
||||
|
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
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, CommentsModule } from '@alfresco/adf-core';
|
||||
import { CoreModule, TRANSLATION_PROVIDER } from '@alfresco/adf-core';
|
||||
|
||||
import { MaterialModule } from './material.module';
|
||||
|
||||
@@ -30,12 +30,26 @@ import { AttachmentModule } from './attachment/attachment.module';
|
||||
import { PeopleModule } from './people/people.module';
|
||||
import { ProcessService } from './process-list/services/process.service';
|
||||
import { ProcessFilterService } from './process-list/services/process-filter.service';
|
||||
import { TaskListService } from './task-list/services/tasklist.service';
|
||||
import { TaskFilterService } from './task-list/services/task-filter.service';
|
||||
import { TaskUploadService } from './task-list/services/task-upload.service';
|
||||
import { ProcessUploadService } from './task-list/services/process-upload.service';
|
||||
|
||||
export function providers() {
|
||||
return [
|
||||
ProcessService,
|
||||
ProcessFilterService,
|
||||
TaskListService,
|
||||
TaskFilterService,
|
||||
TaskUploadService,
|
||||
ProcessUploadService
|
||||
];
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CoreModule,
|
||||
CoreModule.forChild(),
|
||||
CommonModule,
|
||||
CommentsModule,
|
||||
ProcessCommentsModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
@@ -47,6 +61,7 @@ import { ProcessFilterService } from './process-list/services/process-filter.ser
|
||||
PeopleModule
|
||||
],
|
||||
providers: [
|
||||
...providers(),
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
@@ -54,13 +69,10 @@ import { ProcessFilterService } from './process-list/services/process-filter.ser
|
||||
name: 'adf-process-services',
|
||||
source: 'assets/adf-process-services'
|
||||
}
|
||||
},
|
||||
ProcessService,
|
||||
ProcessFilterService
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
CommonModule,
|
||||
CommentsModule,
|
||||
ProcessCommentsModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
@@ -72,4 +84,54 @@ import { ProcessFilterService } from './process-list/services/process-filter.ser
|
||||
]
|
||||
})
|
||||
export class ProcessModule {
|
||||
static forRoot(): ModuleWithProviders {
|
||||
return {
|
||||
ngModule: ProcessModule,
|
||||
providers: [
|
||||
...providers(),
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'adf-process-services',
|
||||
source: 'assets/adf-process-services'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
static forChild(): ModuleWithProviders {
|
||||
return {
|
||||
ngModule: ProcessModuleLazy
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CoreModule.forChild(),
|
||||
CommonModule,
|
||||
ProcessCommentsModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
MaterialModule,
|
||||
ProcessListModule,
|
||||
TaskListModule,
|
||||
AppsListModule,
|
||||
AttachmentModule,
|
||||
PeopleModule
|
||||
],
|
||||
exports: [
|
||||
CommonModule,
|
||||
ProcessCommentsModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
ProcessListModule,
|
||||
TaskListModule,
|
||||
AppsListModule,
|
||||
AttachmentModule,
|
||||
PeopleModule
|
||||
]
|
||||
})
|
||||
export class ProcessModuleLazy {}
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { ProcessCommentsModule } from '../process-comments/process-comments.module';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
@@ -26,10 +25,6 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { PeopleModule } from '../people/people.module';
|
||||
import { ContentWidgetModule } from '../content-widget/content-widget.module';
|
||||
import { TaskUploadService } from './services/task-upload.service';
|
||||
import { ProcessUploadService } from './services/process-upload.service';
|
||||
import { TaskListService } from './services/tasklist.service';
|
||||
import { TaskFilterService } from './services/task-filter.service';
|
||||
|
||||
import { ChecklistComponent } from './components/checklist.component';
|
||||
import { NoTaskDetailsTemplateDirective } from './components/no-task-detail-template.directive';
|
||||
@@ -44,13 +39,12 @@ import { AttachFormComponent } from './components/attach-form.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CoreModule,
|
||||
CommonModule,
|
||||
FlexLayoutModule,
|
||||
MaterialModule,
|
||||
TranslateModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
CoreModule.forChild(),
|
||||
PeopleModule,
|
||||
ProcessCommentsModule,
|
||||
ContentWidgetModule
|
||||
@@ -67,12 +61,6 @@ import { AttachFormComponent } from './components/attach-form.component';
|
||||
TaskStandaloneComponent,
|
||||
AttachFormComponent
|
||||
],
|
||||
providers: [
|
||||
TaskListService,
|
||||
TaskFilterService,
|
||||
TaskUploadService,
|
||||
ProcessUploadService
|
||||
],
|
||||
exports: [
|
||||
NoTaskDetailsTemplateDirective,
|
||||
TaskFiltersComponent,
|
||||
|
@@ -24,11 +24,16 @@ import {
|
||||
AppConfigService,
|
||||
AppConfigServiceMock,
|
||||
TranslationService,
|
||||
TranslationMock
|
||||
TranslationMock,
|
||||
CoreModule
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
@NgModule({
|
||||
imports: [NoopAnimationsModule, ProcessModule],
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot(),
|
||||
ProcessModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
|
Reference in New Issue
Block a user