@ieeesa-npm/tenants 0.4.6 → 0.5.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.
Files changed (142) hide show
  1. package/esm2022/ieeesa-npm-tenants.mjs +5 -0
  2. package/esm2022/lib/assets/constants.json +457 -0
  3. package/esm2022/lib/assets/tenant-validations.mjs +17 -0
  4. package/esm2022/lib/components/create-modify-group-type/create-modify-group-type.component.mjs +476 -0
  5. package/esm2022/lib/components/create-modify-role/create-modify-role.component.mjs +279 -0
  6. package/esm2022/lib/components/create-tenant-application/create-tenant-application.component.mjs +512 -0
  7. package/esm2022/lib/components/roles-and-permissions-mapping/roles-and-permissions-mapping.component.mjs +391 -0
  8. package/esm2022/lib/components/tenant-basic-details/tenant-basic-details.component.mjs +94 -0
  9. package/esm2022/lib/components/view-tenant-details/view-tenant-details.component.mjs +804 -0
  10. package/esm2022/lib/components/view-tenant-group-types/view-tenant-group-types.component.mjs +194 -0
  11. package/esm2022/lib/components/view-tenants-list/view-tenants-list.component.mjs +335 -0
  12. package/esm2022/lib/models/app-type-config.model.mjs +2 -0
  13. package/esm2022/lib/models/app-type.model.mjs +7 -0
  14. package/esm2022/lib/models/create-group-type-config.model.mjs +22 -0
  15. package/esm2022/lib/models/create-group-type.model.mjs +2 -0
  16. package/esm2022/lib/models/feature-permission-id.model.mjs +8 -0
  17. package/esm2022/lib/models/features.model.mjs +2 -0
  18. package/esm2022/lib/models/permission-type.model.mjs +12 -0
  19. package/esm2022/lib/models/role-menu-action.model.mjs +7 -0
  20. package/esm2022/lib/models/role-type.model.mjs +2 -0
  21. package/esm2022/lib/models/roles-and-permissions-table-type.model.mjs +7 -0
  22. package/esm2022/lib/models/roles-and-permissions.model.mjs +2 -0
  23. package/esm2022/lib/models/route-config.model.mjs +2 -0
  24. package/esm2022/lib/models/table-column-schema-view-tenant-list.model.mjs +16 -0
  25. package/esm2022/lib/models/tenant-function-type.model.mjs +12 -0
  26. package/esm2022/lib/models/tenant.model.mjs +2 -0
  27. package/esm2022/lib/models/tenants-permission.model.mjs +2 -0
  28. package/esm2022/lib/models/update-tenant-status.model.mjs +2 -0
  29. package/esm2022/lib/models/view-tenant-group-types.model.mjs +11 -0
  30. package/esm2022/lib/services/tenant-applications.service.mjs +618 -0
  31. package/esm2022/lib/services/tenant-permissions-map.service.mjs +36 -0
  32. package/esm2022/lib/services/tenant-permissions.service.mjs +38 -0
  33. package/esm2022/lib/tenant-applications.component.mjs +14 -0
  34. package/esm2022/lib/tenant-applications.module.mjs +16 -0
  35. package/esm2022/public-api.mjs +36 -0
  36. package/fesm2022/ieeesa-npm-tenants.mjs +4307 -0
  37. package/fesm2022/ieeesa-npm-tenants.mjs.map +1 -0
  38. package/index.d.ts +5 -0
  39. package/lib/assets/tenant-validations.d.ts +15 -0
  40. package/lib/components/create-modify-group-type/create-modify-group-type.component.d.ts +129 -0
  41. package/lib/components/create-modify-role/create-modify-role.component.d.ts +103 -0
  42. package/lib/components/create-tenant-application/create-tenant-application.component.d.ts +128 -0
  43. package/lib/components/roles-and-permissions-mapping/roles-and-permissions-mapping.component.d.ts +106 -0
  44. package/lib/components/tenant-basic-details/tenant-basic-details.component.d.ts +474 -0
  45. package/lib/components/view-tenant-details/view-tenant-details.component.d.ts +250 -0
  46. package/lib/components/view-tenant-group-types/view-tenant-group-types.component.d.ts +63 -0
  47. package/lib/components/view-tenants-list/view-tenants-list.component.d.ts +134 -0
  48. package/lib/models/app-type-config.model.d.ts +14 -0
  49. package/lib/models/app-type.model.d.ts +4 -0
  50. package/lib/models/create-group-type-config.model.d.ts +16 -0
  51. package/lib/models/create-group-type.model.d.ts +49 -0
  52. package/lib/models/feature-permission-id.model.d.ts +4 -0
  53. package/lib/models/features.model.d.ts +15 -0
  54. package/lib/models/permission-type.model.d.ts +8 -0
  55. package/lib/models/role-menu-action.model.d.ts +4 -0
  56. package/lib/models/role-type.model.d.ts +27 -0
  57. package/lib/models/roles-and-permissions-table-type.model.d.ts +4 -0
  58. package/lib/models/roles-and-permissions.model.d.ts +119 -0
  59. package/lib/models/route-config.model.d.ts +4 -0
  60. package/lib/models/table-column-schema-view-tenant-list.model.d.ts +20 -0
  61. package/lib/models/tenant-function-type.model.d.ts +9 -0
  62. package/lib/models/tenant.model.d.ts +51 -0
  63. package/lib/models/tenants-permission.model.d.ts +9 -0
  64. package/lib/models/update-tenant-status.model.d.ts +14 -0
  65. package/lib/models/view-tenant-group-types.model.d.ts +29 -0
  66. package/lib/services/tenant-applications.service.d.ts +399 -0
  67. package/lib/services/tenant-permissions-map.service.d.ts +13 -0
  68. package/lib/services/tenant-permissions.service.d.ts +22 -0
  69. package/lib/tenant-applications.component.d.ts +5 -0
  70. package/lib/tenant-applications.module.d.ts +6 -0
  71. package/package.json +25 -12
  72. package/{src/public-api.ts → public-api.d.ts} +32 -40
  73. package/.eslintrc.json +0 -31
  74. package/ng-package.json +0 -8
  75. package/src/lib/assets/constants.json +0 -454
  76. package/src/lib/assets/tenant-validations.ts +0 -18
  77. package/src/lib/assets/tenants-mock.ts +0 -1240
  78. package/src/lib/components/create-modify-group-type/create-modify-group-type.component.html +0 -15
  79. package/src/lib/components/create-modify-group-type/create-modify-group-type.component.scss +0 -44
  80. package/src/lib/components/create-modify-group-type/create-modify-group-type.component.spec.ts +0 -574
  81. package/src/lib/components/create-modify-group-type/create-modify-group-type.component.ts +0 -602
  82. package/src/lib/components/create-modify-role/create-modify-role.component.html +0 -15
  83. package/src/lib/components/create-modify-role/create-modify-role.component.scss +0 -83
  84. package/src/lib/components/create-modify-role/create-modify-role.component.spec.ts +0 -346
  85. package/src/lib/components/create-modify-role/create-modify-role.component.ts +0 -321
  86. package/src/lib/components/create-tenant-application/create-tenant-application.component.html +0 -18
  87. package/src/lib/components/create-tenant-application/create-tenant-application.component.scss +0 -73
  88. package/src/lib/components/create-tenant-application/create-tenant-application.component.spec.ts +0 -775
  89. package/src/lib/components/create-tenant-application/create-tenant-application.component.ts +0 -638
  90. package/src/lib/components/roles-and-permissions-mapping/roles-and-permissions-mapping.component.html +0 -22
  91. package/src/lib/components/roles-and-permissions-mapping/roles-and-permissions-mapping.component.scss +0 -79
  92. package/src/lib/components/roles-and-permissions-mapping/roles-and-permissions-mapping.component.spec.ts +0 -716
  93. package/src/lib/components/roles-and-permissions-mapping/roles-and-permissions-mapping.component.ts +0 -504
  94. package/src/lib/components/tenant-basic-details/tenant-basic-details.component.html +0 -37
  95. package/src/lib/components/tenant-basic-details/tenant-basic-details.component.scss +0 -16
  96. package/src/lib/components/tenant-basic-details/tenant-basic-details.component.spec.ts +0 -115
  97. package/src/lib/components/tenant-basic-details/tenant-basic-details.component.ts +0 -109
  98. package/src/lib/components/view-tenant-details/view-tenant-details.component.html +0 -195
  99. package/src/lib/components/view-tenant-details/view-tenant-details.component.scss +0 -163
  100. package/src/lib/components/view-tenant-details/view-tenant-details.component.spec.ts +0 -1221
  101. package/src/lib/components/view-tenant-details/view-tenant-details.component.ts +0 -876
  102. package/src/lib/components/view-tenant-group-types/view-tenant-group-types.component.html +0 -10
  103. package/src/lib/components/view-tenant-group-types/view-tenant-group-types.component.scss +0 -44
  104. package/src/lib/components/view-tenant-group-types/view-tenant-group-types.component.spec.ts +0 -410
  105. package/src/lib/components/view-tenant-group-types/view-tenant-group-types.component.ts +0 -219
  106. package/src/lib/components/view-tenants-list/view-tenants-list.component.html +0 -32
  107. package/src/lib/components/view-tenants-list/view-tenants-list.component.scss +0 -35
  108. package/src/lib/components/view-tenants-list/view-tenants-list.component.spec.ts +0 -464
  109. package/src/lib/components/view-tenants-list/view-tenants-list.component.ts +0 -388
  110. package/src/lib/models/app-type-config.model.ts +0 -14
  111. package/src/lib/models/app-type.model.ts +0 -5
  112. package/src/lib/models/create-group-type-config.model.ts +0 -18
  113. package/src/lib/models/create-group-type.model.ts +0 -46
  114. package/src/lib/models/feature-permission-id.model.ts +0 -6
  115. package/src/lib/models/features.model.ts +0 -15
  116. package/src/lib/models/form-status.model.ts +0 -5
  117. package/src/lib/models/permission-type.model.ts +0 -9
  118. package/src/lib/models/role-menu-action.model.ts +0 -5
  119. package/src/lib/models/role-type.model.ts +0 -34
  120. package/src/lib/models/roles-and-permissions-table-type.model.ts +0 -5
  121. package/src/lib/models/roles-and-permissions.model.ts +0 -113
  122. package/src/lib/models/route-config.model.ts +0 -4
  123. package/src/lib/models/table-column-schema-view-tenant-list.model.ts +0 -21
  124. package/src/lib/models/tenant-function-type.model.ts +0 -10
  125. package/src/lib/models/tenant.model.ts +0 -47
  126. package/src/lib/models/tenants-permission.model.ts +0 -9
  127. package/src/lib/models/update-tenant-status.model.ts +0 -12
  128. package/src/lib/models/view-tenant-group-types.model.ts +0 -34
  129. package/src/lib/services/tenant-applications.service.spec.ts +0 -1245
  130. package/src/lib/services/tenant-applications.service.ts +0 -798
  131. package/src/lib/services/tenant-permissions-map.service.spec.ts +0 -25
  132. package/src/lib/services/tenant-permissions-map.service.ts +0 -28
  133. package/src/lib/services/tenant-permissions.service.spec.ts +0 -62
  134. package/src/lib/services/tenant-permissions.service.ts +0 -49
  135. package/src/lib/tenant-applications.component.html +0 -0
  136. package/src/lib/tenant-applications.component.scss +0 -0
  137. package/src/lib/tenant-applications.component.spec.ts +0 -28
  138. package/src/lib/tenant-applications.component.ts +0 -12
  139. package/src/lib/tenant-applications.module.ts +0 -8
  140. package/tsconfig.lib.json +0 -14
  141. package/tsconfig.lib.prod.json +0 -10
  142. package/tsconfig.spec.json +0 -14
