@ieeesa-npm/tenants 0.1.5 → 0.1.7

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,10 +1,11 @@
1
1
  import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
- import { AlignType, CheckboxOption, FormGrid, RadioOption, FormModel, AllowedFileTypes, FileUploadService, DynamicFormComponent } from '@ieeesa-npm/presentation';
2
+ import { AlignType, CheckboxOption, FormGrid, AllowedFileTypes, FileUploadService, RadioOption, DynamicFormComponent, FormModel } from '@ieeesa-npm/presentation';
3
3
  import { Subject } from 'rxjs';
4
4
  import { FormGroup } from '@angular/forms';
5
5
  import { TenantApplicationsService } from '../../services/tenant-applications.service';
6
- import { CreateTenantRequestPayload } from '../../models/tenant.model';
6
+ import { CreateTenantRequestPayload, NewTenantInfo, TenantBasicInfo } from '../../models/tenant.model';
7
7
  import { SharedService } from '@ieeesa-npm/shared';
8
+ import { TenantFunctionType } from '../../models/tenant-function-type.model';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class CreateTenantApplicationComponent implements OnInit, OnDestroy {
10
11
  fileUploadService: FileUploadService;
@@ -31,6 +32,10 @@ export declare class CreateTenantApplicationComponent implements OnInit, OnDestr
31
32
  allowedFileTypes: AllowedFileTypes[];
32
33
  selectedColor: string;
33
34
  selectedAppTypeOption: RadioOption;
35
+ tenantFunctionType: TenantFunctionType;
36
+ selectedTenantInfo: TenantBasicInfo | undefined;
37
+ isAppLogoModified: boolean;
38
+ updatedTenantBasicInfo: NewTenantInfo;
34
39
  constructor(fileUploadService: FileUploadService, tenantAppService: TenantApplicationsService, sharedService: SharedService);
35
40
  ngOnInit(): void;
36
41
  /**
@@ -49,11 +54,21 @@ export declare class CreateTenantApplicationComponent implements OnInit, OnDestr
49
54
  */
50
55
  initializeCreateTenantFormGroup(): void;
51
56
  /**
52
- * Creates tenant on form submission.
57
+ * Creates Payload and gets presigned url for file upload on form submission.
53
58
  * @param {FormGroup[]} form
54
59
  * @memberof CreateTenantApplicationComponent
55
60
  */
56
61
  onCreateTenantFormSubmit(form: FormGroup[]): void;
62
+ /**
63
+ * Creates a new tenant on form submission.
64
+ * @memberof CreateTenantApplicationComponent
65
+ */
66
+ createTenant(): void;
67
+ /**
68
+ * Updates the modified tenant information on form submission.
69
+ * @memberof CreateTenantApplicationComponent
70
+ */
71
+ editTenant(): void;
57
72
  /**
58
73
  * Constructs create tenant payload from the form data and returns.
59
74
  * @param {*} formData
@@ -68,7 +83,7 @@ export declare class CreateTenantApplicationComponent implements OnInit, OnDestr
68
83
  */
69
84
  getCreateTenantFormGroupRef(form: FormGroup[]): void;
70
85
  /**
71
- * Updates createTenantFormGroupRef on add tenant form change event.
86
+ * Updates createTenantFormGroupRef on add or edit tenant form change event.
72
87
  * @param {FormGroup[]} form
73
88
  * @memberof CreateTenantApplicationComponent
74
89
  */
@@ -0,0 +1,279 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { TenantApplicationsService } from '../../services/tenant-applications.service';
3
+ import { BreakpointObserverService } from '@ieeesa-npm/utility';
4
+ import { Subject } from 'rxjs';
5
+ import { FileUploadService } from '@ieeesa-npm/presentation';
6
+ import { SharedService } from '@ieeesa-npm/shared';
7
+ import { TenantBasicInfo } from '../../models/tenant.model';
8
+ import * as i0 from "@angular/core";
9
+ export declare class TenantBasicDetailsComponent implements OnDestroy {
10
+ tenantAppService: TenantApplicationsService;
11
+ private breakpointObserverService;
12
+ private fileUploadService;
13
+ private sharedService;
14
+ destroy$: Subject<boolean>;
15
+ isMobileView: boolean;
16
+ constants: {
17
+ createTenant: {
18
+ heading: string;
19
+ label: {
20
+ leftButtonLabel: string;
21
+ rightButtonLabel: string;
22
+ appTitle: string;
23
+ appId: string;
24
+ appLogo: string;
25
+ appHeading: string;
26
+ appDescription: string;
27
+ appBgColor: string;
28
+ appHelpLink: string;
29
+ featuresList: string;
30
+ featureVersion: string;
31
+ domainURL: string;
32
+ appType: string;
33
+ ariaLabel: {
34
+ appTitle: string;
35
+ appId: string;
36
+ appLogo: string;
37
+ appHeading: string;
38
+ appDescription: string;
39
+ appBgColor: string;
40
+ appHelpLink: string;
41
+ featuresList: string;
42
+ featureVersion: string;
43
+ domainURL: string;
44
+ appType: string;
45
+ };
46
+ ariaDescribedById: {
47
+ appTitle: string;
48
+ appId: string;
49
+ appLogo: string;
50
+ appHeading: string;
51
+ appDescription: string;
52
+ appBgColor: string;
53
+ appHelpLink: string;
54
+ featuresList: string;
55
+ featureVersion: string;
56
+ domainURL: string;
57
+ appType: string;
58
+ };
59
+ };
60
+ message: {
61
+ error: {
62
+ required: string;
63
+ invalidColor: string;
64
+ invalidFile: string;
65
+ limit: {
66
+ appTitleMaxChars: string;
67
+ appIdMaxChars: string;
68
+ appHeadingMaxChars: string;
69
+ appDescriptionMaxChars: string;
70
+ appLogoMaxSize: string;
71
+ };
72
+ pattern: {
73
+ appId: string;
74
+ appHelpLink: string;
75
+ appDomainUrl: string;
76
+ };
77
+ };
78
+ success: {
79
+ submission: string;
80
+ };
81
+ };
82
+ supportText: {
83
+ appTitle: string;
84
+ appId: string;
85
+ appLogo: string;
86
+ appHeading: string;
87
+ appDescription: string;
88
+ appBgColor: string;
89
+ appHelpLink: string;
90
+ featuresList: string;
91
+ featureVersion: string;
92
+ domainURL: string;
93
+ };
94
+ errors: {
95
+ "2003": string;
96
+ "2026": string;
97
+ "2028": string;
98
+ "2029": string;
99
+ "2030": string;
100
+ "2031": string; /**
101
+ * Downloads file from AWS S3 using a presigned URL.
102
+ * @memberof TenantBasicDetailsComponent
103
+ */
104
+ "2032": string;
105
+ "2033": string;
106
+ "2034": string;
107
+ "2035": string;
108
+ "2036": string;
109
+ "2037": string;
110
+ "2038": string;
111
+ "2039": string;
112
+ "2040": string;
113
+ "2041": string;
114
+ "2042": string;
115
+ "2043": string;
116
+ "2044": string;
117
+ "2045": string;
118
+ "2046": string;
119
+ "2047": string;
120
+ "2048": string;
121
+ "2049": string;
122
+ "2050": string;
123
+ "2052": string;
124
+ "2053": string;
125
+ };
126
+ buttons: {
127
+ addApplicationLabel: string;
128
+ };
129
+ };
130
+ editTenant: {
131
+ message: {
132
+ success: {
133
+ submission: string;
134
+ };
135
+ };
136
+ };
137
+ viewTenants: {
138
+ tenantsTitle: string;
139
+ addTenant: string;
140
+ emptyFieldValueReplacedBy: string;
141
+ createTenantsIcon: string;
142
+ pageSizeOptions: number[];
143
+ ariaLabel: {
144
+ add: string;
145
+ };
146
+ label: {
147
+ appId: string;
148
+ status: string;
149
+ viewAllApps: string;
150
+ saAppId: string;
151
+ active: string;
152
+ inactive: string;
153
+ };
154
+ buttons: {
155
+ id: number;
156
+ ariaLabel: string;
157
+ label: string;
158
+ toolTip: string;
159
+ iconURL: string;
160
+ };
161
+ tableColumns: {
162
+ appId: string;
163
+ appTitle: string;
164
+ appDescription: string;
165
+ features: string;
166
+ status: string;
167
+ };
168
+ confirmationInfo: {
169
+ leftButtonLabel: string;
170
+ rightButtonLabel: string;
171
+ promptMessage: string;
172
+ promptMessageInactivate: string;
173
+ promptMessageActivate: string;
174
+ ariaLabel: {
175
+ alert: string;
176
+ };
177
+ };
178
+ errors: {
179
+ "2050": string;
180
+ "2051": string;
181
+ "2054": string;
182
+ "3007": string;
183
+ "3009": string;
184
+ };
185
+ tenantAccordionInfo: {
186
+ id: number;
187
+ title: string;
188
+ isDisabled: boolean;
189
+ content: string;
190
+ }[];
191
+ tenantBasicDetails: {
192
+ label: {
193
+ title: string;
194
+ logo: string;
195
+ description: string;
196
+ bgColor: string;
197
+ heading: string;
198
+ helpLink: string;
199
+ listOfFeatures: string;
200
+ featureVersion: string;
201
+ domainURL: string;
202
+ type: string;
203
+ };
204
+ };
205
+ };
206
+ viewRolesAndPermissions: {
207
+ tableCaption: string;
208
+ tableColumnsHeaderText: string;
209
+ scrollbarSupportMessage: string;
210
+ pageSizeOptions: number[];
211
+ columnActionIconSize: string;
212
+ actionButtonLabels: {
213
+ addRole: string;
214
+ mapPermissionsRoles: string;
215
+ };
216
+ tableColumn: {
217
+ permissions: string;
218
+ };
219
+ tableCellValue: {
220
+ yes: string;
221
+ no: string;
222
+ };
223
+ columnActionMenuItems: {
224
+ id: number;
225
+ label: string;
226
+ ariaLabel: string;
227
+ iconURL: string;
228
+ toolTip: string;
229
+ isToolTipNeeded: boolean;
230
+ }[];
231
+ };
232
+ routeConfigPath: {
233
+ viewTenants: string;
234
+ viewTenantDetails: string;
235
+ };
236
+ };
237
+ basicDetailTexts: {
238
+ title: string;
239
+ logo: string;
240
+ description: string;
241
+ bgColor: string;
242
+ heading: string;
243
+ helpLink: string;
244
+ listOfFeatures: string;
245
+ featureVersion: string;
246
+ domainURL: string;
247
+ type: string;
248
+ };
249
+ tenantBackgroundColor: string;
250
+ selectedAppType: string;
251
+ selectedAppTypeLabel: string;
252
+ logo: string;
253
+ basicInfo: TenantBasicInfo;
254
+ imageUrl: string;
255
+ set tenantDetails(value: TenantBasicInfo);
256
+ constructor(tenantAppService: TenantApplicationsService, breakpointObserverService: BreakpointObserverService, fileUploadService: FileUploadService, sharedService: SharedService);
257
+ /**
258
+ * Gets the application types.
259
+ * @memberof TenantBasicDetailsComponent
260
+ */
261
+ getAppType(): void;
262
+ /**
263
+ * Retrieves presigned URL for downloading files from Amazon S3 bucket.
264
+ * @memberof TenantBasicDetailsComponent
265
+ */
266
+ getFileDownloadPresignedUrls(fileName: string): void;
267
+ /**
268
+ * Downloads file from AWS S3 using a presigned URL.
269
+ * @memberof TenantBasicDetailsComponent
270
+ */
271
+ downloadFile(presignedUrl: string): void;
272
+ /**
273
+ * Performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
274
+ * @memberof ViewTenantDetailsComponent
275
+ */
276
+ ngOnDestroy(): void;
277
+ static ɵfac: i0.ɵɵFactoryDeclaration<TenantBasicDetailsComponent, never>;
278
+ static ɵcmp: i0.ɵɵComponentDeclaration<TenantBasicDetailsComponent, "ieeesa-tenant-basic-details", never, { "tenantDetails": { "alias": "tenantDetails"; "required": false; }; }, {}, never, never, true, never>;
279
+ }
@@ -1,15 +1,15 @@
1
1
  import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { BreakpointObserverService, GlobalErrorHandlerService } from '@ieeesa-npm/utility';
3
- import { AccordionInfo, Menu, PaginatorConfig, TableActions, AlignType, SlideToggleOption, TableColumnSchema } from '@ieeesa-npm/presentation';
3
+ import { AccordionInfo, Menu, PaginatorConfig, TableActions, AlignType, RadioOption, IconButton, SlideToggleOption, TableColumnSchema, AccordionDetails } from '@ieeesa-npm/presentation';
4
4
  import { Subject } from 'rxjs';
5
- import { TenantInfo } from '../../models/tenants.model';
6
5
  import { TenantApplicationsService } from '../../services/tenant-applications.service';
7
6
  import { UserPermission } from '../../models/tenants-permission.model';
8
7
  import { SharedService } from '@ieeesa-npm/shared';
9
8
  import { TenantsRoutesConfig } from '../../models/route-config.model';
10
- import { GetRolesAndPermissionsPayload, RolesAndPermissions } from '../../models/roles-and-permissions.model';
9
+ import { TenantBasicInfo } from '../../models/tenant.model';
11
10
  import { PageEvent } from '@angular/material/paginator';
12
11
  import { MatDialog } from '@angular/material/dialog';
12
+ import { GetRolesAndPermissionsPayload, RolesAndPermissions } from '../../models/roles-and-permissions.model';
13
13
  import * as i0 from "@angular/core";
14
14
  export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
15
15
  dialog: MatDialog;
@@ -30,7 +30,8 @@ export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
30
30
  checked: boolean;
31
31
  disabled: boolean;
32
32
  };
