@ieeesa-npm/groups 0.0.1 → 0.0.4

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,9 +1,13 @@
1
- import { OnDestroy, OnInit } from "@angular/core";
2
- import { MatDialog } from "@angular/material/dialog";
3
- import { GroupsService } from "./services/groups.service";
4
- import { AlertsService } from "@ieeesa-npm/utility";
5
- import { Subject } from "rxjs";
6
- import { GroupFunctionType } from "./models/group-function-type.model";
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { MatDialog } from '@angular/material/dialog';
3
+ import { GroupsService } from './services/groups.service';
4
+ import { Subject } from 'rxjs';
5
+ import { GroupInfo } from './models/group-info.model';
6
+ import { SelectOption, Legend, IconButton, AlignType } from '@ieeesa-npm/presentation';
7
+ import { GroupType } from './models/group-types.model';
8
+ import { AlertsService, GlobalErrorHandlerService, BreakpointObserverService } from '@ieeesa-npm/utility';
9
+ import { GroupFunctionType } from './models/group-function-type.model';
10
+ import { GetGroupsPayload } from './models/view-group.model';
7
11
  import * as i0 from "@angular/core";
8
12
  /**
9
13
  * Groups component is a wrapper or container component for groups management reusable component and in this component integrates all group management functionalities and this will be entry component for managing groups when it is consumed in other applications.
@@ -13,8 +17,36 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
13
17
  dialog: MatDialog;
14
18
  private groupsService;
15
19
  alertService: AlertsService;
20
+ private breakpointObserverService;
21
+ private globalErrorHandlerService;
16
22
  destroy$: Subject<boolean>;
17
23
  dialogRef: any;
24
+ constants: any;
25
+ viewGroupTexts: any;
26
+ isGroupSearchActive: boolean;
27
+ isGroupFilterActive: boolean;
28
+ isGroupSearchOrFilterActive: boolean;
29
+ isMobileView: boolean;
30
+ childGroupsInfo: GroupInfo[];
31
+ addGroupInfo: GroupInfo[];
32
+ isGroupAdded: boolean;
33
+ selectedGroupType: SelectOption;
34
+ parentGroupsInfo: GroupInfo[];
35
+ selectGroupOptions: SelectOption[];
36
+ deletedGroupId: string;
37
+ groupTypes: {
38
+ [key: string]: GroupType;
39
+ };
40
+ searchPlaceHolderText: string;
41
+ filterPlaceHolderText: string;
42
+ createGroupIcon: IconButton;
43
+ filterGroupIcon: IconButton;
44
+ groupsLegends: Legend[];
45
+ getGroupsPayload: GetGroupsPayload[];
46
+ groupsPageInfo: {
47
+ groupsTitle: string;
48
+ groupsDescription: string;
49
+ };
18
50
  applicationId: string;
19
51
  apiBaseURL: string;
20
52
  permissions: any;
@@ -56,13 +88,13 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
56
88
  };
57
89
  pattern: {
58
90
  groupName: string;
91
+ /**
92
+ * Groups component is a wrapper or container component for groups management reusable component and in this component integrates all group management functionalities and this will be entry component for managing groups when it is consumed in other applications.
93
+ * @class GroupsComponent
94
+ */
59
95
  shortName: string;
60
96
  groupScope: string;
61
97
  };
62
- unique: {
63
- "1001": string;
64
- "1002": string;
65
- };
66
98
  };
67
99
  success: {
68
100
  submission: string;
@@ -76,7 +108,8 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
76
108
  };
77
109
  };
78
110
  functionType: GroupFunctionType;
79
- constructor(dialog: MatDialog, groupsService: GroupsService, alertService: AlertsService);
111
+ alignmentType: typeof AlignType;
112
+ constructor(dialog: MatDialog, groupsService: GroupsService, alertService: AlertsService, breakpointObserverService: BreakpointObserverService, globalErrorHandlerService: GlobalErrorHandlerService);
80
113
  /**
81
114
  * Initialize the groups component.
82
115
  * @return -returns nothing
@@ -97,11 +130,71 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
97
130
  * @memberof GroupsComponent
98
131
  */
99
132
  openModal(dialogOptions: any, className?: string): void;
