mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2531] support for AoT and production builds (#3110)
* fix translation for Core module * fix datatable reference * fix issue with duplicate pipe and i18n error * fixes for upload service cutomisation (process services) * demo shell fixes * fix search component * remove unused declaration * update tests * remove fdescribe
This commit is contained in:
committed by
Eugenio Romano
parent
7358563b09
commit
5c4a18dd48
@@ -19,13 +19,23 @@ import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
|
||||
import { ProcessInstance, ProcessService ,
|
||||
ProcessAttachmentListComponent, ProcessUploadService } from '@alfresco/adf-process-services';
|
||||
import { UploadService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
|
||||
export function processUploadServiceFactory(api: AlfrescoApiService, config: AppConfigService) {
|
||||
return new ProcessUploadService(api, config);
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-process-attachments',
|
||||
templateUrl: './process-attachments.component.html',
|
||||
styleUrls: ['./process-attachments.component.css'],
|
||||
providers: [
|
||||
{ provide: UploadService, useClass: ProcessUploadService }
|
||||
{
|
||||
provide: UploadService,
|
||||
useFactory: (processUploadServiceFactory),
|
||||
deps: [AlfrescoApiService, AppConfigService]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
|
@@ -121,6 +121,7 @@
|
||||
<adf-accordion-group [heading]="'Processes'" [isSelected]="true" [isOpen]="true"
|
||||
[headingIcon]="'assessment'">
|
||||
<adf-process-instance-filters
|
||||
#activitiprocessfilter
|
||||
[filterParam]="{index: 0}"
|
||||
[appId]="appId"
|
||||
(filterClick)="onProcessFilterClick($event)"
|
||||
@@ -163,6 +164,7 @@
|
||||
</div>
|
||||
<div class="adf-grid-item adf-processes-details" *ngIf="!isStartProcessMode()" fxFlex.gt-md="1 1 auto">
|
||||
<adf-process-instance-details
|
||||
#activitiprocessdetails
|
||||
[processInstanceId]="currentProcessInstanceId"
|
||||
(processCancelled)="processCancelled()"
|
||||
(showProcessDiagram)="onShowProcessDiagram($event)"
|
||||
@@ -190,6 +192,7 @@
|
||||
<div class="adf-grid-item adf-processes-start" fxFlex.gt-md="1 1 auto"
|
||||
*ngIf="isStartProcessMode()">
|
||||
<adf-start-process
|
||||
#activitiStartProcess
|
||||
[appId]="appId"
|
||||
[name]="defaultProcessName"
|
||||
[processDefinitionName]="defaultProcessDefinitionName"
|
||||
|
@@ -75,34 +75,34 @@ const currentTaskIdNew = '__NEW__';
|
||||
})
|
||||
export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
|
||||
@ViewChild(TaskFiltersComponent)
|
||||
@ViewChild('activitifilter')
|
||||
activitifilter: TaskFiltersComponent;
|
||||
|
||||
@ViewChild(PaginationComponent)
|
||||
@ViewChild('processListPagination')
|
||||
processListPagination: PaginationComponent;
|
||||
|
||||
@ViewChild(PaginationComponent)
|
||||
@ViewChild('taskListPagination')
|
||||
taskListPagination: PaginationComponent;
|
||||
|
||||
@ViewChild(TaskListComponent)
|
||||
@ViewChild('taskList')
|
||||
taskList: TaskListComponent;
|
||||
|
||||
@ViewChild(ProcessFiltersComponent)
|
||||
@ViewChild('activitiprocessfilter')
|
||||
activitiprocessfilter: ProcessFiltersComponent;
|
||||
|
||||
@ViewChild(ProcessInstanceListComponent)
|
||||
@ViewChild('processList')
|
||||
processList: ProcessInstanceListComponent;
|
||||
|
||||
@ViewChild(ProcessInstanceDetailsComponent)
|
||||
@ViewChild('activitiprocessdetails')
|
||||
activitiprocessdetails: ProcessInstanceDetailsComponent;
|
||||
|
||||
@ViewChild(TaskDetailsComponent)
|
||||
@ViewChild('activitidetails')
|
||||
activitidetails: TaskDetailsComponent;
|
||||
|
||||
@ViewChild(StartProcessInstanceComponent)
|
||||
@ViewChild('activitiStartProcess')
|
||||
activitiStartProcess: StartProcessInstanceComponent;
|
||||
|
||||
@ViewChild(AnalyticsReportListComponent)
|
||||
@ViewChild('analyticsreportlist')
|
||||
analyticsreportlist: AnalyticsReportListComponent;
|
||||
|
||||
@Input()
|
||||
|
@@ -17,14 +17,22 @@
|
||||
|
||||
import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
|
||||
import { TaskListService, TaskAttachmentListComponent, TaskDetailsModel, TaskUploadService } from '@alfresco/adf-process-services';
|
||||
import { UploadService } from '@alfresco/adf-core';
|
||||
import { UploadService, AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
|
||||
|
||||
export function taskUploadServiceFactory(api: AlfrescoApiService, config: AppConfigService) {
|
||||
return new TaskUploadService(api, config);
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-task-attachments',
|
||||
templateUrl: './task-attachments.component.html',
|
||||
styleUrls: ['./task-attachments.component.css'],
|
||||
providers: [
|
||||
{ provide: UploadService, useClass: TaskUploadService }
|
||||
{
|
||||
provide: UploadService,
|
||||
useFactory: (taskUploadServiceFactory),
|
||||
deps: [AlfrescoApiService, AppConfigService]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
|
@@ -20,7 +20,7 @@ import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { CardViewModule , FileSizePipe } from '@alfresco/adf-core';
|
||||
import { CardViewModule } from '@alfresco/adf-core';
|
||||
import { ContentMetadataComponent } from './components/content-metadata/content-metadata.component';
|
||||
import { ContentMetadataCardComponent } from './components/content-metadata-card/content-metadata-card.component';
|
||||
import { PropertyDescriptorsService } from './services/property-descriptors.service';
|
||||
@@ -50,8 +50,7 @@ import { PropertyGroupTranslatorService } from './services/property-groups-trans
|
||||
PropertyDescriptorsService,
|
||||
ContentMetadataConfigFactory,
|
||||
BasicPropertiesService,
|
||||
PropertyGroupTranslatorService,
|
||||
FileSizePipe
|
||||
PropertyGroupTranslatorService
|
||||
]
|
||||
})
|
||||
export class ContentMetadataModule {}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<adf-datatable
|
||||
#dataTable
|
||||
[selectionMode]="selectionMode"
|
||||
[data]="data"
|
||||
[actions]="contentActions"
|
||||
|
@@ -229,7 +229,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
@Output()
|
||||
error: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
@ViewChild(DataTableComponent)
|
||||
@ViewChild('dataTable')
|
||||
dataTable: DataTableComponent;
|
||||
|
||||
errorMessage;
|
||||
|
@@ -21,7 +21,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MaterialModule } from '../material.module';
|
||||
|
||||
import { PipeModule, SearchService } from '@alfresco/adf-core';
|
||||
import { PipeModule } from '@alfresco/adf-core';
|
||||
|
||||
import { SearchTriggerDirective } from './components/search-trigger.directive';
|
||||
|
||||
@@ -36,10 +36,6 @@ export const ALFRESCO_SEARCH_DIRECTIVES: any[] = [
|
||||
EmptySearchResultComponent
|
||||
];
|
||||
|
||||
export const ALFRESCO_SEARCH_PROVIDERS: any[] = [
|
||||
SearchService
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
@@ -52,9 +48,6 @@ export const ALFRESCO_SEARCH_PROVIDERS: any[] = [
|
||||
declarations: [
|
||||
...ALFRESCO_SEARCH_DIRECTIVES
|
||||
],
|
||||
providers: [
|
||||
...ALFRESCO_SEARCH_PROVIDERS
|
||||
],
|
||||
exports: [
|
||||
...ALFRESCO_SEARCH_DIRECTIVES
|
||||
]
|
||||
|
@@ -71,7 +71,7 @@ import { SitesService } from './services/sites.service';
|
||||
import { StorageService } from './services/storage.service';
|
||||
import { ThumbnailService } from './services/thumbnail.service';
|
||||
import { TranslateLoaderService } from './services/translate-loader.service';
|
||||
import { TRANSLATION_PROVIDER, TranslationService } from './services/translation.service';
|
||||
import { TranslationService } from './services/translation.service';
|
||||
import { UploadService } from './services/upload.service';
|
||||
import { UserPreferencesService } from './services/user-preferences.service';
|
||||
import { SearchConfigurationService } from './services/search-configuration.service';
|
||||
@@ -241,14 +241,6 @@ export class CoreModuleLazy {
|
||||
TranslateModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'adf-core',
|
||||
source: 'assets/adf-core'
|
||||
}
|
||||
},
|
||||
...providers()
|
||||
]
|
||||
})
|
||||
@@ -257,14 +249,6 @@ export class CoreModule {
|
||||
return {
|
||||
ngModule: CoreModule,
|
||||
providers: [
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'adf-core',
|
||||
source: 'assets/adf-core'
|
||||
}
|
||||
},
|
||||
...providers()
|
||||
]
|
||||
};
|
||||
@@ -275,4 +259,8 @@ export class CoreModule {
|
||||
ngModule: CoreModuleLazy
|
||||
};
|
||||
}
|
||||
|
||||
constructor(translation: TranslationService) {
|
||||
translation.addTranslationFolder('adf-core', 'assets/adf-core');
|
||||
}
|
||||
}
|
||||
|
@@ -52,8 +52,10 @@ export class UploadService {
|
||||
fileUploadDeleted: Subject<FileUploadDeleteEvent> = new Subject<FileUploadDeleteEvent>();
|
||||
fileDeleted: Subject<string> = new Subject<string>();
|
||||
|
||||
constructor(private apiService: AlfrescoApiService, private appConfigService: AppConfigService) {
|
||||
this.excludedFileList = <String[]> this.appConfigService.get('files.excluded');
|
||||
constructor(
|
||||
protected apiService: AlfrescoApiService,
|
||||
appConfigService: AppConfigService) {
|
||||
this.excludedFileList = <String[]> appConfigService.get('files.excluded');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -17,8 +17,7 @@
|
||||
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ProcessContentService } from '@alfresco/adf-core';
|
||||
import { TranslationService } from '@alfresco/adf-core';
|
||||
import { ProcessContentService, CoreModule } from '@alfresco/adf-core';
|
||||
import { CreateProcessAttachmentComponent } from './create-process-attachment.component';
|
||||
|
||||
declare let jasmine: any;
|
||||
@@ -50,12 +49,12 @@ describe('Activiti Process Create Attachment', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
CreateProcessAttachmentComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: TranslationService },
|
||||
ProcessContentService
|
||||
]
|
||||
}).compileComponents();
|
||||
|
@@ -23,11 +23,8 @@ import 'rxjs/add/observable/throw';
|
||||
@Injectable()
|
||||
export class ProcessUploadService extends UploadService {
|
||||
|
||||
instanceApi: AlfrescoApiService;
|
||||
|
||||
constructor(apiService: AlfrescoApiService, appConfigService: AppConfigService) {
|
||||
super(apiService, appConfigService);
|
||||
this.instanceApi = apiService;
|
||||
}
|
||||
|
||||
getUploadPromise(file: any): any {
|
||||
@@ -35,7 +32,7 @@ export class ProcessUploadService extends UploadService {
|
||||
isRelatedContent: true
|
||||
};
|
||||
let processInstanceId = file.options.parentId;
|
||||
let promise = this.instanceApi.getInstance().activiti.contentApi.createRelatedContentOnProcessInstance(processInstanceId, file.file, opts);
|
||||
let promise = this.apiService.getInstance().activiti.contentApi.createRelatedContentOnProcessInstance(processInstanceId, file.file, opts);
|
||||
|
||||
promise.catch(err => this.handleError(err));
|
||||
|
||||
|
@@ -23,11 +23,8 @@ import 'rxjs/add/observable/throw';
|
||||
@Injectable()
|
||||
export class TaskUploadService extends UploadService {
|
||||
|
||||
instanceApi: AlfrescoApiService;
|
||||
|
||||
constructor(apiService: AlfrescoApiService, appConfigService: AppConfigService) {
|
||||
super(apiService, appConfigService);
|
||||
this.instanceApi = apiService;
|
||||
}
|
||||
|
||||
getUploadPromise(file: any): any {
|
||||
@@ -35,7 +32,7 @@ export class TaskUploadService extends UploadService {
|
||||
isRelatedContent: true
|
||||
};
|
||||
let taskId = file.options.parentId;
|
||||
let promise = this.instanceApi.getInstance().activiti.contentApi.createRelatedContentOnTask(taskId, file.file, opts);
|
||||
let promise = this.apiService.getInstance().activiti.contentApi.createRelatedContentOnTask(taskId, file.file, opts);
|
||||
|
||||
promise.catch(err => this.handleError(err));
|
||||
|
||||
|
Reference in New Issue
Block a user