Merge "Drupal: Add views tile which is hidden if views are disabled"

This commit is contained in:
Jenkins 2015-06-29 18:38:15 +00:00 committed by Gerrit Code Review
commit edd84f4f74
3 changed files with 7 additions and 9 deletions

View File

@ -47,17 +47,9 @@
warning="70"
critical="40"></bansho-drupal-tile>
<!--
<bansho-drupal-tile host-name="{{hostName}}"
plugin="drupal_status"
title="Status"
warning="70"
critical="40"></bansho-drupal-tile>
<bansho-drupal-tile host-name="{{hostName}}"
plugin="drupal_views"
title="Views"
warning="70"
critical="40"></bansho-drupal-tile>
-->
</article>

View File

@ -1,4 +1,4 @@
<div class="tile__main" ng-controller='DrupalTileCtrl'>
<div class="tile__main" ng-controller='DrupalTileCtrl' ng-hide="hide">
<h1>{{title}} <span ng-class="finalScoreClass">{{finalScore}}</span></h1>
<table class="data-table">
<tbody>

View File

@ -34,6 +34,12 @@ angular.module('bansho.drupal.tile', [])
$scope.finalScoreClass = 'tile__score-warning';
}
if ($scope.plugins === 'drupal_views') {
if (response[0].plugin_output.indexOf('Views is not enabled.') !== -1) {
$scope.hide = true;
}
}
// Split data into (metric, score_class, action) tuples
for (var i = 0; i < data.length; i+=3) {
var tuple = [];