@ieeesa-npm/tenants 0.5.0 → 0.5.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.
- package/esm2022/lib/assets/constants.json +10 -1
- package/esm2022/lib/components/create-tenant-application/create-tenant-application.component.mjs +73 -6
- package/esm2022/lib/components/tenant-basic-details/tenant-basic-details.component.mjs +3 -3
- package/esm2022/lib/components/view-tenant-details/view-tenant-details.component.mjs +142 -7
- package/esm2022/lib/models/required-profile-fields.model.mjs +2 -0
- package/esm2022/lib/services/tenant-applications.service.mjs +15 -1
- package/fesm2022/ieeesa-npm-tenants.mjs +247 -22
- package/fesm2022/ieeesa-npm-tenants.mjs.map +1 -1
- package/lib/components/create-tenant-application/create-tenant-application.component.d.ts +9 -0
- package/lib/components/tenant-basic-details/tenant-basic-details.component.d.ts +4 -1
- package/lib/components/view-tenant-details/view-tenant-details.component.d.ts +38 -3
- package/lib/models/required-profile-fields.model.d.ts +25 -0
- package/lib/services/tenant-applications.service.d.ts +12 -1
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import { TenantApplicationsService } from '../../services/tenant-applications.se
|
|
|
6
6
|
import { CreateTenantRequestPayload, NewTenantInfo, TenantBasicInfo } from '../../models/tenant.model';
|
|
7
7
|
import { SharedService } from '@ieeesa-npm/shared';
|
|
8
8
|
import { TenantFunctionType } from '../../models/tenant-function-type.model';
|
|
9
|
+
import { RequiredProfileFieldOption, RequiredProfileFieldsConfiguration } from '../../models/required-profile-fields.model';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
export declare class CreateTenantApplicationComponent implements OnInit, OnDestroy {
|
|
11
12
|
fileUploadService: FileUploadService;
|
|
@@ -33,9 +34,13 @@ export declare class CreateTenantApplicationComponent implements OnInit, OnDestr
|
|
|
33
34
|
selectedColor: string;
|
|
34
35
|
selectedAppTypeOption: RadioOption;
|
|
35
36
|
tenantFunctionType: TenantFunctionType;
|
|
37
|
+
tenantFunctionTypeEnum: typeof TenantFunctionType;
|
|
36
38
|
selectedTenantInfo: TenantBasicInfo | undefined;
|
|
37
39
|
isAppLogoModified: boolean;
|
|
38
40
|
updatedTenantBasicInfo: NewTenantInfo;
|
|
41
|
+
requiredProfileFieldsConfiguration?: RequiredProfileFieldsConfiguration;
|
|
42
|
+
requiredProfileFieldOptions: RequiredProfileFieldOption[];
|
|
43
|
+
private requiredProfileFieldsInitialState;
|
|
39
44
|
constructor(fileUploadService: FileUploadService, tenantAppService: TenantApplicationsService, sharedService: SharedService);
|
|
40
45
|
ngOnInit(): void;
|
|
41
46
|
/**
|
|
@@ -69,6 +74,10 @@ export declare class CreateTenantApplicationComponent implements OnInit, OnDestr
|
|
|
69
74
|
* @memberof CreateTenantApplicationComponent
|
|
70
75
|
*/
|
|
71
76
|
editTenant(): void;
|
|
77
|
+
getRequiredProfileFields(): void;
|
|
78
|
+
private captureRequiredProfileFieldsState;
|
|
79
|
+
private hasRequiredProfileFieldsChanges;
|
|
80
|
+
private updateRequiredProfileFields;
|
|
72
81
|
/**
|
|
73
82
|
* Constructs create tenant payload from the form data and returns.
|
|
74
83
|
* @param {*} formData
|
|
@@ -219,6 +219,9 @@ export declare class TenantBasicDetailsComponent implements OnDestroy {
|
|
|
219
219
|
};
|
|
220
220
|
deleteRoleConfirmationMessage: string;
|
|
221
221
|
deleteRolePromptMessage: string;
|
|
222
|
+
featureChangeSignOutLeftButtonLabel: string;
|
|
223
|
+
featureChangeSignOutRightButtonLabel: string;
|
|
224
|
+
featureChangeSignOutMessage: string;
|
|
222
225
|
};
|
|
223
226
|
errors: {
|
|
224
227
|
"2050": string;
|
|
@@ -467,5 +470,5 @@ export declare class TenantBasicDetailsComponent implements OnDestroy {
|
|
|
467
470
|
*/
|
|
468
471
|
ngOnDestroy(): void;
|
|
469
472
|
static ɵfac: i0.ɵɵFactoryDeclaration<TenantBasicDetailsComponent, never>;
|
|
470
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TenantBasicDetailsComponent, "ieeesa-tenant-basic-details", never, { "tenantDetails": { "alias": "tenantDetails"; "required": false; }; }, {}, never,
|
|
473
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TenantBasicDetailsComponent, "ieeesa-tenant-basic-details", never, { "tenantDetails": { "alias": "tenantDetails"; "required": false; }; }, {}, never, ["[afterFeatures]"], true, never>;
|
|
471
474
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { GlobalErrorHandlerService } from '@ieeesa-npm/utility';
|
|
2
|
+
import { AuthService, GlobalErrorHandlerService, StorageService } from '@ieeesa-npm/utility';
|
|
3
3
|
import { AccordionInfo, Menu, PaginatorConfig, TableActions, AlignType, RadioOption, IconButton, SlideToggleOption, TableColumnSchema, AccordionDetails, TableColumnMenuInfo, BreakpointObserverService } from '@ieeesa-npm/presentation';
|
|
4
4
|
import { Subject } from 'rxjs';
|
|
5
5
|
import { ActivatedRoute } from '@angular/router';
|
|
@@ -14,6 +14,7 @@ import { MatDialog } from '@angular/material/dialog';
|
|
|
14
14
|
import { GetRolesAndPermissionsPayload, RolesAndPermissions, PaginationInfo, RoleDetails } from '../../models/roles-and-permissions.model';
|
|
15
15
|
import { PermissionType } from '../../models/permission-type.model';
|
|
16
16
|
import { RoleTypeOption } from '../../models/role-type.model';
|
|
17
|
+
import { RequiredProfileFieldOption, RequiredProfileFieldsConfiguration } from '../../models/required-profile-fields.model';
|
|
17
18
|
import * as i0 from "@angular/core";
|
|
18
19
|
export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
|
|
19
20
|
dialog: MatDialog;
|
|
@@ -22,10 +23,17 @@ export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
|
|
|
22
23
|
globalErrorHandlerService: GlobalErrorHandlerService;
|
|
23
24
|
private sharedService;
|
|
24
25
|
private activatedRoute;
|
|
26
|
+
private authService;
|
|
27
|
+
private storageService;
|
|
25
28
|
destroy$: Subject<boolean>;
|
|
26
29
|
apiBaseURL: string;
|
|
27
30
|
userPermissions: UserPermission[];
|
|
28
31
|
routePaths: TenantsRoutesConfig;
|
|
32
|
+
/** Auth cookie name and SSO sign-out URL, used to sign out after a tenant feature change. */
|
|
33
|
+
signOutConfig?: {
|
|
34
|
+
cookieName: string;
|
|
35
|
+
ssoSignOutUrl: string;
|
|
36
|
+
};
|
|
29
37
|
isMobileView: boolean;
|
|
30
38
|
constants: any;
|
|
31
39
|
tenantLabels: any;
|
|
@@ -70,8 +78,13 @@ export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
|
|
|
70
78
|
roleMenuElement: HTMLElement;
|
|
71
79
|
selectedRoleInfo: RoleDetails;
|
|
72
80
|
isGroupTypesExpanded: boolean;
|
|
81
|
+
requiredProfileFieldsConfiguration?: RequiredProfileFieldsConfiguration;
|
|
82
|
+
private requiredProfileFieldsInitialState;
|
|
83
|
+
requiredProfileFieldOptions: RequiredProfileFieldOption[];
|
|
73
84
|
roleTypeOptions: RoleTypeOption[];
|
|
74
|
-
|
|
85
|
+
/** Feature ids captured before the edit dialog opens, used to detect a feature list change on save. */
|
|
86
|
+
private featureIdsBeforeEdit;
|
|
87
|
+
constructor(dialog: MatDialog, breakpointObserverService: BreakpointObserverService, tenantAppService: TenantApplicationsService, globalErrorHandlerService: GlobalErrorHandlerService, sharedService: SharedService, activatedRoute: ActivatedRoute, authService: AuthService, storageService: StorageService);
|
|
75
88
|
/**
|
|
76
89
|
* Initializes view tenant details component.
|
|
77
90
|
* @return -returns nothing
|
|
@@ -90,6 +103,10 @@ export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
|
|
|
90
103
|
* @memberof ViewTenantDetailsComponent
|
|
91
104
|
*/
|
|
92
105
|
showTenantDetails(accordionInfo: AccordionInfo, expanded: boolean): void;
|
|
106
|
+
getRequiredProfileFields(): void;
|
|
107
|
+
hasRequiredProfileFieldsChanges(): boolean;
|
|
108
|
+
private captureRequiredProfileFieldsState;
|
|
109
|
+
updateRequiredProfileFields(): void;
|
|
93
110
|
/**
|
|
94
111
|
* Fetches the configured roles of the selected tenant and creates the column schema.
|
|
95
112
|
* @memberof ViewTenantDetailsComponent
|
|
@@ -213,11 +230,29 @@ export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
|
|
|
213
230
|
* @memberof ViewTenantDetailsComponent
|
|
214
231
|
*/
|
|
215
232
|
openDeleteRoleModal(): void;
|
|
233
|
+
/**
|
|
234
|
+
* Returns the feature ids of the given tenant.
|
|
235
|
+
* @param {TenantBasicInfo} [tenant]
|
|
236
|
+
* @return {string[]}
|
|
237
|
+
* @memberof ViewTenantDetailsComponent
|
|
238
|
+
*/
|
|
239
|
+
private getFeatureIds;
|
|
240
|
+
/**
|
|
241
|
+
* Opens the re-sign-in confirmation modal when the tenant feature list changed on save, since
|
|
242
|
+
* feature flags are only refreshed at login. Emits signOutRequested when the user confirms.
|
|
243
|
+
* @memberof ViewTenantDetailsComponent
|
|
244
|
+
*/
|
|
245
|
+
private promptReSignInIfFeaturesChanged;
|
|
246
|
+
/**
|
|
247
|
+
* Clears the session and redirects to the SSO sign-out URL, mirroring the header sign-out.
|
|
248
|
+
* @memberof ViewTenantDetailsComponent
|
|
249
|
+
*/
|
|
250
|
+
private signOut;
|
|
216
251
|
/**
|
|
217
252
|
* Performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
|
|
218
253
|
* @memberof ViewTenantDetailsComponent
|
|
219
254
|
*/
|
|
220
255
|
ngOnDestroy(): void;
|
|
221
256
|
static ɵfac: i0.ɵɵFactoryDeclaration<ViewTenantDetailsComponent, never>;
|
|
222
|
-
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; }; }, {}, never, never, true, never>;
|
|
257
|
+
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>;
|
|
223
258
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface RequiredProfileFieldOption {
|
|
2
|
+
field: string;
|
|
3
|
+
label: string;
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface RequiredProfileFieldsValue {
|
|
7
|
+
requiredFields: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface RequiredProfileFieldsConfiguration {
|
|
10
|
+
configFieldId: string;
|
|
11
|
+
configFieldName: string;
|
|
12
|
+
configFieldValue: RequiredProfileFieldsValue;
|
|
13
|
+
}
|
|
14
|
+
export interface RequiredProfileFieldsResponse {
|
|
15
|
+
status: boolean;
|
|
16
|
+
body?: RequiredProfileFieldsConfiguration[];
|
|
17
|
+
}
|
|
18
|
+
export interface UpdateRequiredProfileFieldsPayload {
|
|
19
|
+
payload: {
|
|
20
|
+
appId: string;
|
|
21
|
+
configFieldName: string;
|
|
22
|
+
configFieldId: string;
|
|
23
|
+
configFieldValue: RequiredProfileFieldsValue;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -16,6 +16,7 @@ import { UpdateTenantStatusRequestPayload, UpdateTenantStatusResponse } from '..
|
|
|
16
16
|
import { GetRoleTypesPayload, RoleTypeConfiguration, RoleTypeOption, RoleTypeResponse } from '../models/role-type.model';
|
|
17
17
|
import { ViewGroupTypeResponse } from '../models/view-tenant-group-types.model';
|
|
18
18
|
import { CreateGroupTypeRequestPayload, CreateGroupTypeResponse, CreatedOrModifiedGroupTypeInfo, GetRosterTypeOrSettingsResponse } from '../models/create-group-type.model';
|
|
19
|
+
import { RequiredProfileFieldsResponse, UpdateRequiredProfileFieldsPayload } from '../models/required-profile-fields.model';
|
|
19
20
|
import * as i0 from "@angular/core";
|
|
20
21
|
export declare class TenantApplicationsService {
|
|
21
22
|
private httpService;
|
|
@@ -46,7 +47,12 @@ export declare class TenantApplicationsService {
|
|
|
46
47
|
"2033": string;
|
|
47
48
|
"2034": string;
|
|
48
49
|
"2035": string;
|
|
49
|
-
"2036": string;
|
|
50
|
+
"2036": string; /**
|
|
51
|
+
* Gets tenant details from server using HttpService
|
|
52
|
+
* @param {string} appId
|
|
53
|
+
* @return {Observable<TenantDetailsResponse>}
|
|
54
|
+
* @memberof TenantApplicationsService
|
|
55
|
+
*/
|
|
50
56
|
"2037": string;
|
|
51
57
|
"2038": string;
|
|
52
58
|
"2039": string;
|
|
@@ -335,6 +341,11 @@ export declare class TenantApplicationsService {
|
|
|
335
341
|
* @memberof TenantApplicationsService
|
|
336
342
|
*/
|
|
337
343
|
updateTenantStatus(updateTenantStatusPayload: UpdateTenantStatusRequestPayload): Observable<UpdateTenantStatusResponse>;
|
|
344
|
+
getRequiredProfileFields(appId: string): Observable<RequiredProfileFieldsResponse>;
|
|
345
|
+
updateRequiredProfileFields(payload: UpdateRequiredProfileFieldsPayload): Observable<{
|
|
346
|
+
status: boolean;
|
|
347
|
+
message: string;
|
|
348
|
+
}>;
|
|
338
349
|
/**
|
|
339
350
|
* It generates Feature list from checkbox options generated in form array.
|
|
340
351
|
* @param {CheckboxOption[]} features
|