Fix Bug 1973: VIM Resources Type Overview issue in Dashboard
- Charts of selected VIM Resource type will change when a different type is selected.
- VIM resource overview shows 'No Data' content for invalid VIM account details.
- Added tooltip in VimAccountActions for VimResourcesOverview &
RunningInstances
Change-Id: I45dcf504309f58a6c0345e0c01220ee392b37502
Signed-off-by: SANDHYA.JS <sandhya.j@tataelxsi.co.in>
diff --git a/src/app/dashboard/DashboardComponent.html b/src/app/dashboard/DashboardComponent.html
index a54351b..9689e03 100644
--- a/src/app/dashboard/DashboardComponent.html
+++ b/src/app/dashboard/DashboardComponent.html
@@ -150,12 +150,12 @@
<label for="vimList">{{'PAGE.VIMDETAILS.NAME' | translate}}</label>
<ng-select (change)="getSelectedVIMDetails($event)" [clearable]="false"
placeholder="{{'SELECT' | translate}}" [items]="vimList" bindLabel="name"
- bindValue="name" id="vimList"></ng-select>
+ bindValue="name" id="vimList" [(ngModel)]="vimListData"></ng-select>
</div>
</div>
</div>
</div>
- <app-resources-overview *ngIf="selectedVIMDetails !== null && selectedVIMDetails !== undefined"
+ <app-resources-overview *ngIf="selectedVIMDetails !== null && selectedVIMDetails !== undefined && vimListData !== null"
[resourcesData]="selectedVIMDetails"></app-resources-overview>
</div>
</div>
diff --git a/src/app/dashboard/DashboardComponent.ts b/src/app/dashboard/DashboardComponent.ts
index 2feef7c..d6dc801 100644
--- a/src/app/dashboard/DashboardComponent.ts
+++ b/src/app/dashboard/DashboardComponent.ts
@@ -123,6 +123,9 @@
/** Array holds Vim data filtered with selected vimtype */
public vimList: VimAccountDetails[] = [];
+ /** Model value used to hold selected vimtype Data @public */
+ public vimListData: string;
+
/** List of color for Instances @private */
private backgroundColor: string[] = [];
@@ -398,6 +401,9 @@
public getSelectedVimTypeList(selectedVIMType: string): void {
this.vimList = this.vimData.filter((vimData: VimAccountDetails): boolean =>
vimData.vim_type === selectedVIMType);
+ if (this.vimList.length === 0) {
+ this.vimListData = null;
+ }
}
diff --git a/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.html b/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.html
index 515066e..51c57b0 100644
--- a/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.html
+++ b/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.html
@@ -44,7 +44,7 @@
[ngbPopover]="graphContent" triggers="manual" #chart="ngbPopover"
(click)="chart.open()" [autoClose]="'outside'" [popoverTitle]="graphTitle" popoverClass="resources-chart-popover"
[disabled]="value.resources === null">
- <i class="fas fa-chart-pie"></i>
+ <i ngbTooltip="{{'PAGE.VIMDETAILS.VIMRESOURCES' | translate}}" class="fas fa-chart-pie"></i>
</button>
<button type="button" class="btn btn-primary" (click)="vimInfo()" placement="top" container="body"
ngbTooltip="{{'INFO' | translate}}">
@@ -57,6 +57,6 @@
<button type="button" placement="left" container="body" [ngbPopover]="popContent" triggers="manual" #p="ngbPopover"
(click)="p.open()" [autoClose]="'outside'" [popoverTitle]="popTitle" class="btn btn-primary"
popoverClass="runninginstances" [disabled]="!showMapIcon">
- <i class="fas fa-layer-group"></i>
+ <i ngbTooltip="{{'PAGE.DASHBOARD.RUNNINGINSTANCES' | translate}}" class="fas fa-layer-group"></i>
</button>
</div>
\ No newline at end of file
diff --git a/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.html b/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.html
index 39990b5..483fc0b 100644
--- a/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.html
+++ b/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.html
@@ -44,6 +44,9 @@
[legend]="chartLegend"
[colors]="list.colorValues">
</canvas>
+ <div class="no-data" *ngIf="list.values.total === 0 || list.values.total === null">
+ <h4><strong>{{'PAGE.VIMDETAILS.NODATA' | translate}}</strong></h4>
+ </div>
<div class="card-body">
<h5 class="card-title"><strong>{{list.title}}</strong></h5>
<p class="card-text">
diff --git a/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.scss b/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.scss
index e042092..721e8ad 100644
--- a/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.scss
+++ b/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.scss
@@ -27,6 +27,10 @@
.card-body {
@include padding-value(5, 5, 5, 10);
}
+ .no-data {
+ margin-bottom: 2.5rem;
+ margin-top: -1.5rem;
+ }
}
.switch {
@include position_value(relative, null, null, null, null);