From 4056cd3e68b5dc3e9114d361bc5fceaf7f61d081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Vachon?= Date: Mon, 29 Jun 2015 14:12:35 -0400 Subject: [PATCH] Drupal: Add views tile which is hidden if views are disabled Change-Id: I3f3c9d95c9fb754052f29c7627fed125804cb6e3 --- app/components/drupal/drupal.html | 8 -------- app/components/drupal/drupal_tile/drupal_tile.html | 2 +- app/components/drupal/drupal_tile/drupal_tile.js | 6 ++++++ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/components/drupal/drupal.html b/app/components/drupal/drupal.html index 115e48d..17b952e 100644 --- a/app/components/drupal/drupal.html +++ b/app/components/drupal/drupal.html @@ -47,17 +47,9 @@ warning="70" critical="40"> - diff --git a/app/components/drupal/drupal_tile/drupal_tile.html b/app/components/drupal/drupal_tile/drupal_tile.html index 4a7d0b4..9f0f766 100644 --- a/app/components/drupal/drupal_tile/drupal_tile.html +++ b/app/components/drupal/drupal_tile/drupal_tile.html @@ -1,4 +1,4 @@ -
+

{{title}} {{finalScore}}

diff --git a/app/components/drupal/drupal_tile/drupal_tile.js b/app/components/drupal/drupal_tile/drupal_tile.js index 07bec7a..8159119 100644 --- a/app/components/drupal/drupal_tile/drupal_tile.js +++ b/app/components/drupal/drupal_tile/drupal_tile.js @@ -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 = [];