@ieeesa-npm/groups 0.9.7 → 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.
- package/esm2022/lib/assets/constants.json +8 -0
- package/esm2022/lib/components/add-user-roster/add-user-roster.component.mjs +2 -2
- package/esm2022/lib/components/create-group/create-group.component.mjs +151 -31
- package/esm2022/lib/components/edit-user-roles/edit-user-roles.component.mjs +1 -1
- package/esm2022/lib/groups.component.mjs +7 -1
- package/esm2022/lib/models/group-function-type.model.mjs +2 -1
- package/esm2022/lib/models/parent-groups-info.model.mjs +2 -0
- package/esm2022/lib/models/user.model.mjs +1 -1
- package/esm2022/lib/services/groups.service.mjs +34 -2
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/ieeesa-npm-groups.mjs +199 -32
- package/fesm2022/ieeesa-npm-groups.mjs.map +1 -1
- package/lib/components/create-group/create-group.component.d.ts +47 -4
- package/lib/models/group-function-type.model.d.ts +1 -0
- package/lib/models/parent-groups-info.model.d.ts +5 -0
- package/lib/models/user.model.d.ts +5 -1
- package/lib/services/groups.service.d.ts +27 -22
- package/package.json +3 -3
- package/public-api.d.ts +1 -0
|
@@ -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
|
|
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
|
|
@@ -13,6 +13,10 @@ 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
|
+
}
|
|
16
20
|
export interface GetGroupUsersResponse {
|
|
17
21
|
status: boolean;
|
|
18
22
|
message: string;
|
|
@@ -24,7 +28,7 @@ export interface GetGroupUsersResponse {
|
|
|
24
28
|
classification: Classification | null;
|
|
25
29
|
memberStatus: MemberType | null;
|
|
26
30
|
organization: Organization | null;
|
|
27
|
-
employer:
|
|
31
|
+
employer: Employer | null;
|
|
28
32
|
}[];
|
|
29
33
|
}
|
|
30
34
|
export interface FilterUsersPayload {
|
|
@@ -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;
|
|
@@ -97,17 +82,17 @@ export declare class GroupsService {
|
|
|
97
82
|
"2016": string;
|
|
98
83
|
"2017": string;
|
|
99
84
|
"2018": string;
|
|
85
|
+
"2019": string;
|
|
86
|
+
"2020": string;
|
|
87
|
+
"2021": string;
|
|
88
|
+
"2022": string;
|
|
89
|
+
"2023": string;
|
|
100
90
|
/**
|
|
101
91
|
* Gets the group users based on searched name or email
|
|
102
92
|
* @param {SearchUsersPayload} payload
|
|
103
93
|
* @return {Observable<GetGroupUsersResponse>}
|
|
104
94
|
* @memberof GroupsService
|
|
105
95
|
*/
|
|
106
|
-
"2019": string;
|
|
107
|
-
"2020": string;
|
|
108
|
-
"2021": string;
|
|
109
|
-
"2022": string;
|
|
110
|
-
"2023": string;
|
|
111
96
|
"3004": string;
|
|
112
97
|
};
|
|
113
98
|
apiBaseUrl: string;
|
|
@@ -122,6 +107,7 @@ export declare class GroupsService {
|
|
|
122
107
|
rosterFunctionType: RosterFunctionType;
|
|
123
108
|
userGroupPermissions: GroupPermission[];
|
|
124
109
|
groupTypes: GroupTypeConfiguration[];
|
|
110
|
+
isParentGroupChanged: boolean;
|
|
125
111
|
constructor(httpService: HttpService, userPermissionsService: UserPermissionsService, alertService: AlertsService);
|
|
126
112
|
setAppConfig(apiBaseUrl: string, userPermission: any): void;
|
|
127
113
|
/**
|
|
@@ -130,6 +116,13 @@ export declare class GroupsService {
|
|
|
130
116
|
* @memberof GroupsService
|
|
131
117
|
*/
|
|
132
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[]>;
|
|
133
126
|
/**
|
|
134
127
|
* Returns all the groups based on passed group Id and group type.
|
|
135
128
|
* @param {GetGroupsPayload} getGroupsPayload
|
|
@@ -384,6 +377,18 @@ export declare class GroupsService {
|
|
|
384
377
|
* @memberof GroupsService
|
|
385
378
|
*/
|
|
386
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;
|
|
387
392
|
static ɵfac: i0.ɵɵFactoryDeclaration<GroupsService, never>;
|
|
388
393
|
static ɵprov: i0.ɵɵInjectableDeclaration<GroupsService>;
|
|
389
394
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ieeesa-npm/groups",
|
|
3
|
-
"version": "0.9.
|
|
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.
|
|
7
|
+
"@ieeesa-npm/presentation": "^0.10.5",
|
|
8
8
|
"@ieeesa-npm/shared-styles": "^0.2.5",
|
|
9
|
-
"@ieeesa-npm/utility": "^0.9.
|
|
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';
|