@ieeesa-npm/groups 0.10.5 → 0.10.6

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.
Files changed (30) hide show
  1. package/esm2022/lib/assets/constants.json +0 -10
  2. package/esm2022/lib/components/add-user-roster/add-user-roster.component.mjs +3 -3
  3. package/esm2022/lib/components/create-group/create-group.component.mjs +68 -192
  4. package/esm2022/lib/components/edit-user-roles/edit-user-roles.component.mjs +3 -3
  5. package/esm2022/lib/components/tree-view/tree-view.component.mjs +11 -16
  6. package/esm2022/lib/components/view-roster/view-roster.component.mjs +4 -5
  7. package/esm2022/lib/groups.component.mjs +19 -34
  8. package/esm2022/lib/models/group-function-type.model.mjs +1 -2
  9. package/esm2022/lib/models/group-info.model.mjs +1 -1
  10. package/esm2022/lib/models/permission-type.model.mjs +2 -6
  11. package/esm2022/lib/models/user.model.mjs +1 -1
  12. package/esm2022/lib/services/group-permissions-map-service.mjs +6 -42
  13. package/esm2022/lib/services/groups.service.mjs +6 -48
  14. package/esm2022/lib/services/user-permissions.service.mjs +5 -3
  15. package/esm2022/public-api.mjs +1 -2
  16. package/fesm2022/ieeesa-npm-groups.mjs +115 -349
  17. package/fesm2022/ieeesa-npm-groups.mjs.map +1 -1
  18. package/lib/components/create-group/create-group.component.d.ts +4 -55
  19. package/lib/groups.component.d.ts +1 -3
  20. package/lib/models/group-function-type.model.d.ts +0 -1
  21. package/lib/models/group-info.model.d.ts +0 -2
  22. package/lib/models/permission-type.model.d.ts +2 -6
  23. package/lib/models/user.model.d.ts +1 -5
  24. package/lib/services/group-permissions-map-service.d.ts +0 -13
  25. package/lib/services/groups.service.d.ts +15 -37
  26. package/lib/services/user-permissions.service.d.ts +1 -1
  27. package/package.json +4 -4
  28. package/public-api.d.ts +0 -1
  29. package/esm2022/lib/models/parent-groups-info.model.mjs +0 -2
  30. package/lib/models/parent-groups-info.model.d.ts +0 -5
@@ -1,16 +1,15 @@
1
1
  import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { FormGroup } from '@angular/forms';
3
- import { FormGrid, FormModel, SelectOption, AlignType, DynamicFormComponent, FieldConfig, SlideToggleOption } from '@ieeesa-npm/presentation';
3
+ import { FormGrid, FormModel, SelectOption, AlignType, FieldConfig } from '@ieeesa-npm/presentation';
4
4
  import { AlertsService, AlertType, GlobalErrorHandlerService } from '@ieeesa-npm/utility';
5
5
  import { GroupsService } from '../../services/groups.service';
6
6
  import { HttpErrorResponse } from '@angular/common/http';
7
7
  import { Subject } from 'rxjs';
8
8
  import { GroupInfo } from '../../models/group-info.model';
9
9
  import { GroupFunctionType } from '../../models/group-function-type.model';
10
- import { ParentGroupsInfo } from '../../models/parent-groups-info.model';
11
10
  import * as i0 from "@angular/core";
12
11
  /**
13
- * CreateGroupComponent uses DynamicFormComponent to build create new group form or edit group and implement the functionalities of submission of form and handling success and error scenarios.
12
+ * CreateGroupComponent uses DynamicFormComponent to build create new group form and implement the functionalities of submission of form and handling success and error scenarios.
14
13
  * @class CreateGroupComponent
15
14
  * @implements {OnInit}
16
15
  * @implements {OnDestroy}
@@ -34,8 +33,6 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
34
33
  heading: string;
35
34
  label: {
36
35
  parentGroup: string;
37
- changeParentGroup: string;
38
- newParentGroup: string;
39
36
  groupType: string;
40
37
  groupName: string;
41
38
  shortName: string;
@@ -44,17 +41,12 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
44
41
  leftButtonLabel: string;
45
42
  ariaLabel: {
46
43
  parentGroup: string;
47
- changeParentGroup: string;
48
- newParentGroup: string;
49
44
  groupType: string;
50
45
  groupName: string;
51
46
  shortName: string;
52
47
  groupScope: string;
53
48
  };
54
49
  ariaDescribedById: {
55
- parentGroup: string;
56
- changeParentGroup: string;
57
- newParentGroup: string;
58
50
  groupType: string;
59
51
  groupName: string;
60
52
  shortName: string;
@@ -86,7 +78,6 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
86
78
  };
87
79
  };
88
80
  supportText: {
89
- newParentGroup: string;
90
81
  groupType: string;
91
82
  groupName: string;
92
83
  shortName: string;
@@ -106,11 +97,6 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
106
97
  selectedGroupInfo: GroupInfo | undefined;
107
98
  groupFunctionType: GroupFunctionType;
108
99
  selectedGroupParentInfo: GroupInfo | undefined;
109
- allowedParentGroups: ParentGroupsInfo[];
110
- allowedParentGroupsOptions: SelectOption[];
111
- isParentGroupChanged: boolean;
112
- slideToggleOption: SlideToggleOption;
113
- dynamicFormComponent: DynamicFormComponent;
114
100
  constructor(groupsService: GroupsService, globalErrorHandlerService: GlobalErrorHandlerService, alertService: AlertsService);
115
101
  /**
116
102
  * Initialize the create group form group array and component.
@@ -128,7 +114,7 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
128
114
  * Initialize the create group form group array.
129
115
  * @memberof CreateGroupComponent
130
116
  */
