mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ACA-3273] - fix start process empty message (#5689)
* [ACA-3273] - fix start process empty message * revert licenses changes Co-authored-by: Silviu Popa <p3701014@L3700101120.ness.com>
This commit is contained in:
@@ -3,11 +3,12 @@
|
|||||||
<mat-card-title class="adf-title">{{'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.FORM.TITLE' | translate}}
|
<mat-card-title class="adf-title">{{'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.FORM.TITLE' | translate}}
|
||||||
</mat-card-title>
|
</mat-card-title>
|
||||||
|
|
||||||
<mat-card-content *ngIf="!isProcessDefinitionsEmpty(); else emptyProcessDefinitionsList">
|
<mat-card-content>
|
||||||
<mat-card-subtitle id="error-message" *ngIf="errorMessageId">
|
<mat-card-subtitle id="error-message" *ngIf="errorMessageId">
|
||||||
{{ errorMessageId | translate }}
|
{{ errorMessageId | translate }}
|
||||||
</mat-card-subtitle>
|
</mat-card-subtitle>
|
||||||
|
|
||||||
|
<div *ngIf="!isProcessDefinitionsEmpty(); else emptyProcessDefinitionsList">
|
||||||
<form [formGroup]="processForm">
|
<form [formGroup]="processForm">
|
||||||
<mat-form-field class="adf-process-input-container" [floatLabel]="'always'">
|
<mat-form-field class="adf-process-input-container" [floatLabel]="'always'">
|
||||||
<mat-label>{{ 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.FORM.LABEL.TYPE' | translate }}</mat-label>
|
<mat-label>{{ 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.FORM.LABEL.TYPE' | translate }}</mat-label>
|
||||||
@@ -70,6 +71,7 @@
|
|||||||
</adf-cloud-form-custom-outcomes>
|
</adf-cloud-form-custom-outcomes>
|
||||||
</adf-cloud-form>
|
</adf-cloud-form>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
|
||||||
@@ -86,7 +88,7 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<ng-template #emptyProcessDefinitionsList>
|
<ng-template #emptyProcessDefinitionsList>
|
||||||
<mat-card-content>
|
<mat-card-content *ngIf="processDefinitionLoaded">
|
||||||
<mat-card-subtitle class="error-message" id="no-process-message">
|
<mat-card-subtitle class="error-message" id="no-process-message">
|
||||||
{{ 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.NO_PROCESS_DEFINITIONS' | translate | uppercase}}
|
{{ 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.NO_PROCESS_DEFINITIONS' | translate | uppercase}}
|
||||||
</mat-card-subtitle>
|
</mat-card-subtitle>
|
||||||
|
@@ -736,5 +736,18 @@ describe('StartProcessCloudComponent', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
selectOptionByName(fakeProcessDefinitions[0].name);
|
selectOptionByName(fakeProcessDefinitions[0].name);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should wait for process definition to be loaded before showing the empty process definition message', () => {
|
||||||
|
component.processDefinitionLoaded = false;
|
||||||
|
fixture.detectChanges();
|
||||||
|
let noProcessElement = fixture.nativeElement.querySelector('#no-process-message');
|
||||||
|
expect(noProcessElement).toBeNull();
|
||||||
|
getDefinitionsSpy.and.returnValue(of([]));
|
||||||
|
|
||||||
|
component.loadProcessDefinitions();
|
||||||
|
fixture.detectChanges();
|
||||||
|
noProcessElement = fixture.nativeElement.querySelector('#no-process-message');
|
||||||
|
expect(noProcessElement).not.toBeNull();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -104,6 +104,7 @@ export class StartProcessCloudComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
disableStartButton: boolean = true;
|
disableStartButton: boolean = true;
|
||||||
|
|
||||||
protected onDestroy$ = new Subject<boolean>();
|
protected onDestroy$ = new Subject<boolean>();
|
||||||
|
processDefinitionLoaded = false;
|
||||||
|
|
||||||
constructor(private startProcessCloudService: StartProcessCloudService,
|
constructor(private startProcessCloudService: StartProcessCloudService,
|
||||||
private formBuilder: FormBuilder) {
|
private formBuilder: FormBuilder) {
|
||||||
@@ -233,7 +234,9 @@ export class StartProcessCloudComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
this.resetErrorMessage();
|
this.resetErrorMessage();
|
||||||
|
|
||||||
this.startProcessCloudService.getProcessDefinitions(this.appName)
|
this.startProcessCloudService.getProcessDefinitions(this.appName)
|
||||||
.pipe(takeUntil(this.onDestroy$))
|
.pipe(
|
||||||
|
tap(() => this.processDefinitionLoaded = true),
|
||||||
|
takeUntil(this.onDestroy$))
|
||||||
.subscribe((processDefinitionRepresentations: ProcessDefinitionCloud[]) => {
|
.subscribe((processDefinitionRepresentations: ProcessDefinitionCloud[]) => {
|
||||||
this.processDefinitionList = processDefinitionRepresentations;
|
this.processDefinitionList = processDefinitionRepresentations;
|
||||||
if (processDefinitionRepresentations.length === 1) {
|
if (processDefinitionRepresentations.length === 1) {
|
||||||
|
Reference in New Issue
Block a user