33
- tenantDetails: TenantInfo;
33
+ editButton: IconButton;
34
+ tenantDetails: TenantBasicInfo;
34
35
  accordionInfoList: AccordionInfo[];
35
36
  appId: string;
36
37
  iconSize: any;
@@ -45,8 +46,12 @@ export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
45
46
  paginatorConfig: PaginatorConfig;
46
47
  tableActions: TableActions;
47
48
  viewTenantsRouteUrl: string;
48
- alignmentType: typeof AlignType;
49
49
  dialogRef: any;
50
+ accordionDetails: typeof AccordionDetails;
51
+ appTypeOptions: RadioOption[];
52
+ isBasicDetailsExpanded: boolean;
53
+ editTenantScreenTexts: any;
54
+ alignmentType: typeof AlignType;
50
55
  constructor(dialog: MatDialog, breakpointObserverService: BreakpointObserverService, tenantAppService: TenantApplicationsService, globalErrorHandlerService: GlobalErrorHandlerService, sharedService: SharedService);
51
56
  /**
52
57
  * Initializes view tenant details component.
@@ -88,6 +93,20 @@ export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
88
93
  * @memberof ViewTenantDetailsComponent
89
94
  */
90
95
  trackByAccordionFn(index: number, item: AccordionInfo): number;