131
- createFormGroup(formValue?: any): void;
117
+ createFormGroup(): void;
132
118
  /**
133
119
  * Update the create sub group form group array.
134
120
  * @param {GroupInfo} parentGroupInfo -Parent group info.
@@ -136,14 +122,6 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
136
122
  * @memberof CreateGroupComponent
137
123
  */
138
124
  updateCreateFormGroup(parentGroupInfo: GroupInfo): void;
139
- /**
140
- * Updates the create or edit user form group controls by adding fieldConfig at required index.
141
- * @param {number} indexPosition
142
- * @param {FieldConfig} fieldConfig
143
- * @return -returns nothing
144
- * @memberof CreateGroupComponent
145
- */
146
- updateAddUserFormControls(indexPosition: number, fieldConfig: FieldConfig): void;
147
125
  /**
148
126
  * Handles client side validation and calls create group or edit group methods.
149
127
  * @param {FormGroup[]} form -Array of formGroup
@@ -160,7 +138,7 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
160
138
  createGroup(formData: any): void;
161
139
  /**
162
140
  * Constructs edit group payload and calls edit group API and emits create group API response.
163
- * @param formData
141
+ * @param {*} formData
164
142
  * @return -returns nothing
165
143
  * @memberof CreateGroupComponent
166
144
  */
@@ -192,35 +170,6 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
192
170
  * @memberof CreateGroupComponent
193
171
  */
194
172
  createGroupCancelled(): void;
