This commit is contained in:
Eugenio Romano 2018-09-15 16:38:01 +01:00
parent 6ac0346039
commit fc8b9e5ed1
4 changed files with 28 additions and 28 deletions

View File

@ -1,13 +1,13 @@
<mat-card class="adf-start-process"> <mat-card class="adf-start-process">
<mat-card-title>{{'ADF_PROCESS_LIST.START_PROCESS.FORM.TITLE' | translate}} <mat-card-title>{{'ADF_PROCESS_LIST.START_PROCESS.FORM.TITLE' | translate}}
</mat-card-title> </mat-card-title>
<mat-card-content *ngIf="isProcessDefinitionEmpty()"> <mat-card-content *ngIf="isProcessDefinitionEmpty()">
<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>
<mat-form-field class="adf-process-input-container"> <mat-form-field class="adf-process-input-container">
<input matInput placeholder="{{'ADF_PROCESS_LIST.START_PROCESS.FORM.LABEL.NAME'|translate}}" [(ngModel)]="name" id="processName" required /> <input matInput placeholder="{{'ADF_PROCESS_LIST.START_PROCESS.FORM.LABEL.NAME'|translate}}" [(ngModel)]="name" id="processName" required />
</mat-form-field> </mat-form-field>
<div *ngIf="showSelectProcessDropdown"> <div *ngIf="showSelectProcessDropdown">
<mat-form-field> <mat-form-field>
@ -23,21 +23,21 @@
<adf-start-form <adf-start-form
#startForm #startForm
*ngIf="hasStartForm()" *ngIf="hasStartForm()"
[data]="values" [data]="values"
[disableStartProcessButton]="!hasProcessName()" [disableStartProcessButton]="!hasProcessName()"
[processDefinitionId]="selectedProcessDef.id" [processDefinitionId]="selectedProcessDef.id"
(outcomeClick)="onOutcomeClick($event)" (outcomeClick)="onOutcomeClick($event)"
[showRefreshButton]="false"> [showRefreshButton]="false">
<button form-custom-button mat-button (click)="cancelStartProcess()" id="cancle_process" class=""> {{'ADF_PROCESS_LIST.START_PROCESS.FORM.ACTION.CANCEL'| translate}} </button> <button form-custom-button mat-button (click)="cancelStartProcess()" id="cancel_process" class=""> {{'ADF_PROCESS_LIST.START_PROCESS.FORM.ACTION.CANCEL'| translate}} </button>
</adf-start-form> </adf-start-form>
</mat-card-content> </mat-card-content>
<mat-card-content *ngIf="hasErrorMessage()"> <mat-card-content *ngIf="hasErrorMessage()">
<mat-card-subtitle class="error-message" id="no-process-message"> <mat-card-subtitle class="error-message" id="no-process-message">
{{'ADF_PROCESS_LIST.START_PROCESS.NO_PROCESS_DEFINITIONS' | translate}} {{'ADF_PROCESS_LIST.START_PROCESS.NO_PROCESS_DEFINITIONS' | translate}}
</mat-card-subtitle> </mat-card-subtitle>
</mat-card-content> </mat-card-content>
<mat-card-actions *ngIf="!hasStartForm()"> <mat-card-actions *ngIf="!hasStartForm()">
<button mat-button *ngIf="!hasStartForm()" (click)="cancelStartProcess()" id="cancle_process" class=""> {{'ADF_PROCESS_LIST.START_PROCESS.FORM.ACTION.CANCEL'| translate}} </button> <button mat-button *ngIf="!hasStartForm()" (click)="cancelStartProcess()" id="cancel_process" class=""> {{'ADF_PROCESS_LIST.START_PROCESS.FORM.ACTION.CANCEL'| translate}} </button>
<button color="primary" mat-button *ngIf="!hasStartForm()" [disabled]="!validateForm()" (click)="startProcess()" data-automation-id="btn-start" id="button-start" class="btn-start"> {{'ADF_PROCESS_LIST.START_PROCESS.FORM.ACTION.START' | translate}} </button> <button color="primary" mat-button *ngIf="!hasStartForm()" [disabled]="!validateForm()" (click)="startProcess()" data-automation-id="btn-start" id="button-start" class="btn-start"> {{'ADF_PROCESS_LIST.START_PROCESS.FORM.ACTION.START' | translate}} </button>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>

View File

@ -154,7 +154,7 @@ describe('StartFormComponent', () => {
it('should emit cancel event on cancel Button', async(() => { it('should emit cancel event on cancel Button', async(() => {
fixture.detectChanges(); fixture.detectChanges();
let cancelButton = fixture.nativeElement.querySelector('#cancle_process'); let cancelButton = fixture.nativeElement.querySelector('#cancel_process');
let cancelSpy: jasmine.Spy = spyOn(component.cancel, 'emit'); let cancelSpy: jasmine.Spy = spyOn(component.cancel, 'emit');
cancelButton.click(); cancelButton.click();
fixture.detectChanges(); fixture.detectChanges();

View File

@ -74,7 +74,7 @@
<mat-grid-list cols="1" rowHeight="60px"> <mat-grid-list cols="1" rowHeight="60px">
<mat-grid-tile> <mat-grid-tile>
<div class="adf-new-task-footer"> <div class="adf-new-task-footer">
<button mat-button (click)="onCancel()" id="button-cancle"> <button mat-button (click)="onCancel()" id="button-cancel">
{{'ADF_TASK_LIST.START_TASK.FORM.ACTION.CANCEL'|translate}} {{'ADF_TASK_LIST.START_TASK.FORM.ACTION.CANCEL'|translate}}
</button> </button>
<button color="primary" mat-button [disabled]="!startTaskmodel.name || dateError" (click)="start()" id="button-start"> <button color="primary" mat-button [disabled]="!startTaskmodel.name || dateError" (click)="start()" id="button-start">

View File

@ -302,10 +302,10 @@ describe('StartTaskComponent', () => {
it('should cancel start task on cancel button click', () => { it('should cancel start task on cancel button click', () => {
let emitSpy = spyOn(component.cancel, 'emit'); let emitSpy = spyOn(component.cancel, 'emit');
let cancleTaskButton = fixture.nativeElement.querySelector('#button-cancle'); let cancelTaskButton = fixture.nativeElement.querySelector('#button-cancel');
component.startTaskmodel.name = ''; component.startTaskmodel.name = '';
fixture.detectChanges(); fixture.detectChanges();
cancleTaskButton.click(); cancelTaskButton.click();
expect(emitSpy).not.toBeNull(); expect(emitSpy).not.toBeNull();
expect(emitSpy).toHaveBeenCalled(); expect(emitSpy).toHaveBeenCalled();
}); });