@ieeesa-npm/groups 0.9.8 → 0.9.9

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.
@@ -1,15 +1,16 @@
1
1
  import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { FormGroup } from '@angular/forms';
3
- import { FormGrid, FormModel, SelectOption, AlignType, FieldConfig } from '@ieeesa-npm/presentation';
3
+ import { FormGrid, FormModel, SelectOption, AlignType, DynamicFormComponent, FieldConfig, SlideToggleOption } 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';
10
11
  import * as i0 from "@angular/core";
11
12
  /**
12
- * CreateGroupComponent uses DynamicFormComponent to build create new group form and implement the functionalities of submission of form and handling success and error scenarios.
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.
13
14
  * @class CreateGroupComponent
14
15
  * @implements {OnInit}
15
16
  * @implements {OnDestroy}
@@ -33,6 +34,8 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
33
34
  heading: string;
34
35
  label: {
35
36
  parentGroup: string;
37
+ changeParentGroup: string;
38
+ newParentGroup: string;
36
39
  groupType: string;
37
40
  groupName: string;
38
41
  shortName: string;
@@ -41,12 +44,17 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
41
44
  leftButtonLabel: string;
42
45
  ariaLabel: {
43
46
  parentGroup: string;
47
+ changeParentGroup: string;
48
+ newParentGroup: string;
44
49
  groupType: string;
45
50
  groupName: string;
46
51
  shortName: string;
47
52
  groupScope: string;
48
53
  };
49
54
  ariaDescribedById: {
55
+ parentGroup: string;
56
+ changeParentGroup: string;
57
+ newParentGroup: string;
50
58
  groupType: string;
51
59
  groupName: string;
52
60
  shortName: string;
@@ -78,6 +86,7 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
78
86
  };
79
87
  };
80
88
  supportText: {
89
+ newParentGroup: string;
81
90
  groupType: string;
82
91
  groupName: string;
83
92
  shortName: string;
@@ -97,6 +106,11 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
97
106
  selectedGroupInfo: GroupInfo | undefined;
98
107
  groupFunctionType: GroupFunctionType;
99
108
  selectedGroupParentInfo: GroupInfo | undefined;
109
+ allowedParentGroups: ParentGroupsInfo[];
110
+ allowedParentGroupsOptions: SelectOption[];
111
+ isParentGroupChanged: boolean;
112
+ slideToggleOption: SlideToggleOption;
113
+ dynamicFormComponent: DynamicFormComponent;
100
114
  constructor(groupsService: GroupsService, globalErrorHandlerService: GlobalErrorHandlerService, alertService: AlertsService);
101
115
  /**
102
116
  * Initialize the create group form group array and component.
@@ -114,7 +128,7 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
114
128
  * Initialize the create group form group array.
115
129
  * @memberof CreateGroupComponent
116
130
  */
117
- createFormGroup(): void;
131
+ createFormGroup(formValue?: any): void;
118
132
  /**
119
133
  * Update the create sub group form group array.
120
134
  * @param {GroupInfo} parentGroupInfo -Parent group info.
@@ -122,6 +136,14 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
122
136
  * @memberof CreateGroupComponent
123
137
  */
124
138
  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;
125
147
  /**
126
148
  * Handles client side validation and calls create group or edit group methods.
127
149
  * @param {FormGroup[]} form -Array of formGroup
@@ -138,7 +160,7 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
138
160
  createGroup(formData: any): void;
139
161
  /**
140
162
  * Constructs edit group payload and calls edit group API and emits create group API response.
141
- * @param {*} formData
163
+ * @param formData
142
164
  * @return -returns nothing
143
165
  * @memberof CreateGroupComponent
144
166
  */
@@ -170,6 +192,27 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
170
192
  * @memberof CreateGroupComponent
171
193
  */
172
194
  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
+ * Adds/removes new parent group selection options whenever Change Parent Group slider is toggled.
204
+ * @param {SlideToggleOption} toggle
205
+ * @return -returns nothing
206
+ * @memberof CreateGroupComponent
207
+ */
208
+ onFormSlideToggleChange(toggle: SlideToggleOption): void;
209
+ /**
210
+ * Handles create group form change event.
211
+ * @param {FormGroup[]} form
212
+ * @return -returns nothing
213
+ * @memberof CreateGroupComponent
214
+ */
215
+ onCreateGroupFormChange(form: FormGroup[]): void;
173
216
  /**
174
217
  * NgOnDestroy performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
175
218
  * @memberof CreateGroupComponent
@@ -5,6 +5,7 @@ export declare enum GroupFunctionType {
5
5
  FILTER = "FILTER",
6
6
  TOGGLE = "TOGGLE",
7
7
  SEARCH = "SEARCH",
8
+ REASSIGN_PARENT_GROUP = "REASSIGN_PARENT_GROUP",
8
9
  EDIT_ROSTER_USER_ROLE = "EDIT_ROSTER_USER_ROLE",
9
10
  ADD_USER_TO_ROSTER = "ADD_USER_TO_ROSTER"
10
11
  }
@@ -0,0 +1,5 @@
1
+ export interface ParentGroupsInfo {
2
+ groupId: string;
3
+ groupName: string;
4
+ groupAcronym: string;
5
+ }
@@ -22,6 +22,7 @@ import { FormControlStatus } from '@angular/forms';
22
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 { ParentGroupsInfo } from '../models/parent-groups-info.model';
25
26
  import * as i0 from "@angular/core";
26
27
  /**
27
28
  * Groups service is an abstract layer and responsible for managing groups REST API calls.
@@ -33,12 +34,6 @@ export declare class GroupsService {
33
34
  alertService: AlertsService;
34
35
  groupsText: {
35
36
  ER1000: string;
36
- /**
37
- * Sets selected group info.
38
- * @param {(GroupInfo | undefined)} selectedGroupInfo -selected group info.
39
- * @param {(GroupInfo | undefined)} [selectedGroupParentInfo] -selected parent group info.
40
- * @memberof GroupsService
41
- */
42
37
  ER1001: string;
