Resolve "Enhance the user experience at landing/metrics page, when APIs are not responding"

Closes #33 (closed)

Merge request reports

Loading
+7 −7
Changes for src/app/landing/metrics/doughnutchart/doughnutchart.component.html: 7 added lines, 7 removed lines.
Original line number Diff line number Diff line
<div class="chart-container">
    
    <div class="service-chart">
        <div *ngIf="isLoading" class="pie-chart">
        <div *ngIf="isLoading || isNaN(totalChartData)" class="pie-chart">
            <skeleton [height]="'100%'" [width]="'100%'" [borderRadius]="'50%'"></skeleton>
        </div>
        <div *ngIf="totalChartData==0 && !isLoading" class="no-data-found">
        <div *ngIf="totalChartData==0 && !isLoading && !isNaN(totalChartData)" class="no-data-found">
            {{noDataMessage}}
        </div>
        <canvas *ngIf="totalChartData!=0 && !isLoading" baseChart [data]="chartData" [type]="'doughnut'"
        <canvas *ngIf="totalChartData!=0 && !isLoading && !isNaN(totalChartData)" baseChart [data]="chartData" [type]="'doughnut'"
        [options]="chartOptions" [plugins]="plugins">
        </canvas>  
    </div>
    <div class="chart-info">
        <div *ngIf="isLoading" style="height: 20%; width: 65%; margin-bottom: 0.5rem">
        <div *ngIf="isLoading || isNaN(totalChartData)" style="height: 20%; width: 65%; margin-bottom: 0.5rem">
            <skeleton [height]="'100%'" [width]="'100%'"></skeleton>
        </div>
        <div class="chart-title" *ngIf="!isLoading"> 
        <div class="chart-title" *ngIf="!isLoading && !isNaN(totalChartData)"> 
            {{chartTitle}}
        </div> 
        <div *ngIf="isLoading" style="height: 50%; width: 50%">
        <div *ngIf="isLoading || isNaN(totalChartData)" style="height: 50%; width: 50%">
            <skeleton [height]="'100%'" [width]="'100%'"></skeleton>
        </div>
        <div class="chart-legend" *ngIf="!isLoading">
        <div class="chart-legend" *ngIf="!isLoading && !isNaN(totalChartData)">
            <ul style="padding: 0; margin-bottom: 0;">
                <li style="display: flex; align-items: center; padding-right: 20px" *ngFor="let label of chartData.labels; index as i">
                    <span [ngStyle]="{
+5 −5
Changes for src/app/landing/metrics/doughnutchart/doughnutchart.component.scss: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -18,11 +18,11 @@

.pie-chart {
    // height: calc(20vh - 10px); 
    // width: calc(20vh - 10px); 
    // max-height: 170px; 
    // max-width: 170px; 
    min-height: 150px; 
    min-width: 150px;
    width: calc(20vh - 20px); 
    max-height: 170px; 
    max-width: 170px; 
    min-height: 80px;
    min-width: 80px;
}

.chart-info {
+4
Changes for src/app/landing/metrics/doughnutchart/doughnutchart.component.ts: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -26,4 +26,8 @@ export class DoughnutchartComponent implements OnInit {

    }

    isNaN(value: any): boolean {
      return isNaN(value);
    }

}
 No newline at end of file
+11 −9
Changes for src/app/landing/metrics/statuscard/statuscard.component.html: 11 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -21,10 +21,8 @@
            </div>
        </div>
        <div class="card-main">
            <div *ngIf="isLoading" style="width: 50%; height: 50%">
                <skeleton [height]="'100%'" [width]="'100%'"></skeleton>
            </div>
            <div class="card-stats" *ngIf="!isLoading">
            
            <div class="card-stats">
                <div class="status-icon">
                    <svg *ngIf="statusIcon==='users'" xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" fill="currentColor" class="bi bi-people-fill" viewBox="0 0 16 16">
                        <path d="M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6m-5.784 6A2.24 2.24 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.3 6.3 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1zM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5"/>
@@ -49,13 +47,17 @@
                        <path d="M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8m0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-1-5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0M4 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0m0 2.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0"/>
                    </svg>
                </div>
                <h6 class="card-title" style="font-weight: 700" >{{statusStats}}</h6>
                
                <h6 class="card-title">
                    <div *ngIf="isNaN(statusStats) || isLoading; else apiResponded">
                        <skeleton [width]="'48px'" [height]="'26px'"></skeleton>
                    </div>
            <div *ngIf="isLoading" style="height: 25%; width: 100%">
                <skeleton [height]="'100%'" [width]="'100%'"></skeleton>
                    <ng-template #apiResponded>
                        <div class="status-stats">{{statusStats}}</div>
                    </ng-template>
                </h6>
                
            </div>
            <p *ngIf="!isLoading" class="card-text">{{statusTitle}}</p>
            <p class="card-text">{{statusTitle}}</p>
        </div>
        
    </div>
+4
Changes for src/app/landing/metrics/statuscard/statuscard.component.scss: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -50,6 +50,10 @@
    font-size: 0.9rem;
}

.status-stats {
    font-weight: 700;
}

.portal-button {
    color: #0078AE;
}
Loading
Loading