133
+ /**
134
+ * This method invokes the delete modal, and asks user for confirmation to delete the group.
135
+ * @memberof GroupComponent
136
+ */
137
+ openDeleteConfirmationModal(groupInfo: GroupInfo): void;
138
+ /**
139
+ * This method sends API Request to delete the selected group and handles the success and error response of the http request.
140
+ * @memberof GroupComponent
141
+ */
142
+ deleteGroup(groupInfo: GroupInfo): void;
143
+ /**
144
+ * Shows the search field on click of search icon in case of mobile view
145
+ * @memberof GroupsComponent
146
+ */
147
+ onGroupSearch(): void;
148
+ /**
149
+ * Shows the Filter by dropdown options on click of filter icon in case of mobile view
150
+ * @memberof GroupsComponent
151
+ */
152
+ showGroupFilter(): void;
153
+ /**
154
+ * Sets isGroupSearchOrFilterActive to true and loads the groups those are configured with selected group type.
155
+ * @param {string} searchTerm
156
+ * @memberof GroupsComponent
157
+ */
158
+ onGroupSearchClick(searchTerm: string): void;
159
+ /**
160
+ * Sets select group type options from groupTypes response
161
+ * @return {*} {SelectOption[]}
162
+ * @memberof GroupsComponent
163
+ */
164
+ getGroupTypeOptions(): SelectOption[];
165
+ /**
166
+ * Sets legend color from groupTypes response
167
+ * @memberof GroupsComponent
168
+ */
169
+ legendColor(): void;
170
+ /**
171
+ * Sets the isGroupSearchOrFilterActive flag and loads parent group info as per selected filter option.
172
+ * @param {SelectOption} event
173
+ * @memberof GroupsComponent
174
+ */
175
+ onGroupTypeFiltered(event: SelectOption): void;
176
+ /**
177
+ * Loads all the parent groups information.
178
+ * @memberof GroupsComponent
179
+ */
180
+ getGroups(group?: GroupInfo): void;
181
+ /**
182
+ * Sets groupType info with group response from groupType response
183
+ * @param {GroupInfo[]} response
184
+ * @return {*} {GroupInfo[]}
185
+ * @memberof GroupsComponent
186
+ */
187
+ viewGroupResponse(response: GroupInfo[]): GroupInfo[];
188
+ /**
189
+ * Loads the group types.
190
+ * @memberof GroupsComponent
191
+ */
192
+ getGroupTypes(): void;
100
193
  /**
101
194
  * NgOnDestroy performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
102
195
  * @memberof GroupsComponent
103
196
  */
104
197
  ngOnDestroy(): void;
105
198
  static ɵfac: i0.ɵɵFactoryDeclaration<GroupsComponent, never>;
106
- static ɵcmp: i0.ɵɵComponentDeclaration<GroupsComponent, "ieeesa-groups", never, { "applicationId": { "alias": "applicationId"; "required": false; }; "apiBaseURL": { "alias": "apiBaseURL"; "required": false; }; "permissions": { "alias": "permissions"; "required": false; }; }, {}, never, never, true, never>;
199
+ static ɵcmp: i0.ɵɵComponentDeclaration<GroupsComponent, "ieeesa-groups", never, { "groupsPageInfo": { "alias": "groupsPageInfo"; "required": false; }; "applicationId": { "alias": "applicationId"; "required": false; }; "apiBaseURL": { "alias": "apiBaseURL"; "required": false; }; "permissions": { "alias": "permissions"; "required": false; }; }, {}, never, never, true, never>;
107
200
  }
