mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4039] Copy/Move of the files/folders is not working when the root folder of the user is chosen. (#4280)
* fix infinite pagination test * ready event only after full source * infinite init to pagesize maxitems * infinite init to pagesize maxitems * infinite init to pagesize maxitems
This commit is contained in:
@@ -56,6 +56,7 @@ import { NodeEntityEvent, NodeEntryEvent } from './node.event';
|
||||
import { CustomResourcesService } from './../services/custom-resources.service';
|
||||
import { NavigableComponentInterface } from '../../breadcrumb/navigable-component.interface';
|
||||
import { RowFilter } from '../data/row-filter.model';
|
||||
import { Observable } from 'rxjs/index';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-document-list',
|
||||
@@ -624,19 +625,24 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
where: this.where
|
||||
}, this.includeFields)
|
||||
.subscribe((nodePaging: NodePaging) => {
|
||||
this.onPageLoaded(nodePaging);
|
||||
this.getSourceNodeWithPath(nodeId);
|
||||
this.getSourceNodeWithPath(nodeId).subscribe((nodeEntry: NodeEntry) => {
|
||||
this.onPageLoaded(nodePaging);
|
||||
});
|
||||
}, (err) => {
|
||||
this.handleError(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
getSourceNodeWithPath(nodeId: string) {
|
||||
this.documentListService.getFolderNode(nodeId, this.includeFields).subscribe((nodeEntry: NodeEntry) => {
|
||||
getSourceNodeWithPath(nodeId: string): Observable<NodeEntry> {
|
||||
let getSourceObservable = this.documentListService.getFolderNode(nodeId, this.includeFields);
|
||||
|
||||
getSourceObservable.subscribe((nodeEntry: NodeEntry) => {
|
||||
this.folderNode = nodeEntry.entry;
|
||||
this.$folderNode.next(this.folderNode);
|
||||
});
|
||||
|
||||
return getSourceObservable;
|
||||
}
|
||||
|
||||
resetSelection() {
|
||||
|
@@ -217,7 +217,7 @@ describe('InfinitePaginationComponent', () => {
|
||||
|
||||
expect(spyTarget).toHaveBeenCalledWith({
|
||||
skipCount: 0,
|
||||
maxItems: 25,
|
||||
maxItems: 50,
|
||||
hasMoreItems: false,
|
||||
merge: false
|
||||
});
|
||||
@@ -231,7 +231,7 @@ describe('InfinitePaginationComponent', () => {
|
||||
component.onLoadMore();
|
||||
|
||||
expect(spyTarget).toHaveBeenCalledWith({
|
||||
maxItems: 7,
|
||||
maxItems: 14,
|
||||
skipCount: 0,
|
||||
hasMoreItems: false,
|
||||
merge: false
|
||||
|
@@ -84,6 +84,7 @@ export class InfinitePaginationComponent implements OnInit, OnDestroy, Paginatio
|
||||
|
||||
this.userPreferencesService.select(UserPreferenceValues.PaginationSize).subscribe((pagSize) => {
|
||||
this.pageSize = this.pageSize || pagSize;
|
||||
this.requestPaginationModel.maxItems = this.pageSize;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -91,11 +92,7 @@ export class InfinitePaginationComponent implements OnInit, OnDestroy, Paginatio
|
||||
this.requestPaginationModel.skipCount = 0;
|
||||
this.requestPaginationModel.merge = false;
|
||||
|
||||
if (!this.requestPaginationModel.maxItems) {
|
||||
this.requestPaginationModel.maxItems = this.pageSize;
|
||||
} else {
|
||||
this.requestPaginationModel.maxItems += this.pageSize;
|
||||
}
|
||||
this.requestPaginationModel.maxItems += this.pageSize;
|
||||
|
||||
this.loadMore.next(this.requestPaginationModel);
|
||||
|
||||
|
Reference in New Issue
Block a user