43
38
  "1001": string;
44
39
  "1002": string;
@@ -54,11 +49,7 @@ export declare class GroupsService {
54
49
  "1012": string;
55
50
  "1013": string;
56
51
  "1014": string;
57
- "1015": string; /**
58
- * Sets group function type.
59
- * @param {GroupFunctionType} groupFunctionType -group function type.
60
- * @memberof GroupsService
61
- */
52
+ "1015": string;
62
53
  "1016": string;
63
54
  "1017": string;
64
55
  "1018": string;
@@ -67,12 +58,6 @@ export declare class GroupsService {
67
58
  "1021": string;
68
59
  "1022": string;
69
60
  "1023": string;
70
- /**
71
- * Gets the group users for the given group id.
72
- * @param {string} groupId
73
- * @return {Observable<GetGroupUsersResponse>}
74
- * @memberof GroupsService
75
- */
76
61
  "1024": string;
77
62
  "1025": string;
78
63
  "1026": string;
@@ -102,6 +87,12 @@ export declare class GroupsService {
102
87
  "2021": string;
103
88
  "2022": string;
104
89
  "2023": string;
90
+ /**
91
+ * Gets the group users based on searched name or email
92
+ * @param {SearchUsersPayload} payload
93
+ * @return {Observable<GetGroupUsersResponse>}
94
+ * @memberof GroupsService
95
+ */
105
96
  "3004": string;
106
97
  };
107
98
  apiBaseUrl: string;
@@ -116,6 +107,7 @@ export declare class GroupsService {
116
107
  rosterFunctionType: RosterFunctionType;
117
108
  userGroupPermissions: GroupPermission[];
118
109
  groupTypes: GroupTypeConfiguration[];
110
+ isParentGroupChanged: boolean;
119
111
  constructor(httpService: HttpService, userPermissionsService: UserPermissionsService, alertService: AlertsService);
120
112
  setAppConfig(apiBaseUrl: string, userPermission: any): void;
121
113
  /**
@@ -124,6 +116,13 @@ export declare class GroupsService {
124
116
  * @memberof GroupsService
125
117
  */
126
118
  getGroupTypes(): Observable<GroupTypeResponse>;
119
+ /**
120
+ * Get allowed parent groups from API and returns it as an observable.
121
+ * @param {string} groupId
122
+ * @return {Observable<GroupTypeResponse>}
123
+ * @memberof GroupsService
124
+ */
125
+ getAllowedParentGroups(groupId: string): Observable<ParentGroupsInfo[]>;
127
126
  /**
128
127
  * Returns all the groups based on passed group Id and group type.
129
128
  * @param {GetGroupsPayload} getGroupsPayload
@@ -378,6 +377,18 @@ export declare class GroupsService {
378
377
  * @memberof GroupsService
379
378
  */
380
379
  isSubmitButtonDisabled(groupRosterType: GroupRosterType, formStatus: FormControlStatus, selectedUserRoles: string[]): boolean;
380
+ /**
381
+ * Sets isParentGroupChanged true or false.
382
+ * @param {boolean} isParentGroupChanged
383
+ * @memberof GroupsService
384
+ */
385
+ setParentGroupChangeStatus(isParentGroupChanged: boolean): void;
386
+ /**
387
+ * Returns isParentGroupChanged value.
388
+ * @return {boolean}
389
+ * @memberof GroupsService
390
+ */
391
+ getParentGroupChangeStatus(): boolean;
381
392
  static ɵfac: i0.ɵɵFactoryDeclaration<GroupsService, never>;
382
393
  static ɵprov: i0.ɵɵInjectableDeclaration<GroupsService>;
383
394
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ieeesa-npm/groups",
3
- "version": "0.9.8",
3
+ "version": "0.9.9",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0",
7
- "@ieeesa-npm/presentation": "^0.10.4",
7
+ "@ieeesa-npm/presentation": "^0.10.5",
8
8
  "@ieeesa-npm/shared-styles": "^0.2.5",
9
- "@ieeesa-npm/utility": "^0.9.4"
9
+ "@ieeesa-npm/utility": "^0.9.5"
10
10
  },
11
11
  "dependencies": {
12
12
  "tslib": "^2.3.0"
package/public-api.d.ts CHANGED
@@ -20,6 +20,7 @@ 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';
23
24
  export * from './lib/services/groups.service';
24
25
  export * from './lib/assets/form-validations';
25
26
  export * from './lib/groups.module';