From 15dd04149e01a64115a7d0dc3a80054e50a8bc80 Mon Sep 17 00:00:00 2001 From: arditdomi <32884230+arditdomi@users.noreply.github.com> Date: Wed, 23 Jun 2021 14:56:07 +0100 Subject: [PATCH] Revert "[AAE-5392] - Add find people api call (#7119)" This reverts commit 1e251ab8aa4efcccdb7d72a94a34f30c7b040673. --- docs/core/services/people-content.service.md | 5 ---- .../services/people-content.service.spec.ts | 9 ------- lib/core/services/people-content.service.ts | 26 +------------------ 3 files changed, 1 insertion(+), 39 deletions(-) diff --git a/docs/core/services/people-content.service.md b/docs/core/services/people-content.service.md index 2e74eae1bf2..9d927d0ed03 100644 --- a/docs/core/services/people-content.service.md +++ b/docs/core/services/people-content.service.md @@ -34,11 +34,6 @@ Gets information about a Content Services user. - _requestQuery:_ [`PeopleContentQueryRequestModel`](../../../lib/core/services/people-content.service.ts) - (Optional) maxItems and skipCount used for pagination - **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`[]>` - Array of people -- **findPeople**(searchTerm: string, requestQuery?: [`PeopleContentQueryRequestModel`](../../../lib/core/services/people-content.service.ts#32)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`[]>`
- Gets a list of people. - - _searchTerm:_ `string` - The term to search for - - _requestQuery:_ [`PeopleContentQueryRequestModel`](../../../lib/core/services/people-content.service.ts) - (Optional) maxItems and skipCount used for pagination - - **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`[]>` - Array of people ## Details The class returned by `getPerson` and `getCurrentPerson` is detailed diff --git a/lib/core/services/people-content.service.spec.ts b/lib/core/services/people-content.service.spec.ts index 6e675774a68..9c2498087b8 100644 --- a/lib/core/services/people-content.service.spec.ts +++ b/lib/core/services/people-content.service.spec.ts @@ -94,15 +94,6 @@ describe('PeopleContentService', () => { }); }); - it('should search for users with search term and pagination info', (done) => { - const findPeopleSpy = spyOn(service.queriesApi, 'findPeople').and.returnValue(Promise.resolve({ ...fakeEcmUserList })); - - service.findPeople('fake-term', { skipCount: 5, maxItems: 10 }).subscribe(() => { - expect(findPeopleSpy).toHaveBeenCalledWith('fake-term', { skipCount: 5, maxItems: 10 }); - done(); - }); - }); - it('should be able to create new person', (done) => { spyOn(service.peopleApi, 'createPerson').and.returnValue(Promise.resolve(new PersonEntry({ entry: fakeEcmUser }))); service.createPerson(createNewPersonMock).subscribe((person) => { diff --git a/lib/core/services/people-content.service.ts b/lib/core/services/people-content.service.ts index 02145cb8f62..48f504029a9 100644 --- a/lib/core/services/people-content.service.ts +++ b/lib/core/services/people-content.service.ts @@ -19,7 +19,7 @@ import { Injectable } from '@angular/core'; import { Observable, from, throwError } from 'rxjs'; import { AlfrescoApiService } from './alfresco-api.service'; import { catchError, map } from 'rxjs/operators'; -import { PersonEntry, PeopleApi, PersonBodyCreate, Pagination, QueriesApi } from '@alfresco/js-api'; +import { PersonEntry, PeopleApi, PersonBodyCreate, Pagination } from '@alfresco/js-api'; import { EcmUserModel } from '../models/ecm-user.model'; import { LogService } from './log.service'; @@ -45,7 +45,6 @@ export class PeopleContentService { hasCheckedIsContentAdmin: boolean = false; private _peopleApi: PeopleApi; - private _queriesApi: QueriesApi; constructor(private apiService: AlfrescoApiService, private logService: LogService) {} @@ -53,10 +52,6 @@ export class PeopleContentService { return this._peopleApi || (this._peopleApi = new PeopleApi(this.apiService.getInstance())); } - get queriesApi() { - return this._queriesApi || (this._queriesApi = new QueriesApi(this.apiService.getInstance())); - } - /** * Gets information about a user identified by their username. * @param personId ID of the target user @@ -96,25 +91,6 @@ export class PeopleContentService { ); } - /** - * Gets a list of people that match the given search criteria. - * @param searchTerm The term to search for - * @param requestQuery maxItems and skipCount parameters supported by JS-API - * @returns Response containing pagination and list of entries - */ - findPeople(searchTerm: string, requestQuery?: PeopleContentQueryRequestModel): Observable { - const promise = this.queriesApi.findPeople(searchTerm, { ...requestQuery }); - return from(promise).pipe( - map(response => { - return { - pagination: response.list.pagination, - entries: response.list.entries.map((person: PersonEntry) => person.entry) - }; - }), - catchError((err) => this.handleError(err)) - ); - } - /** * Creates new person. * @param newPerson Object containing the new person details.