mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-1819] Start task - Use the correct translation path (#2540)
* Use the correct translation path * Fix start process component
This commit is contained in:
committed by
Eugenio Romano
parent
dfcaa63d8e
commit
52bba291de
@@ -143,7 +143,7 @@ describe('StartProcessInstanceComponent', () => {
|
|||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
let errorEl = fixture.nativeElement.querySelector('#error-message');
|
let errorEl = fixture.nativeElement.querySelector('#error-message');
|
||||||
expect(errorEl).not.toBeNull('Expected error message to be present');
|
expect(errorEl).not.toBeNull('Expected error message to be present');
|
||||||
expect(errorEl.innerText.trim()).toBe('START_PROCESS.ERROR.LOAD_PROCESS_DEFS');
|
expect(errorEl.innerText.trim()).toBe('ADF_PROCESS_LIST.START_PROCESS.ERROR.LOAD_PROCESS_DEFS');
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ describe('StartProcessInstanceComponent', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
let errorEl = fixture.nativeElement.querySelector('#error-message');
|
let errorEl = fixture.nativeElement.querySelector('#error-message');
|
||||||
expect(errorEl).not.toBeNull();
|
expect(errorEl).not.toBeNull();
|
||||||
expect(errorEl.innerText.trim()).toBe('START_PROCESS.ERROR.START');
|
expect(errorEl.innerText.trim()).toBe('ADF_PROCESS_LIST.START_PROCESS.ERROR.START');
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -73,7 +73,7 @@ export class StartProcessInstanceComponent implements OnChanges {
|
|||||||
this.processDefinitions = res;
|
this.processDefinitions = res;
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
this.errorMessageId = 'START_PROCESS.ERROR.LOAD_PROCESS_DEFS';
|
this.errorMessageId = 'ADF_PROCESS_LIST.START_PROCESS.ERROR.LOAD_PROCESS_DEFS';
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ export class StartProcessInstanceComponent implements OnChanges {
|
|||||||
this.start.emit(res);
|
this.start.emit(res);
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
this.errorMessageId = 'START_PROCESS.ERROR.START';
|
this.errorMessageId = 'ADF_PROCESS_LIST.START_PROCESS.ERROR.START';
|
||||||
this.error.error(err);
|
this.error.error(err);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<mat-card class="adf-new-task-layout-card">
|
<mat-card class="adf-new-task-layout-card">
|
||||||
<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-heading">{{'START_TASK.FORM.TITLE'|translate}}</div>
|
<div class="adf-new-task-heading">{{'ADF_TASK_LIST.START_TASK.FORM.TITLE'|translate}}</div>
|
||||||
</mat-grid-tile>
|
</mat-grid-tile>
|
||||||
</mat-grid-list>
|
</mat-grid-list>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<mat-grid-list cols="1" rowHeight="80px">
|
<mat-grid-list cols="1" rowHeight="80px">
|
||||||
<mat-grid-tile>
|
<mat-grid-tile>
|
||||||
<mat-form-field class="adf-new-task-text-width">
|
<mat-form-field class="adf-new-task-text-width">
|
||||||
<input matInput placeholder="{{'START_TASK.FORM.LABEL.NAME'|translate}}"
|
<input matInput placeholder="{{'ADF_TASK_LIST.START_TASK.FORM.LABEL.NAME'|translate}}"
|
||||||
[(ngModel)]="startTaskmodel.name" required id="name_id">
|
[(ngModel)]="startTaskmodel.name" required id="name_id">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</mat-grid-tile>
|
</mat-grid-tile>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
<mat-grid-list cols="1" rowHeight="80px">
|
<mat-grid-list cols="1" rowHeight="80px">
|
||||||
<mat-grid-tile>
|
<mat-grid-tile>
|
||||||
<mat-form-field class="adf-new-task-text-width">
|
<mat-form-field class="adf-new-task-text-width">
|
||||||
<textarea matInput placeholder="{{'START_TASK.FORM.LABEL.DESCRIPTION'|translate}}"
|
<textarea matInput placeholder="{{'ADF_TASK_LIST.START_TASK.FORM.LABEL.DESCRIPTION'|translate}}"
|
||||||
[(ngModel)]="startTaskmodel.description" id="description_id"></textarea>
|
[(ngModel)]="startTaskmodel.description" id="description_id"></textarea>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</mat-grid-tile>
|
</mat-grid-tile>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
[matDatepicker]="taskDatePicker"
|
[matDatepicker]="taskDatePicker"
|
||||||
(keydown)="true"
|
(keydown)="true"
|
||||||
(focusout)="onDateChanged($event.srcElement.value)"
|
(focusout)="onDateChanged($event.srcElement.value)"
|
||||||
placeholder="{{'START_TASK.FORM.LABEL.DATE'|translate}}"
|
placeholder="{{'ADF_TASK_LIST.START_TASK.FORM.LABEL.DATE'|translate}}"
|
||||||
[(ngModel)]="startTaskmodel.dueDate" id="date_id">
|
[(ngModel)]="startTaskmodel.dueDate" id="date_id">
|
||||||
<mat-datepicker-toggle matSuffix [for]="taskDatePicker"></mat-datepicker-toggle>
|
<mat-datepicker-toggle matSuffix [for]="taskDatePicker"></mat-datepicker-toggle>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
@@ -36,16 +36,16 @@
|
|||||||
(dateChanged)="onDateChanged($event)"></mat-datepicker>
|
(dateChanged)="onDateChanged($event)"></mat-datepicker>
|
||||||
<div class="adf-error-text-container">
|
<div class="adf-error-text-container">
|
||||||
<div *ngIf="dateError">
|
<div *ngIf="dateError">
|
||||||
<div class="adf-error-text">{{'START_TASK.FORM.DATE.ERROR'|translate}}</div>
|
<div class="adf-error-text">{{'ADF_TASK_LIST.START_TASK.FORM.DATE.ERROR'|translate}}</div>
|
||||||
<mat-icon class="adf-error-icon">warning</mat-icon>
|
<mat-icon class="adf-error-icon">warning</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</mat-grid-tile>
|
</mat-grid-tile>
|
||||||
<mat-grid-tile>
|
<mat-grid-tile>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-select placeholder="{{'START_TASK.FORM.LABEL.ASSIGNEE'|translate}}" id="assignee_id"
|
<mat-select placeholder="{{'ADF_TASK_LIST.START_TASK.FORM.LABEL.ASSIGNEE'|translate}}" id="assignee_id"
|
||||||
class="adf-start-task-input-container adf-mat-select" [(ngModel)]="assigneeId">
|
class="adf-start-task-input-container adf-mat-select" [(ngModel)]="assigneeId">
|
||||||
<mat-option>{{'START_TASK.FORM.LABEL.NONE'|translate}}</mat-option>
|
<mat-option>{{'ADF_TASK_LIST.START_TASK.FORM.LABEL.NONE'|translate}}</mat-option>
|
||||||
<span *ngFor="let user of people">
|
<span *ngFor="let user of people">
|
||||||
<mat-option [value]="user.id" *ngIf="!isUserNameEmpty(user)">{{ getDisplayUser(user.firstName,
|
<mat-option [value]="user.id" *ngIf="!isUserNameEmpty(user)">{{ getDisplayUser(user.firstName,
|
||||||
user.lastName, ' ')}}
|
user.lastName, ' ')}}
|
||||||
@@ -58,9 +58,9 @@
|
|||||||
<mat-grid-list cols="2" rowHeight="80px">
|
<mat-grid-list cols="2" rowHeight="80px">
|
||||||
<mat-grid-tile>
|
<mat-grid-tile>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-select placeholder="{{'START_TASK.FORM.LABEL.FORM'|translate}}" id="form_id" [(ngModel)]="formKey"
|
<mat-select placeholder="{{'ADF_TASK_LIST.START_TASK.FORM.LABEL.FORM'|translate}}" id="form_id" [(ngModel)]="formKey"
|
||||||
class="adf-start-task-input-container">
|
class="adf-start-task-input-container">
|
||||||
<mat-option>{{'START_TASK.FORM.LABEL.NONE'|translate}}</mat-option>
|
<mat-option>{{'ADF_TASK_LIST.START_TASK.FORM.LABEL.NONE'|translate}}</mat-option>
|
||||||
<mat-option *ngFor="let form of forms" [value]="form.id">{{ form.name }}</mat-option>
|
<mat-option *ngFor="let form of forms" [value]="form.id">{{ form.name }}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
@@ -73,10 +73,10 @@
|
|||||||
<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-cancle">
|
||||||
{{'START_TASK.FORM.ACTION.CANCEL'|translate}}
|
{{'ADF_TASK_LIST.START_TASK.FORM.ACTION.CANCEL'|translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-button [disabled]="!startTaskmodel.name || dateError" (click)="start()" id="button-start">
|
<button mat-button [disabled]="!startTaskmodel.name || dateError" (click)="start()" id="button-start">
|
||||||
{{'START_TASK.FORM.ACTION.START'|translate}}
|
{{'ADF_TASK_LIST.START_TASK.FORM.ACTION.START'|translate}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</mat-grid-tile>
|
</mat-grid-tile>
|
||||||
|
@@ -308,7 +308,7 @@ describe('StartTaskComponent', () => {
|
|||||||
it('should show start task button', () => {
|
it('should show start task button', () => {
|
||||||
expect(element.querySelector('#button-start')).toBeDefined();
|
expect(element.querySelector('#button-start')).toBeDefined();
|
||||||
expect(element.querySelector('#button-start')).not.toBeNull();
|
expect(element.querySelector('#button-start')).not.toBeNull();
|
||||||
expect(element.querySelector('#button-start').textContent).toContain('START_TASK.FORM.ACTION.START');
|
expect(element.querySelector('#button-start').textContent).toContain('ADF_TASK_LIST.START_TASK.FORM.ACTION.START');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should fetch all users on ngonint', () => {
|
it('should fetch all users on ngonint', () => {
|
||||||
@@ -357,7 +357,7 @@ describe('StartTaskComponent', () => {
|
|||||||
let selectElement = fixture.nativeElement.querySelector('#assignee_id');
|
let selectElement = fixture.nativeElement.querySelector('#assignee_id');
|
||||||
expect(selectElement).not.toBeNull();
|
expect(selectElement).not.toBeNull();
|
||||||
expect(selectElement).toBeDefined();
|
expect(selectElement).toBeDefined();
|
||||||
expect(selectElement.attributes['aria-label'].value).toContain('START_TASK.FORM.LABEL.ASSIGNEE');
|
expect(selectElement.attributes['aria-label'].value).toContain('ADF_TASK_LIST.START_TASK.FORM.LABEL.ASSIGNEE');
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -365,7 +365,7 @@ describe('StartTaskComponent', () => {
|
|||||||
component.forms = fakeForms;
|
component.forms = fakeForms;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
let selectElement = fixture.nativeElement.querySelector('#form_id');
|
let selectElement = fixture.nativeElement.querySelector('#form_id');
|
||||||
expect(selectElement.attributes['aria-label'].value).toContain('START_TASK.FORM.LABEL.FORM');
|
expect(selectElement.attributes['aria-label'].value).toContain('ADF_TASK_LIST.START_TASK.FORM.LABEL.FORM');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should get formatted fullname', () => {
|
it('should get formatted fullname', () => {
|
||||||
|
Reference in New Issue
Block a user