@ieeesa-npm/groups 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -145,6 +145,7 @@ export declare class TreeViewComponent implements OnInit, AfterViewInit, OnDestr
145
145
  createGroupClick: EventEmitter<GroupInfo>;
146
146
  editGroupClick: EventEmitter<EditGroupAndParentInfo>;
147
147
  deleteGroupClick: EventEmitter<GroupInfo>;
148
+ viewRosterClick: EventEmitter<GroupInfo>;
148
149
  constructor(database: Groups, elementRef: ElementRef);
149
150
  /**
150
151
  * Initializes the tree view component
@@ -245,5 +246,5 @@ export declare class TreeViewComponent implements OnInit, AfterViewInit, OnDestr
245
246
  */
246
247
  ngOnDestroy(): void;
247
248
  static ɵfac: i0.ɵɵFactoryDeclaration<TreeViewComponent, never>;
248
- static ɵcmp: i0.ɵɵComponentDeclaration<TreeViewComponent, "ieeesa-tree", never, { "parentGroupsInfo": { "alias": "parentGroupsInfo"; "required": false; }; "childGroupsInfo": { "alias": "childGroupsInfo"; "required": false; }; "isGroupSearchOrFilterActive": { "alias": "isGroupSearchOrFilterActive"; "required": false; }; "deletedGroupIdInfo": { "alias": "deletedGroupIdInfo"; "required": false; }; }, { "toggleGroupClick": "toggleGroupClick"; "createGroupClick": "createGroupClick"; "editGroupClick": "editGroupClick"; "deleteGroupClick": "deleteGroupClick"; }, never, never, true, never>;
249
+ static ɵcmp: i0.ɵɵComponentDeclaration<TreeViewComponent, "ieeesa-tree", never, { "parentGroupsInfo": { "alias": "parentGroupsInfo"; "required": false; }; "childGroupsInfo": { "alias": "childGroupsInfo"; "required": false; }; "isGroupSearchOrFilterActive": { "alias": "isGroupSearchOrFilterActive"; "required": false; }; "deletedGroupIdInfo": { "alias": "deletedGroupIdInfo"; "required": false; }; }, { "toggleGroupClick": "toggleGroupClick"; "createGroupClick": "createGroupClick"; "editGroupClick": "editGroupClick"; "deleteGroupClick": "deleteGroupClick"; "viewRosterClick": "viewRosterClick"; }, never, never, true, never>;
249
250
  }
