[ADF-2188] Start Process - Change processDefinition property and fix bug (#2884)

* Change processDefinition property and fix bug

* Fix unit test

* Fix async

* Fix id
This commit is contained in:
Maurizio Vitale
2018-01-25 17:52:05 +01:00
committed by Eugenio Romano
parent abca6e481d
commit 657c28491a
7 changed files with 43 additions and 32 deletions

View File

@@ -341,6 +341,10 @@
]
}
},
"adf-start-process": {
"name": "My Default Name",
"processDefinitionName": "My default process def name"
},
"adf-process-list": {
"presets": {
"default": [

View File

@@ -182,6 +182,8 @@
*ngIf="isStartProcessMode()">
<adf-start-process
[appId]="appId"
[name]="defaultProcessName"
[processDefinitionName]="defaultProcessDefinitionName"
(start)="onStartProcessInstance($event)"
(cancel)="onCancelProcessInstance()">
</adf-start-process>

View File

@@ -30,7 +30,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { Pagination, ProcessInstanceFilterRepresentation } from 'alfresco-js-api';
import {
FORM_FIELD_VALIDATORS, FormEvent, FormFieldEvent, FormRenderingService, FormService,
DynamicTableRow, ValidateDynamicTableRowEvent
DynamicTableRow, ValidateDynamicTableRowEvent, AppConfigService
} from '@alfresco/adf-core';
import { AnalyticsReportListComponent } from '@alfresco/adf-insights';
@@ -123,6 +123,9 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
supportedPages: number[];
defaultProcessDefinitionName: string;
defaultProcessName: string;
activeTab: number = this.tabs.tasks; // tasks|processes|reports
taskFilter: FilterRepresentationModel;
@@ -148,6 +151,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
private taskListService: TaskListService,
private apiService: AlfrescoApiService,
private logService: LogService,
private appConfig: AppConfigService,
formRenderingService: FormRenderingService,
formService: FormService,
private preferenceService: UserPreferencesService) {
@@ -156,6 +160,9 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
this.supportedPages = this.preferenceService.getDifferentPageSizes();
this.taskPagination.maxItems = this.preferenceService.paginationSize;
this.defaultProcessName = this.appConfig.get<string>('adf-start-process.name');
this.defaultProcessDefinitionName = this.appConfig.get<string>('adf-start-process.processDefinitionName');
// Uncomment this line to replace all 'text' field editors with custom component
// formRenderingService.setComponentTypeResolver('text', () => CustomEditorComponent, true);