@ieeesa-npm/groups 0.0.1 → 0.0.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,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 } 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,34 @@ 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
+ selectedGroupType: SelectOption;
32
+ parentGroupsInfo: GroupInfo[];
33
+ selectGroupOptions: SelectOption[];
34
+ deleteGroupInfo: string;
35
+ groupTypes: {
36
+ [key: string]: GroupType;
37
+ };
38
+ searchPlaceHolderText: string;
39
+ filterPlaceHolderText: string;
40
+ createGroupIcon: IconButton;
41
+ filterGroupIcon: IconButton;
42
+ groupsLegends: Legend[];
43
+ getGroupsPayload: GetGroupsPayload[];
44
+ groupsPageInfo: {
45
+ groupsTitle: string;
46
+ groupsDescription: string;
47
+ };
18
48
  applicationId: string;
19
49
  apiBaseURL: string;
20
50
  permissions: any;
@@ -59,10 +89,6 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
59
89
  shortName: string;
60
90
  groupScope: string;
61
91
  };
62
- unique: {
63
- "1001": string;
64
- "1002": string;
65
- };
66
92
  };
67
93
  success: {
68
94
  submission: string;
@@ -76,7 +102,7 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
76
102
  };
77
103
  };
78
104
  functionType: GroupFunctionType;
79
- constructor(dialog: MatDialog, groupsService: GroupsService, alertService: AlertsService);
105
+ constructor(dialog: MatDialog, groupsService: GroupsService, alertService: AlertsService, breakpointObserverService: BreakpointObserverService, globalErrorHandlerService: GlobalErrorHandlerService);
80
106
  /**
81
107
  * Initialize the groups component.
82
108
  * @return -returns nothing
@@ -97,11 +123,61 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
97
123
  * @memberof GroupsComponent
98
124
  */
99
125
  openModal(dialogOptions: any, className?: string): void;
126
+ /**
127
+ * Shows the search field on click of search icon in case of mobile view
128
+ * @memberof GroupsComponent
129
+ */
130
+ onGroupSearch(): void;
131
+ /**
132
+ * Shows the Filter by dropdown options on click of filter icon in case of mobile view
133
+ * @memberof GroupsComponent
134
+ */
135
+ showGroupFilter(): void;
136
+ /**
137
+ * Sets isGroupSearchOrFilterActive to true and loads the groups those are configured with selected group type.
138
+ * @param {string} searchTerm
139
+ * @memberof GroupsComponent
140
+ */
141
+ onGroupSearchClick(searchTerm: string): void;
142
+ /**
143
+ * Sets select group type options from groupTypes response
144
+ * @return {*} {SelectOption[]}
145
+ * @memberof GroupsComponent
146
+ */
147
+ getGroupTypeOptions(): SelectOption[];
148
+ /**
149
+ * Sets legend color from groupTypes response
150
+ * @memberof GroupsComponent
151
+ */
152
+ legendColor(): void;
153
+ /**
154
+ * Sets the isGroupSearchOrFilterActive flag and loads parent group info as per selected filter option.
155
+ * @param {SelectOption} event
156
+ * @memberof GroupsComponent
157
+ */
158
+ onGroupTypeFiltered(event: SelectOption): void;
159
+ /**
160
+ * Loads all the parent groups information.
161
+ * @memberof GroupsComponent
162
+ */
163
+ getGroups(group?: GroupInfo): void;
164
+ /**
165
+ * Sets groupType info with group response from groupType response
166
+ * @param {GroupInfo[]} response
167
+ * @return {*} {GroupInfo[]}
168
+ * @memberof GroupsComponent
169
+ */
170
+ viewGroupResponse(response: GroupInfo[]): GroupInfo[];
171
+ /**
172
+ * Loads the group types.
173
+ * @memberof GroupsComponent
174
+ */
175
+ getGroupTypes(): void;
100
176
  /**
101
177
  * NgOnDestroy performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
102
178
  * @memberof GroupsComponent
103
179
  */
104
180
  ngOnDestroy(): void;
105
181
  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>;
182
+ 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
183
  }
@@ -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,26 @@
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 { AlertsService, HttpService } from '@ieeesa-npm/utility';
4
+ import { GroupTypeResponse } from '../models/group-types.model';
5
+ import { GetGroupResponse } from '../models/view-group.model';
5
6
  import * as i0 from "@angular/core";
6
7
  /**
7
8
  * Groups service is an abstract layer and responsible for managing groups REST API calls.
8
9
  * @class GroupsService
9
- * @implements {OnDestroy}
10
10
  */
11
11
  export declare class GroupsService {
12
12
  private httpService;
13
+ alertService: AlertsService;
14
+ groupsText: {
15
+ "1001": string;
16
+ "1002": string;
17
+ "1010": string;
18
+ "1011": string;
19
+ "1012": string;
20
+ };
13
21
  apiBaseUrl: string;
14
22
  userPermission: any;
15
- constructor(httpService: HttpService);
23
+ constructor(httpService: HttpService, alertService: AlertsService);
16
24
  setAppConfig(apiBaseUrl: string, userPermission: any): void;
17
25
  /**
18
26
  * Gets application group types from API and returns it as an observable.
@@ -20,6 +28,13 @@ export declare class GroupsService {
20
28
  * @memberof GroupsService
21
29
  */
22
30
  getGroupTypes(): Observable<GroupTypeResponse>;
31
+ /**
32
+ * Returns all the groups based on passed group Id and group type.
33
+ * @param {GetGroupsPayload} getGroupsPayload
34
+ * @return {Observable<GetGroupResponse>}
35
+ * @memberof GroupsService
36
+ */
37
+ getAllGroups(getGroupsPayload: any): Observable<GetGroupResponse>;
23
38
  /**
24
39
  * Posts create group form data to server using HttpService for creating new group.
25
40
  * @param {CreateGroupPayload} createGroupPayload -create group form data which includes group name, type, short name, scope.
@@ -27,6 +42,13 @@ export declare class GroupsService {
27
42
  * @memberof GroupsService
28
43
  */
29
44
  createGroup(createGroupPayload: CreateGroupPayload): Observable<CreateGroupResponse>;
45
+ /**
46
+ * This method will parse the error codes and return the respective error message for each code.
47
+ * @param {string[]} errorCodes
48
+ * @return {string[]} errorMessage
49
+ * @memberof GroupsService
50
+ */
51
+ parseErrorMessage(errorCodes: string[]): string[];
30
52
  static ɵfac: i0.ɵɵFactoryDeclaration<GroupsService, never>;
31
53
  static ɵprov: i0.ɵɵInjectableDeclaration<GroupsService>;
32
54
  }
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.2",
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.0",
8
+ "@ieeesa-npm/shared-styles": "^0.0.5",
9
+ "@ieeesa-npm/utility": "^0.2.4"
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';