diff --git a/app/assets/javascripts/controllers/ems_container_dashboard/aggregate_status_card_controller.js b/app/assets/javascripts/controllers/ems_container_dashboard/aggregate_status_card_controller.js index be6e2407770d..f87855b072e9 100644 --- a/app/assets/javascripts/controllers/ems_container_dashboard/aggregate_status_card_controller.js +++ b/app/assets/javascripts/controllers/ems_container_dashboard/aggregate_status_card_controller.js @@ -67,6 +67,7 @@ angular.module( 'patternfly.card' ).controller('aggregateStatusCardContainerCont "iconClass": data.alerts.notifications[0].iconClass, "href": data.alerts.href, "count": data.alerts.notifications[0].count, + "dataAvailable": data.alerts.dataAvailable, }, ], }; @@ -80,10 +81,6 @@ angular.module( 'patternfly.card' ).controller('aggregateStatusCardContainerCont "title": attrHsh[attributes[i]], "count": dataStatus.count, "href": dataStatus.href, - "notification": { - "iconClass": "pficon pficon-error-circle-o", - "count": 0, - }, }); } vm.loadingDone = true; diff --git a/app/controllers/container_dashboard_controller.rb b/app/controllers/container_dashboard_controller.rb index 8638f5f5ff67..bb27a4a4209c 100644 --- a/app/controllers/container_dashboard_controller.rb +++ b/app/controllers/container_dashboard_controller.rb @@ -13,6 +13,7 @@ def show if params[:id].nil? @breadcrumbs.clear end + @title = title end def index diff --git a/app/services/container_dashboard_service.rb b/app/services/container_dashboard_service.rb index 801f3cb1c7d7..6dff59e4acc6 100644 --- a/app/services/container_dashboard_service.rb +++ b/app/services/container_dashboard_service.rb @@ -142,6 +142,8 @@ def alerts warnings_struct = warnings > 0 ? {:iconClass => "pficon pficon-warning-triangle-o", :count => warnings} : nil notifications = if (errors + warnings) > 0 [errors_struct, warnings_struct].compact + elsif alerts_status == [nil, nil] + [{}] else [{:iconClass => "pficon-large pficon-ok"}] end @@ -166,7 +168,7 @@ def build_provider_status(provider_type) { :count => 0, :typeName => _(provider_type.to_s), - :iconImage => icons[provider_type][:icon], + :iconImage => @ems.present? ? icons[provider_type][:icon] : nil, :statusIcon => provider_status_icon } end diff --git a/app/services/ems_dashboard_service.rb b/app/services/ems_dashboard_service.rb index 9c4ebb417f03..2295059caec3 100644 --- a/app/services/ems_dashboard_service.rb +++ b/app/services/ems_dashboard_service.rb @@ -68,10 +68,6 @@ def format_data(ems_type, attributes, attr_icon, attr_url, attr_hsh) :title => attr_hsh[attr], :count => @ems.send(attr).count, :href => get_url(ems_type, @ems_id, attr_url[attr]), - :notification => { - :iconClass => 'pficon pficon-error-circle-o', - :count => 0, - }, ) end attr_data diff --git a/app/views/container_dashboard/show.html.haml b/app/views/container_dashboard/show.html.haml index 4457ab385c77..c0ccf013ac9e 100644 --- a/app/views/container_dashboard/show.html.haml +++ b/app/views/container_dashboard/show.html.haml @@ -1 +1,3 @@ +%h1 + = @title = render :partial => "ems_container/show_dashboard" diff --git a/app/views/static/pf_charts/aggregate-status-card.html.haml b/app/views/static/pf_charts/aggregate-status-card.html.haml index 341f2974fdfb..312e3efc4b69 100644 --- a/app/views/static/pf_charts/aggregate-status-card.html.haml +++ b/app/views/static/pf_charts/aggregate-status-card.html.haml @@ -29,6 +29,7 @@ %image{"ng-if" => "notification.iconImage", "ng-src" => "{{notification.iconImage}}", :alt => "", :class => "card-pf-icon-image"} %span{:class => "{{notification.iconClass}}"} {{ notification.count }} + %pf-empty-chart{'ng-if' => "$ctrl.status.notifications[0].dataAvailable === false"} %div{"ng-if" => "$ctrl.isMiniLayout", :class => "card-pf card-pf-aggregate-status card-pf-aggregate-status-mini", "ng-class" => "{'card-pf-accented': $ctrl.shouldShowTopBorder}"} %h2{:class => "card-pf-title"} @@ -47,7 +48,7 @@ %div{:class => "card-pf-body"} %p{"ng-if" => "$ctrl.status.notification.iconImage || $ctrl.status.notification.iconClass || $ctrl.status.notification.count", :class => "card-pf-aggregate-status-notifications"} %span{:class => "card-pf-aggregate-status-notification", :title => "{{$ctrl.status.notification.tooltip}}" } - %a{"ng-if" => "$ctrl.status.notification.href", :href => "{{$ctrl$ctrl.status.notification.href}}"} + %a{"ng-if" => "$ctrl.status.notification.href && !$ctrl.status.notification.count", :href => "{{$ctrl$ctrl.status.notification.href}}"} %image{"ng-if" => "$ctrl.status.notification.iconImage", "ng-src" => "{{$ctrl.status.notification.iconImage}}", :alt => "", :class => "card-pf-icon-image"} %span{"ng-if" => "$ctrl.status.notification.iconClass", :class => "{{$ctrl.status.notification.iconClass}}"} %span{"ng-if" => "$ctrl.status.notification.count"}