@ieeesa-npm/groups 0.10.0 → 0.10.2

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,35 @@ 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
+ * 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;
173
224
  /**
174
225
  * NgOnDestroy performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
175
226
  * @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,17 +34,16 @@ export declare class GroupsService {
33
34
  alertService: AlertsService;
34
35
  groupsText: {
35
36
  ER1000: string;
36
- /**
37
+ ER1001: string;
38
+ "1001": string;
39
+ "1002": string;
40
+ "1003": string;
41
+ "1004": string; /**
37
42
  * Sets selected group info.
38
43
  * @param {(GroupInfo | undefined)} selectedGroupInfo -selected group info.
39
44
  * @param {(GroupInfo | undefined)} [selectedGroupParentInfo] -selected parent group info.
40
45
  * @memberof GroupsService
41
46
  */
42
- ER1001: string;
43
- "1001": string;
44
- "1002": string;
45
- "1003": string;
46
- "1004": string;
47
47
  "1005": string;
48
48
  "1006": string;
49
49
  "1007": string;
@@ -54,11 +54,7 @@ export declare class GroupsService {
54
54
  "1012": string;
55
55
  "1013": string;
56
56
  "1014": string;
57
- "1015": string; /**
58
- * Sets group function type.
59
- * @param {GroupFunctionType} groupFunctionType -group function type.
60
- * @memberof GroupsService
61
- */
57
+ "1015": string;
62
58
  "1016": string;
63
59
  "1017": string;
64
60
  "1018": string;
@@ -67,12 +63,6 @@ export declare class GroupsService {
67
63
  "1021": string;
68
64
  "1022": string;
69
65
  "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
66
  "1024": string;
77
67
  "1025": string;
78
68
  "1026": string;
@@ -86,6 +76,8 @@ export declare class GroupsService {
86
76
  "1034": string;
87
77
  "1035": string;
88
78
  "1036": string;
79
+ "1037": string;
80
+ "1038": string;
89
81
  "2001": string;
90
82
  "2002": string;
91
83
  "2010": string;
@@ -116,6 +108,7 @@ export declare class GroupsService {
116
108
  rosterFunctionType: RosterFunctionType;
117
109
  userGroupPermissions: GroupPermission[];
118
110
  groupTypes: GroupTypeConfiguration[];
111
+ isParentGroupChanged: boolean;
119
112
  constructor(httpService: HttpService, userPermissionsService: UserPermissionsService, alertService: AlertsService);
120
113
  setAppConfig(apiBaseUrl: string, userPermission: any): void;
121
114
  /**
@@ -124,6 +117,13 @@ export declare class GroupsService {
124
117
  * @memberof GroupsService
125
118
  */
126
119
  getGroupTypes(): Observable<GroupTypeResponse>;
120
+ /**
121
+ * Get allowed parent groups from API and returns it as an observable.
122
+ * @param {string} groupId
123
+ * @return {Observable<GroupTypeResponse>}
124
+ * @memberof GroupsService
125
+ */
126
+ getAllowedParentGroups(groupId: string): Observable<ParentGroupsInfo[]>;
127
127
  /**
128
128
  * Returns all the groups based on passed group Id and group type.
129
129
  * @param {GetGroupsPayload} getGroupsPayload
@@ -378,6 +378,18 @@ export declare class GroupsService {
378
378
  * @memberof GroupsService
379
379
  */
380
380
  isSubmitButtonDisabled(groupRosterType: GroupRosterType, formStatus: FormControlStatus, selectedUserRoles: string[]): boolean;
381
+ /**
382
+ * Sets isParentGroupChanged true or false.
383
+ * @param {boolean} isParentGroupChanged
384
+ * @memberof GroupsService
385
+ */
386
+ setParentGroupChangeStatus(isParentGroupChanged: boolean): void;
387
+ /**
388
+ * Returns isParentGroupChanged value.
389
+ * @return {boolean}
390
+ * @memberof GroupsService
391
+ */
392
+ getParentGroupChangeStatus(): boolean;
381
393
  static ɵfac: i0.ɵɵFactoryDeclaration<GroupsService, never>;
382
394
  static ɵprov: i0.ɵɵInjectableDeclaration<GroupsService>;
383
395
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ieeesa-npm/groups",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0",
7
- "@ieeesa-npm/presentation": "^0.10.7",
8
- "@ieeesa-npm/shared-styles": "^0.2.5",
9
- "@ieeesa-npm/utility": "^0.9.6"
7
+ "@ieeesa-npm/presentation": "^0.10.9",
8
+ "@ieeesa-npm/shared-styles": "^0.2.6",
9
+ "@ieeesa-npm/utility": "^0.9.8"
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';