195
- /**
196
- * Gets allowed parent groups for reassigning the parent.
197
- * @param {string} groupId
198
- * @return -returns nothing
199
- * @memberof CreateGroupComponent
200
- */
201
- getParentGroups(groupId: string): void;
202
- /**
203
- * Update passed form field values.
204
- * @param {string} formControlName
205
- * @param {string} formControlInputProperty
206
- * @param {*} value
207
- * @memberof CreateGroupComponent
208
- */
209
- updateFormControlOptions(formControlName: string, formControlInputProperty: string, value: any): void;
210
- /**
211
- * Adds/removes new parent group selection options whenever Change Parent Group slider is toggled.
212
- * @param {SlideToggleOption} toggle
213
- * @return -returns nothing
214
- * @memberof CreateGroupComponent
215
- */
216
- onFormSlideToggleChange(toggle: SlideToggleOption): void;
217
- /**
218
- * Handles create group form change event.
219
- * @param {FormGroup[]} form
220
- * @return -returns nothing
221
- * @memberof CreateGroupComponent
222
- */
223
- onCreateGroupFormChange(form: FormGroup[]): void;
224
173
  /**
225
174
  * NgOnDestroy performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
226
175
  * @memberof CreateGroupComponent
@@ -13,7 +13,6 @@ import { EditGroupAndParentInfo } from './models/edit-group.model';
13
13
  import { UserPermissionsService } from './services/user-permissions.service';
14
14
  import { GroupPermission, UserPermission } from './models/group-permissions.model';
15
15
  import { PermissionType } from './models/permission-type.model';
16
- import { GroupPermissionsMapService } from './services/group-permissions-map-service';
17
16
  import * as i0 from "@angular/core";
18
17
  /**
19
18
  * Groups component is a wrapper or container component for groups management reusable component and in this component integrates all group management functionalities and this will be entry component for managing groups when it is consumed in other applications.
@@ -26,7 +25,6 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
26
25
  private breakpointObserverService;
27
26
  globalErrorHandlerService: GlobalErrorHandlerService;
28
27
  private userPermissionsService;
29
- private groupPermissionsService;
30
28
  destroy$: Subject<boolean>;
31
29
  dialogRef: any;
32
30
  constants: any;
@@ -69,7 +67,7 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
69
67
  trimmedSearchTerm: string;
70
68
  userGroupPermissions: GroupPermission[];
71
69
  supportMessage: string;
72
- constructor(dialog: MatDialog, groupsService: GroupsService, alertService: AlertsService, breakpointObserverService: BreakpointObserverService, globalErrorHandlerService: GlobalErrorHandlerService, userPermissionsService: UserPermissionsService, groupPermissionsService: GroupPermissionsMapService);
70
+ constructor(dialog: MatDialog, groupsService: GroupsService, alertService: AlertsService, breakpointObserverService: BreakpointObserverService, globalErrorHandlerService: GlobalErrorHandlerService, userPermissionsService: UserPermissionsService);
73
71
  /**
74
72
  * Initialize the groups component.
75
73
  * @return -returns nothing
@@ -5,7 +5,6 @@ export declare enum GroupFunctionType {
5
5
  FILTER = "FILTER",
6
6
  TOGGLE = "TOGGLE",
7
7
  SEARCH = "SEARCH",
8
- REASSIGN_PARENT_GROUP = "REASSIGN_PARENT_GROUP",
9
8
  EDIT_ROSTER_USER_ROLE = "EDIT_ROSTER_USER_ROLE",
10
9
  ADD_USER_TO_ROSTER = "ADD_USER_TO_ROSTER"
11
10
  }
@@ -1,4 +1,3 @@
1
- import { UserPermission } from './group-permissions.model';
2
1
  import { GroupType } from './group-types.model';
3
2
  export interface GroupInfo {
4
3
  groupId: string;
@@ -13,5 +12,4 @@ export interface GroupInfo {
13
12
  groupTypeInfo?: GroupType;
14
13
  children?: GroupInfo[];
15
14
  noOfChildren?: number;
16
- permissions: UserPermission[] | null;
17
15
  }
@@ -4,13 +4,9 @@ export declare enum PermissionType {
4
4
  CREATE_SUBGROUP = "CREATE_SUBGROUP",
5
5
  EDIT_GROUP = "EDIT_GROUP",
6
6
  DELETE_GROUP = "DELETE_GROUP",
7
+ MANAGE_SYSTEM_USERS = "MANAGE_SYSTEM_USERS",
7
8
  VIEW_GROUP_OFFICERS = "VIEW_GROUP_OFFICERS",
8
9
  MANAGE_GROUP_OFFICERS = "MANAGE_GROUP_OFFICERS",
9
10
  VIEW_GROUP_MEMBERS = "VIEW_GROUP_MEMBERS",
10
- MANAGE_GROUP_MEMBERS = "MANAGE_GROUP_MEMBERS",
11
- MANAGE_SYSTEM_USERS = "MANAGE_SYSTEM_USERS",
12
- VIEW_ALL_GROUPS = "VIEW_ALL_GROUPS",
13
- MANAGE_ALL_GROUPS = "MANAGE_ALL_GROUPS",
14
- VIEW_ALL_ROSTERS = "VIEW_ALL_ROSTERS",
15
- MANAGE_ALL_ROSTERS = "MANAGE_ALL_ROSTERS"
11
+ MANAGE_GROUP_MEMBERS = "MANAGE_GROUP_MEMBERS"
16
12
  }
@@ -13,10 +13,6 @@ export interface User {
13
13
  employer: string | null;
14
14
  checked?: boolean;
15
15
  }
16
- export interface Employer {
17
- orgId: string | null;
18
- orgName: string | null;
19
- }
20
16
  export interface GetGroupUsersResponse {
21
17
  status: boolean;
22
18
  message: string;
@@ -28,7 +24,7 @@ export interface GetGroupUsersResponse {
28
24
  classification: Classification | null;
29
25
  memberStatus: MemberType | null;
30
26
  organization: Organization | null;
31
- employer: Employer | null;
27
+ employer: string | null;
32
28
  }[];
33
29
  }
34
30
  export interface FilterUsersPayload {
@@ -2,20 +2,7 @@ import { GroupPermission } from '../models/group-permissions.model';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class GroupPermissionsMapService {
4
4
  groupPermissions: GroupPermission[];
5
- globalGroupPermissions: GroupPermission[];
6
- /**
7
- * Returns group-wise permission mappings.
8
- * @return {GroupPermission[]}
9
- * @memberof GroupPermissionsMapService
10
- */
11
5
  getGroupPermissions(): GroupPermission[];
