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 ,
|
import { ProcessInstance, ProcessService ,
|
||||||
ProcessAttachmentListComponent, ProcessUploadService } from '@alfresco/adf-process-services';
|
ProcessAttachmentListComponent, ProcessUploadService } from '@alfresco/adf-process-services';
|
||||||
import { UploadService } from '@alfresco/adf-core';
|
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({
|
@Component({
|
||||||
selector: 'app-process-attachments',
|
selector: 'app-process-attachments',
|
||||||
templateUrl: './process-attachments.component.html',
|
templateUrl: './process-attachments.component.html',
|
||||||
styleUrls: ['./process-attachments.component.css'],
|
styleUrls: ['./process-attachments.component.css'],
|
||||||
providers: [
|
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"
|
<adf-accordion-group [heading]="'Processes'" [isSelected]="true" [isOpen]="true"
|
||||||
[headingIcon]="'assessment'">
|
[headingIcon]="'assessment'">
|
||||||
<adf-process-instance-filters
|
<adf-process-instance-filters
|
||||||
|
#activitiprocessfilter
|
||||||
[filterParam]="{index: 0}"
|
[filterParam]="{index: 0}"
|
||||||
[appId]="appId"
|
[appId]="appId"
|
||||||
(filterClick)="onProcessFilterClick($event)"
|
(filterClick)="onProcessFilterClick($event)"
|
||||||
@@ -163,6 +164,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="adf-grid-item adf-processes-details" *ngIf="!isStartProcessMode()" fxFlex.gt-md="1 1 auto">
|
<div class="adf-grid-item adf-processes-details" *ngIf="!isStartProcessMode()" fxFlex.gt-md="1 1 auto">
|
||||||
<adf-process-instance-details
|
<adf-process-instance-details
|
||||||
|
#activitiprocessdetails
|
||||||
[processInstanceId]="currentProcessInstanceId"
|
[processInstanceId]="currentProcessInstanceId"
|
||||||
(processCancelled)="processCancelled()"
|
(processCancelled)="processCancelled()"
|
||||||
(showProcessDiagram)="onShowProcessDiagram($event)"
|
(showProcessDiagram)="onShowProcessDiagram($event)"
|
||||||
@@ -190,6 +192,7 @@
|
|||||||
<div class="adf-grid-item adf-processes-start" fxFlex.gt-md="1 1 auto"
|
<div class="adf-grid-item adf-processes-start" fxFlex.gt-md="1 1 auto"
|
||||||
*ngIf="isStartProcessMode()">
|
*ngIf="isStartProcessMode()">
|
||||||
<adf-start-process
|
<adf-start-process
|
||||||
|
#activitiStartProcess
|
||||||
[appId]="appId"
|
[appId]="appId"
|
||||||
[name]="defaultProcessName"
|
[name]="defaultProcessName"
|
||||||
[processDefinitionName]="defaultProcessDefinitionName"
|
[processDefinitionName]="defaultProcessDefinitionName"
|
||||||
|
@@ -75,34 +75,34 @@ const currentTaskIdNew = '__NEW__';
|
|||||||
})
|
})
|
||||||
export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit {
|
export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||||
|
|
||||||
@ViewChild(TaskFiltersComponent)
|
@ViewChild('activitifilter')
|
||||||
activitifilter: TaskFiltersComponent;
|
activitifilter: TaskFiltersComponent;
|
||||||
|
|
||||||
@ViewChild(PaginationComponent)
|
@ViewChild('processListPagination')
|
||||||
processListPagination: PaginationComponent;
|
processListPagination: PaginationComponent;
|
||||||
|
|
||||||
@ViewChild(PaginationComponent)
|
@ViewChild('taskListPagination')
|
||||||
taskListPagination: PaginationComponent;
|
taskListPagination: PaginationComponent;
|
||||||
|
|
||||||
@ViewChild(TaskListComponent)
|
@ViewChild('taskList')
|
||||||
taskList: TaskListComponent;
|
taskList: TaskListComponent;
|
||||||
|
|
||||||
@ViewChild(ProcessFiltersComponent)
|
@ViewChild('activitiprocessfilter')
|
||||||
activitiprocessfilter: ProcessFiltersComponent;
|
activitiprocessfilter: ProcessFiltersComponent;
|
||||||
|
|
||||||
@ViewChild(ProcessInstanceListComponent)
|
@ViewChild('processList')
|
||||||
processList: ProcessInstanceListComponent;
|
processList: ProcessInstanceListComponent;
|
||||||
|
|
||||||
@ViewChild(ProcessInstanceDetailsComponent)
|
@ViewChild('activitiprocessdetails')
|
||||||
activitiprocessdetails: ProcessInstanceDetailsComponent;
|
activitiprocessdetails: ProcessInstanceDetailsComponent;
|
||||||
|
|
||||||
@ViewChild(TaskDetailsComponent)
|
@ViewChild('activitidetails')
|
||||||
activitidetails: TaskDetailsComponent;
|
activitidetails: TaskDetailsComponent;
|
||||||
|
|
||||||
@ViewChild(StartProcessInstanceComponent)
|
@ViewChild('activitiStartProcess')
|
||||||
activitiStartProcess: StartProcessInstanceComponent;
|
activitiStartProcess: StartProcessInstanceComponent;
|
||||||
|
|
||||||
@ViewChild(AnalyticsReportListComponent)
|
@ViewChild('analyticsreportlist')
|
||||||
analyticsreportlist: AnalyticsReportListComponent;
|
analyticsreportlist: AnalyticsReportListComponent;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
|
@@ -17,14 +17,22 @@
|
|||||||
|
|
||||||
import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
|
import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
|
||||||
import { TaskListService, TaskAttachmentListComponent, TaskDetailsModel, TaskUploadService } from '@alfresco/adf-process-services';
|
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({
|
@Component({
|
||||||
selector: 'app-task-attachments',
|
selector: 'app-task-attachments',
|
||||||
templateUrl: './task-attachments.component.html',
|
templateUrl: './task-attachments.component.html',
|
||||||
styleUrls: ['./task-attachments.component.css'],
|
styleUrls: ['./task-attachments.component.css'],
|
||||||
providers: [
|
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 { NgModule } from '@angular/core';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { MaterialModule } from '../material.module';
|
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 { ContentMetadataComponent } from './components/content-metadata/content-metadata.component';
|
||||||
import { ContentMetadataCardComponent } from './components/content-metadata-card/content-metadata-card.component';
|
import { ContentMetadataCardComponent } from './components/content-metadata-card/content-metadata-card.component';
|
||||||
import { PropertyDescriptorsService } from './services/property-descriptors.service';
|
import { PropertyDescriptorsService } from './services/property-descriptors.service';
|
||||||
@@ -50,8 +50,7 @@ import { PropertyGroupTranslatorService } from './services/property-groups-trans
|
|||||||
PropertyDescriptorsService,
|
PropertyDescriptorsService,
|
||||||
ContentMetadataConfigFactory,
|
ContentMetadataConfigFactory,
|
||||||
BasicPropertiesService,
|
BasicPropertiesService,
|
||||||
PropertyGroupTranslatorService,
|
PropertyGroupTranslatorService
|
||||||
FileSizePipe
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ContentMetadataModule {}
|
export class ContentMetadataModule {}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<adf-datatable
|
<adf-datatable
|
||||||
|
#dataTable
|
||||||
[selectionMode]="selectionMode"
|
[selectionMode]="selectionMode"
|
||||||
[data]="data"
|
[data]="data"
|
||||||
[actions]="contentActions"
|
[actions]="contentActions"
|
||||||
|
@@ -229,7 +229,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
|||||||
@Output()
|
@Output()
|
||||||
error: EventEmitter<any> = new EventEmitter();
|
error: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
@ViewChild(DataTableComponent)
|
@ViewChild('dataTable')
|
||||||
dataTable: DataTableComponent;
|
dataTable: DataTableComponent;
|
||||||
|
|
||||||
errorMessage;
|
errorMessage;
|
||||||
|
@@ -21,7 +21,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { MaterialModule } from '../material.module';
|
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';
|
import { SearchTriggerDirective } from './components/search-trigger.directive';
|
||||||
|
|
||||||
@@ -36,10 +36,6 @@ export const ALFRESCO_SEARCH_DIRECTIVES: any[] = [
|
|||||||
EmptySearchResultComponent
|
EmptySearchResultComponent
|
||||||
];
|
];
|
||||||
|
|
||||||
export const ALFRESCO_SEARCH_PROVIDERS: any[] = [
|
|
||||||
SearchService
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
@@ -52,9 +48,6 @@ export const ALFRESCO_SEARCH_PROVIDERS: any[] = [
|
|||||||
declarations: [
|
declarations: [
|
||||||
...ALFRESCO_SEARCH_DIRECTIVES
|
...ALFRESCO_SEARCH_DIRECTIVES
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
...ALFRESCO_SEARCH_PROVIDERS
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
...ALFRESCO_SEARCH_DIRECTIVES
|
...ALFRESCO_SEARCH_DIRECTIVES
|
||||||
]
|
]
|
||||||
|
@@ -71,7 +71,7 @@ import { SitesService } from './services/sites.service';
|
|||||||
import { StorageService } from './services/storage.service';
|
import { StorageService } from './services/storage.service';
|
||||||
import { ThumbnailService } from './services/thumbnail.service';
|
import { ThumbnailService } from './services/thumbnail.service';
|
||||||
import { TranslateLoaderService } from './services/translate-loader.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 { UploadService } from './services/upload.service';
|
||||||
import { UserPreferencesService } from './services/user-preferences.service';
|
import { UserPreferencesService } from './services/user-preferences.service';
|
||||||
import { SearchConfigurationService } from './services/search-configuration.service';
|
import { SearchConfigurationService } from './services/search-configuration.service';
|
||||||
@@ -241,14 +241,6 @@ export class CoreModuleLazy {
|
|||||||
TranslateModule
|
TranslateModule
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
|
||||||
provide: TRANSLATION_PROVIDER,
|
|
||||||
multi: true,
|
|
||||||
useValue: {
|
|
||||||
name: 'adf-core',
|
|
||||||
source: 'assets/adf-core'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
...providers()
|
...providers()
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@@ -257,14 +249,6 @@ export class CoreModule {
|
|||||||
return {
|
return {
|
||||||
ngModule: CoreModule,
|
ngModule: CoreModule,
|
||||||
providers: [
|
providers: [
|
||||||
{
|
|
||||||
provide: TRANSLATION_PROVIDER,
|
|
||||||
multi: true,
|
|
||||||
useValue: {
|
|
||||||
name: 'adf-core',
|
|
||||||
source: 'assets/adf-core'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
...providers()
|
...providers()
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@@ -275,4 +259,8 @@ export class CoreModule {
|
|||||||
ngModule: CoreModuleLazy
|
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>();
|
fileUploadDeleted: Subject<FileUploadDeleteEvent> = new Subject<FileUploadDeleteEvent>();
|
||||||
fileDeleted: Subject<string> = new Subject<string>();
|
fileDeleted: Subject<string> = new Subject<string>();
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService, private appConfigService: AppConfigService) {
|
constructor(
|
||||||
this.excludedFileList = <String[]> this.appConfigService.get('files.excluded');
|
protected apiService: AlfrescoApiService,
|
||||||
|
appConfigService: AppConfigService) {
|
||||||
|
this.excludedFileList = <String[]> appConfigService.get('files.excluded');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -17,8 +17,7 @@
|
|||||||
|
|
||||||
import { SimpleChange } from '@angular/core';
|
import { SimpleChange } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { ProcessContentService } from '@alfresco/adf-core';
|
import { ProcessContentService, CoreModule } from '@alfresco/adf-core';
|
||||||
import { TranslationService } from '@alfresco/adf-core';
|
|
||||||
import { CreateProcessAttachmentComponent } from './create-process-attachment.component';
|
import { CreateProcessAttachmentComponent } from './create-process-attachment.component';
|
||||||
|
|
||||||
declare let jasmine: any;
|
declare let jasmine: any;
|
||||||
@@ -50,12 +49,12 @@ describe('Activiti Process Create Attachment', () => {
|
|||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
CoreModule.forRoot()
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
CreateProcessAttachmentComponent
|
CreateProcessAttachmentComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TranslationService },
|
|
||||||
ProcessContentService
|
ProcessContentService
|
||||||
]
|
]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
@@ -23,11 +23,8 @@ import 'rxjs/add/observable/throw';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class ProcessUploadService extends UploadService {
|
export class ProcessUploadService extends UploadService {
|
||||||
|
|
||||||
instanceApi: AlfrescoApiService;
|
|
||||||
|
|
||||||
constructor(apiService: AlfrescoApiService, appConfigService: AppConfigService) {
|
constructor(apiService: AlfrescoApiService, appConfigService: AppConfigService) {
|
||||||
super(apiService, appConfigService);
|
super(apiService, appConfigService);
|
||||||
this.instanceApi = apiService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getUploadPromise(file: any): any {
|
getUploadPromise(file: any): any {
|
||||||
@@ -35,7 +32,7 @@ export class ProcessUploadService extends UploadService {
|
|||||||
isRelatedContent: true
|
isRelatedContent: true
|
||||||
};
|
};
|
||||||
let processInstanceId = file.options.parentId;
|
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));
|
promise.catch(err => this.handleError(err));
|
||||||
|
|
||||||
|
@@ -23,11 +23,8 @@ import 'rxjs/add/observable/throw';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class TaskUploadService extends UploadService {
|
export class TaskUploadService extends UploadService {
|
||||||
|
|
||||||
instanceApi: AlfrescoApiService;
|
|
||||||
|
|
||||||
constructor(apiService: AlfrescoApiService, appConfigService: AppConfigService) {
|
constructor(apiService: AlfrescoApiService, appConfigService: AppConfigService) {
|
||||||
super(apiService, appConfigService);
|
super(apiService, appConfigService);
|
||||||
this.instanceApi = apiService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getUploadPromise(file: any): any {
|
getUploadPromise(file: any): any {
|
||||||
@@ -35,7 +32,7 @@ export class TaskUploadService extends UploadService {
|
|||||||
isRelatedContent: true
|
isRelatedContent: true
|
||||||
};
|
};
|
||||||
let taskId = file.options.parentId;
|
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));
|
promise.catch(err => this.handleError(err));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user