96
+ /**
97
+ * Sets the dialog options for edit tenant modal and calls openModal method.
98
+ * @return -returns nothing
99
+ * @memberof ViewTenantDetailsComponent
100
+ */
101
+ openEditTenantForm(): void;
102
+ /**
103
+ * Opens modal component with received params and handles form submission success and errors.
104
+ * @param {*} dialogOptions
105
+ * @param {string} [className]
106
+ * @return -returns nothing
107
+ * @memberof ViewTenantsDetailsComponent
108
+ */
109
+ openModal(dialogOptions: any, className?: string): void;
91
110
  /**
92
111
  * Calls openTenantStatusConfirmationModal to change the status of tenant on slide toggle change.
93
112
  * @param {SlideToggleOption} slideToggleOption
@@ -112,6 +131,11 @@ export declare class ViewTenantDetailsComponent implements OnInit, OnDestroy {
112
131
  * @memberof ViewTenantDetailsComponent
113
132
  */
114
133
  setSlideToggleStatus(isActivate: boolean): void;
134
+ /**
135
+ * Gets the application/tenant types.
136
+ * @memberof ViewTenantDetailsComponent
137
+ */
138
+ getApplicationTypes(): void;
115
139
  /**
116
140
  * Performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
117
141
  * @memberof ViewTenantDetailsComponent
@@ -1,6 +1,5 @@
1
1
  import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { PaginatorConfig, TableActions, TableColumnSchema } from '@ieeesa-npm/presentation';
3
- import { FeatureInfo, TenantInfo } from '../../models/tenants.model';
4
3
  import { Subject } from 'rxjs';
5
4
  import { AlertsService, BreakpointObserverService } from '@ieeesa-npm/utility';
6
5
  import { TenantsRoutesConfig } from '../../models/route-config.model';
@@ -13,6 +12,8 @@ import { PermissionType } from '../../models/permission-type.model';
13
12
  import { TenantsPermissions, UserPermission } from '../../models/tenants-permission.model';
14
13
  import { GetTenantsPayload } from '../../models/table-column-schema-view-tenant-list.model';
15
14
  import { MatDialog } from '@angular/material/dialog';
15
+ import { TenantBasicInfo } from '../../models/tenant.model';
16
+ import { Features } from '../../models/features.model';
16
17
  import * as i0 from "@angular/core";
17
18
  export declare class ViewTenantsListComponent implements OnInit, OnDestroy {
18
19
  dialog: MatDialog;
@@ -33,8 +34,8 @@ export declare class ViewTenantsListComponent implements OnInit, OnDestroy {
33
34
  userPermissions: UserPermission[];
34
35
  defaultSortedColumn: string;
35
36
  createTenant: EventEmitter<any>;
36
- viewTenantsDetails: EventEmitter<TenantInfo>;
37
- tableData: TenantInfo[];
37
+ viewTenantsDetails: EventEmitter<TenantBasicInfo>;
38
+ tableData: TenantBasicInfo[];
38
39
  columnSchema: TableColumnSchema[];
39
40
  tableActions: TableActions;
40
41
  tableColumns: any;
@@ -67,7 +68,7 @@ export declare class ViewTenantsListComponent implements OnInit, OnDestroy {
67
68
  * Format the features name in to single sentence with comma separated.
68
69
  * @memberof ViewTenantsListComponent
69
70
  */
