mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2455] fix properly fall back datatable thumbnail
fix search node selector drop down list style
This commit is contained in:
@@ -726,7 +726,7 @@ describe('DataTable', () => {
|
||||
expect(event.target.src).toBe(dataTable.fallbackThumbnail);
|
||||
});
|
||||
|
||||
it('should replace image source only when fallback available', () => {
|
||||
it('should replace image source with miscellaneous icon when fallback is not available', () => {
|
||||
const originalSrc = 'missing-image';
|
||||
let event = <any> {
|
||||
target: {
|
||||
@@ -736,7 +736,7 @@ describe('DataTable', () => {
|
||||
|
||||
dataTable.fallbackThumbnail = null;
|
||||
dataTable.onImageLoadingError(event);
|
||||
expect(event.target.src).toBe(originalSrc);
|
||||
expect(event.target.src).toBe('./assets/images/ft_ic_miscellaneous.svg' );
|
||||
});
|
||||
|
||||
it('should replace image source with icon if fallback is not available and mimeType is provided', () => {
|
||||
|
@@ -162,11 +162,9 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck
|
||||
private singleClickStreamSub: Subscription;
|
||||
private multiClickStreamSub: Subscription;
|
||||
|
||||
constructor(
|
||||
private elementRef: ElementRef,
|
||||
differs: IterableDiffers,
|
||||
private thumbnailService?: ThumbnailService
|
||||
) {
|
||||
constructor(private elementRef: ElementRef,
|
||||
differs: IterableDiffers,
|
||||
private thumbnailService?: ThumbnailService) {
|
||||
if (differs) {
|
||||
this.differ = differs.find([]).create(null);
|
||||
}
|
||||
@@ -427,13 +425,15 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck
|
||||
}
|
||||
|
||||
onImageLoadingError(event: Event, mimeType?: string) {
|
||||
if (mimeType && !this.fallbackThumbnail) {
|
||||
this.fallbackThumbnail = this.thumbnailService.getMimeTypeIcon(mimeType);
|
||||
}
|
||||
|
||||
if (event && this.fallbackThumbnail) {
|
||||
if (event) {
|
||||
let element = <any> event.target;
|
||||
element.src = this.fallbackThumbnail;
|
||||
|
||||
if (this.fallbackThumbnail) {
|
||||
element.src = this.fallbackThumbnail;
|
||||
} else {
|
||||
element.src = this.thumbnailService.getMimeTypeIcon(mimeType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -62,7 +62,6 @@ export class InfinitePaginationComponent implements OnInit, OnDestroy, Paginatio
|
||||
@Input('loading')
|
||||
isLoading: boolean = false;
|
||||
|
||||
/** @deprecated 2.3.0 use the paginated component interface to use it. */
|
||||
/** Emitted when the "Load More" button is clicked. */
|
||||
@Output()
|
||||
loadMore: EventEmitter<Pagination> = new EventEmitter<Pagination>();
|
||||
|
Reference in New Issue
Block a user