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:
@@ -29,7 +29,7 @@ install:
|
||||
if ([ "$TRAVIS_BRANCH" = "master" ]); then
|
||||
(./scripts/npm-build-all.sh || exit 1;);
|
||||
else
|
||||
(./scripts/npm-build-all.sh -vjsapi alpha || exit 1;);
|
||||
(./scripts/npm-build-all.sh -vjsapi alpha -sb || exit 1;);
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -252,7 +252,7 @@
|
||||
</data-column>
|
||||
<data-column
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.CREATED_BY' | translate}}"
|
||||
key="createdByUser.displayName"
|
||||
key="createdByUser?.displayName"
|
||||
class="desktop-only">
|
||||
</data-column>
|
||||
<data-column
|
||||
|
@@ -7,7 +7,7 @@
|
||||
data-automation-id="dropdown-breadcrumb-trigger">
|
||||
<mat-icon [class.isRoot]="!hasPreviousNodes()">folder</mat-icon>
|
||||
</button>
|
||||
<mat-icon class="adf-dropddown-breadcrumb-item-chevron">chevron_right</mat-icon>
|
||||
<mat-icon class="adf-dropdown-breadcrumb-item-chevron">chevron_right</mat-icon>
|
||||
|
||||
<mat-select
|
||||
#select
|
||||
|
@@ -17,6 +17,10 @@
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&-dropdown-breadcrumb-item-chevron {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
&-dropdown-breadcumb-trigger.isRoot {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
@@ -35,8 +39,8 @@
|
||||
|
||||
&-current-folder {
|
||||
text-align: left;
|
||||
line-height: 33px;
|
||||
margin-left: $dropdownHorizontalOffset;
|
||||
line-height: 26px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
@@ -92,6 +92,7 @@
|
||||
<adf-infinite-pagination
|
||||
[target]="documentList"
|
||||
[loading]="loadingSearchResults"
|
||||
(loadMore)="getNextPageOfSearch($event)"
|
||||
data-automation-id="content-node-selector-search-pagination">
|
||||
{{ 'ADF-DOCUMENT-LIST.LAYOUT.LOAD_MORE' | translate }}
|
||||
</adf-infinite-pagination>
|
||||
|
@@ -324,6 +324,20 @@ export class ContentNodeSelectorPanelComponent implements OnInit, PaginatedCompo
|
||||
return !this.showingSearchResults || this.chosenNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the next batch of search results
|
||||
*
|
||||
* @param event Pagination object
|
||||
*/
|
||||
getNextPageOfSearch(event: Pagination): void {
|
||||
this.infiniteScroll = true;
|
||||
this.skipCount = event.skipCount;
|
||||
|
||||
if (this.searchTerm.length > 0) {
|
||||
this.querySearch();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects node as chosen if it has the right permission, clears the selection otherwise
|
||||
*
|
||||
|
@@ -374,12 +374,15 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
this.resetNewFolderPagination();
|
||||
this.loadFolder();
|
||||
} else if (changes.currentFolderId &&
|
||||
changes.currentFolderId.currentValue &&
|
||||
changes.currentFolderId.currentValue !== changes.currentFolderId.previousValue) {
|
||||
changes.currentFolderId.currentValue &&
|
||||
changes.currentFolderId.currentValue !== changes.currentFolderId.previousValue) {
|
||||
this.resetNewFolderPagination();
|
||||
this.loadFolder();
|
||||
} else if (this.data) {
|
||||
if (changes.node && changes.node.currentValue) {
|
||||
if (changes.node.currentValue.list.pagination) {
|
||||
changes.node.currentValue.list.pagination.skipCount = 0;
|
||||
}
|
||||
this.data.loadPage(changes.node.currentValue);
|
||||
this.onDataReady(changes.node.currentValue);
|
||||
} else if (changes.rowFilter) {
|
||||
@@ -742,7 +745,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
this.currentFolderId = nodeId;
|
||||
this.resetNewFolderPagination();
|
||||
this.loadFolder();
|
||||
this.folderChange.emit(new NodeEntryEvent({id: nodeId}));
|
||||
this.folderChange.emit(new NodeEntryEvent({ id: nodeId }));
|
||||
}
|
||||
|
||||
private resetNewFolderPagination() {
|
||||
|
@@ -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