mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2629] Fix infinite pagination and e2e parallel task (#3691)
* change infinite pagination logic make merge in share adapter a real merge * missing semi column * type problem * fix pagination infinite test * tentative file detector * add other remote files for webdriver * parallel execution test * fix refresh browser e2e * missing driver remote in util
This commit is contained in:
committed by
Eugenio Romano
parent
2602879cba
commit
83b2857097
@@ -371,13 +371,13 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
onContentActionSuccess(message) {
|
onContentActionSuccess(message) {
|
||||||
const translatedMessage: any = this.translateService.get(message);
|
const translatedMessage: any = this.translateService.get(message);
|
||||||
this.openSnackMessage(translatedMessage.value);
|
this.openSnackMessage(translatedMessage.value);
|
||||||
this.reloadForInfiniteScrolling();
|
this.documentList.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
onDeleteActionSuccess(message) {
|
onDeleteActionSuccess(message) {
|
||||||
this.uploadService.fileDeleted.next(message);
|
this.uploadService.fileDeleted.next(message);
|
||||||
this.deleteElementSuccess.emit();
|
this.deleteElementSuccess.emit();
|
||||||
this.reloadForInfiniteScrolling();
|
this.documentList.reload();
|
||||||
this.openSnackMessage(message);
|
this.openSnackMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -385,10 +385,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
this.router.navigate(['/permissions', node.value.entry.id]);
|
this.router.navigate(['/permissions', node.value.entry.id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private reloadForInfiniteScrolling() {
|
|
||||||
this.documentList.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
onManageVersions(event) {
|
onManageVersions(event) {
|
||||||
const contentEntry = event.value.entry;
|
const contentEntry = event.value.entry;
|
||||||
const showComments = this.showVersionComments;
|
const showComments = this.showVersionComments;
|
||||||
@@ -521,7 +517,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
onInfiniteScrolling(): void {
|
onInfiniteScrolling(): void {
|
||||||
this.infiniteScrolling = !this.infiniteScrolling;
|
this.infiniteScrolling = !this.infiniteScrolling;
|
||||||
this.infinitePaginationComponent.reset();
|
this.infinitePaginationComponent.reset();
|
||||||
this.reloadForInfiniteScrolling();
|
this.documentList.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
canDownloadNode = (node: MinimalNodeEntity): boolean => {
|
canDownloadNode = (node: MinimalNodeEntity): boolean => {
|
||||||
|
@@ -18,10 +18,12 @@
|
|||||||
import path = require('path');
|
import path = require('path');
|
||||||
import fs = require('fs');
|
import fs = require('fs');
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
|
import remote = require('selenium-webdriver/remote');
|
||||||
|
|
||||||
export class UploadActions {
|
export class UploadActions {
|
||||||
|
|
||||||
async uploadFile(alfrescoJsApi, fileLocation, fileName, parentFolderId) {
|
async uploadFile(alfrescoJsApi, fileLocation, fileName, parentFolderId) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
let pathFile = path.join(TestConfig.main.rootPath + fileLocation);
|
let pathFile = path.join(TestConfig.main.rootPath + fileLocation);
|
||||||
let file = fs.createReadStream(pathFile);
|
let file = fs.createReadStream(pathFile);
|
||||||
@@ -40,6 +42,8 @@ export class UploadActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createEmptyFiles(alfrescoJsApi, emptyFileNames: string[], parentFolderId) {
|
async createEmptyFiles(alfrescoJsApi, emptyFileNames: string[], parentFolderId) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
let filesRequest = [];
|
let filesRequest = [];
|
||||||
|
|
||||||
for (let i = 0; i < emptyFileNames.length; i++) {
|
for (let i = 0; i < emptyFileNames.length; i++) {
|
||||||
@@ -55,6 +59,8 @@ export class UploadActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async uploadFolder(alfrescoJsApi, folderName, parentFolderId) {
|
async uploadFolder(alfrescoJsApi, folderName, parentFolderId) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
return alfrescoJsApi.nodes.addNode(parentFolderId, {
|
return alfrescoJsApi.nodes.addNode(parentFolderId, {
|
||||||
'name': folderName,
|
'name': folderName,
|
||||||
'nodeType': 'cm:folder'
|
'nodeType': 'cm:folder'
|
||||||
|
@@ -19,10 +19,12 @@ import path = require('path');
|
|||||||
import fs = require('fs');
|
import fs = require('fs');
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import AppPublish = require('../../models/APS/AppPublish');
|
import AppPublish = require('../../models/APS/AppPublish');
|
||||||
|
import remote = require('selenium-webdriver/remote');
|
||||||
|
|
||||||
export class AppsActions {
|
export class AppsActions {
|
||||||
|
|
||||||
async importPublishDeployApp(alfrescoJsApi, appFileLocation) {
|
async importPublishDeployApp(alfrescoJsApi, appFileLocation) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
let pathFile = path.join(TestConfig.main.rootPath + appFileLocation);
|
let pathFile = path.join(TestConfig.main.rootPath + appFileLocation);
|
||||||
let file = fs.createReadStream(pathFile);
|
let file = fs.createReadStream(pathFile);
|
||||||
@@ -37,6 +39,7 @@ export class AppsActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async publishDeployApp(alfrescoJsApi, appId) {
|
async publishDeployApp(alfrescoJsApi, appId) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
let publishApp = await alfrescoJsApi.activiti.appsApi.publishAppDefinition(appId, new AppPublish());
|
let publishApp = await alfrescoJsApi.activiti.appsApi.publishAppDefinition(appId, new AppPublish());
|
||||||
|
|
||||||
@@ -46,6 +49,7 @@ export class AppsActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async importNewVersionAppDefinitionPublishDeployApp(alfrescoJsApi, appFileLocation, modelId) {
|
async importNewVersionAppDefinitionPublishDeployApp(alfrescoJsApi, appFileLocation, modelId) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
let pathFile = path.join(TestConfig.main.rootPath + appFileLocation);
|
let pathFile = path.join(TestConfig.main.rootPath + appFileLocation);
|
||||||
let file = fs.createReadStream(pathFile);
|
let file = fs.createReadStream(pathFile);
|
||||||
@@ -60,6 +64,7 @@ export class AppsActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async startProcess(alfrescoJsApi, app, processName?: string) {
|
async startProcess(alfrescoJsApi, app, processName?: string) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
let appDefinitionsList = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
let appDefinitionsList = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||||
|
|
||||||
|
@@ -21,6 +21,7 @@ import { browser } from 'protractor';
|
|||||||
import fs = require('fs');
|
import fs = require('fs');
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
|
import remote = require('selenium-webdriver/remote');
|
||||||
|
|
||||||
let JS_BIND_INPUT = function (target) {
|
let JS_BIND_INPUT = function (target) {
|
||||||
let input = document.createElement('input');
|
let input = document.createElement('input');
|
||||||
@@ -79,6 +80,8 @@ let JS_BIND_INPUT_FOLDER = function (target) {
|
|||||||
export class DropActions {
|
export class DropActions {
|
||||||
|
|
||||||
dropFile(dropArea, filePath) {
|
dropFile(dropArea, filePath) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
let absolutePath = path.resolve(path.join(TestConfig.main.rootPath, filePath));
|
let absolutePath = path.resolve(path.join(TestConfig.main.rootPath, filePath));
|
||||||
|
|
||||||
fs.accessSync(absolutePath, fs.constants.F_OK);
|
fs.accessSync(absolutePath, fs.constants.F_OK);
|
||||||
@@ -91,6 +94,8 @@ export class DropActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dropFolder(dropArea, folderPath) {
|
dropFolder(dropArea, folderPath) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
let absolutePath = path.resolve(path.join(TestConfig.main.rootPath, folderPath));
|
let absolutePath = path.resolve(path.join(TestConfig.main.rootPath, folderPath));
|
||||||
fs.accessSync(absolutePath, fs.constants.F_OK);
|
fs.accessSync(absolutePath, fs.constants.F_OK);
|
||||||
|
|
||||||
|
@@ -20,6 +20,8 @@ import User = require('../models/APS/User');
|
|||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
import fs = require('fs');
|
import fs = require('fs');
|
||||||
|
import remote = require('selenium-webdriver/remote');
|
||||||
|
import { browser } from "protractor";
|
||||||
|
|
||||||
export class UsersActions {
|
export class UsersActions {
|
||||||
|
|
||||||
@@ -46,6 +48,8 @@ export class UsersActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async changeProfilePictureAps(alfrescoJsApi, fileLocation) {
|
async changeProfilePictureAps(alfrescoJsApi, fileLocation) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
let pathFile = path.join(TestConfig.main.rootPath + fileLocation);
|
let pathFile = path.join(TestConfig.main.rootPath + fileLocation);
|
||||||
let file = fs.createReadStream(pathFile);
|
let file = fs.createReadStream(pathFile);
|
||||||
|
|
||||||
|
@@ -21,6 +21,7 @@ var CreateFolderDialog = require('./dialog/createFolderDialog');
|
|||||||
var path = require('path');
|
var path = require('path');
|
||||||
var TestConfig = require('../../test.config');
|
var TestConfig = require('../../test.config');
|
||||||
var NavigationBarPage = require('./navigationBarPage');
|
var NavigationBarPage = require('./navigationBarPage');
|
||||||
|
var remote = require('selenium-webdriver/remote');
|
||||||
|
|
||||||
var ContentServicesPage = function () {
|
var ContentServicesPage = function () {
|
||||||
|
|
||||||
@@ -323,6 +324,7 @@ var ContentServicesPage = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.uploadFile = function (fileLocation) {
|
this.uploadFile = function (fileLocation) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
this.checkUploadButton();
|
this.checkUploadButton();
|
||||||
Util.waitUntilElementIsVisible(uploadFileButton);
|
Util.waitUntilElementIsVisible(uploadFileButton);
|
||||||
uploadFileButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
|
uploadFileButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
|
||||||
@@ -331,6 +333,7 @@ var ContentServicesPage = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.uploadMultipleFile = function (files) {
|
this.uploadMultipleFile = function (files) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
Util.waitUntilElementIsVisible(uploadMultipleFileButton);
|
Util.waitUntilElementIsVisible(uploadMultipleFileButton);
|
||||||
var allFiles = path.resolve(path.join(TestConfig.main.rootPath, files[0]));
|
var allFiles = path.resolve(path.join(TestConfig.main.rootPath, files[0]));
|
||||||
for (var i = 1; i < files.length; i++) {
|
for (var i = 1; i < files.length; i++) {
|
||||||
@@ -342,6 +345,7 @@ var ContentServicesPage = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.uploadFolder = function (folder) {
|
this.uploadFolder = function (folder) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
Util.waitUntilElementIsVisible(uploadFolderButton);
|
Util.waitUntilElementIsVisible(uploadFolderButton);
|
||||||
uploadFolderButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, folder)));
|
uploadFolderButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, folder)));
|
||||||
Util.waitUntilElementIsVisible(uploadFolderButton);
|
Util.waitUntilElementIsVisible(uploadFolderButton);
|
||||||
|
@@ -20,6 +20,7 @@ import { element, by, protractor, browser } from 'protractor';
|
|||||||
import Util = require('../../../util/util');
|
import Util = require('../../../util/util');
|
||||||
import TestConfig = require('../../../test.config');
|
import TestConfig = require('../../../test.config');
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
|
import remote = require('selenium-webdriver/remote');
|
||||||
|
|
||||||
export class AttachmentListPage {
|
export class AttachmentListPage {
|
||||||
|
|
||||||
@@ -36,6 +37,8 @@ export class AttachmentListPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clickAttachFileButton(fileLocation) {
|
clickAttachFileButton(fileLocation) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(this.attachFileButton);
|
Util.waitUntilElementIsVisible(this.attachFileButton);
|
||||||
return this.attachFileButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
|
return this.attachFileButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,7 @@ var FormFields = require('../formFields');
|
|||||||
var TestConfig = require('../../../../test.config');
|
var TestConfig = require('../../../../test.config');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var Util = require('../../../../util/util');
|
var Util = require('../../../../util/util');
|
||||||
|
var remote = require('selenium-webdriver/remote');
|
||||||
|
|
||||||
var AttachFile = function () {
|
var AttachFile = function () {
|
||||||
|
|
||||||
@@ -28,6 +29,7 @@ var AttachFile = function () {
|
|||||||
var filesListLocator = by.css("div[id='adf-attach-widget-readonly-list']");
|
var filesListLocator = by.css("div[id='adf-attach-widget-readonly-list']");
|
||||||
|
|
||||||
this.attachFile = function (fieldId, fileLocation) {
|
this.attachFile = function (fieldId, fileLocation) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
var widget = formFields.getWidget(fieldId);
|
var widget = formFields.getWidget(fieldId);
|
||||||
var uploadButton = widget.element(uploadLocator);
|
var uploadButton = widget.element(uploadLocator);
|
||||||
Util.waitUntilElementIsVisible(uploadButton);
|
Util.waitUntilElementIsVisible(uploadButton);
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
import Util = require('../../util/util');
|
import Util = require('../../util/util');
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
|
import remote = require('selenium-webdriver/remote');
|
||||||
import { browser, by, element, protractor } from 'protractor';
|
import { browser, by, element, protractor } from 'protractor';
|
||||||
|
|
||||||
export class VersionManagePage {
|
export class VersionManagePage {
|
||||||
@@ -39,6 +40,7 @@ export class VersionManagePage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uploadNewVersionFile(fileLocation) {
|
uploadNewVersionFile(fileLocation) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
Util.waitUntilElementIsVisible(this.uploadNewVersionButton);
|
Util.waitUntilElementIsVisible(this.uploadNewVersionButton);
|
||||||
this.uploadNewVersionButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
|
this.uploadNewVersionButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
|
||||||
Util.waitUntilElementIsVisible(this.showNewVersionButton);
|
Util.waitUntilElementIsVisible(this.showNewVersionButton);
|
||||||
|
@@ -127,7 +127,7 @@ describe('Start Task - Task App', () => {
|
|||||||
await this.alfrescoJsApi.activiti.taskApi.removeForm(listOfTasks.data[0].id);
|
await this.alfrescoJsApi.activiti.taskApi.removeForm(listOfTasks.data[0].id);
|
||||||
});
|
});
|
||||||
|
|
||||||
Util.refreshBrowser();
|
browser.refresh();
|
||||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[3]);
|
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[3]);
|
||||||
taskPage.checkTaskTitle(tasks[3]);
|
taskPage.checkTaskTitle(tasks[3]);
|
||||||
|
|
||||||
|
@@ -22,6 +22,7 @@ var path = require('path');
|
|||||||
var until = protractor.ExpectedConditions;
|
var until = protractor.ExpectedConditions;
|
||||||
var TestConfig = require('../test.config');
|
var TestConfig = require('../test.config');
|
||||||
var moment = require('moment');
|
var moment = require('moment');
|
||||||
|
var remote = require('selenium-webdriver/remote');
|
||||||
|
|
||||||
var DEFAULT_TIMEOUT = parseInt(TestConfig.main.timeout);
|
var DEFAULT_TIMEOUT = parseInt(TestConfig.main.timeout);
|
||||||
/**
|
/**
|
||||||
@@ -34,6 +35,8 @@ var DEFAULT_TIMEOUT = parseInt(TestConfig.main.timeout);
|
|||||||
* creates an absolute path string if multiple file uploads are required
|
* creates an absolute path string if multiple file uploads are required
|
||||||
*/
|
*/
|
||||||
exports.uploadParentFolder = function (filePath) {
|
exports.uploadParentFolder = function (filePath) {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
|
||||||
var parentFolder = path.resolve(path.join(__dirname, 'test'));
|
var parentFolder = path.resolve(path.join(__dirname, 'test'));
|
||||||
return path.resolve(path.join(parentFolder, filePath));
|
return path.resolve(path.join(parentFolder, filePath));
|
||||||
};
|
};
|
||||||
|
@@ -440,7 +440,6 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
|||||||
}
|
}
|
||||||
|
|
||||||
getNodeActions(node: MinimalNodeEntity | any): ContentActionModel[] {
|
getNodeActions(node: MinimalNodeEntity | any): ContentActionModel[] {
|
||||||
|
|
||||||
if (node && node.entry) {
|
if (node && node.entry) {
|
||||||
let target = null;
|
let target = null;
|
||||||
|
|
||||||
|
@@ -234,7 +234,15 @@ export class ShareDataTableAdapter implements DataTableAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (merge) {
|
if (merge) {
|
||||||
this.rows = this.rows.concat(rows);
|
let listPrunedDuplicate = rows.filter((elemntToFilter) => {
|
||||||
|
let isPresent = this.rows.find((currenRow: any) => {
|
||||||
|
return currenRow.obj.entry.id === elemntToFilter.obj.entry.id;
|
||||||
|
});
|
||||||
|
|
||||||
|
return !isPresent;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.rows = this.rows.concat(listPrunedDuplicate);
|
||||||
} else {
|
} else {
|
||||||
this.rows = rows;
|
this.rows = rows;
|
||||||
}
|
}
|
||||||
|
@@ -100,7 +100,7 @@ describe('InfinitePaginationComponent', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
component.loadMore.subscribe((newPagination: Pagination) => {
|
component.loadMore.subscribe((newPagination: Pagination) => {
|
||||||
expect(newPagination.skipCount).toBe(10);
|
expect(newPagination.skipCount).toBe(0);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ describe('InfinitePaginationComponent', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
expect(component.pagination).toBe(pagination);
|
expect(component.pagination).toBe(pagination);
|
||||||
expect(component.pageSize).toBe(pagination.maxItems);
|
expect(component.pageSize).toBe(25);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should call the target\'s updatePagination on invoking the onLoadMore', () => {
|
it('should call the target\'s updatePagination on invoking the onLoadMore', () => {
|
||||||
@@ -139,7 +139,7 @@ describe('InfinitePaginationComponent', () => {
|
|||||||
|
|
||||||
component.onLoadMore();
|
component.onLoadMore();
|
||||||
|
|
||||||
expect(testTarget.updatePagination).toHaveBeenCalledWith({ maxItems: 444, skipCount: 444, totalItems: 888, hasMoreItems: true, merge: true });
|
expect(testTarget.updatePagination).toHaveBeenCalledWith({ maxItems: 469, skipCount: 0, totalItems: 888, hasMoreItems: true, merge: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should unsubscribe from the target\'s pagination on onDestroy', () => {
|
it('should unsubscribe from the target\'s pagination on onDestroy', () => {
|
||||||
|
@@ -27,6 +27,7 @@ import { Pagination } from 'alfresco-js-api';
|
|||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { PaginationComponentInterface } from './pagination-component.interface';
|
import { PaginationComponentInterface } from './pagination-component.interface';
|
||||||
import { PaginationModel } from '../models/pagination.model';
|
import { PaginationModel } from '../models/pagination.model';
|
||||||
|
import { UserPreferencesService } from '../services/user-preferences.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-infinite-pagination',
|
selector: 'adf-infinite-pagination',
|
||||||
@@ -68,7 +69,7 @@ export class InfinitePaginationComponent implements OnInit, OnDestroy, Paginatio
|
|||||||
|
|
||||||
private paginationSubscription: Subscription;
|
private paginationSubscription: Subscription;
|
||||||
|
|
||||||
constructor(private cdr: ChangeDetectorRef) {
|
constructor(private cdr: ChangeDetectorRef, private userPreferencesService: UserPreferencesService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -76,7 +77,7 @@ export class InfinitePaginationComponent implements OnInit, OnDestroy, Paginatio
|
|||||||
this.paginationSubscription = this.target.pagination.subscribe(pagination => {
|
this.paginationSubscription = this.target.pagination.subscribe(pagination => {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
this.pagination = pagination;
|
this.pagination = pagination;
|
||||||
this.pageSize = pagination.maxItems;
|
this.pageSize = this.userPreferencesService.paginationSize || this.pageSize;
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -87,12 +88,12 @@ export class InfinitePaginationComponent implements OnInit, OnDestroy, Paginatio
|
|||||||
}
|
}
|
||||||
|
|
||||||
onLoadMore() {
|
onLoadMore() {
|
||||||
this.pagination.skipCount += this.pageSize;
|
this.pagination.skipCount = 0;
|
||||||
this.pagination.skipCount = this.pagination.skipCount;
|
this.pagination.maxItems = this.pagination.maxItems + this.pageSize;
|
||||||
this.pagination.merge = true;
|
this.pagination.merge = true;
|
||||||
this.loadMore.next(this.pagination);
|
this.loadMore.next(this.pagination);
|
||||||
|
|
||||||
if ((this.pagination.skipCount + this.pageSize) > this.pagination.totalItems) {
|
if (this.pagination.maxItems >= this.pagination.totalItems) {
|
||||||
this.pagination.hasMoreItems = false;
|
this.pagination.hasMoreItems = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5627
package-lock.json
generated
5627
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -92,6 +92,7 @@
|
|||||||
"ng2-charts": "1.6.0",
|
"ng2-charts": "1.6.0",
|
||||||
"ngx-monaco-editor": "^5.0.0",
|
"ngx-monaco-editor": "^5.0.0",
|
||||||
"pdfjs-dist": "2.0.303",
|
"pdfjs-dist": "2.0.303",
|
||||||
|
"protractor-retry": "^1.2.0",
|
||||||
"raphael": "2.2.7",
|
"raphael": "2.2.7",
|
||||||
"reflect-metadata": "0.1.10",
|
"reflect-metadata": "0.1.10",
|
||||||
"rxjs": "^6.0.0",
|
"rxjs": "^6.0.0",
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const {SpecReporter} = require('jasmine-spec-reporter');
|
const {SpecReporter} = require('jasmine-spec-reporter');
|
||||||
const jasmineReporters = require('jasmine-reporters');
|
const jasmineReporters = require('jasmine-reporters');
|
||||||
|
const retry = require('protractor-retry').retry;
|
||||||
|
|
||||||
const projectRoot = path.resolve(__dirname);
|
const projectRoot = path.resolve(__dirname);
|
||||||
|
|
||||||
@@ -19,9 +20,9 @@ var DIRECT_CONNECCT = SELENIUM_SERVER ? false : true;
|
|||||||
var args_options = [];
|
var args_options = [];
|
||||||
|
|
||||||
if (BROWSER_RUN === 'true') {
|
if (BROWSER_RUN === 'true') {
|
||||||
args_options = ['--incognito', '--window-size=1366,768'];
|
args_options = ['--incognito', '--window-size=1366,768', '--disable-gpu'];
|
||||||
} else {
|
} else {
|
||||||
args_options = ['--incognito', '--headless', '--window-size=1366,768'];
|
args_options = ['--incognito', '--headless', '--window-size=1366,768', '--disable-gpu'];
|
||||||
}
|
}
|
||||||
|
|
||||||
var downloadFolder = path.join(__dirname, 'e2e/downloads');
|
var downloadFolder = path.join(__dirname, 'e2e/downloads');
|
||||||
@@ -35,6 +36,9 @@ exports.config = {
|
|||||||
|
|
||||||
capabilities: {
|
capabilities: {
|
||||||
browserName: 'chrome',
|
browserName: 'chrome',
|
||||||
|
|
||||||
|
shardTestFiles: true,
|
||||||
|
maxInstances: 2,
|
||||||
chromeOptions: {
|
chromeOptions: {
|
||||||
prefs: {
|
prefs: {
|
||||||
'credentials_enable_service': false,
|
'credentials_enable_service': false,
|
||||||
@@ -77,7 +81,13 @@ exports.config = {
|
|||||||
screenshotPath: `${projectRoot}/e2e-output/screenshots/`
|
screenshotPath: `${projectRoot}/e2e-output/screenshots/`
|
||||||
}],
|
}],
|
||||||
|
|
||||||
|
onCleanUp(results) {
|
||||||
|
retry.onCleanUp(results);
|
||||||
|
},
|
||||||
|
|
||||||
onPrepare() {
|
onPrepare() {
|
||||||
|
retry.onPrepare();
|
||||||
|
|
||||||
require('ts-node').register({
|
require('ts-node').register({
|
||||||
project: 'e2e/tsconfig.e2e.json'
|
project: 'e2e/tsconfig.e2e.json'
|
||||||
});
|
});
|
||||||
@@ -112,5 +122,9 @@ exports.config = {
|
|||||||
head.appendChild(style);
|
head.appendChild(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
afterLaunch() {
|
||||||
|
return retry.afterLaunch(3);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user