@@ -0,0 +1,250 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { AuthService, GlobalErrorHandlerService, StorageService } from '@ieeesa-npm/utility';
3
+ import { AccordionInfo, Menu, PaginatorConfig, TableActions, AlignType, RadioOption, IconButton, SlideToggleOption, TableColumnSchema, AccordionDetails, TableColumnMenuInfo, BreakpointObserverService } from '@ieeesa-npm/presentation';
4
+ import { Subject } from 'rxjs';
5
+ import { ActivatedRoute } from '@angular/router';
6
+ import { TenantApplicationsService } from '../../services/tenant-applications.service';
7
+ import { TenantsPermissions, UserPermission } from '../../models/tenants-permission.model';
8
+ import { SharedService } from '@ieeesa-npm/shared';
9
+ import { TenantsRoutesConfig } from '../../models/route-config.model';
10
+ import { TenantBasicInfo } from '../../models/tenant.model';
11
+ import { TenantFunctionType } from '../../models/tenant-function-type.model';
12
+ import { PageEvent } from '@angular/material/paginator';
13
+ import { MatDialog } from '@angular/material/dialog';
14
+ import { GetRolesAndPermissionsPayload, RolesAndPermissions, PaginationInfo, RoleDetails } from '../../models/roles-and-permissions.model';
15
+ import { PermissionType } from '../../models/permission-type.model';
16
+ import { RoleTypeOption } from '../../models/role-type.model';
17
+ import * as i0 from "@angular/core";
18
+ export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
19
+ dialog: MatDialog;
20
+ private breakpointObserverService;
21
+ private tenantAppService;
22
+ globalErrorHandlerService: GlobalErrorHandlerService;
23
+ private sharedService;
24
+ private activatedRoute;
25
+ private authService;
26
+ private storageService;
27
+ destroy$: Subject<boolean>;
28
+ apiBaseURL: string;
29
+ userPermissions: UserPermission[];
30
+ routePaths: TenantsRoutesConfig;
31
+ /** Auth cookie name and SSO sign-out URL, used to sign out after a tenant feature change. */
32
+ signOutConfig?: {
33
+ cookieName: string;
34
+ ssoSignOutUrl: string;
35
+ };
36
+ isMobileView: boolean;
37
+ constants: any;
38
+ tenantLabels: any;
39
+ slideToggleOption: {
40
+ id: number;
41
+ label: any;
42
+ checked: boolean;
43
+ disabled: boolean;
44
+ };
45
+ editButton: IconButton;
46
+ tenantDetails: TenantBasicInfo;
47
+ accordionInfoList: AccordionInfo[];
48
+ appId: string;
49
+ iconSize: any;
50
+ rolesAndPermissionsTableCaption: any;
51
+ rolesAndPermissionsTableHeaderName: any;
52
+ rolesAndPermissionsTableSupportMessage: any;
53
+ permissionsColumnClassNumber: number;
54
+ menuItems: Menu[];
55
+ columnSchema: TableColumnSchema[];
56
+ tableData: RolesAndPermissions[];
57
+ isRolesAndPermissionsExpanded: boolean;
58
+ paginatorConfig: PaginatorConfig;
59
+ tablePagination: PaginationInfo;
60
+ rolesAndPermissionsClassName: string;
61
+ headerElementClassName: string;
62
+ tableActions: TableActions;
63
+ viewTenantsRouteUrl: string;
64
+ dialogRef: any;
65
+ accordionDetails: typeof AccordionDetails;
66
+ appTypeOptions: RadioOption[];
67
+ isBasicDetailsExpanded: boolean;
68
+ createGroupTypeScreenTexts: any;
69
+ editTenantScreenTexts: any;
70
+ deleteRoleScreenTexts: any;
71
+ mapRolesAndPermissionsScreenTexts: any;
72
+ alignmentType: typeof AlignType;
73
+ userTenantsPermissions: TenantsPermissions[];
74
+ permissionType: typeof PermissionType;
75
+ functionType: TenantFunctionType;
76
+ createRoleScreenTexts: any;
77
+ roleMenuElement: HTMLElement;
78
+ selectedRoleInfo: RoleDetails;
79
+ isGroupTypesExpanded: boolean;
80
+ roleTypeOptions: RoleTypeOption[];
81
+ /** Feature ids captured before the edit dialog opens, used to detect a feature list change on save. */
82
+ private featureIdsBeforeEdit;
83
+ constructor(dialog: MatDialog, breakpointObserverService: BreakpointObserverService, tenantAppService: TenantApplicationsService, globalErrorHandlerService: GlobalErrorHandlerService, sharedService: SharedService, activatedRoute: ActivatedRoute, authService: AuthService, storageService: StorageService);
84
+ /**
85
+ * Initializes view tenant details component.
86
+ * @return -returns nothing
87
+ * @memberof ViewTenantDetailsComponent
88
+ */
89
+ ngOnInit(): void;
90
+ /**
91
+ * Gets the selected tenant details from server.
92
+ * @memberof ViewTenantDetailsComponent
93
+ */
94
+ getTenantDetails(appId: string): void;
95
+ /**
96
+ * Display the corresponding tenant basic or feature details based on selected accordion.
97
+ * @param {AccordionInfo} accordionInfo
98
+ * @param {boolean} expanded
99
+ * @memberof ViewTenantDetailsComponent
100
+ */
101
+ showTenantDetails(accordionInfo: AccordionInfo, expanded: boolean): void;
102
+ /**
103
+ * Fetches the configured roles of the selected tenant and creates the column schema.
104
+ * @memberof ViewTenantDetailsComponent
105
+ */
106
+ getRolesAndInitializeTableSchema(): void;
107
+ /**
108
+ * Fetches the roles and permissions mappings for the selected tenant and and initialize table view.
109
+ * @param {GetRolesAndPermissionsPayload} payload
110
+ * @memberof ViewTenantDetailsComponent
111
+ */
112
+ getRolesAndPermissionsAndInitializeTableView(payload: GetRolesAndPermissionsPayload): void;
113
+ /**
114
+ * Fetch the roles and permissions records based on offset and page size while the pagination changes.
115
+ * @param {PageEvent} pageEvent
116
+ * @memberof ViewTenantDetailsComponent
117
+ */
118
+ onTablePaginationChange(pageEvent: PageEvent): void;
119
+ /**
120
+ * Captures the selected role's information and performs edit or delete action basis on the selected menu item.
121
+ * @param {TableColumnMenuInfo} roleMenuInfo
122
+ * @memberof ViewTenantDetailsComponent
123
+ */
124
+ onRoleMenuClick(roleMenuInfo: TableColumnMenuInfo): void;
125
+ /**
126
+ * Keeps track of the accordion based on the element's ID in DOM tree.
127
+ * @memberof ViewTenantDetailsComponent
128
+ */
129
+ trackByAccordionFn(index: number, item: AccordionInfo): number;
130
+ /**
131
+ * Gets the role types and updates the form control.
132
+ * @memberof ViewTenantDetailsComponent
133
+ */
134
+ getRoleTypes(): void;
135
+ /**
136
+ * Sets the dialog options for create role modal and calls openModal method.
137
+ * @return -returns nothing
138
+ * @memberof ViewTenantDetailsComponent
139
+ */
140
+ openCreateRoleForm(): void;
141
+ /**
142
+ * Sets the dialog options for create group type modal and calls openModal method.
143
+ * @return -returns nothing
144
+ * @memberof ViewTenantDetailsComponent
145
+ */
146
+ openCreateGroupTypeForm(): void;
147
+ /**
148
+ * Sets the dialog options for edit role modal and calls openModal method.
149
+ * @return -returns nothing
150
+ * @memberof ViewTenantDetailsComponent
151
+ */
152
+ openEditRoleForm(): void;
153
+ /**
154
+ * Sets the dialog options for edit tenant modal and calls openModal method.
155
+ * @return -returns nothing
156
+ * @memberof ViewTenantDetailsComponent
157
+ */
158
+ openEditTenantForm(): void;
159
+ /**
160
+ * Opens modal component with received params and handles form submission success and errors.
161
+ * @param {*} dialogOptions
162
+ * @param {string} [className]
163
+ * @return -returns nothing
164
+ * @memberof ViewTenantsDetailsComponent
165
+ */
166
+ openModal(dialogOptions: any, className?: string): void;
167
+ /**
168
+ * Calls openTenantStatusConfirmationModal to change the status of tenant on slide toggle change.
169
+ * @param {SlideToggleOption} slideToggleOption
170
+ * @memberof ViewTenantDetailsComponent
171
+ */
172
+ onSlideToggleChange(slideToggleOption: SlideToggleOption): void;
173
+ /**
174
+ * Opens the confirmation modal to inactivate/reactivate the tenant.
175
+ * @param {boolean} isActivate
176
+ * @memberof ViewTenantDetailsComponent
177
+ */
178
+ openTenantStatusConfirmationModal(isActivate: boolean): void;
179
+ /**
180
+ * Opens the map permissions and roles modal.
181
+ * @memberof ViewTenantDetailsComponent
182
+ * @returns {void}
183
+ */
184
+ openMapRolesAndPermissionsForm(): void;
185
+ /**
186
+ * Updates the tenant status to the server using http request and display success/error message based on request response (success or failure).
187
+ * @param {boolean} isActivate
188
+ * @memberof ViewTenantDetailsComponent
189
+ */
190
+ updateTenantStatus(isActivate: boolean): void;
191
+ /**
192
+ * Sets slide toggle checked status and label.
193
+ * @param {boolean} isActivate
194
+ * @memberof ViewTenantDetailsComponent
195
+ */
196
+ setSlideToggleStatus(isActivate: boolean): void;
197
+ /**
198
+ * Gets the application/tenant types.
199
+ * @memberof ViewTenantDetailsComponent
200
+ */
201
+ getApplicationTypes(): void;
202
+ /**
203
+ * Validates permission based access for provided feature.
204
+ * @param {PermissionType} permissionType
205
+ * @return {boolean}
206
+ * @memberof ViewTenantDetailsComponent
207
+ */
208
+ validateAccess(permissionType: PermissionType): boolean;
209
+ /**
210
+ * Posts the details of the role to be deleted to the server using http request and display success/error message based on request response (success or failure).
211
+ * @memberof ViewTenantDetailsComponent
212
+ */
213
+ deleteRole(): void;
214
+ /**
215
+ * Sets the role menu HTMLElement.
216
+ * @param {HTMLElement} menuButton
217
+ * @memberof ViewTenantDetailsComponent
218
+ */
219
+ selectedRoleMenuElement(menuButton: HTMLElement): void;
220
+ /**
221
+ * Opens the confirmation modal to get user confirmation to delete the role.
222
+ * @memberof ViewTenantDetailsComponent
223
+ */
224
+ openDeleteRoleModal(): void;
225
+ /**
226
+ * Returns the feature ids of the given tenant.
227
+ * @param {TenantBasicInfo} [tenant]
228
+ * @return {string[]}
229
+ * @memberof ViewTenantDetailsComponent
230
+ */
231
+ private getFeatureIds;
232
+ /**
233
+ * Opens the re-sign-in confirmation modal when the tenant feature list changed on save, since
234
+ * feature flags are only refreshed at login. Emits signOutRequested when the user confirms.
235
+ * @memberof ViewTenantDetailsComponent
236
+ */
237
+ private promptReSignInIfFeaturesChanged;
238
+ /**
239
+ * Clears the session and redirects to the SSO sign-out URL, mirroring the header sign-out.
240
+ * @memberof ViewTenantDetailsComponent
241
+ */
242
+ private signOut;
243
+ /**
244
+ * Performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
245
+ * @memberof ViewTenantDetailsComponent
246
+ */
247
+ ngOnDestroy(): void;
248
+ static ɵfac: i0.ɵɵFactoryDeclaration<ViewTenantDetailsComponent, never>;
249
+ static ɵcmp: i0.ɵɵComponentDeclaration<ViewTenantDetailsComponent, "ieeesa-view-tenant-details", never, { "apiBaseURL": { "alias": "apiBaseURL"; "required": false; }; "userPermissions": { "alias": "userPermissions"; "required": false; }; "routePaths": { "alias": "routePaths"; "required": false; }; "signOutConfig": { "alias": "signOutConfig"; "required": false; }; }, {}, never, never, true, never>;
250
+ }
@@ -0,0 +1,63 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { Menu, TableColumnSchema } from '@ieeesa-npm/presentation';
3
+ import { Subject } from 'rxjs';
4
+ import { TenantApplicationsService } from '../../services/tenant-applications.service';
5
+ import { SharedService } from '@ieeesa-npm/shared';
6
+ import { GroupTypeDetails, ViewGroupTypeResponse } from '../../models/view-tenant-group-types.model';
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * Component for viewing and managing tenant group types. Fetches the configured group types associated to the selected tenant and displays in tabular view.
10
+ * @export
11
+ * @class ViewTenantGroupTypesComponent
12
+ * @implements {OnInit}
13
+ */
14
+ export declare class ViewTenantGroupTypesComponent implements OnInit, OnDestroy {
15
+ private tenantAppService;
16
+ private sharedService;
17
+ destroy$: Subject<boolean>;
18
+ constants: any;
19
+ columnHeading: any;
20
+ settings: any;
21
+ tableRowActions: Menu[];
22
+ columnSchema: TableColumnSchema[];
23
+ groupTypes: GroupTypeDetails[];
24
+ appId: string;
25
+ headerElementClassName: string;
26
+ constructor(tenantAppService: TenantApplicationsService, sharedService: SharedService);
27
+ /**
28
+ * Fetches group types data from the server and initializes column schema.
29
+ * @memberof ViewTenantGroupTypesComponent
30
+ */
31
+ ngOnInit(): void;
32
+ /**
33
+ * Get group types from tenant application service.
34
+ * @memberof ViewTenantGroupTypesComponent
35
+ */
36
+ getGroupTypes(): void;
37
+ /**
38
+ * Formats raw group types data into a required format for display.
39
+ * @param {ViewGroupTypeResponse} groupTypeRes
40
+ * @return {GroupTypeDetails[]}
41
+ * @memberof ViewTenantGroupTypesComponent
42
+ */
43
+ formatGroupTypesTableData(groupTypeRes: ViewGroupTypeResponse): GroupTypeDetails[];
44
+ /**
45
+ * Transforms business rule to required format in string.
46
+ * @param {*} rule
47
+ * @return {string}
48
+ * @memberof ViewTenantGroupTypesComponent
49
+ */
50
+ transformBusinessRule(rule: any): string;
51
+ /**
52
+ * Initializes table column schema to display group types in tabular view.
53
+ * @memberof ViewTenantGroupTypesComponent
54
+ */
55
+ initializeColumnSchema(): void;
56
+ /**
57
+ * Performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
58
+ * @memberof ViewTenantGroupTypesComponent
59
+ */
60
+ ngOnDestroy(): void;
61
+ static ɵfac: i0.ɵɵFactoryDeclaration<ViewTenantGroupTypesComponent, never>;
62
+ static ɵcmp: i0.ɵɵComponentDeclaration<ViewTenantGroupTypesComponent, "ieeesa-view-tenant-group-types", never, {}, {}, never, never, true, never>;
63
+ }
@@ -0,0 +1,134 @@
1
+ import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { PaginatorConfig, TableActions, TableColumnSchema, BreakpointObserverService } from '@ieeesa-npm/presentation';
3
+ import { Subject } from 'rxjs';
4
+ import { AlertsService } from '@ieeesa-npm/utility';
5
+ import { TenantsRoutesConfig } from '../../models/route-config.model';
6
+ import { SharedService } from '@ieeesa-npm/shared';
7
+ import { TenantApplicationsService } from '../../services/tenant-applications.service';
8
+ import { Router } from '@angular/router';
9
+ import { PageEvent } from '@angular/material/paginator';
10
+ import { Sort } from '@angular/material/sort';
11
+ import { PermissionType } from '../../models/permission-type.model';
12
+ import { TenantsPermissions, UserPermission } from '../../models/tenants-permission.model';
13
+ import { GetTenantsPayload } from '../../models/table-column-schema-view-tenant-list.model';
14
+ import { MatDialog } from '@angular/material/dialog';
15
+ import { SortConfig, TenantBasicInfo } from '../../models/tenant.model';
16
+ import { Features } from '../../models/features.model';
17
+ import * as i0 from "@angular/core";
18
+ export declare class ViewTenantsListComponent implements OnInit, OnDestroy {
19
+ dialog: MatDialog;
20
+ alertService: AlertsService;
21
+ private breakpointObserverService;
22
+ private sharedService;
23
+ private tenantApplicationsService;
24
+ private router;
25
+ destroy$: Subject<boolean>;
26
+ constants: any;
27
+ viewTenantsConstants: any;
28
+ isMobileView: boolean;
29
+ tenantsPageInfo: {
30
+ tenantsTitle: string;
31
+ };
32
+ apiBaseURL: string;
33
+ routePaths: TenantsRoutesConfig;
34
+ userPermissions: UserPermission[];
35
+ defaultSortedColumn: string;
36
+ createTenant: EventEmitter<any>;
37
+ viewTenantsDetails: EventEmitter<TenantBasicInfo>;
38
+ tableData: TenantBasicInfo[];
39
+ columnSchema: TableColumnSchema[];
40
+ tableActions: TableActions;
41
+ tableColumns: any;
42
+ emptyFieldValueReplacedBy: any;
43
+ paginatorConfig: PaginatorConfig;
44
+ userTenantsPermissions: TenantsPermissions[];
45
+ permissionType: typeof PermissionType;
46
+ dialogRef: any;
47
+ createTenantScreenTexts: any;
48
+ defaultColumnSortDirection: boolean;
49
+ pageEvent: PageEvent;
50
+ sortConfig: SortConfig;
51
+ constructor(dialog: MatDialog, alertService: AlertsService, breakpointObserverService: BreakpointObserverService, sharedService: SharedService, tenantApplicationsService: TenantApplicationsService, router: Router);
52
+ /**
53
+ * Sets the user permissions, router config path, base API URL, table column schema and gets the tenants list.
54
+ * @memberof ViewTenantsListComponent
55
+ */
56
+ ngOnInit(): void;
57
+ /**
58
+ * Validates permission based access for provided feature.
59
+ * @param {PermissionType} permissionType
60
+ * @return {boolean}
61
+ * @memberof ViewTenantsListComponent
62
+ */
63
+ validateAccess(permissionType: PermissionType): boolean;
64
+ /**
65
+ * Configures table schema to display the tenants in table view.
66
+ * @memberof ViewTenantsListComponent
67
+ */
68
+ configureTableInfo(): void;
69
+ /**
70
+ * Format the features name in to single sentence with comma separated.
71
+ * @memberof ViewTenantsListComponent
72
+ */
73
+ formatFeaturesName(features: Features[]): string;
74
+ /**
75
+ * Fetching details of tenants and initialize table view
76
+ * @param {GetTenantsPayload} payload
77
+ * @memberof ViewTenantsListComponent
78
+ */
79
+ getTenantsAndInitializeTableView(payload: GetTenantsPayload): void;
80
+ /**
81
+ * Sets the dialog options for create tenant modal and calls openModal method.
82
+ * @return -returns nothing
83
+ * @memberof ViewTenantsListComponent
84
+ */
85
+ openCreateTenantForm(): void;
86
+ /**
87
+ * Opens modal component with received params and handles form submission success and errors.
88
+ * @param {*} dialogOptions
89
+ * @param {string} [className]
90
+ * @return -returns nothing
91
+ * @memberof ViewTenantsListComponent
92
+ */
93
+ openModal(dialogOptions: any, className?: string): void;
94
+ /**
95
+ * Sorts the tenants by application id or title in ascending or descending.
96
+ * @param {Sort} sort
97
+ * @memberof ViewTenantsListComponent
98
+ */
99
+ onSortTenants(sort: Sort): void;
100
+ /**
101
+ * Constructs and returns the payload for fetching the tenants list.
102
+ * @returns GetTenantsPayload
103
+ */
104
+ getTenantsPayload(): GetTenantsPayload;
105
+ /**
106
+ * Returning sorting order according to column definition.
107
+ * @param defaultColumnSortDirection
108
+ * @returns SortOrderBy.ASC | SortOrderBy.DESC
109
+ */
110
+ filterSortedOrderBy(defaultColumnSortDirection: boolean): string;
111
+ /**
112
+ * Get the the records according to pagination.
113
+ * @param {{
114
+ * pageOffset: number;
115
+ * pageLimit: number;
116
+ * }} pageEvent
117
+ * @memberof ViewTenantsListComponent
118
+ */
119
+ onTablePaginationChange(pageEvent: PageEvent): void;
120
+ /**
121
+ * Navigates to view tenants detail component.
122
+ * @param {{tenantInfo: TenantBasicInfo}}
123
+ * @memberof ViewTenantsListComponent
124
+ */
125
+ navigateToViewTenantDetails(tenantInfo: TenantBasicInfo): void;
126
+ /**
127
+ * NgOnDestroy performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
128
+ * @memberof ViewTenantsListComponent
129
+ * @return -returns nothing
130
+ */
131
+ ngOnDestroy(): void;
132
+ static ɵfac: i0.ɵɵFactoryDeclaration<ViewTenantsListComponent, never>;
133
+ static ɵcmp: i0.ɵɵComponentDeclaration<ViewTenantsListComponent, "ieeesa-view-tenants-list", never, { "tenantsPageInfo": { "alias": "tenantsPageInfo"; "required": false; }; "apiBaseURL": { "alias": "apiBaseURL"; "required": false; }; "routePaths": { "alias": "routePaths"; "required": false; }; "userPermissions": { "alias": "userPermissions"; "required": false; }; "defaultSortedColumn": { "alias": "defaultSortedColumn"; "required": false; }; }, { "createTenant": "createTenant"; "viewTenantsDetails": "viewTenantsDetails"; }, never, never, true, never>;
134
+ }
@@ -0,0 +1,14 @@
1
+ import { AppType } from "./app-type.model";
2
+ export interface AppTypeConfig {
3
+ configFieldId: string;
4
+ configFieldValue: {
5
+ type: AppType;
6
+ };
7
+ }
8
+ export interface GetAppTypesResponse {
9
+ status: boolean;
10
+ message: string;
11
+ body: AppTypeConfig[] | null | {
12
+ errorCodes: string[];
13
+ };
14
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum AppType {
2
+ GENERIC = "Generic",
3
+ STANDALONE = "Standalone"
4
+ }
@@ -0,0 +1,16 @@
1
+ export declare enum Settings {
2
+ ALLOW_SUB_GROUPS = "Allow Sub-Groups",
3
+ ALLOW_ROSTERS = "Rosters Enabled",
4
+ ALLOW_ALTERNATE_VOTING = "Allow Alternate Voting",
5
+ HAS_CLASSIFICATION = "Has Classification",
6
+ ALLOW_EDIT = "Allow Edit",
7
+ ALLOW_DELETE = "Allow Delete"
8
+ }
9
+ export declare enum VotingMemberLevelRole {
10
+ VOTING_MEMBER_PRINCIPAL = "Voting Member (Principal)",
11
+ VOTING_MEMBER_ALTERNATE = "Voting Member (Alternate)"
12
+ }
13
+ export declare enum RosterTypeLOVCode {
14
+ INDIVIDUAL = "IND",
15
+ ENTITY = "EN"
16
+ }
@@ -0,0 +1,49 @@
1
+ import { LOV } from '@ieeesa-npm/shared';
2
+ export interface GetRosterTypeOrSettingsResponse {
3
+ status: boolean;
4
+ message: string;
5
+ body?: LOV[] | null | {
6
+ errorCodes: string[];
7
+ };
8
+ }
9
+ export interface ConfigFieldValue {
10
+ name: string;
11
+ description: string;
12
+ businessRule: {
13
+ rosterType: string;
14
+ allowEdit: boolean;
15
+ allowRoster: boolean;
16
+ allowSubGroup: boolean;
17
+ allowAlternateVoting: boolean;
18
+ allowDelete: boolean;
19
+ hasClassification: boolean;
20
+ allowedGroupType: string[];
21
+ isRootGroup: boolean;
22
+ };
23
+ hierarchy?: number;
24
+ }
25
+ export interface CreatedOrModifiedGroupTypeInfo {
26
+ appId: string;
27
+ roles: {
28
+ roleId: string;
29
+ }[];
30
+ configFieldName: string;
31
+ configFieldValue: ConfigFieldValue;
32
+ }
33
+ export interface CreateGroupTypeRequestPayload {
34
+ payload: {
35
+ appId: string;
36
+ roles: {
37
+ roleId: string;
38
+ }[];
39
+ configFieldName: string;
40
+ configFieldValue: string;
41
+ };
42
+ }
43
+ export interface CreateGroupTypeResponse {
44
+ status: boolean;
45
+ message: string;
46
+ body?: string | null | {
47
+ errorCodes: string[];
48
+ };
49
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum FeaturePermissionId {
2
+ MEETINGS_AND_EVENTS = "FEATURE_049753e8-ea5c-4fad-adb0-e1456e69c7a5",
3
+ BALLOTS = "FEATURE_a0ad3616-20dc-43da-813f-9b76d33f227a"
4
+ }
@@ -0,0 +1,15 @@
1
+ export interface Features {
2
+ featureId: string;
3
+ featureName: string;
4
+ isDefault: boolean;
5
+ }
6
+ export interface FeatureId {
7
+ featureId: string;
8
+ }
9
+ export interface GetFeaturesResponse {
10
+ status: boolean;
11
+ message: string;
12
+ body: Features[] | null | {
13
+ errorCodes: string[];
14
+ };
15
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum PermissionType {
2
+ VIEW_TENANTS = "VIEW_TENANTS",
3
+ MANAGE_TENANT = "MANAGE_TENANT"
4
+ }
5
+ export declare enum TenantStatus {
6
+ ACTIVE = "Active",
7
+ INACTIVE = "Inactive"
8
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum RoleMenuAction {
2
+ EDIT_ROLE = 1,
3
+ DELETE_ROLE = 2
4
+ }
@@ -0,0 +1,27 @@
1
+ export interface RoleType {
2
+ roleTypeName: string;
3
+ viewOrder: number;
4
+ }
5
+ export interface RoleTypeConfiguration {
6
+ configFieldId: string;
7
+ configFieldValue: RoleType;
8
+ }
9
+ export interface RoleTypeResponse {
10
+ status: boolean;
11
+ message: string;
12
+ body: RoleTypeConfiguration[] | null | {
13
+ errorCodes: string[];
14
+ };
15
+ }
16
+ export interface RoleTypeOption {
17
+ id: string | number;
18
+ name: string;
19
+ order: number;
20
+ }
21
+ export interface RoleTypePayload {
22
+ appId: string;
23
+ configFieldName: string;
24
+ }
25
+ export interface GetRoleTypesPayload {
26
+ payload: RoleTypePayload;
27
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum RoleAndPermissionsTableType {
2
+ ROLE = "ROLE",
3
+ PERMISSION = "PERMISSION"
4
+ }