From 59fa28f6831fd358596252ef896d5278531e8682 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 12 Apr 2019 15:26:49 +0100 Subject: [PATCH] upgrade to latest ADF 3.2 alpha (#1069) --- package-lock.json | 59 ++++++--- package.json | 6 +- src/app/app.module.ts | 5 +- .../components/preview/preview.component.ts | 28 ++++- src/app/services/data.service.ts | 119 ------------------ 5 files changed, 68 insertions(+), 149 deletions(-) delete mode 100644 src/app/services/data.service.ts diff --git a/package-lock.json b/package-lock.json index 04bd52e3e..6ead01c2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,25 +5,25 @@ "requires": true, "dependencies": { "@alfresco/adf-content-services": { - "version": "3.2.0-a87d1ef002cf53e1592ed984a5bce0038eda6fad", - "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-3.2.0-a87d1ef002cf53e1592ed984a5bce0038eda6fad.tgz", - "integrity": "sha512-X/5oQdWxdV1ij8yIwim5LHEj2gIFywHBZ3/PBBSlk1TAiY2lWt/QIJ3fPbqIGrXarp5vezA/NCiXPI1BPTyNvw==", + "version": "3.2.0-6ad63055b35b43eb305359b6f47851facd672476", + "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-3.2.0-6ad63055b35b43eb305359b6f47851facd672476.tgz", + "integrity": "sha512-em9lmfsdco7q6nQrvBsnnyxZhxYFgqsjnrPUJkF30U20HVbLn9C0PQpqch24qoJGF//qMzvnIR+DmkeUmYntbA==", "requires": { "tslib": "^1.9.0" } }, "@alfresco/adf-core": { - "version": "3.2.0-a87d1ef002cf53e1592ed984a5bce0038eda6fad", - "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-3.2.0-a87d1ef002cf53e1592ed984a5bce0038eda6fad.tgz", - "integrity": "sha512-Z3DSR/gu9vlmczmXJHt07p49e6cl9aJ4Xu3Xj/MGlrveUG333v4wCwaTMfSaVv80Ca5QhKqR+P/vHLjvJuoAhw==", + "version": "3.2.0-dac3bed09f5e8235868555c24102f91dcae9c6e1", + "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-3.2.0-dac3bed09f5e8235868555c24102f91dcae9c6e1.tgz", + "integrity": "sha512-GwSkh42tUvTRjfnkZ8kJiuF8wB0C4137cm/JA11raT5mihrCzTBwH3GutmnWRZuxLXE4wwKRquTD5s0Bbh4K1w==", "requires": { "tslib": "^1.9.0" } }, "@alfresco/adf-extensions": { - "version": "3.2.0-a87d1ef002cf53e1592ed984a5bce0038eda6fad", - "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-3.2.0-a87d1ef002cf53e1592ed984a5bce0038eda6fad.tgz", - "integrity": "sha512-eVL1O1yZFQJdvOfrHwD+NW7kox2lkhldX/5FOUD7X70my6MGQjXPtPupwhruvda94LFgjM8FDmbSr8ahns+KQw==", + "version": "3.2.0-6ad63055b35b43eb305359b6f47851facd672476", + "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-3.2.0-6ad63055b35b43eb305359b6f47851facd672476.tgz", + "integrity": "sha512-YIFi8iZg8/2/e866a9KXb3sOlzbjd1MePp7L0bA2YLQE+gOw7Xka4e++ieZtLA6Oo7SWZt1l6wkdfscx+WS/cQ==", "requires": { "tslib": "^1.9.0" } @@ -4959,7 +4959,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -4980,12 +4981,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5000,17 +5003,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -5127,7 +5133,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -5139,6 +5146,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5153,6 +5161,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5160,12 +5169,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -5184,6 +5195,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -5264,7 +5276,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -5276,6 +5289,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -5361,7 +5375,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -5397,6 +5412,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5416,6 +5432,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -5459,12 +5476,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, diff --git a/package.json b/package.json index 7e09f0fb3..dcc15e88c 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,9 @@ }, "private": true, "dependencies": { - "@alfresco/adf-content-services": "3.2.0-a87d1ef002cf53e1592ed984a5bce0038eda6fad", - "@alfresco/adf-core": "3.2.0-a87d1ef002cf53e1592ed984a5bce0038eda6fad", - "@alfresco/adf-extensions": "3.2.0-a87d1ef002cf53e1592ed984a5bce0038eda6fad", + "@alfresco/adf-content-services": "3.2.0-6ad63055b35b43eb305359b6f47851facd672476", + "@alfresco/adf-core": "3.2.0-dac3bed09f5e8235868555c24102f91dcae9c6e1", + "@alfresco/adf-extensions": "3.2.0-6ad63055b35b43eb305359b6f47851facd672476", "@alfresco/js-api": "3.1.0-2c7e78d49c51ba0966d4e6c4dedf2b64da83d630", "@angular/animations": "7.2.12", "@angular/cdk": "^7.3.7", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 639f0ccc7..c8068b034 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -39,8 +39,7 @@ import { } from '@alfresco/adf-core'; import { LibraryDialogComponent, - ContentModule, - CustomResourcesService + ContentModule } from '@alfresco/adf-content-services'; import { AppComponent } from './app.component'; @@ -76,7 +75,6 @@ import { AppLoginModule } from './components/login/login.module'; import { AppHeaderModule } from './components/header/header.module'; import { AppNodeVersionModule } from './components/node-version/node-version.module'; import { environment } from '../environments/environment'; -import { AppDataService } from './services/data.service'; @NgModule({ imports: [ @@ -124,7 +122,6 @@ import { AppDataService } from './services/data.service'; providers: [ { provide: RouteReuseStrategy, useClass: AppRouteReuseStrategy }, { provide: AppConfigService, useClass: DebugAppConfigService }, - { provide: CustomResourcesService, useClass: AppDataService }, { provide: TRANSLATION_PROVIDER, multi: true, diff --git a/src/app/components/preview/preview.component.ts b/src/app/components/preview/preview.component.ts index 98d3eff00..376ebbd13 100644 --- a/src/app/components/preview/preview.component.ts +++ b/src/app/components/preview/preview.component.ts @@ -54,7 +54,6 @@ import { AppExtensionService } from '../../extensions/extension.service'; import { ContentManagementService } from '../../services/content-management.service'; import { ContentActionRef, ViewerExtensionRef } from '@alfresco/adf-extensions'; import { SearchRequest } from '@alfresco/js-api'; -import { AppDataService } from '../../services/data.service'; import { from } from 'rxjs'; @Component({ @@ -85,10 +84,33 @@ export class PreviewComponent extends PageComponent contentExtensions: Array = []; showRightSide = false; + recentFileFilters = [ + 'TYPE:"content"', + '-PNAME:"0/wiki"', + '-TYPE:"app:filelink"', + '-TYPE:"fm:post"', + '-TYPE:"cm:thumbnail"', + '-TYPE:"cm:failedThumbnail"', + '-TYPE:"cm:rating"', + '-TYPE:"dl:dataList"', + '-TYPE:"dl:todoList"', + '-TYPE:"dl:issue"', + '-TYPE:"dl:contact"', + '-TYPE:"dl:eventAgenda"', + '-TYPE:"dl:event"', + '-TYPE:"dl:task"', + '-TYPE:"dl:simpletask"', + '-TYPE:"dl:meetingAgenda"', + '-TYPE:"dl:location"', + '-TYPE:"fm:topic"', + '-TYPE:"fm:post"', + '-TYPE:"ia:calendarEvent"', + '-TYPE:"lnk:link"' + ]; + constructor( private contentApi: ContentApiService, private preferences: UserPreferencesService, - private appDataService: AppDataService, private route: ActivatedRoute, private router: Router, private apiService: AlfrescoApiService, @@ -370,7 +392,7 @@ export class PreviewComponent extends PageComponent { query: `cm:modified:[NOW/DAY-30DAYS TO NOW/DAY+1DAY]` }, { query: `cm:modifier:${username} OR cm:creator:${username}` }, { - query: this.appDataService.recentFileFilters.join(' AND ') + query: this.recentFileFilters.join(' AND ') } ], fields: ['id', this.getRootField(sortingKey)], diff --git a/src/app/services/data.service.ts b/src/app/services/data.service.ts deleted file mode 100644 index a8ce3404f..000000000 --- a/src/app/services/data.service.ts +++ /dev/null @@ -1,119 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2019 Alfresco Software Limited - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -import { Injectable } from '@angular/core'; -import { CustomResourcesService } from '@alfresco/adf-content-services'; -import { - PaginationModel, - LogService, - AlfrescoApiService -} from '@alfresco/adf-core'; -import { Observable } from 'rxjs'; -import { PersonEntry, SearchRequest, ResultSetPaging } from '@alfresco/js-api'; - -@Injectable({ - providedIn: 'root' -}) -export class AppDataService extends CustomResourcesService { - recentFileFilters = [ - 'TYPE:"content"', - '-PNAME:"0/wiki"', - '-TYPE:"app:filelink"', - '-TYPE:"fm:post"', - '-TYPE:"cm:thumbnail"', - '-TYPE:"cm:failedThumbnail"', - '-TYPE:"cm:rating"', - '-TYPE:"dl:dataList"', - '-TYPE:"dl:todoList"', - '-TYPE:"dl:issue"', - '-TYPE:"dl:contact"', - '-TYPE:"dl:eventAgenda"', - '-TYPE:"dl:event"', - '-TYPE:"dl:task"', - '-TYPE:"dl:simpletask"', - '-TYPE:"dl:meetingAgenda"', - '-TYPE:"dl:location"', - '-TYPE:"fm:topic"', - '-TYPE:"fm:post"', - '-TYPE:"ia:calendarEvent"', - '-TYPE:"lnk:link"' - ]; - - constructor(private api: AlfrescoApiService, logService: LogService) { - super(api, logService); - } - - getRecentFiles( - personId: string, - pagination: PaginationModel - ): Observable { - return new Observable(observer => { - this.api.peopleApi.getPerson(personId).then( - (person: PersonEntry) => { - const username = person.entry.id; - const query: SearchRequest = { - query: { - query: '*', - language: 'afts' - }, - filterQueries: [ - { query: `cm:modified:[NOW/DAY-30DAYS TO NOW/DAY+1DAY]` }, - { query: `cm:modifier:${username} OR cm:creator:${username}` }, - { - query: this.recentFileFilters.join(' AND ') - } - ], - include: ['path', 'properties', 'allowableOperations'], - sort: [ - { - type: 'FIELD', - field: 'cm:modified', - ascending: false - } - ], - paging: { - maxItems: pagination.maxItems, - skipCount: pagination.skipCount - } - }; - return this.api.searchApi.search(query).then( - searchResult => { - observer.next(searchResult); - observer.complete(); - }, - err => { - observer.error(err); - observer.complete(); - } - ); - }, - err => { - observer.error(err); - observer.complete(); - } - ); - }); - } -}