Skip to content

Commit

Permalink
fix(outages): do not pop up outages when not supported (COMPASS-42)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed May 14, 2015
1 parent 37fb6fb commit 37220be
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions scss/includes/outage-list.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.outage-list {
.error {
color: red;
}

.item {
border-top: 0;
border-bottom: 0;
Expand Down
6 changes: 4 additions & 2 deletions www/css/opennms.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@font-face {
font-family: "Ionicons";
src: url("../lib/ionic/release/fonts/ionicons.eot?v=2.0.1");
src: url("../lib/ionic/release/fonts/ionicons.eot?v=2.0.1#iefix") format("embedded-opentype"), url("../lib/ionic/release/fonts/ionicons.ttf?v=2.0.1") format("truetype"), url("../lib/ionic/release/fonts/ionicons.woff?v=2.0.1") format("woff"), url("../lib/ionic/release/fonts/ionicons.svg?v=2.0.1#Ionicons") format("svg");
src: url("../lib/ionic/release/fonts/ionicons.eot?v=2.0.1#iefix") format("embedded-opentype"), url("../lib/ionic/release/fonts/ionicons.ttf?v=2.0.1") format("truetype"), url("../lib/ionic/release/fonts/ionicons.woff?v=2.0.1") format("woff"), url("../lib/ionic/release/fonts/ionicons.woff") format("woff"), url("../lib/ionic/release/fonts/ionicons.svg?v=2.0.1#Ionicons") format("svg");
font-weight: normal;
font-style: normal; }

Expand Down Expand Up @@ -2578,7 +2578,7 @@ body.grade-b, body.grade-c {
width: auto;
height: auto; }

.scroll-content-false, .menu .scroll-content.scroll-content-false {
.menu .scroll-content.scroll-content-false {
z-index: 11; }

.scroll-view {
Expand Down Expand Up @@ -8090,6 +8090,8 @@ a.button {
.node-detail .row {
font-size: 90%; }

.outage-list .error {
color: red; }
.outage-list .item {
border-top: 0;
border-bottom: 0; }
Expand Down
2 changes: 1 addition & 1 deletion www/css/opennms.min.css

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions www/scripts/opennms/services/Modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@
};

modal.scope.refreshOutages = function() {
OutageService.summaries().then(function(outages) {
var promise = OutageService.summaries();
promise.then(function(outages) {
var oldOutages = byId(modal.scope.outages);
var oldOutage;
for (var i=0; i < outages.length; i++) {
Expand All @@ -270,6 +271,7 @@
modal.scope.outages = [];
modal.scope.$broadcast('scroll.refreshComplete');
});
return promise;
};

var startRefresh = function() {
Expand All @@ -285,8 +287,9 @@

modal.scope.show = function() {
modal.scope.outages = [];
startRefresh();
modal.show();
modal.scope.refreshOutages().then(function() {
modal.show();
});
};
modal.scope.hide = function() {
modal.hide();
Expand Down
3 changes: 3 additions & 0 deletions www/templates/outages.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ <h1 class="title">Nodes with Outages</h1>
<ion-content>
<ion-refresher pulling-text="Pull to Refresh..." on-refresh="refreshOutages()"></ion-refresher>
<ion-list>
<ion-item ng-if="error" class="item-text-wrap error">
Error: Unable to retrieve outage summaries.
</ion-item>
<span ng-repeat="outage in outages track by outage.nodeId">
<ion-item class="item-divider item-compass" ng-click="showNode(outage.nodeId)">
<span class="item-note">{{outage.down.fromNow()}}</span>
Expand Down

0 comments on commit 37220be

Please sign in to comment.