Skip to content

Commit 085ed06

Browse files
committed
fix(arc-saas): changes in tenant component
changes in tenant component GH-76
1 parent dd630c8 commit 085ed06

File tree

5 files changed

+31
-28
lines changed

5 files changed

+31
-28
lines changed

projects/saas-ui/src/app/main/components/onboarding-tenant-list/onboarding-tenant-list.component.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ <h2 class="heading">Onboarded Tenant List</h2>
1616
</div>
1717
</div>
1818

19-
<!-- loader -->
20-
<!-- <div *ngIf="loading" class="loader-overlay">
21-
<div class="loader"></div>
22-
</div> -->
23-
2419
<!-- ag-grid -->
2520
<div class="grid-wrapper">
2621
<div class="grid">

projects/saas-ui/src/app/main/components/onboarding-tenant-list/onboarding-tenant-list.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.ag-theme-alpine {
44
width: 100%;
55
height: 100%;
6-
overflow-x: auto; /* Enable horizontal scroll */
6+
overflow-x: auto;
77
}
88

99
.header-wrapper {
@@ -17,7 +17,6 @@
1717
color: #19a5ff;
1818
}
1919

20-
// for test
2120
.loader-overlay {
2221
position: fixed;
2322
top: 0;

projects/saas-ui/src/app/main/components/onboarding-tenant-list/onboarding-tenant-list.component.ts

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -134,26 +134,36 @@ export class OnboardingTenantListComponent extends RouteComponentBaseDirective {
134134

135135
getTenantDetails() {
136136
this.tenantFacade.getTenantDetails().subscribe(resp => {
137-
console.log(resp);
138137
this.rowData = resp.map(item => {
139-
const addressString = `${item.address.zip}, ${item.address.country}`;
140-
const tenantName = `${item.contacts[0].firstName} ${item.contacts[0].lastName}`;
138+
if (item) {
139+
const fullTenantName = [
140+
item.contacts[0]?.firstName,
141+
' ',
142+
item.contacts[0]?.lastName,
143+
]
144+
.filter(ele => ele != null && ele.trim() != '')
145+
.join(' ');
141146

142-
return {
143-
id: item.id,
144-
name: item.name,
145-
tenant_name: tenantName,
146-
email: item.contacts[0].email,
147-
address: addressString,
148-
planName: item.subscription?.plan.name,
149-
status: TenantStatus[item.subscription?.status],
150-
startDate: item.subscription?.startDate
151-
? new Date(item.subscription.startDate).toLocaleDateString()
152-
: 'N/A',
153-
endDate: item.subscription?.endDate
154-
? new Date(item.subscription.endDate).toLocaleDateString()
155-
: 'N/A',
156-
};
147+
const addressString = [item.address.zip, ' ', item.address.country]
148+
.filter(ele => ele != null && ele.trim() != '')
149+
.join(' ');
150+
151+
return {
152+
id: item.id,
153+
name: item.name,
154+
tenant_name: fullTenantName,
155+
email: item.contacts[0].email,
156+
address: addressString,
157+
planName: item.subscription?.plan.name,
158+
status: TenantStatus[item.subscription?.status],
159+
startDate: item.subscription?.startDate
160+
? new Date(item.subscription.startDate).toLocaleDateString()
161+
: 'N/A',
162+
endDate: item.subscription?.endDate
163+
? new Date(item.subscription.endDate).toLocaleDateString()
164+
: 'N/A',
165+
};
166+
}
157167
});
158168
if (this.gridApi) {
159169
this.gridApi.setRowData(this.rowData);

projects/saas-ui/src/app/main/components/tenant-detail/tenant-detail.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$primary-color: #f50057; // You can replace with your app's primary color
1+
$primary-color: #f50057;
22
$secondary-color: #6c757d;
33
$background-color: #f8f9fa;
44
$text-color: #343a40;

projects/saas-ui/src/app/main/components/tenant-detail/tenant-detail.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,13 @@ export class TenantDetailComponent {
6969
}
7070
},
7171
error => {
72-
console.error('Error fetching tenant data:', error);
72+
console.error('Error fetching tenant data:', error); // NOSONAR
7373
},
7474
);
7575
}
7676
}
7777

7878
backToPriviousPage() {
79-
console.log('Go back to the previous page');
8079
this.router.navigate(['main/onboard-tenant-list']);
8180
}
8281
}

0 commit comments

Comments
 (0)