mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-5483] group details view general info and list of assigned users (#9329)
* ACS-5483 Added possibility to load and update group * ACS-5483 Implemented unsaved changes dialog * ACS-5483 Removed console log * ACS-5483 Made dynamic chip list reusable * ACS-5483 Fix for more than one row chips * ACS-5483 Fix for pagination * ACS-5483 Added some fixes * ACS-5483 Fixed displaying tags for node * ACS-5483 Renamed css classes * ACS-5483 Fixed resizing when chips have pagination * ACS-5483 Clearing code * ACS-5483 Documentation for dynamic chip list component * ACS-5483 Documentation for unsaved changes dialog and guard * ACS-5483 Documentation for group service * ACS-5483 Unit tests for GroupService * ACS-5483 Unit tests for dynamic chip list component * ACS-5483 Changed fdescribe to describe * ACS-5483 Unit tests for tag node list component * ACS-5483 Unit tests for unsaved changes dialog component * ACS-5483 Unit tests for unsaved changes guard * ACS-5483 Added description field to group models * ACS-5483 Correction for updating with description * ACS-5483 Fixed lint issues * ACS-5483 Addressed PR comments * ACS-5483 Reduced complexity * ACS-5483 Reduced complexity * ACS-5483 Addressed PR comments
This commit is contained in:
@@ -16,8 +16,10 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { GroupEntry, GroupsApi } from '@alfresco/js-api';
|
||||
import { ContentIncludeQuery, Group, GroupEntry, GroupsApi } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { from, Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -48,4 +50,35 @@ export class GroupService {
|
||||
return accumulator;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns group for specified id.
|
||||
*
|
||||
* @param id id of group to return.
|
||||
* @param opts additional query parameters
|
||||
* @returns Observable<GroupEntry> group for specified id.
|
||||
*/
|
||||
getGroup(id: string, opts?: ContentIncludeQuery): Observable<GroupEntry> {
|
||||
return from(this.groupsApi.getGroup(id, opts)).pipe(map((group) => {
|
||||
group.entry.description ||= '';
|
||||
return group;
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates specified group.
|
||||
*
|
||||
* @param group group to update.
|
||||
* @param opts additional query parameters
|
||||
* @returns Observable<GroupEntry> updated group.
|
||||
*/
|
||||
updateGroup(group: Group, opts?: ContentIncludeQuery): Observable<GroupEntry> {
|
||||
return from(this.groupsApi.updateGroup(group.id, {
|
||||
displayName: group.displayName,
|
||||
description: group.description
|
||||
}, opts)).pipe(map((updatedGroup) => {
|
||||
updatedGroup.entry.description ||= '';
|
||||
return updatedGroup;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user