Skip to content

Commit

Permalink
Fixed some inconsistencies on provider dashboards.
Browse files Browse the repository at this point in the history
- Red crosses were added as part of ManageIQ#4453 that caused them to show up on all aggregate status cards on all provider dashboards, fixed the condition and removed setting of redundant notification hash for providers when it is not needed.
- Show status icon under Alerts in aggregate card if Alerts are configured for a container provider, otherwise show "No data available" empty pf card.
- On Containers Overview dashboard, Fixed to not show provider icon in Provider status aggregate card, it should only show count of providers with a link to list view to Container Providers show list.
- Added a title on Container Overview dashboard screen, since that's the only screen on that subtab there are no breadcrumbs on the screen.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628384
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
  • Loading branch information
h-kataria committed Sep 13, 2018
1 parent 9bb3bda commit 2c470cc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
Expand Up @@ -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,
},
],
};
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions app/controllers/container_dashboard_controller.rb
Expand Up @@ -13,6 +13,7 @@ def show
if params[:id].nil?
@breadcrumbs.clear
end
@title = title
end

def index
Expand Down
4 changes: 3 additions & 1 deletion app/services/container_dashboard_service.rb
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions app/services/ems_dashboard_service.rb
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/views/container_dashboard/show.html.haml
@@ -1 +1,3 @@
%h1
= @title
= render :partial => "ems_container/show_dashboard"
3 changes: 2 additions & 1 deletion app/views/static/pf_charts/aggregate-status-card.html.haml
Expand Up @@ -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"}
Expand All @@ -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"}
Expand Down

0 comments on commit 2c470cc

Please sign in to comment.