@@ -0,0 +1,5 @@
1
+ export interface DeleteGroupPayload {
2
+ payload: {
3
+ groupId: string;
4
+ };
5
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum GroupAction {
2
+ VIEW_ROSTER = 1,
3
+ CREATE_SUB_GROUP = 2,
4
+ EDIT_GROUP = 3,
5
+ DELETE_GROUP = 4,
6
+ EXPAND_GROUP_VIEW = 5,
7
+ COLLAPSE_GROUP_VIEW = 6
8
+ }
@@ -0,0 +1,12 @@
1
+ import { GroupType } from './group-types.model';
2
+ export interface GroupInfo {
3
+ groupId: string;
4
+ groupName: string;
5
+ groupAcronym: string;
6
+ groupType: string;
7
+ groupParentId: string | null;
8
+ hasChildren: boolean;
9
+ groupLevel: number;
10
+ groupTypeInfo?: GroupType;
11
+ children?: GroupInfo[];
12
+ }
@@ -0,0 +1,9 @@
1
+ import { GroupInfo } from "./group-info.model";
2
+ export interface GetGroupsPayload {
3
+ [key: string]: string;
4
+ }
5
+ export interface GetGroupResponse {
6
+ status: boolean;
7
+ message: string;
8
+ body: GroupInfo[];
9
+ }
@@ -1,18 +1,29 @@
1
- import { CreateGroupPayload, CreateGroupResponse } from "../models/create-group.model";
2
- import { HttpService } from "@ieeesa-npm/utility";
3
- import { Observable } from "rxjs";
4
- import { GroupTypeResponse } from "../models/group-types.model";
1
+ import { Observable } from 'rxjs';
2
+ import { CreateGroupPayload, CreateGroupResponse } from '../models/create-group.model';
3
+ import { GroupTypeResponse } from '../models/group-types.model';
4
+ import { AlertsService, HttpService } from '@ieeesa-npm/utility';
5
+ import { GetGroupResponse } from '../models/view-group.model';
6
+ import { DeleteGroupPayload } from '../models/delete-group.model';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * Groups service is an abstract layer and responsible for managing groups REST API calls.
8
10
  * @class GroupsService
9
- * @implements {OnDestroy}
10
11
  */
11
12
  export declare class GroupsService {
12
13
  private httpService;
14
+ alertService: AlertsService;
15
+ groupsText: {
16
+ "1001": string;
17
+ "1002": string;
18
+ "1010": string;
19
+ "1011": string;
20
+ "1012": string;
21
+ "1009": string;
22
+ "1008": string;
23
+ };
13
24
  apiBaseUrl: string;
14
25
  userPermission: any;
15
- constructor(httpService: HttpService);
26
+ constructor(httpService: HttpService, alertService: AlertsService);
16
27
  setAppConfig(apiBaseUrl: string, userPermission: any): void;
17
28
  /**
18
29
  * Gets application group types from API and returns it as an observable.
@@ -20,6 +31,20 @@ export declare class GroupsService {
20
31
  * @memberof GroupsService
21
32
  */
22
33
  getGroupTypes(): Observable<GroupTypeResponse>;
34
+ /**
35
+ * Returns all the groups based on passed group Id and group type.
36
+ * @param {GetGroupsPayload} getGroupsPayload
37
+ * @return {Observable<GetGroupResponse>}
38
+ * @memberof GroupsService
39
+ */
40
+ getAllGroups(getGroupsPayload: any): Observable<GetGroupResponse>;
41
+ /**
42
+ * Deletes a group based on the provided information
43
+ * @param {groupId} string -groupId of the group which is to be deleted
44
+ * @return {*} {Observable<any>} -Observable representing the group deletion response
45
+ * @memberof GroupsService
46
+ */
47
+ deleteGroup(deleteGroupPayload: DeleteGroupPayload): Observable<any>;
23
48
  /**
24
49
  * Posts create group form data to server using HttpService for creating new group.
25
50
  * @param {CreateGroupPayload} createGroupPayload -create group form data which includes group name, type, short name, scope.
@@ -27,6 +52,13 @@ export declare class GroupsService {
27
52
  * @memberof GroupsService
28
53
  */
29
54
  createGroup(createGroupPayload: CreateGroupPayload): Observable<CreateGroupResponse>;
55
+ /**
56
+ * This method will parse the error codes and return the respective error message for each code.
57
+ * @param {string[]} errorCodes
58
+ * @return {string[]} errorMessage
59
+ * @memberof GroupsService
60
+ */
61
+ parseErrorMessage(errorCodes: string[]): string[];
30
62
  static ɵfac: i0.ɵɵFactoryDeclaration<GroupsService, never>;
31
63
  static ɵprov: i0.ɵɵInjectableDeclaration<GroupsService>;
32
64
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ieeesa-npm/groups",
3
- "version": "0.0.1",
3
+ "version": "0.0.4",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0",
7
- "@ieeesa-npm/presentation": "^0.2.4",
8
- "@ieeesa-npm/shared-styles": "^0.0.4",
9
- "@ieeesa-npm/utility": "^0.2.1"
7
+ "@ieeesa-npm/presentation": "^0.3.3",
8
+ "@ieeesa-npm/shared-styles": "^0.0.5",
9
+ "@ieeesa-npm/utility": "^0.2.5"
10
10
  },
11
11
  "dependencies": {
12
12
  "tslib": "^2.3.0"
package/public-api.d.ts CHANGED
@@ -1,8 +1,12 @@
1
- export * from "./lib/components/create-group/create-group.component";
2
- export * from "./lib/groups.component";
3
- export * from "./lib/services/groups.service";
4
- export * from "./lib/models/create-group.model";
5
- export * from "./lib/models/group-types.model";
6
- export * from "./lib/models/group-function-type.model";
7
- export * from "./lib/assets/form-validations";
8
- export * from "./lib/groups.module";
1
+ export * from './lib/components/create-group/create-group.component';
2
+ export * from './lib/components/tree-view/tree-view.component';
3
+ export * from './lib/groups.component';
4
+ export * from './lib/models/create-group.model';
5
+ export * from './lib/models/group-action.model';
6
+ export * from './lib/models/group-function-type.model';
7
+ export * from './lib/models/group-info.model';
8
+ export * from './lib/models/group-types.model';
9
+ export * from './lib/models/view-group.model';
10
+ export * from './lib/services/groups.service';
11
+ export * from './lib/assets/form-validations';
12
+ export * from './lib/groups.module';