Skip to content

Commit

Permalink
hide link to LS Dashboard in menu behind feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawid Mydlo committed Dec 4, 2018
1 parent a94465b commit 32244e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ describe('Navigation Directive', function () {
var $rootScope, $compile, $httpBackend, controller;

var myScope;
beforeEach(module('icdsApp'));
beforeEach(module('icdsApp', function ($provide) {
$provide.constant("haveAccessToFeatures", false);
}));

beforeEach(inject(function (_$rootScope_, _$compile_, _$httpBackend_) {
$compile = _$compile_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

var url = hqImport('hqwebapp/js/initial_page_data').reverse;

function NavigationController($window, $scope, $route, $routeParams, $location) {
function NavigationController($window, $scope, $route, $routeParams, $location, haveAccessToFeatures) {
$scope.$route = $route;
$scope.$location = $location;
$scope.$routeParams = $routeParams;
$scope.haveAccessToFeatures = haveAccessToFeatures;

var checkColapse = function(reports) {
var path = _.filter(reports, function(report) { return $location.path().indexOf(report) !== -1; });
Expand Down Expand Up @@ -37,7 +38,7 @@ function NavigationController($window, $scope, $route, $routeParams, $location)
};
}

NavigationController.$inject = ['$window', '$scope', '$route', '$routeParams', '$location'];
NavigationController.$inject = ['$window', '$scope', '$route', '$routeParams', '$location', 'haveAccessToFeatures'];

window.angular.module('icdsApp').directive('navigation', function() {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<div class="col-sm-9">{% trans "AWC Report" %}</div>
</a>
</li>
<li ng-class="{'active': $location.path().indexOf('/lady_supervisor') !== -1}">
<li ng-if="haveAccessToFeatures" ng-class="{'active': $location.path().indexOf('/lady_supervisor') !== -1}">
<a class="row pointer" href="{$ goToStep('lady_supervisor', $location.search()) $}" style="width: 100%" ng-click="healthCollapsed = true; icdsCasReach = true; demographics = true; infrastructure = true;">
<div class="col-sm-1"><i class="fa fa-tasks" aria-hidden="true"></i></div>
<div class="col-sm-9">{% trans "LS Dashboard" %}</div>
Expand Down

0 comments on commit 32244e3

Please sign in to comment.