@@ -0,0 +1,66 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { Subject } from 'rxjs';
3
+ import { SortDirection } from '@angular/material/sort';
4
+ import { TableColumnSchema, TableActions, CheckboxOption, ChipOption } from '@ieeesa-npm/presentation';
5
+ import { AlertsService, GlobalErrorHandlerService } from '@ieeesa-npm/utility';
6
+ import { GroupsService } from '../../services/groups.service';
7
+ import { User } from '../../models/user.model';
8
+ import * as i0 from "@angular/core";
9
+ /**
10
+ * ViewRosterComponent implements the functionalities to add, edit, delete user to group roster, assign and modify roles(s) to the group users, and search user from roster.
11
+ * @export
12
+ * @class ViewRosterComponent
13
+ * @implements {OnDestroy}
14
+ */
15
+ export declare class ViewRosterComponent implements OnDestroy {
16
+ private groupService;
17
+ private alertService;
18
+ private globalErrorHandlerService;
19
+ destroy$: Subject<boolean>;
20
+ constants: any;
21
+ viewRosterConstants: any;
22
+ filters: ChipOption[];
23
+ columnSchema: TableColumnSchema[];
24
+ tableData: User[];
25
+ selectedRoleIds: string[];
26
+ roles: CheckboxOption[];
27
+ rosterActions: TableActions;
28
+ defaultSortedColumn: string;
29
+ defaultColumnSortDirection: SortDirection;
30
+ constructor(groupService: GroupsService, alertService: AlertsService, globalErrorHandlerService: GlobalErrorHandlerService);
31
+ /**
32
+ * Gets the group users by calling getGroupUsers() from groupService and sets tableData to display the users in a grid.
33
+ * @memberof ViewRosterComponent
34
+ */
35
+ getGroupUsersAndInitializeTableView(): void;
36
+ /**
37
+ * Gets the selected group type roles by calling getGroupTypeRoles() from groupService and sets assign roles.
38
+ * @memberof ViewRosterComponent
39
+ */
40
+ getRoles(): void;
41
+ /**
42
+ * Gets the group users by calling searchGroupUsers() from groupService and sets tableData to display the users in a grid.
43
+ * @param {string} searchTerm -searchTerm can be user name or email and user is searched based on the email or name.
44
+ * @memberof ViewRosterComponent
45
+ */
46
+ onSearchGroupUsers(searchTerm: string): void;
47
+ /**
48
+ * Gets the group users by calling getGroupUsersByRoles() from groupService and sets tableData to display the users in a grid.
49
+ * @param {ChipOption[] | | CheckboxOption[]} roles
50
+ * @memberof ViewRosterComponent
51
+ */
52
+ onFilterUsersByRoles(roles: ChipOption[] | CheckboxOption[]): void;
53
+ /**
54
+ * Handles the custom errors while retrieving groups users, roles, search users, filter user by roles.
55
+ * @param {*} error
56
+ * @memberof ViewRosterComponent
57
+ */
58
+ handleErrors(error: any): void;
59
+ /**
60
+ * NgOnDestroy performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
61
+ * @memberof ViewRosterComponent
62
+ */
63
+ ngOnDestroy(): void;
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<ViewRosterComponent, never>;
65
+ static ɵcmp: i0.ɵɵComponentDeclaration<ViewRosterComponent, "ieeesa-view-roster", never, {}, {}, never, never, true, never>;
66
+ }
@@ -73,6 +73,12 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
73
73
  * @memberof GroupsComponent
74
74
  */
75
75
  openEditGroupForm(editGroupInfo: EditGroupAndParentInfo): void;
76
+ /**
77
+ * Sets the dialog options for users modal and calls openModal method.
78
+ * @param {GroupInfo} group
79
+ * @memberof GroupsComponent
80
+ */
81
+ viewRoster(group: GroupInfo): void;
76
82
  /**
77
83
  * Opens modal component with for received params and handles form submission success and errors.
78
84
  * @param {*} dialogOptions
@@ -1,4 +1,5 @@
1
1
  export declare enum GroupFunctionType {
2
2
  CREATE = "CREATE",
3
- EDIT = "EDIT"
3
+ EDIT = "EDIT",
4
+ VIEW_ROSTER = "VIEW_ROSTER"
4
5
  }
@@ -0,0 +1,4 @@
1
+ export interface Role {
2
+ roleId: string;
3
+ roleName: string;
4
+ }
@@ -0,0 +1,30 @@
1
+ import { Role } from './role.model';
2
+ export interface User {
3
+ userId: string;
4
+ name: string;
5
+ email: string;
6
+ role: string;
7
+ }
8
+ export interface GetGroupUsersResponse {
9
+ status: boolean;
10
+ message: string;
11
+ body: {
12
+ userId: string;
13
+ name: string;
14
+ email: string;
15
+ rolesList: Role[];
16
+ }[];
17
+ }
18
+ export interface FilterUsersByRolesPayload {
19
+ payload: {
20
+ groupId: string;
21
+ roles: string[];
22
+ };
23
+ }
24
+ export interface SearchUsersPayload {
25
+ payload: {
26
+ groupId: string;
27
+ searchByNameOrEmail: string;
28
+ roles: string[];
29
+ };
30
+ }
@@ -5,6 +5,8 @@ import { AlertsService, HttpService } from '@ieeesa-npm/utility';
5
5
  import { GetGroupResponse, GetGroupsPayload } from '../models/view-group.model';
6
6
  import { DeleteGroupPayload } from '../models/delete-group.model';
7
7
  import { GroupInfo } from '../models/group-info.model';
8
+ import { SearchUsersPayload, FilterUsersByRolesPayload, GetGroupUsersResponse, User } from '../models/user.model';
9
+ import { CheckboxOption } from '@ieeesa-npm/presentation';
8
10
  import { EditGroupPayload } from '../models/edit-group.model';
9
11
  import { GroupFunctionType } from '../models/group-function-type.model';
10
12
  import * as i0 from "@angular/core";
@@ -23,6 +25,7 @@ export declare class GroupsService {
23
25
  "1004": string;
24
26
  "1005": string;
25
27
  "1006": string;
28
+ "1007": string;
26
29
  "1008": string;
27
30
  "1009": string;
28
31
  "1010": string;
@@ -34,6 +37,15 @@ export declare class GroupsService {
34
37
  "1016": string;
35
38
  "1017": string;
36
39
  "1018": string;
40
+ "1020": string;
41
+ "1026": string;
42
+ "1027": string;
43
+ "1028": string;
44
+ "1029": string;
45
+ "1030": string;
46
+ "1031": string;
47
+ "1032": string;
48
+ "2002": string;
37
49
  };
38
50
  apiBaseUrl: string;
39
51
  userPermission: any;
@@ -114,6 +126,41 @@ export declare class GroupsService {
114
126
  * @memberof GroupsService
115
127
  */