70
- formatFeaturesName(features: FeatureInfo[]): string;
71
+ formatFeaturesName(features: Features[]): string;
71
72
  /**
72
73
  * Fetching details of tenants and initialize table view
73
74
  * @param {GetTenantsPayload} payload
@@ -95,13 +96,13 @@ export declare class ViewTenantsListComponent implements OnInit, OnDestroy {
95
96
  */
96
97
  onSortTenants(sort: Sort): void;
97
98
  /**
98
- * Returning sorting order according to column definition
99
+ * Returning sorting order according to column definition.
99
100
  * @param defaultColumnSortDirection
100
101
  * @returns SortOrderBy.ASC | SortOrderBy.DESC
101
102
  */
102
103
  filterSortedOrderBy(defaultColumnSortDirection: boolean): string;
103
104
  /**
104
- * Get the the records according to pagination
105
+ * Get the the records according to pagination.
105
106
  * @param {{
106
107
  * pageOffset: number;
107
108
  * pageLimit: number;
@@ -110,10 +111,11 @@ export declare class ViewTenantsListComponent implements OnInit, OnDestroy {
110
111
  */
111
112
  onTablePaginationChange(pageEvent: PageEvent): void;
112
113
  /**
113
- * Navigates to view tenants detail component
114
+ * Navigates to view tenants detail component.
115
+ * @param {{tenantInfo: TenantBasicInfo}}
114
116
  * @memberof ViewTenantsListComponent
115
117
  */
