[ADF 3635] Added translation label to checklist dialog (#3894)

* [ADF-3635] added translation label to checklist dialog

* [ADF-3635] fixed tests
This commit is contained in:
Vito
2018-10-16 18:04:33 +01:00
committed by Eugenio Romano
parent 392bd62610
commit 5378df9425
4 changed files with 27 additions and 12 deletions

View File

@@ -94,7 +94,13 @@
"NONE": "Nobody involved" "NONE": "Nobody involved"
}, },
"CHECKLIST": { "CHECKLIST": {
"NONE": "No checklist" "NONE": "No checklist",
"DIALOG" : {
"TITLE": "New Check",
"CANCEL-BUTTON": "Cancel",
"ADD-BUTTON": "Add Checklist",
"PLACEHOLDER": "Name"
}
}, },
"ERROR": { "ERROR": {
"TITLE": "Couldn't complete the action", "TITLE": "Couldn't complete the action",

View File

@@ -91,7 +91,13 @@
"NONE": "Nessuno coinvolto" "NONE": "Nessuno coinvolto"
}, },
"CHECKLIST": { "CHECKLIST": {
"NONE": "Nessun elenco di controllo" "NONE": "Nessun elenco di controllo",
"DIALOG" : {
"TITLE": "Nuova Checklist",
"CANCEL-BUTTON": "Cancella",
"ADD-BUTTON": "Aggiungi Checklist",
"PLACEHOLDER": "Nome"
}
}, },
"ERROR": { "ERROR": {
"TITLE": "Impossibile completare l'azione", "TITLE": "Impossibile completare l'azione",
@@ -316,4 +322,4 @@
"CHOOSE": "Scegli" "CHOOSE": "Scegli"
} }
} }
} }

View File

@@ -28,16 +28,16 @@
<ng-template #dialog> <ng-template #dialog>
<div class="adf-checklist-dialog" id="checklist-dialog"> <div class="adf-checklist-dialog" id="checklist-dialog">
<h4 matDialogTitle id="add-checklist-title">New Check</h4> <h4 matDialogTitle id="add-checklist-title">{{ 'ADF_TASK_LIST.DETAILS.CHECKLIST.DIALOG.TITLE' | translate }}</h4>
<mat-dialog-content> <mat-dialog-content>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Name" [(ngModel)]="taskName" id="checklist-name" <input matInput placeholder="{{ 'ADF_TASK_LIST.DETAILS.CHECKLIST.DIALOG.PLACEHOLDER' | translate }}" [(ngModel)]="taskName" id="checklist-name"
data-automation-id="checklist-name"> data-automation-id="checklist-name">
</mat-form-field> </mat-form-field>
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions class="adf-checklist-dialog-actions"> <mat-dialog-actions class="adf-checklist-dialog-actions">
<button mat-button type="button" id="close-check-dialog" (click)="cancel()">Cancel</button> <button mat-button type="button" id="close-check-dialog" (click)="cancel()">{{ 'ADF_TASK_LIST.DETAILS.CHECKLIST.DIALOG.CANCEL-BUTTON' | translate }}</button>
<button mat-button type="button" id="add-check" (click)="add()">Add Checklist</button> <button mat-button type="button" id="add-check" (click)="add()">{{ 'ADF_TASK_LIST.DETAILS.CHECKLIST.DIALOG.ADD-BUTTON' | translate }}</button>
</mat-dialog-actions> </mat-dialog-actions>
</div> </div>
</ng-template> </ng-template>

View File

@@ -116,13 +116,16 @@ describe('ChecklistComponent', () => {
showChecklistDialog = <HTMLElement> element.querySelector('#add-checklist'); showChecklistDialog = <HTMLElement> element.querySelector('#add-checklist');
}); });
it('should show dialog when clicked on add', () => { it('should show dialog when clicked on add', (done) => {
expect(showChecklistDialog).not.toBeNull(); expect(showChecklistDialog).not.toBeNull();
showChecklistDialog.click(); showChecklistDialog.click();
fixture.detectChanges();
expect(window.document.querySelector('#checklist-dialog')).not.toBeNull(); fixture.whenStable().then(() => {
expect(window.document.querySelector('#add-checklist-title')).not.toBeNull(); expect(window.document.querySelector('#checklist-dialog')).not.toBeNull();
expect(window.document.querySelector('#add-checklist-title').textContent).toContain('New Check'); expect(window.document.querySelector('#add-checklist-title')).not.toBeNull();
expect(window.document.querySelector('#add-checklist-title').textContent).toContain('ADF_TASK_LIST.DETAILS.CHECKLIST.DIALOG.TITLE');
done();
});
}); });
}); });