mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-5021] Add listPeople method to PeopleContentService (#6947)
* [AAE-5021] Add listPeople method to PeopleContentService * lint * Replace Person with EcmUserModel * Update imports to @alfresco/adf-core * Change to const + lint
This commit is contained in:
@@ -17,8 +17,9 @@
|
||||
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { Group, NodeEntry, Person } from '@alfresco/js-api';
|
||||
import { Group, NodeEntry } from '@alfresco/js-api';
|
||||
import { NodePermissionService } from '../../services/node-permission.service';
|
||||
import { EcmUserModel } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-user-name-column',
|
||||
@@ -59,7 +60,7 @@ export class UserNameColumnComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
private updatePerson(person: Person) {
|
||||
private updatePerson(person: EcmUserModel) {
|
||||
if (person) {
|
||||
this.displayText$.next(`${person.firstName ?? ''} ${person.lastName ?? ''}`);
|
||||
this.subTitleText$.next(person.email ?? '');
|
||||
|
@@ -15,9 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Group, Node, NodeEntry, PermissionElement, Person } from '@alfresco/js-api';
|
||||
import { Group, Node, NodeEntry, PermissionElement } from '@alfresco/js-api';
|
||||
import { PermissionDisplayModel } from './permission.model';
|
||||
import { RoleModel } from './role.model';
|
||||
import { EcmUserModel } from '@alfresco/adf-core';
|
||||
|
||||
export interface NodePermissionsModel {
|
||||
node: Node;
|
||||
@@ -31,7 +32,7 @@ export class MemberModel {
|
||||
role: string;
|
||||
accessStatus: PermissionElement.AccessStatusEnum | string;
|
||||
entry: {
|
||||
person?: Person;
|
||||
person?: EcmUserModel;
|
||||
group?: Group;
|
||||
};
|
||||
readonly: boolean = false;
|
||||
@@ -46,7 +47,7 @@ export class MemberModel {
|
||||
const result = new MemberModel();
|
||||
|
||||
if (entry.nodeType === 'cm:person') {
|
||||
const person = new Person({
|
||||
const person = new EcmUserModel({
|
||||
firstName: entry.properties['cm:firstName'],
|
||||
lastName: entry.properties['cm:lastName'],
|
||||
email: entry.properties['cm:email'],
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, NodesApiService, SearchService, TranslationService } from '@alfresco/adf-core';
|
||||
import { Group, GroupMemberEntry, GroupMemberPaging, Node, PathElement, PermissionElement, Person, QueryBody } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService, NodesApiService, SearchService, TranslationService, EcmUserModel } from '@alfresco/adf-core';
|
||||
import { Group, GroupMemberEntry, GroupMemberPaging, Node, PathElement, PermissionElement, QueryBody } from '@alfresco/js-api';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { forkJoin, from, Observable, of, throwError } from 'rxjs';
|
||||
import { catchError, map, switchMap } from 'rxjs/operators';
|
||||
@@ -287,14 +287,14 @@ export class NodePermissionService {
|
||||
);
|
||||
}
|
||||
|
||||
transformNodeToUserPerson(node: Node): { person: Person, group: Group } {
|
||||
transformNodeToUserPerson(node: Node): { person: EcmUserModel, group: Group } {
|
||||
let person = null, group = null;
|
||||
if (node.nodeType === 'cm:person') {
|
||||
const firstName = node.properties['cm:firstName'];
|
||||
const lastName = node.properties['cm:lastName'];
|
||||
const email = node.properties['cm:email'];
|
||||
const id = node.properties['cm:userName'];
|
||||
person = new Person({ id, firstName, lastName, email});
|
||||
person = new EcmUserModel({ id, firstName, lastName, email});
|
||||
}
|
||||
|
||||
if (node.nodeType === 'cm:authorityContainer') {
|
||||
|
Reference in New Issue
Block a user