12
- /**
13
- * Returns global permissions mapping for groups.
14
- * Global permissions are maintained separately as global permissions also include role based group wise permissions irrespective of the attached group.
15
- * @return {GroupPermission[]}
16
- * @memberof GroupPermissionsMapService
17
- */
18
- getGlobalGroupPermissions(): GroupPermission[];
19
6
  static ɵfac: i0.ɵɵFactoryDeclaration<GroupPermissionsMapService, never>;
20
7
  static ɵprov: i0.ɵɵInjectableDeclaration<GroupPermissionsMapService>;
21
8
  }
@@ -19,11 +19,9 @@ import { MemberTypeResponse } from '../models/member-type.model';
19
19
  import { ClassificationResponse } from '../models/classification.model';
20
20
  import { GroupRosterType } from '../models/roster-type.model';
21
21
  import { FormControlStatus } from '@angular/forms';
22
- import { GroupPermission, UserPermission } from '../models/group-permissions.model';
22
+ import { GroupPermission } from '../models/group-permissions.model';
23
23
  import { PermissionType } from '../models/permission-type.model';
24
24
  import { UserPermissionsService } from './user-permissions.service';
25
- import { GroupPermissionsMapService } from './group-permissions-map-service';
26
- import { ParentGroupsInfo } from '../models/parent-groups-info.model';
27
25
  import * as i0 from "@angular/core";
28
26
  /**
29
27
  * Groups service is an abstract layer and responsible for managing groups REST API calls.
@@ -32,7 +30,6 @@ import * as i0 from "@angular/core";
32
30
  export declare class GroupsService {
33
31
  private httpService;
34
32
  private userPermissionsService;
35
- private groupPermissionsService;
36
33
  alertService: AlertsService;
37
34
  groupsText: {
38
35
  ER1000: string;
@@ -48,7 +45,11 @@ export declare class GroupsService {
48
45
  "1009": string;
49
46
  "1010": string;
50
47
  "1011": string;
51
- "1012": string;
48
+ "1012": string; /**
49
+ * Returns the selected group parent group info.
50
+ * @return {(GroupInfo | undefined)} -group info.
51
+ * @memberof GroupsService
52
+ */
52
53
  "1013": string;
53
54
  "1014": string;
54
55
  "1015": string;
