[AAE-5343] add update person api (#7426)

* add update person api

* fix e2e tests
This commit is contained in:
Denys Vuika 2021-12-16 11:08:09 +00:00 committed by GitHub
parent 75adf217d1
commit 65a9d2bbfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View File

@ -132,7 +132,9 @@ describe('Modify applications', () => {
'models': [firstApp.definition.models[0]], 'theme': 'theme-4',
'icon': 'glyphicon-user'
}
}, 'publish': true
},
'publish': true,
'force': true
};
await appsApi.updateAppDefinition(appVersionToBeDeleted.id, appDefinition);

View File

@ -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 } from '@alfresco/js-api';
import { PersonEntry, PeopleApi, PersonBodyCreate, Pagination, PersonBodyUpdate } from '@alfresco/js-api';
import { EcmUserModel } from '../models/ecm-user.model';
import { LogService } from './log.service';
@ -117,6 +117,20 @@ export class PeopleContentService {
);
}
/**
* Updates the person details
* @param personId The identifier of a person
* @param details The person details
* @param opts Optional parameters
* @returns Updated person model
*/
updatePerson(personId: string, details: PersonBodyUpdate, opts?: any): Observable<EcmUserModel> {
return from(this.peopleApi.updatePerson(personId, details, opts)).pipe(
map((res: PersonEntry) => <EcmUserModel> res?.entry),
catchError((error) => this.handleError(error))
);
}
async isContentAdmin(): Promise<boolean> {
if (!this.hasCheckedIsContentAdmin) {
const user: PersonEntry = await this.getCurrentPerson().toPromise();

View File

@ -113,6 +113,7 @@ export class EditProcessFilterCloudComponentPage {
async setSortFilterDropDown(option) {
await this.sortDropdown.selectDropdownOption(option);
await browser.sleep(500);
}
async getSortFilterDropDownValue(): Promise<string> {
@ -120,7 +121,7 @@ export class EditProcessFilterCloudComponentPage {
return BrowserActions.getText(sortLocator);
}
async setOrderFilterDropDown(option) {
async setOrderFilterDropDown(option: string) {
await this.orderDropdown.selectDropdownOption(option);
await browser.sleep(1500);
}