116
128
  getGroupFunctionType(): GroupFunctionType;
129
+ /**
130
+ * Gets the group users for the given group id.
131
+ * @param {string} groupId
132
+ * @return {Observable<GetGroupUsersResponse>}
133
+ * @memberof GroupsService
134
+ */
135
+ getGroupUsers(groupId: string): Observable<GetGroupUsersResponse>;
136
+ /**
137
+ * Gets the group users based on the filtered roles.
138
+ * @param {FilterUsersByRolesPayload} payload
139
+ * @return {Observable<GetGroupUsersResponse>}
140
+ * @memberof GroupsService
141
+ */
142
+ getGroupUsersByRoles(payload: FilterUsersByRolesPayload): Observable<GetGroupUsersResponse>;
143
+ /**
144
+ * Gets the group users based on searched name or email
145
+ * @param {SearchUsersPayload} payload
146
+ * @return {Observable<GetGroupUsersResponse>}
147
+ * @memberof GroupsService
148
+ */
149
+ searchGroupUsers(payload: SearchUsersPayload): Observable<GetGroupUsersResponse>;
150
+ /**
151
+ * Gets the group roles based on the group type.
152
+ * @param {string} groupTypeId
153
+ * @return {Observable<CheckboxOption[]>}
154
+ * @memberof GroupsService
155
+ */
156
+ getGroupTypeRoles(groupTypeId: string): Observable<CheckboxOption[]>;
157
+ /**
158
+ * Concatenates the group users assigned roles name separated by comma as string and returns the group users in an array.
159
+ * @param {GetGroupUsersResponse} response
160
+ * @return {User[]}
161
+ * @memberof GroupsService
162
+ */
163
+ transformUserRolesNameAsString(response: GetGroupUsersResponse): User[];
117
164
  /**
118
165
  * Returns formatted group types.
119
166
  * @param {GroupTypeConfiguration[]} groupTypeResponse
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ieeesa-npm/groups",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0",
7
- "@ieeesa-npm/presentation": "^0.4.6",
7
+ "@ieeesa-npm/presentation": "^0.4.7",
8
8
  "@ieeesa-npm/shared-styles": "^0.1.2",
9
- "@ieeesa-npm/utility": "^0.3.7"
9
+ "@ieeesa-npm/utility": "^0.3.8"
10
10
  },
11
11
  "dependencies": {
12
12
  "tslib": "^2.3.0"