From b780bd831b4217c196975d662e3a3e9ccc92f615 Mon Sep 17 00:00:00 2001 From: suzanadirla Date: Thu, 11 Jan 2018 19:21:54 +0200 Subject: [PATCH] upgrade to ADF 2.1.0-beta6 (#174) --- package.json | 30 +++++----- .../common/services/node-actions.service.ts | 56 ++++++++++++------- 2 files changed, 51 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 9f4fd5f20..19f9d976b 100644 --- a/package.json +++ b/package.json @@ -16,20 +16,20 @@ }, "private": true, "dependencies": { - "@alfresco/adf-content-services": "2.0.0", - "@alfresco/adf-core": "2.0.0", - "@angular/animations": "5.0.0", - "@angular/cdk": "5.0.0-rc0", - "@angular/common": "5.0.0", - "@angular/compiler": "5.0.0", - "@angular/core": "5.0.0", - "@angular/flex-layout": "2.0.0-beta.10", - "@angular/forms": "5.0.0", - "@angular/http": "5.0.0", - "@angular/material": "5.0.0-rc0", - "@angular/platform-browser": "5.0.0", - "@angular/platform-browser-dynamic": "5.0.0", - "@angular/router": "5.0.0", + "@alfresco/adf-content-services": "2.1.0-beta6", + "@alfresco/adf-core": "2.1.0-beta6", + "@angular/animations": "5.1.1", + "@angular/cdk": "5.0.1", + "@angular/common": "5.1.1", + "@angular/compiler": "5.1.1", + "@angular/core": "5.1.1", + "@angular/flex-layout": "2.0.0-beta.12", + "@angular/forms": "5.1.1", + "@angular/http": "5.1.1", + "@angular/material": "5.0.1", + "@angular/platform-browser": "5.1.1", + "@angular/platform-browser-dynamic": "5.1.1", + "@angular/router": "5.1.1", "@ngx-translate/core": "8.0.0", "alfresco-js-api": "2.0.0", "core-js": "2.4.1", @@ -42,7 +42,7 @@ }, "devDependencies": { "@angular/cli": "1.5.0", - "@angular/compiler-cli": "5.0.0", + "@angular/compiler-cli": "5.1.1", "@angular/language-service": "4.4.5", "@types/jasmine": "^2.5.53", "@types/jasminewd2": "^2.0.2", diff --git a/src/app/common/services/node-actions.service.ts b/src/app/common/services/node-actions.service.ts index 17b2feb77..8d148933a 100644 --- a/src/app/common/services/node-actions.service.ts +++ b/src/app/common/services/node-actions.service.ts @@ -23,13 +23,13 @@ * along with Alfresco. If not, see . */ -import { EventEmitter, Injectable } from '@angular/core'; +import { Injectable } from '@angular/core'; import { MatDialog } from '@angular/material'; import { Observable, Subject } from 'rxjs/Rx'; -import { AlfrescoApiService, ContentService, NodesApiService, DataColumn, DataSorting } from '@alfresco/adf-core'; +import { AlfrescoApiService, ContentService, NodesApiService, DataColumn } from '@alfresco/adf-core'; import { DocumentListService, ContentNodeSelectorComponent, ContentNodeSelectorComponentData } from '@alfresco/adf-content-services'; -import { MinimalNodeEntity, MinimalNodeEntryEntity } from 'alfresco-js-api'; +import { MinimalNodeEntity, MinimalNodeEntryEntity, SitePaging } from 'alfresco-js-api'; @Injectable() export class NodeActionsService { @@ -121,7 +121,6 @@ export class NodeActionsService { }, observable.error.bind(observable) ); - this.dialog.closeAll(); }); } else { @@ -173,7 +172,7 @@ export class NodeActionsService { return entryParentId; } - getContentNodeSelection(action: string, contentEntities: MinimalNodeEntity[]): EventEmitter { + getContentNodeSelection(action: string, contentEntities: MinimalNodeEntity[]): Subject { const currentParentFolderId = this.getFirstParentId(contentEntities); let nodeEntryName = ''; @@ -181,17 +180,34 @@ export class NodeActionsService { nodeEntryName = `'${contentEntities[0].entry.name}' `; } + const customDropdown: SitePaging = { + list: { + entries: [ + { + entry: { + guid: '-my-', + title: 'APP.BROWSE.PERSONAL.SIDENAV_LINK.LABEL' + } + }, + { + entry: { + guid: '-mysites-', + title: 'APP.BROWSE.LIBRARIES.SIDENAV_LINK.LABEL' + } + } + ] + } + }; + const data: ContentNodeSelectorComponentData = { title: `${action} ${nodeEntryName}to ...`, currentFolderId: currentParentFolderId, actionName: action, dropdownHideMyFiles: true, - dropdownSiteList: [ - {title: 'APP.BROWSE.PERSONAL.SIDENAV_LINK.LABEL', guid: '-my-'}, - {title: 'APP.BROWSE.LIBRARIES.SIDENAV_LINK.LABEL', guid: '-mysites-'}], + dropdownSiteList: customDropdown, rowFilter: this.rowFilter.bind(this), imageResolver: this.imageResolver.bind(this), - select: new EventEmitter() + select: new Subject() }; const matDialogRef = this.dialog.open(ContentNodeSelectorComponent, { @@ -199,7 +215,9 @@ export class NodeActionsService { panelClass: 'adf-content-node-selector-dialog', width: '630px' }); - const destinationPicker = matDialogRef.componentInstance; + + // todo: add back the fix for [ACA-1054]: + /* const destinationPicker = matDialogRef.componentInstance; const initialSiteChanged = destinationPicker.siteChanged; destinationPicker.siteChanged = (chosenSite) => { @@ -210,21 +228,19 @@ export class NodeActionsService { } else { destinationPicker.documentList.data.setSorting(new DataSorting('name', 'asc')); } - }; + };*/ - const initialGetNextPageOfSearch = destinationPicker.getNextPageOfSearch; - destinationPicker.getNextPageOfSearch = (event) => { - destinationPicker.infiniteScroll = true; - destinationPicker.skipCount = event.skipCount; - - if (destinationPicker.searchTerm.length > 0) { - initialGetNextPageOfSearch.call(destinationPicker, event); - } - }; + data.select.subscribe({ + complete: this.close.bind(this) + }); return data.select; } + close() { + this.dialog.closeAll(); + } + copyNodeAction(nodeEntry, selectionId): Observable { if (nodeEntry.isFolder) { return this.copyFolderAction(nodeEntry, selectionId);