@ieeesa-npm/groups 0.10.0 → 0.10.1
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/create-group/create-group.component.mjs +151 -31
- 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/services/groups.service.mjs +34 -2
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/ieeesa-npm-groups.mjs +197 -30
- 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/services/groups.service.d.ts +27 -17
- 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
|
|
@@ -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;
|
|
@@ -116,6 +106,7 @@ export declare class GroupsService {
|
|
|
116
106
|
rosterFunctionType: RosterFunctionType;
|
|
117
107
|
userGroupPermissions: GroupPermission[];
|
|
118
108
|
groupTypes: GroupTypeConfiguration[];
|
|
109
|
+
isParentGroupChanged: boolean;
|
|
119
110
|
constructor(httpService: HttpService, userPermissionsService: UserPermissionsService, alertService: AlertsService);
|
|
120
111
|
setAppConfig(apiBaseUrl: string, userPermission: any): void;
|
|
121
112
|
/**
|
|
@@ -124,6 +115,13 @@ export declare class GroupsService {
|
|
|
124
115
|
* @memberof GroupsService
|
|
125
116
|
*/
|
|
126
117
|
getGroupTypes(): Observable<GroupTypeResponse>;
|
|
118
|
+
/**
|
|
119
|
+
* Get allowed parent groups from API and returns it as an observable.
|
|
120
|
+
* @param {string} groupId
|
|
121
|
+
* @return {Observable<GroupTypeResponse>}
|
|
122
|
+
* @memberof GroupsService
|
|
123
|
+
*/
|
|
124
|
+
getAllowedParentGroups(groupId: string): Observable<ParentGroupsInfo[]>;
|
|
127
125
|
/**
|
|
128
126
|
* Returns all the groups based on passed group Id and group type.
|
|
129
127
|
* @param {GetGroupsPayload} getGroupsPayload
|
|
@@ -378,6 +376,18 @@ export declare class GroupsService {
|
|
|
378
376
|
* @memberof GroupsService
|
|
379
377
|
*/
|
|
380
378
|
isSubmitButtonDisabled(groupRosterType: GroupRosterType, formStatus: FormControlStatus, selectedUserRoles: string[]): boolean;
|
|
379
|
+
/**
|
|
380
|
+
* Sets isParentGroupChanged true or false.
|
|
381
|
+
* @param {boolean} isParentGroupChanged
|
|
382
|
+
* @memberof GroupsService
|
|
383
|
+
*/
|
|
384
|
+
setParentGroupChangeStatus(isParentGroupChanged: boolean): void;
|
|
385
|
+
/**
|
|
386
|
+
* Returns isParentGroupChanged value.
|
|
387
|
+
* @return {boolean}
|
|
388
|
+
* @memberof GroupsService
|
|
389
|
+
*/
|
|
390
|
+
getParentGroupChangeStatus(): boolean;
|
|
381
391
|
static ɵfac: i0.ɵɵFactoryDeclaration<GroupsService, never>;
|
|
382
392
|
static ɵprov: i0.ɵɵInjectableDeclaration<GroupsService>;
|
|
383
393
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ieeesa-npm/groups",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
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.8",
|
|
8
8
|
"@ieeesa-npm/shared-styles": "^0.2.5",
|
|
9
|
-
"@ieeesa-npm/utility": "^0.9.
|
|
9
|
+
"@ieeesa-npm/utility": "^0.9.7"
|
|
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';
|