[ADF-1026] i18n support for "empty" screen (#2066)

* i18n support for "empty" screen

* fix unit tests

* fix tests

* fix tests
This commit is contained in:
Denys Vuika
2017-07-10 13:44:39 +01:00
committed by Eugenio Romano
parent 403d5cea85
commit 2a16bf2f34
14 changed files with 65 additions and 31 deletions

View File

@@ -24,7 +24,9 @@
<div *ngIf="!isEmptyTemplateDefined()">
<no-content-template>
<ng-template>
<adf-empty-list [emptyMsg]="'This folder is empty'"></adf-empty-list>
<adf-empty-list
emptyMsg="ADF-DOCUMENT-LIST.EMPTY.HEADER">
</adf-empty-list>
</ng-template>
</no-content-template>
</div>

View File

@@ -17,8 +17,9 @@
import { NgZone, SimpleChange, TemplateRef } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DataTableModule } from 'ng2-alfresco-datatable';
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
import { DataColumn, DataRowEvent, DataTableComponent } from 'ng2-alfresco-datatable';
import { DataTableModule } from 'ng2-alfresco-datatable';
import { Observable, Subject } from 'rxjs/Rx';
import { FileNode, FolderNode } from '../assets/document-library.model.mock';
import {
@@ -34,7 +35,6 @@ import { ImageResolver, RowFilter, ShareDataRow } from './../data/share-datatabl
import { DocumentListService } from './../services/document-list.service';
import { DocumentListComponent } from './document-list.component';
import { DocumentMenuActionComponent } from './document-menu-action.component';
import { CoreModule, AlfrescoTranslationService } from 'ng2-alfresco-core';
declare let jasmine: any;
@@ -712,7 +712,7 @@ describe('DocumentList', () => {
it('should check [empty folder] template ', () => {
documentList.emptyFolderTemplate = <TemplateRef<any>> {};
documentList.dataTable = new DataTableComponent(null, null);
documentList.dataTable = new DataTableComponent(null, null, null);
expect(documentList.dataTable).toBeDefined();
expect(documentList.isEmptyTemplateDefined()).toBeTruthy();
@@ -722,7 +722,7 @@ describe('DocumentList', () => {
it('should empty folder NOT show the pagination', () => {
documentList.emptyFolderTemplate = <TemplateRef<any>> {};
documentList.dataTable = new DataTableComponent(null, null);
documentList.dataTable = new DataTableComponent(null, null, null);
expect(documentList.isEmpty()).toBeTruthy();
expect(element.querySelector('alfresco-pagination')).toBe(null);

View File

@@ -29,7 +29,7 @@ describe('EmptyFolderContent', () => {
beforeEach(() => {
let documentListService = new DocumentListServiceMock();
documentList = new DocumentListComponent(documentListService, null, null, null);
documentList.dataTable = new DataTableComponent(null, null);
documentList.dataTable = new DataTableComponent(null, null, null);
emptyFolderContent = new EmptyFolderContentDirective(documentList);
});

View File

@@ -6,5 +6,10 @@
"CREATE": "Create",
"CANCEL": "Cancel"
}
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "This folder is empty"
}
}
}