@ieeesa-npm/groups 0.4.7 → 0.4.8
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 +45 -0
- package/esm2022/lib/assets/form-validations.mjs +3 -2
- package/esm2022/lib/components/add-user-roster/add-user-roster.component.mjs +344 -0
- package/esm2022/lib/components/create-group/create-group.component.mjs +2 -2
- package/esm2022/lib/components/tree-view/tree-view.component.mjs +2 -2
- package/esm2022/lib/components/view-roster/view-roster.component.mjs +11 -4
- package/esm2022/lib/groups.component.mjs +59 -2
- package/esm2022/lib/models/add-new-user.model.mjs +2 -0
- package/esm2022/lib/models/group-function-type.model.mjs +2 -1
- package/esm2022/lib/models/user-info.model.mjs +2 -0
- package/esm2022/lib/services/groups.service.mjs +66 -2
- package/fesm2022/ieeesa-npm-groups.mjs +510 -7
- package/fesm2022/ieeesa-npm-groups.mjs.map +1 -1
- package/lib/assets/form-validations.d.ts +1 -0
- package/lib/components/add-user-roster/add-user-roster.component.d.ts +108 -0
- package/lib/components/view-roster/view-roster.component.d.ts +5 -0
- package/lib/groups.component.d.ts +7 -0
- package/lib/models/add-new-user.model.d.ts +30 -0
- package/lib/models/group-function-type.model.d.ts +1 -0
- package/lib/models/user-info.model.d.ts +5 -0
- package/lib/services/groups.service.d.ts +55 -2
- package/package.json +4 -4
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
|
+
import { AlertsService, GlobalErrorHandlerService } from '@ieeesa-npm/utility';
|
|
5
|
+
import { FormGrid, FormModel, AlignType, CheckboxOption } from '@ieeesa-npm/presentation';
|
|
6
|
+
import { GroupsService } from '../../services/groups.service';
|
|
7
|
+
import { UserInfo } from '../../models/user-info.model';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* Component implements the view and functionalities to add group users to roster.
|
|
11
|
+
* @export
|
|
12
|
+
* @class AddUserRosterComponent
|
|
13
|
+
* @implements {OnInit}
|
|
14
|
+
* @implements {OnDestroy}
|
|
15
|
+
*/
|
|
16
|
+
export declare class AddUserRosterComponent implements OnInit, OnDestroy {
|
|
17
|
+
private groupService;
|
|
18
|
+
private globalErrorHandlerService;
|
|
19
|
+
alertService: AlertsService;
|
|
20
|
+
destroy$: Subject<boolean>;
|
|
21
|
+
constants: any;
|
|
22
|
+
addUserRosterTexts: any;
|
|
23
|
+
leftButtonLabel: any;
|
|
24
|
+
rightButtonLabel: any;
|
|
25
|
+
isSubmitButtonDisabled: boolean;
|
|
26
|
+
colWidth: FormGrid;
|
|
27
|
+
searchUserFormGroup: FormModel;
|
|
28
|
+
addUserFormGroup: FormModel;
|
|
29
|
+
actionButtonAlign: AlignType;
|
|
30
|
+
addUserFormGroupRef: FormGroup;
|
|
31
|
+
isSearchUserForm: boolean;
|
|
32
|
+
userRoles: CheckboxOption[];
|
|
33
|
+
selectedUserRoles: string[];
|
|
34
|
+
userInfo: UserInfo;
|
|
35
|
+
isAddUserFormEmailSearch: boolean;
|
|
36
|
+
submitFormResponse: EventEmitter<any>;
|
|
37
|
+
formCancel: EventEmitter<any>;
|
|
38
|
+
constructor(groupService: GroupsService, globalErrorHandlerService: GlobalErrorHandlerService, alertService: AlertsService);
|
|
39
|
+
/**
|
|
40
|
+
* Initializes user roles and searchUserFormGroup.
|
|
41
|
+
* @memberof AddUserRosterComponent
|
|
42
|
+
*/
|
|
43
|
+
ngOnInit(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Creates search user form group
|
|
46
|
+
* @memberof AddUserRosterComponent
|
|
47
|
+
*/
|
|
48
|
+
createSearchUserFormGroup(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Checks form validity and searches the user by entered email.
|
|
51
|
+
* @param {FormGroup[]} form
|
|
52
|
+
* @memberof AddUserRosterComponent
|
|
53
|
+
*/
|
|
54
|
+
onSearchUserFormSubmit(form: FormGroup[]): void;
|
|
55
|
+
/**
|
|
56
|
+
* Searches the user by entered email and gets the user details when the email id is found.
|
|
57
|
+
* @param {string} email
|
|
58
|
+
* @memberof AddUserRosterComponent
|
|
59
|
+
*/
|
|
60
|
+
searchUserByEmail(email: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Validates whether the user is exists in the selected group and then creates add user form when the user does not exist in the selected group.
|
|
63
|
+
* @memberof AddUserRosterComponent
|
|
64
|
+
*/
|
|
65
|
+
validateUserExistence(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Handles add user form email search
|
|
68
|
+
* @param {string} email
|
|
69
|
+
* @memberof AddUserRosterComponent
|
|
70
|
+
*/
|
|
71
|
+
formSearchApply(email: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* Assigns role to user on form submission.
|
|
74
|
+
* @param {FormGroup[]} form
|
|
75
|
+
* @memberof AddUserRosterComponent
|
|
76
|
+
*/
|
|
77
|
+
onAddUserFormSubmit(form: FormGroup[]): void;
|
|
78
|
+
/**
|
|
79
|
+
* Get add user form group reference.
|
|
80
|
+
* @param {FormGroup[]} form
|
|
81
|
+
* @memberof AddUserRosterComponent
|
|
82
|
+
*/
|
|
83
|
+
getAddUserFormGroupRef(form: FormGroup[]): void;
|
|
84
|
+
/**
|
|
85
|
+
* Handles user role selection in add user form.
|
|
86
|
+
* @param {CheckboxOption} event
|
|
87
|
+
* @memberof AddUserRosterComponent
|
|
88
|
+
*/
|
|
89
|
+
onUserRoleSelection(event: CheckboxOption): void;
|
|
90
|
+
/**
|
|
91
|
+
* Emits form cancel event.
|
|
92
|
+
* @memberof AddUserRosterComponent
|
|
93
|
+
*/
|
|
94
|
+
onFormCancel(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Handles the custom errors while searching user by email, validating user existence and adding new user to roster.
|
|
97
|
+
* @param {*} error
|
|
98
|
+
* @memberof AddUserRosterComponent
|
|
99
|
+
*/
|
|
100
|
+
handleErrors(error: any): void;
|
|
101
|
+
/**
|
|
102
|
+
* NgOnDestroy performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
|
|
103
|
+
* @memberof AddUserRosterComponent
|
|
104
|
+
*/
|
|
105
|
+
ngOnDestroy(): void;
|
|
106
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AddUserRosterComponent, never>;
|
|
107
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AddUserRosterComponent, "ieeesa-add-user-roster", never, {}, { "submitFormResponse": "submitFormResponse"; "formCancel": "formCancel"; }, never, never, true, never>;
|
|
108
|
+
}
|
|
@@ -58,6 +58,11 @@ export declare class ViewRosterComponent implements OnDestroy {
|
|
|
58
58
|
* @memberof ViewRosterComponent
|
|
59
59
|
*/
|
|
60
60
|
handleErrors(error: any): void;
|
|
61
|
+
/**
|
|
62
|
+
* Emits openModalNotifier event with GroupFunctionType value as ADD_USER_TO_ROSTER
|
|
63
|
+
* @memberof ViewRosterComponent
|
|
64
|
+
*/
|
|
65
|
+
onAddNewUser(): void;
|
|
61
66
|
/**
|
|
62
67
|
* NgOnDestroy performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
|
|
63
68
|
* @memberof ViewRosterComponent
|
|
@@ -27,6 +27,7 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
|
|
|
27
27
|
viewGroupTexts: any;
|
|
28
28
|
createGroupText: any;
|
|
29
29
|
editGroupTexts: any;
|
|
30
|
+
addUserRosterTexts: any;
|
|
30
31
|
isGroupSearchActive: boolean;
|
|
31
32
|
isGroupFilterActive: boolean;
|
|
32
33
|
isGroupSearchOrFilterActive: boolean;
|
|
@@ -54,6 +55,7 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
|
|
|
54
55
|
functionType: GroupFunctionType;
|
|
55
56
|
alignmentType: typeof AlignType;
|
|
56
57
|
isSorting: boolean;
|
|
58
|
+
canReopenViewRosterModal: boolean;
|
|
57
59
|
constructor(dialog: MatDialog, groupsService: GroupsService, alertService: AlertsService, breakpointObserverService: BreakpointObserverService, globalErrorHandlerService: GlobalErrorHandlerService);
|
|
58
60
|
/**
|
|
59
61
|
* Initialize the groups component.
|
|
@@ -75,6 +77,11 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
|
|
|
75
77
|
* @memberof GroupsComponent
|
|
76
78
|
*/
|
|
77
79
|
openEditGroupForm(editGroupInfo: EditGroupAndParentInfo): void;
|
|
80
|
+
/**
|
|
81
|
+
* Sets the dialog options for add users modal and calls openModal method.
|
|
82
|
+
* @memberof GroupsComponent
|
|
83
|
+
*/
|
|
84
|
+
openAddUserRosterModal(): void;
|
|
78
85
|
/**
|
|
79
86
|
* Sets the dialog options for users modal and calls openModal method.
|
|
80
87
|
* @param {GroupInfo} group
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface SearchUserByEmailResponse {
|
|
2
|
+
status: boolean;
|
|
3
|
+
message: string;
|
|
4
|
+
body: {
|
|
5
|
+
userId: string;
|
|
6
|
+
email: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface GetUserDetailsPayload {
|
|
11
|
+
payload: {
|
|
12
|
+
groupId: string;
|
|
13
|
+
userId: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface AddNewUserPayload {
|
|
17
|
+
payload: {
|
|
18
|
+
groupId: string;
|
|
19
|
+
userId: string;
|
|
20
|
+
roles: string[];
|
|
21
|
+
email: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface GroupUserDetailsResponse {
|
|
25
|
+
status: boolean;
|
|
26
|
+
message: string;
|
|
27
|
+
body?: string | null | {
|
|
28
|
+
errorCodes: string[];
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
1
|
+
import { Observable, BehaviorSubject } from 'rxjs';
|
|
2
2
|
import { CreateGroupPayload, CreateGroupResponse } from '../models/create-group.model';
|
|
3
3
|
import { GroupTypeConfiguration, GroupTypeConfigValue, GroupTypeResponse } from '../models/group-types.model';
|
|
4
4
|
import { AlertsService, HttpService } from '@ieeesa-npm/utility';
|
|
@@ -9,6 +9,7 @@ import { SearchUsersPayload, FilterUsersByRolesPayload, GetGroupUsersResponse, U
|
|
|
9
9
|
import { CheckboxOption } from '@ieeesa-npm/presentation';
|
|
10
10
|
import { EditGroupPayload } from '../models/edit-group.model';
|
|
11
11
|
import { GroupFunctionType } from '../models/group-function-type.model';
|
|
12
|
+
import { AddNewUserPayload, GetUserDetailsPayload, SearchUserByEmailResponse, GroupUserDetailsResponse } from '../models/add-new-user.model';
|
|
12
13
|
import * as i0 from "@angular/core";
|
|
13
14
|
/**
|
|
14
15
|
* Groups service is an abstract layer and responsible for managing groups REST API calls.
|
|
@@ -25,6 +26,12 @@ export declare class GroupsService {
|
|
|
25
26
|
"1004": string;
|
|
26
27
|
"1005": string;
|
|
27
28
|
"1006": string;
|
|
29
|
+
/**
|
|
30
|
+
* Sets selected group info.
|
|
31
|
+
* @param {(GroupInfo | undefined)} selectedGroupInfo -selected group info.
|
|
32
|
+
* @param {(GroupInfo | undefined)} [selectedGroupParentInfo] -selected parent group info.
|
|
33
|
+
* @memberof GroupsService
|
|
34
|
+
*/
|
|
28
35
|
"1007": string;
|
|
29
36
|
"1008": string;
|
|
30
37
|
"1009": string;
|
|
@@ -37,7 +44,17 @@ export declare class GroupsService {
|
|
|
37
44
|
"1016": string;
|
|
38
45
|
"1017": string;
|
|
39
46
|
"1018": string;
|
|
40
|
-
"
|
|
47
|
+
"1019": string;
|
|
48
|
+
"1020": string; /**
|
|
49
|
+
* Sets group function type.
|
|
50
|
+
* @param {GroupFunctionType} groupFunctionType -group function type.
|
|
51
|
+
* @memberof GroupsService
|
|
52
|
+
*/
|
|
53
|
+
"1021": string;
|
|
54
|
+
"1022": string;
|
|
55
|
+
"1023": string;
|
|
56
|
+
"1024": string;
|
|
57
|
+
"1025": string;
|
|
41
58
|
"1026": string;
|
|
42
59
|
"1027": string;
|
|
43
60
|
"1028": string;
|
|
@@ -45,6 +62,7 @@ export declare class GroupsService {
|
|
|
45
62
|
"1030": string;
|
|
46
63
|
"1031": string;
|
|
47
64
|
"1032": string;
|
|
65
|
+
"2001": string;
|
|
48
66
|
"2002": string;
|
|
49
67
|
};
|
|
50
68
|
apiBaseUrl: string;
|
|
@@ -52,6 +70,8 @@ export declare class GroupsService {
|
|
|
52
70
|
selectedGroupInfo: GroupInfo | undefined;
|
|
53
71
|
groupFunctionType: GroupFunctionType;
|
|
54
72
|
selectedGroupParentInfo: GroupInfo | undefined;
|
|
73
|
+
openModalNotifier: BehaviorSubject<GroupFunctionType>;
|
|
74
|
+
groupTypeRoles: CheckboxOption[];
|
|
55
75
|
constructor(httpService: HttpService, alertService: AlertsService);
|
|
56
76
|
setAppConfig(apiBaseUrl: string, userPermission: any): void;
|
|
57
77
|
/**
|
|
@@ -168,6 +188,39 @@ export declare class GroupsService {
|
|
|
168
188
|
* @memberof GroupsService
|
|
169
189
|
*/
|
|
170
190
|
getFormattedGroupTypes(groupTypeResponse: GroupTypeConfiguration[]): GroupTypeConfigValue;
|
|
191
|
+
/**
|
|
192
|
+
* Returns group user details if email is found, else throws error.
|
|
193
|
+
* @param {string} email
|
|
194
|
+
* @return {Observable<SearchUserByEmailResponse>}
|
|
195
|
+
* @memberof GroupsService
|
|
196
|
+
*/
|
|
197
|
+
getUserByEmail(email: string): Observable<SearchUserByEmailResponse>;
|
|
198
|
+
/**
|
|
199
|
+
* Gets the user details for the selected group
|
|
200
|
+
* @param {GetUserDetailsPayload} payload
|
|
201
|
+
* @return {Observable<GroupUserDetailsResponse>}
|
|
202
|
+
* @memberof GroupsService
|
|
203
|
+
*/
|
|
204
|
+
getGroupUserDetails(payload: GetUserDetailsPayload): Observable<GroupUserDetailsResponse>;
|
|
205
|
+
/**
|
|
206
|
+
* Posts add new user form data to the API for the selected group and returns the success or failure response.
|
|
207
|
+
* @param {AddNewUserPayload} addNewUserPayload
|
|
208
|
+
* @return {Observable<GroupUserDetailsResponse>}
|
|
209
|
+
* @memberof GroupsService
|
|
210
|
+
*/
|
|
211
|
+
addNewGroupUser(addNewUserPayload: AddNewUserPayload): Observable<GroupUserDetailsResponse>;
|
|
212
|
+
/**
|
|
213
|
+
* Sets the loaded group type user roles
|
|
214
|
+
* @param {CheckboxOption[]} userRoles
|
|
215
|
+
* @memberof GroupsService
|
|
216
|
+
*/
|
|
217
|
+
setGroupTypeUserRoles(userRoles: CheckboxOption[]): void;
|
|
218
|
+
/**
|
|
219
|
+
* Returns the group type user roles.
|
|
220
|
+
* @return {CheckboxOption[]}
|
|
221
|
+
* @memberof GroupsService
|
|
222
|
+
*/
|
|
223
|
+
getGroupTypeUserRoles(): CheckboxOption[];
|
|
171
224
|
static ɵfac: i0.ɵɵFactoryDeclaration<GroupsService, never>;
|
|
172
225
|
static ɵprov: i0.ɵɵInjectableDeclaration<GroupsService>;
|
|
173
226
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ieeesa-npm/groups",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^16.1.0",
|
|
6
6
|
"@angular/core": "^16.1.0",
|
|
7
|
-
"@ieeesa-npm/presentation": "^0.6.
|
|
8
|
-
"@ieeesa-npm/shared-styles": "^0.1.
|
|
9
|
-
"@ieeesa-npm/utility": "^0.5.
|
|
7
|
+
"@ieeesa-npm/presentation": "^0.6.7",
|
|
8
|
+
"@ieeesa-npm/shared-styles": "^0.1.7",
|
|
9
|
+
"@ieeesa-npm/utility": "^0.5.9"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"tslib": "^2.3.0"
|