[ACA-3358] Show user friendly error templates when there are no applications/processDefinitions (#5746)

* * Added empty template on start process component

* * Removed errorMessageId

* * Added unit tests to recent changes

* * Added doc

* * fixed comments

* * Used showError notification

* * After rebase

* * Fixed failing e2e

* * Fixed comments
This commit is contained in:
siva kumar
2020-06-09 13:45:22 +05:30
committed by GitHub
parent fffa97c7f8
commit b161ceab26
13 changed files with 361 additions and 187 deletions

View File

@@ -224,7 +224,8 @@
[name]="defaultProcessName"
(formContentClicked)="onContentClick($event)"
(start)="onStartProcessInstance($event)"
(cancel)="onCancelProcessInstance()">
(cancel)="onCancelProcessInstance()"
(error)="onStartProcessError($event)">
</adf-start-process>
</div>
</div>

View File

@@ -36,7 +36,7 @@ import {
import {
FORM_FIELD_VALIDATORS, FormRenderingService, FormService,
DynamicTableRow, ValidateDynamicTableRowEvent, AppConfigService, PaginationComponent, UserPreferenceValues,
AlfrescoApiService, UserPreferencesService, LogService, DataCellEvent
AlfrescoApiService, UserPreferencesService, LogService, DataCellEvent, NotificationService
} from '@alfresco/adf-core';
import { AnalyticsReportListComponent } from '@alfresco/adf-insights';
@@ -174,6 +174,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
formRenderingService: FormRenderingService,
formService: FormService,
private location: Location,
private notificationService: NotificationService,
private preferenceService: UserPreferencesService) {
this.defaultProcessName = this.appConfig.get<string>('adf-start-process.name');
@@ -403,6 +404,10 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
this.reloadProcessFilters();
}
onStartProcessError(event: any) {
this.notificationService.showError(event.message);
}
isStartProcessMode(): boolean {
return this.currentProcessInstanceId === currentProcessIdNew;
}