<commit_before>// global angular
(function (angular) {
  angular.module(APP_NAME).directive('rhpTabs', rhpTabs);

  function rhpTabs () {

    var rhpTabsTemplate = [
      '<md-tabs md-stretch-tabs="always" class="md-primary md-fixed" md-selected="tabs.selectedTab">', //
      '  <md-tab ui-sref="{{tab.path}}" ng-repeat="tab in tabs.tabs">', //
      '    <md-tab-label>{{tab.name}}</md-tab-label>', //
      '  </md-tab>', //
      '</md-tabs>' //
    ].join('');

    var directive = {
      restrict: 'E',
      template: rhpTabsTemplate,
      scope : {
      },
      bindToController: true,
      controller: rhpTabsController,
      controllerAs: 'tabs'
    }
    return directive;

    rhpTabsController.$inject = [ '$scope', '$state', '$filter', '$timeout' ];

    function rhpTabsController ($scope, $state, $filter, $timeout) {

      var vm = this;

      vm.tabs = [];

      function buildTabArray(state) {

        vm.tabs = [];
        var parent = state.parent;
        if (parent === 'home')
          return;

        var tabsTypes = [ 'List', 'View', 'Manage' ];

        angular.forEach(tabsTypes, function(type) {
          var path = parent + '.' + type.toLowerCase();
          var tab = {<commit_msg>feature/RHP_55-cleanup-extraneous-buttons-placeholders-and-bobo-functionality Fix tab directive to not populate empty data on pages.<commit_after>// global angular
(function (angular) {
  angular.module(APP_NAME).directive('rhpTabs', rhpTabs);

  function rhpTabs () {

    var rhpTabsTemplate = [
      '<md-tabs ng-show="tabs.tabVisibility()" md-stretch-tabs="always" class="md-primary md-fixed" md-selected="tabs.selectedTab">', //
      '  <md-tab ng-click="tabs.tabPath(tab.path)" ng-repeat="tab in tabs.tabs">', //
      '    <md-tab-label>{{tab.name}}</md-tab-label>', //
      '  </md-tab>', //
      '</md-tabs>' //
    ].join('');

    var directive = {
      restrict: 'E',
      template: rhpTabsTemplate,
      scope : {
      },
      bindToController: true,
      controller: rhpTabsController,
      controllerAs: 'tabs'
    }
    return directive;

    rhpTabsController.$inject = [ '$scope', '$state', '$filter', '$timeout', '$stateParams' ];

    function rhpTabsController ($scope, $state, $filter, $timeout, $stateParams) {

      var vm = this;

      vm.tabs = [];

      vm.tabVisibility = function() {
        return $state.current.name.split('.')[1] !== 'list';
      }

      vm.tabPath = function(path) {
        var pathArray = path.split('.');

        if ($stateParams.id){
          $state.transitionTo(path, { id: $stateParams.id});
        } else if (pathArray[1] === 'list') {
          $state.transitionTo(path);
        }
      }

      function buildTabArray(state) {

        vm.tabs = [];
        var parent = state.parent;
        if (parent === 'home')
          return;

        var tabsTypes = [ 'List', 'View', 'Manage' ];

        angular.forEach(tabsTypes, function(type) {
          var path = parent + '.' + type.toLowerCase();
          var tab = {
{'fraction_non_alphanumeric': 0.17547918043621943, 'fraction_numerical': 0.0013218770654329147, 'mean_word_length': 2.370824053452116, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5822062', 'n_tokens_mistral': 984, 'n_tokens_neox': 957, 'n_words': 189}