@ieeesa-npm/tenants 0.2.7 → 0.2.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 +2 -1
- package/esm2022/lib/components/create-modify-role/create-modify-role.component.mjs +108 -69
- package/esm2022/lib/components/create-tenant-application/create-tenant-application.component.mjs +3 -3
- 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 +75 -4
- package/esm2022/lib/components/view-tenants-list/view-tenants-list.component.mjs +3 -3
- package/esm2022/lib/models/roles-and-permissions.model.mjs +1 -1
- package/esm2022/lib/services/tenant-applications.service.mjs +68 -5
- package/fesm2022/ieeesa-npm-tenants.mjs +255 -82
- package/fesm2022/ieeesa-npm-tenants.mjs.map +1 -1
- package/lib/components/create-modify-role/create-modify-role.component.d.ts +34 -25
- package/lib/components/tenant-basic-details/tenant-basic-details.component.d.ts +1 -0
- package/lib/components/view-tenant-details/view-tenant-details.component.d.ts +18 -0
- package/lib/models/roles-and-permissions.model.d.ts +6 -5
- package/lib/services/tenant-applications.service.d.ts +57 -7
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
|
-
import { AlignType, DynamicFormComponent, FormGrid, FormModel, SelectOption } from '@ieeesa-npm/presentation';
|
|
4
|
+
import { AlignType, DynamicFormComponent, FieldConfig, FormGrid, FormModel, SelectOption } from '@ieeesa-npm/presentation';
|
|
5
5
|
import { TenantApplicationsService } from '../../services/tenant-applications.service';
|
|
6
6
|
import { SharedService } from '@ieeesa-npm/shared';
|
|
7
7
|
import { TenantFunctionType } from '../../models/tenant-function-type.model';
|
|
8
8
|
import { TenantBasicInfo } from '../../models/tenant.model';
|
|
9
|
-
import {
|
|
9
|
+
import { RoleDetails, Role, CreateModifyRoleRequestPayload } from '../../models/roles-and-permissions.model';
|
|
10
10
|
import { GlobalErrorHandlerService } from '@ieeesa-npm/utility';
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
12
12
|
export declare class CreateModifyRoleComponent implements OnInit, OnDestroy {
|
|
@@ -20,58 +20,67 @@ export declare class CreateModifyRoleComponent implements OnInit, OnDestroy {
|
|
|
20
20
|
rightButtonLabel: any;
|
|
21
21
|
colWidth: FormGrid;
|
|
22
22
|
createRoleFormGroup: FormModel;
|
|
23
|
-
|
|
23
|
+
createModifyRoleFormGroupRef: FormGroup;
|
|
24
24
|
actionButtonAlign: AlignType;
|
|
25
25
|
dynamicFormComponent: DynamicFormComponent;
|
|
26
26
|
submitFormResponse: EventEmitter<any>;
|
|
27
27
|
formCancel: EventEmitter<any>;
|
|
28
28
|
tenantFunctionType: TenantFunctionType;
|
|
29
29
|
selectedTenantInfo: TenantBasicInfo | undefined;
|
|
30
|
-
|
|
30
|
+
createModifyRolePayload: CreateModifyRoleRequestPayload;
|
|
31
31
|
roleTypeOptions: SelectOption[];
|
|
32
|
+
selectedRoleDetails: RoleDetails;
|
|
33
|
+
selectedRole: Role;
|
|
32
34
|
constructor(tenantAppService: TenantApplicationsService, sharedService: SharedService, globalErrorHandlerService: GlobalErrorHandlerService);
|
|
33
35
|
ngOnInit(): void;
|
|
34
36
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @
|
|
37
|
+
* Constructs and returns the role type form field based on credit or edit role.
|
|
38
|
+
* @return {FieldConfig} -role type form field.
|
|
39
|
+
* @memberof CreateModifyRoleComponent
|
|
37
40
|
*/
|
|
38
|
-
|
|
41
|
+
getRoleTypeField(): FieldConfig;
|
|
39
42
|
/**
|
|
40
|
-
* Initialize the create role form group array.
|
|
41
|
-
* @memberof
|
|
43
|
+
* Initialize the create/edit role form group array.
|
|
44
|
+
* @memberof CreateModifyRoleComponent
|
|
42
45
|
*/
|
|
43
46
|
initializeCreateRoleFormGroup(): void;
|
|
44
47
|
/**
|
|
45
|
-
* Gets create role form group reference.
|
|
48
|
+
* Gets create/edit role form group reference.
|
|
46
49
|
* @param {FormGroup[]} form
|
|
47
|
-
* @memberof
|
|
50
|
+
* @memberof CreateModifyRoleComponent
|
|
48
51
|
*/
|
|
49
|
-
|
|
52
|
+
getCreateModifyRoleFormGroupRef(form: FormGroup[]): void;
|
|
50
53
|
/**
|
|
51
|
-
* Updates
|
|
54
|
+
* Updates createModifyRoleFormGroupRef on add role form change event.
|
|
52
55
|
* @param {FormGroup[]} form
|
|
53
|
-
* @memberof
|
|
56
|
+
* @memberof CreateModifyRoleComponent
|
|
54
57
|
*/
|
|
55
|
-
|
|
58
|
+
onCreateModifyRoleFormChange(form: FormGroup[]): void;
|
|
56
59
|
/**
|
|
57
60
|
* Creates a new role on form submission and the form is valid.
|
|
58
61
|
* @param {FormGroup[]} form
|
|
59
|
-
* @memberof
|
|
62
|
+
* @memberof CreateModifyRoleComponent
|
|
60
63
|
*/
|
|
61
|
-
|
|
64
|
+
onCreateModifyRoleFormSubmit(form: FormGroup[]): void;
|
|
62
65
|
/**
|
|
63
|
-
* Constructs create role payload from the form data and returns.
|
|
66
|
+
* Constructs create/edit role payload from the form data and returns.
|
|
64
67
|
* @param {*} formData
|
|
65
|
-
* @return {
|
|
66
|
-
* @memberof
|
|
68
|
+
* @return {CreateModifyRoleRequestPayload}
|
|
69
|
+
* @memberof CreateModifyRoleComponent
|
|
67
70
|
*/
|
|
68
|
-
|
|
71
|
+
getCreateModifyRolePayload(formData: any): CreateModifyRoleRequestPayload;
|
|
69
72
|
/**
|
|
70
73
|
* Post the creates new role form data to the server on form submission to create a new role.
|
|
71
|
-
*
|
|
72
|
-
* @memberof
|
|
74
|
+
* @param {CreateRoleRequestPayload} createModifyRolePayload
|
|
75
|
+
* @memberof CreateModifyRoleComponent
|
|
73
76
|
*/
|
|
74
77
|
createRole(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Post the edited role form data to server on form submission to update the selected role information.
|
|
80
|
+
* @param {CreateModifyRoleRequestPayload} createModifyRolePayload
|
|
81
|
+
* @memberof CreateModifyRoleComponent
|
|
82
|
+
*/
|
|
83
|
+
editRole(): void;
|
|
75
84
|
/**
|
|
76
85
|
* Captures the server side errors and handles it based on the custom or Http errors.
|
|
77
86
|
* @param {HttpErrorResponse} error
|
|
@@ -81,12 +90,12 @@ export declare class CreateModifyRoleComponent implements OnInit, OnDestroy {
|
|
|
81
90
|
handleErrors(error: any): void;
|
|
82
91
|
/**
|
|
83
92
|
* Emits form cancel event.
|
|
84
|
-
* @memberof
|
|
93
|
+
* @memberof CreateModifyRoleComponent
|
|
85
94
|
*/
|
|
86
95
|
onFormCancel(): void;
|
|
87
96
|
/**
|
|
88
97
|
* Implementation of ngOnDestroy lifecycle hook method to unsubscribe the open observable subscriptions.
|
|
89
|
-
* @memberof
|
|
98
|
+
* @memberof CreateModifyRoleComponent
|
|
90
99
|
*/
|
|
91
100
|
ngOnDestroy(): void;
|
|
92
101
|
static ɵfac: i0.ɵɵFactoryDeclaration<CreateModifyRoleComponent, never>;
|
|
@@ -12,6 +12,7 @@ import { PageEvent } from '@angular/material/paginator';
|
|
|
12
12
|
import { MatDialog } from '@angular/material/dialog';
|
|
13
13
|
import { GetRolesAndPermissionsPayload, RolesAndPermissions, PaginationInfo, RoleDetails } from '../../models/roles-and-permissions.model';
|
|
14
14
|
import { PermissionType } from '../../models/permission-type.model';
|
|
15
|
+
import { RoleTypeOption } from '../../models/role-type.model';
|
|
15
16
|
import * as i0 from "@angular/core";
|
|
16
17
|
export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
|
|
17
18
|
dialog: MatDialog;
|
|
@@ -64,6 +65,7 @@ export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
|
|
|
64
65
|
createRoleScreenTexts: any;
|
|
65
66
|
roleMenuElement: HTMLElement;
|
|
66
67
|
selectedRoleInfo: RoleDetails;
|
|
68
|
+
roleTypeOptions: RoleTypeOption[];
|
|
67
69
|
constructor(dialog: MatDialog, breakpointObserverService: BreakpointObserverService, tenantAppService: TenantApplicationsService, globalErrorHandlerService: GlobalErrorHandlerService, sharedService: SharedService);
|
|
68
70
|
/**
|
|
69
71
|
* Initializes view tenant details component.
|
|
@@ -111,7 +113,23 @@ export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
|
|
|
111
113
|
* @memberof ViewTenantDetailsComponent
|
|
112
114
|
*/
|
|
113
115
|
trackByAccordionFn(index: number, item: AccordionInfo): number;
|
|
116
|
+
/**
|
|
117
|
+
* Gets the role types and updates the form control.
|
|
118
|
+
* @memberof ViewTenantDetailsComponent
|
|
119
|
+
*/
|
|
120
|
+
getRoleTypes(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Sets the dialog options for create role modal and calls openModal method.
|
|
123
|
+
* @return -returns nothing
|
|
124
|
+
* @memberof ViewTenantDetailsComponent
|
|
125
|
+
*/
|
|
114
126
|
openCreateRoleForm(): void;
|
|
127
|
+
/**
|
|
128
|
+
* Sets the dialog options for edit role modal and calls openModal method.
|
|
129
|
+
* @return -returns nothing
|
|
130
|
+
* @memberof ViewTenantDetailsComponent
|
|
131
|
+
*/
|
|
132
|
+
openEditRoleForm(): void;
|
|
115
133
|
/**
|
|
116
134
|
* Sets the dialog options for edit tenant modal and calls openModal method.
|
|
117
135
|
* @return -returns nothing
|
|
@@ -43,16 +43,17 @@ export interface GetRolesAndPermissionsResponse {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
export interface RoleInfo {
|
|
46
|
-
roleType
|
|
46
|
+
roleType?: string;
|
|
47
47
|
roleName: string;
|
|
48
|
+
roleId?: string;
|
|
48
49
|
}
|
|
49
|
-
export interface
|
|
50
|
+
export interface CreateModifyRoleInfo extends RoleInfo {
|
|
50
51
|
appId: string;
|
|
51
52
|
}
|
|
52
|
-
export interface
|
|
53
|
-
payload:
|
|
53
|
+
export interface CreateModifyRoleRequestPayload {
|
|
54
|
+
payload: CreateModifyRoleInfo;
|
|
54
55
|
}
|
|
55
|
-
export interface
|
|
56
|
+
export interface CreateModifyRoleResponse {
|
|
56
57
|
status: boolean;
|
|
57
58
|
message: string;
|
|
58
59
|
body?: string | null | {
|
|
@@ -10,7 +10,7 @@ import { FeatureId, Features, GetFeaturesResponse } from '../models/features.mod
|
|
|
10
10
|
import { AppTypeConfig, GetAppTypesResponse } from '../models/app-type-config.model';
|
|
11
11
|
import { TenantPermissionsService } from './tenant-permissions.service';
|
|
12
12
|
import { TenantFunctionType } from '../models/tenant-function-type.model';
|
|
13
|
-
import {
|
|
13
|
+
import { GetRolesAndPermissionsPayload, GetRolesAndPermissionsResponse, GetRolesResponse, RoleInfo, DeleteRoleRequestPayload, DeleteRoleResponse, Role, RoleDetails, CreateModifyRoleRequestPayload, CreateModifyRoleResponse } from '../models/roles-and-permissions.model';
|
|
14
14
|
import { UpdateTenantStatusRequestPayload, UpdateTenantStatusResponse } from '../models/update-tenant-status.model';
|
|
15
15
|
import { GetRoleTypesPayload, RoleTypeConfiguration, RoleTypeOption, RoleTypeResponse } from '../models/role-type.model';
|
|
16
16
|
import * as i0 from "@angular/core";
|
|
@@ -46,17 +46,21 @@ export declare class TenantApplicationsService {
|
|
|
46
46
|
"2036": string;
|
|
47
47
|
"2037": string;
|
|
48
48
|
"2038": string;
|
|
49
|
+
"2039": string;
|
|
50
|
+
"2040": string;
|
|
49
51
|
/**
|
|
50
52
|
* Sets the user tenants information
|
|
51
53
|
* @param {TenantBasicInfo} tenantInfo
|
|
52
54
|
* @memberof TenantApplicationsService
|
|
53
55
|
*/
|
|
54
|
-
"2039": string;
|
|
55
|
-
"2040": string;
|
|
56
56
|
"2041": string;
|
|
57
57
|
"2042": string;
|
|
58
58
|
"2043": string;
|
|
59
|
-
"2044": string;
|
|
59
|
+
"2044": string; /**
|
|
60
|
+
* Returns the tenants information
|
|
61
|
+
* @return {TenantBasicInfo}
|
|
62
|
+
* @memberof TenantApplicationsService
|
|
63
|
+
*/
|
|
60
64
|
"2045": string;
|
|
61
65
|
"2046": string;
|
|
62
66
|
"2047": string;
|
|
@@ -74,6 +78,9 @@ export declare class TenantApplicationsService {
|
|
|
74
78
|
featureList: Features[];
|
|
75
79
|
roleTypeOptions: RoleTypeOption[];
|
|
76
80
|
newlyCreatedRole: RoleInfo;
|
|
81
|
+
roleTypeOption: RoleTypeOption[];
|
|
82
|
+
selectedRoleInfo: RoleDetails;
|
|
83
|
+
roles: Role[];
|
|
77
84
|
constructor(httpService: HttpService, tenantPermissionsService: TenantPermissionsService, tenantPermissionsMapService: TenantPermissionsMapService);
|
|
78
85
|
setAppConfig(apiBaseUrl: string, userPermission: UserPermission[]): void;
|
|
79
86
|
/**
|
|
@@ -107,6 +114,42 @@ export declare class TenantApplicationsService {
|
|
|
107
114
|
* @memberof TenantApplicationsService
|
|
108
115
|
*/
|
|
109
116
|
getSelectedTenantInformation(): TenantBasicInfo | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Sets the roles informations
|
|
119
|
+
* @param {Role} roles
|
|
120
|
+
* @memberof TenantApplicationsService
|
|
121
|
+
*/
|
|
122
|
+
setRolesInfo(roles: Role[]): void;
|
|
123
|
+
/**
|
|
124
|
+
* Returns the roles information
|
|
125
|
+
* @return {Role}
|
|
126
|
+
* @memberof TenantApplicationsService
|
|
127
|
+
*/
|
|
128
|
+
getRolesInfo(): Role[] | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Sets the selected role information.
|
|
131
|
+
* @param {RoleDetails} roleInfo
|
|
132
|
+
* @memberof TenantApplicationsService
|
|
133
|
+
*/
|
|
134
|
+
setSelectedRoleInformation(roleInfo: RoleDetails): void;
|
|
135
|
+
/**
|
|
136
|
+
* Returns the selected role information.
|
|
137
|
+
* @return {RoleDetails}
|
|
138
|
+
* @memberof TenantApplicationsService
|
|
139
|
+
*/
|
|
140
|
+
getSelectedRoleInformation(): RoleDetails | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* Sets the tenant role type options.
|
|
143
|
+
* @param {RoleTypeOption} roleTypeOptions
|
|
144
|
+
* @memberof TenantApplicationsService
|
|
145
|
+
*/
|
|
146
|
+
setRoleTypeOption(roleTypeOptions: RoleTypeOption[]): void;
|
|
147
|
+
/**
|
|
148
|
+
* Returns the tenant role type options.
|
|
149
|
+
* @return {RoleTypeOption}
|
|
150
|
+
* @memberof TenantApplicationsService
|
|
151
|
+
*/
|
|
152
|
+
getRoleTypeOption(): RoleTypeOption[];
|
|
110
153
|
/**
|
|
111
154
|
* Sets the list of application type information
|
|
112
155
|
* @param {RadioOption} appTypeInfo
|
|
@@ -168,11 +211,18 @@ export declare class TenantApplicationsService {
|
|
|
168
211
|
getApplicationTypes(): Observable<GetAppTypesResponse>;
|
|
169
212
|
/**
|
|
170
213
|
* Posts create role form data to server using HttpService to create a new role.
|
|
171
|
-
* @param {
|
|
172
|
-
* @return {Observable<
|
|
214
|
+
* @param {CreateModifyRoleRequestPayload} createModifyRolePayload
|
|
215
|
+
* @return {Observable<CreateModifyRoleResponse>}
|
|
216
|
+
* @memberof TenantApplicationsService
|
|
217
|
+
*/
|
|
218
|
+
createRole(createModifyRolePayload: CreateModifyRoleRequestPayload): Observable<CreateModifyRoleResponse>;
|
|
219
|
+
/**
|
|
220
|
+
* Posts the edited role form data to server using HttpService for updating the role information.
|
|
221
|
+
* @param {CreateModifyRoleRequestPayload} createModifyRolePayload
|
|
222
|
+
* @return {Observable<CreateModifyRoleResponse>}
|
|
173
223
|
* @memberof TenantApplicationsService
|
|
174
224
|
*/
|
|
175
|
-
|
|
225
|
+
editRole(createModifyRolePayload: CreateModifyRoleRequestPayload): Observable<CreateModifyRoleResponse>;
|
|
176
226
|
/**
|
|
177
227
|
* Gets list of role types from server using HttpService.
|
|
178
228
|
* @param {GetRoleTypesPayload} payload
|