Skip to content

Commit

Permalink
[AAE-5343] add update person api (#7426)
Browse files Browse the repository at this point in the history
* add update person api

* fix e2e tests
  • Loading branch information
DenysVuika committed Dec 16, 2021
1 parent 75adf21 commit 65a9d2b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
4 changes: 3 additions & 1 deletion e2e/process-services/form/apps-section.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 15 additions & 1 deletion lib/core/services/people-content.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ export class EditProcessFilterCloudComponentPage {

async setSortFilterDropDown(option) {
await this.sortDropdown.selectDropdownOption(option);
await browser.sleep(500);
}

async getSortFilterDropDownValue(): Promise<string> {
const sortLocator = $$("mat-form-field[data-automation-id='sort'] span").first();
return BrowserActions.getText(sortLocator);
}

async setOrderFilterDropDown(option) {
async setOrderFilterDropDown(option: string) {
await this.orderDropdown.selectDropdownOption(option);
await browser.sleep(1500);
}
Expand Down

0 comments on commit 65a9d2b

Please sign in to comment.