fix new ts javascript api

This commit is contained in:
Mario Romano
2016-09-26 23:32:18 +01:00
parent 16d8c55f62
commit 07f6bb2552
5 changed files with 24 additions and 24 deletions

View File

@@ -130,7 +130,7 @@ describe('ShareDataTableAdapter', () => {
});
it('should covert cell value to formatted date', () => {
let rawValue = new Date(2015, 6, 15, 21, 43, 11).toString(); // Wed Jul 15 2015 21:43:11 GMT+0100 (BST);
let rawValue = new Date(2015, 6, 15, 21, 43, 11); // Wed Jul 15 2015 21:43:11 GMT+0100 (BST);
let dateValue = 'Jul 15, 2015, 9:43:11 PM';
let file = new FileNode();
@@ -150,7 +150,7 @@ describe('ShareDataTableAdapter', () => {
});
it('should use default date format as fallback', () => {
let rawValue = new Date(2015, 6, 15, 21, 43, 11).toString(); // Wed Jul 15 2015 21:43:11 GMT+0100 (BST);
let rawValue = new Date(2015, 6, 15, 21, 43, 11); // Wed Jul 15 2015 21:43:11 GMT+0100 (BST);
let dateValue = 'Jul 15, 2015, 9:43:11 PM';
let file = new FileNode();
@@ -170,7 +170,7 @@ describe('ShareDataTableAdapter', () => {
});
it('should return date value as string', () => {
let rawValue = new Date(2015, 6, 15, 21, 43, 11).toString(); // Wed Jul 15 2015 21:43:11 GMT+0100 (BST);
let rawValue = new Date(2015, 6, 15, 21, 43, 11); // Wed Jul 15 2015 21:43:11 GMT+0100 (BST);
let file = new FileNode();
file.entry.createdAt = rawValue;
@@ -190,7 +190,7 @@ describe('ShareDataTableAdapter', () => {
it('should log error when having date conversion issues', () => {
let dateValue = '[wrong-date]';
let file = new FileNode();
file.entry.createdAt = dateValue;
file.entry.createdAt = <any> dateValue;
let col = <DataColumn> {
key: 'createdAt',

View File

@@ -23,7 +23,7 @@ import {
DataRow, DataColumn, DataSorting
} from 'ng2-alfresco-datatable';
import { NodePaging, MinimalNodeEntity } from './../models/document-library.model';
import { NodePaging, NodeMinimalEntry } from './../models/document-library.model';
import { DocumentListService } from './../services/document-list.service';
export class ShareDataTableAdapter implements DataTableAdapter, PaginationProvider {
@@ -305,11 +305,11 @@ export class ShareDataRow implements DataRow {
isSelected: boolean = false;
get node(): MinimalNodeEntity {
get node(): NodeMinimalEntry {
return this.obj;
}
constructor(private obj: MinimalNodeEntity) {
constructor(private obj: NodeMinimalEntry) {
if (!obj) {
throw new Error(ShareDataRow.ERR_OBJECT_NOT_FOUND);
}