116
- navigateToViewTenantDetails(tenantInfo: TenantInfo): void;
118
+ navigateToViewTenantDetails(tenantInfo: TenantBasicInfo): void;
117
119
  /**
118
120
  * NgOnDestroy performs necessary cleanup tasks, such as unsubscribing from subscription when the component is being destroyed.
119
121
  * @memberof ViewTenantsListComponent
@@ -0,0 +1,4 @@
1
+ export declare enum TenantFunctionType {
2
+ CREATE = "CREATE",
3
+ EDIT = "EDIT"
4
+ }
@@ -1,18 +1,24 @@
1
- import { FeatureId } from './features.model';
2
- export interface TenantBasicInfo {
1
+ import { FeatureId, Features } from './features.model';
2
+ export interface TenantInfo {
3
3
  appId: string;
4
4
  appTitle: string;
5
- appLogo: string;
5
+ appLogo?: string;
6
6
  appHeading: string;
7
7
  appDescription: string;
8
- backgroundColor: string;
9
- appHelpLink: string;
10
- appType: string;
11
- appDomainUrl: string;
12
- features: FeatureId[];
8
+ backgroundColor?: string;
9
+ appHelpLink?: string;
10
+ appType?: string;
11
+ appDomainUrl?: string;
12
+ }
13
+ export interface NewTenantInfo extends TenantInfo {
14
+ features: FeatureId[] | Features[];
15
+ }
16
+ export interface TenantBasicInfo extends TenantInfo {
17
+ status?: boolean;
18
+ features: Features[];
13
19
  }
14
20
  export interface CreateTenantRequestPayload {
15
- payload: TenantBasicInfo;
21
+ payload: NewTenantInfo;
16
22
  }
17
23
  export interface CreateTenantResponse {
18
24
  status: boolean;
@@ -21,3 +27,20 @@ export interface CreateTenantResponse {
21
27
  errorCodes: string[];
22
28
  };
23
29
  }
30
+ export interface GetTenantsResponse {
31
+ status: boolean;
32
+ message: string;
33
+ body?: {
34
+ totalRecords: number;
35
+ appDetails: TenantBasicInfo[] | null | {
36
+ errorCodes: string[];
37
+ };
38
+ };
39
+ }
40
+ export interface TenantDetailsResponse {
41
+ status: boolean;
42
+ message: string;
43
+ body?: TenantBasicInfo | {
44
+ errorCodes: string[];
45
+ };
46
+ }