mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[no-issue] error image resolver mimetype should not be part of datatable (#3415)
* move error image custom logic form datatable to documentlist * change travis * [fix-test-log] added optional function to data row interface * [no-issue] fixed datatable tests * [no-issue] fixing tests
This commit is contained in:
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DataRow } from '@alfresco/adf-core';
|
||||
import { ObjectUtils } from '@alfresco/adf-core';
|
||||
import { DataRow, ObjectUtils, ThumbnailService } from '@alfresco/adf-core';
|
||||
import { MinimalNode, MinimalNodeEntity } from 'alfresco-js-api';
|
||||
import { PermissionStyleModel } from './../models/permissions-style.model';
|
||||
import { DocumentListService } from './../services/document-list.service';
|
||||
@@ -34,7 +33,10 @@ export class ShareDataRow implements DataRow {
|
||||
return this.obj;
|
||||
}
|
||||
|
||||
constructor(private obj: MinimalNodeEntity, private documentListService: DocumentListService, private permissionsStyle: PermissionStyleModel[]) {
|
||||
constructor(private obj: MinimalNodeEntity,
|
||||
private documentListService: DocumentListService,
|
||||
private permissionsStyle: PermissionStyleModel[],
|
||||
private thumbnailService?: ThumbnailService) {
|
||||
if (!obj) {
|
||||
throw new Error(ShareDataRow.ERR_OBJECT_NOT_FOUND);
|
||||
}
|
||||
@@ -91,6 +93,10 @@ export class ShareDataRow implements DataRow {
|
||||
return ObjectUtils.getValue(this.obj.entry, key);
|
||||
}
|
||||
|
||||
imageErrorResolver(event: Event): any {
|
||||
return this.thumbnailService.getMimeTypeIcon(this.obj.entry.content.mimeType);
|
||||
}
|
||||
|
||||
hasValue(key: string): boolean {
|
||||
return this.getValue(key) !== undefined;
|
||||
}
|
||||
|
Reference in New Issue
Block a user