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. Adjusted existing spec test to expect iconImage to be nil.
- 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=1626199
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
  • Loading branch information
h-kataria committed Sep 14, 2018
1 parent ecd81a8 commit 66a6c42
Show file tree
Hide file tree
Showing 7 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
2 changes: 2 additions & 0 deletions app/services/container_dashboard_service.rb
Expand Up @@ -141,6 +141,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 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
2 changes: 1 addition & 1 deletion spec/services/container_dashboard_service_spec.rb
Expand Up @@ -15,7 +15,7 @@

# Kubernetes should not appear
providers_data.each do |p|
expect(p[:iconImage]).not_to be_nil
expect(p[:iconImage]).to be_nil
expect(p[:count]).to eq(1)
end
end
Expand Down

0 comments on commit 66a6c42

Please sign in to comment.