@@ -69,19 +70,18 @@ export declare class GroupsService {
69
70
  "1030": string;
70
71
  "1031": string;
71
72
  "1032": string;
72
- "1033": string; /**
73
- * Gets the group users for the given group id.
74
- * @param {string} groupId
75
- * @return {Observable<GetGroupUsersResponse>}
76
- * @memberof GroupsService
77
- */
73
+ "1033": string;
78
74
  "1034": string;
79
75
  "1035": string;
80
76
  "1036": string;
81
- "1037": string;
82
- "1038": string;
83
77
  "2001": string;
84
78
  "2002": string;
79
+ /**
80
+ * Gets the group users based on the filtered roles.
81
+ * @param {FilterUsersPayload} payload
82
+ * @return {Observable<GetGroupUsersResponse>}
83
+ * @memberof GroupsService
84
+ */
85
85
  "2010": string;
86
86
  "2011": string;
87
87
  "20l2": string;
@@ -110,8 +110,7 @@ export declare class GroupsService {
110
110
  rosterFunctionType: RosterFunctionType;
111
111
  userGroupPermissions: GroupPermission[];
112
112
  groupTypes: GroupTypeConfiguration[];
113
- isParentGroupChanged: boolean;
114
- constructor(httpService: HttpService, userPermissionsService: UserPermissionsService, groupPermissionsService: GroupPermissionsMapService, alertService: AlertsService);
113
+ constructor(httpService: HttpService, userPermissionsService: UserPermissionsService, alertService: AlertsService);
115
114
  setAppConfig(apiBaseUrl: string, userPermission: any): void;
116
115
  /**
117
116
  * Gets application group types from API and returns it as an observable.
@@ -119,13 +118,6 @@ export declare class GroupsService {
119
118
  * @memberof GroupsService
120
119
  */
121
120
  getGroupTypes(): Observable<GroupTypeResponse>;
122
- /**
123
- * Get allowed parent groups from API and returns it as an observable.
124
- * @param {string} groupId
125
- * @return {Observable<GroupTypeResponse>}
126
- * @memberof GroupsService
127
- */
128
- getAllowedParentGroups(groupId: string): Observable<ParentGroupsInfo[]>;
129
121
  /**
130
122
  * Returns all the groups based on passed group Id and group type.
131
123
  * @param {GetGroupsPayload} getGroupsPayload
@@ -341,13 +333,11 @@ export declare class GroupsService {
341
333
  getUserGroupPermissions(): GroupPermission[];
342
334
  /**
343
335
  * Validates permission based access for provided feature.
344
- * Checks for group level permissions, and provides access based on individual group permissions.
345
- * For global permissions provides access across the individual groups or System groups.
346
336
  * @param {PermissionType} permissionType
347
337
  * @return {boolean}
348
338
  * @memberof GroupsService
349
339
  */
350
- validateAccess(permissionType: PermissionType, permissions?: UserPermission[] | null): boolean;
340
+ validateAccess(permissionType: PermissionType): boolean;
351
341
  /**
352
342
  * Store the loaded group types.
353
343
  * @param {GroupTypeConfiguration[]} groupTypes
@@ -382,18 +372,6 @@ export declare class GroupsService {
382
372
  * @memberof GroupsService
383
373
  */
384
374
  isSubmitButtonDisabled(groupRosterType: GroupRosterType, formStatus: FormControlStatus, selectedUserRoles: string[]): boolean;
385
- /**
386
- * Sets isParentGroupChanged true or false.
387
- * @param {boolean} isParentGroupChanged
388
- * @memberof GroupsService
389
- */
390
- setParentGroupChangeStatus(isParentGroupChanged: boolean): void;
391
- /**
392
- * Returns isParentGroupChanged value.
393
- * @return {boolean}
394
- * @memberof GroupsService
395
- */
396
- getParentGroupChangeStatus(): boolean;
397
375
  static ɵfac: i0.ɵɵFactoryDeclaration<GroupsService, never>;
398
376
  static ɵprov: i0.ɵɵInjectableDeclaration<GroupsService>;
399
377
  }
@@ -19,7 +19,7 @@ export declare class UserPermissionsService {
19
19
  * @return {GroupPermissions[]}
20
20
  * @memberof UserPermissionsService
21
21
  */
22
- filterUserGroupPermissions(userPermissions: UserPermission[], groupPermissions: GroupPermission[]): GroupPermission[];
22
+ filterUserGroupPermissions(userPermissions: UserPermission[]): GroupPermission[];
23
23
  static ɵfac: i0.ɵɵFactoryDeclaration<UserPermissionsService, never>;
24
24
  static ɵprov: i0.ɵɵInjectableDeclaration<UserPermissionsService>;
25
25
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ieeesa-npm/groups",
3
- "version": "0.10.5",
3
+ "version": "0.10.6",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0",
7
- "@ieeesa-npm/presentation": "^0.11.0",
8
- "@ieeesa-npm/shared-styles": "^0.2.6",
9
- "@ieeesa-npm/utility": "^0.9.9"
7
+ "@ieeesa-npm/presentation": "^0.11.1",
8
+ "@ieeesa-npm/shared-styles": "^0.2.7",
9
+ "@ieeesa-npm/utility": "^0.10.0"
10
10
  },
11
11
  "dependencies": {
12
12
  "tslib": "^2.3.0"
package/public-api.d.ts CHANGED
@@ -20,7 +20,6 @@ export * from './lib/models/organization.model';
20
20
  export * from './lib/models/member-type.model';
21
21
  export * from './lib/models/roster-type.model';
22
22
  export * from './lib/models/table-column-schema-user-group.model';
23
- export * from './lib/models/parent-groups-info.model';
24
23
  export * from './lib/services/groups.service';
25
24
  export * from './lib/assets/form-validations';
26
25
  export * from './lib/groups.module';
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyZW50LWdyb3Vwcy1pbmZvLm1vZGVsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZ3JvdXBzL3NyYy9saWIvbW9kZWxzL3BhcmVudC1ncm91cHMtaW5mby5tb2RlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBQYXJlbnRHcm91cHNJbmZvIHtcclxuICBncm91cElkOiBzdHJpbmc7XHJcbiAgZ3JvdXBOYW1lOiBzdHJpbmc7XHJcbiAgZ3JvdXBBY3JvbnltOiBzdHJpbmc7XHJcbn0iXX0=
@@ -1,5 +0,0 @@
1
- export interface ParentGroupsInfo {
2
- groupId: string;
3
- groupName: string;
4
- groupAcronym: string;
5
- }