<commit_before>angular.module('app.dash', [])

.controller('DashboardController', ['$scope','$http', '$state', function($scope, $http, $state){

  $scope.username = '';

  $scope.followedMapsResponseBody = {};

  $scope.myMapsResponseBody = {};

  $scope.hideMyMaps = true;

  $scope.followed = [];

  $scope.myMaps = [];

  $scope.followedTotalNodes = 0;

  // helper functions

  $scope.showMyMaps = function(){
      $scope.hideMyMaps = false;
      angular.element( '#myMapsBtn' ).addClass( 'pressed' );
      angular.element( '#followedBtn' ).removeClass( 'pressed' );
  };

  $scope.showFollowed = function(){
      $scope.hideMyMaps = true;
      angular.element( '#myMapsBtn' ).removeClass( 'pressed' );
      angular.element( '#followedBtn' ).addClass( 'pressed' );
  };

  $scope.addTotalNodesOfFollowedMaps = function (arr){
    arr.forEach(function(map){
      map.totalNodes = map.nodes.length;
    });
  };

  $scope.addTotalNodesOfMyMaps = function (arr){
    arr.forEach(function(map){
      map.totalNodes = map.nodes.length;
    });
  };

  $scope.getMyMaps = function (){
    // $http.get('http://roadmaptoanything.herokuapp.com/#/api/users/' + $scope.userName )
    $http.get('/api/users/' + localStorage.getItem('user.username') )
      .then(function(response){
          console.log('Got author maps:', response.data);
          $scope.myMaps = response.data.data.authoredRoadmaps || [];
          $scope.addTotalNodesOfMyMaps($scope.myMaps);
        }, function(err){
          console.log('Failed to get authored roadmaps:', err);
        });
    };

  $scope.getFollowedMaps = function (){
    // $http.get('http://roadmaptoanything.herokuapp.com/#/api/users/' + $scope.userName )
    $http.get('/api/users/' + localStorage.getItem('user.username') )
      .then(function(response){
          console.log('Got followed maps', response.data);
          $scope.followed = response.data.data.inProgress.roadmaps || [];
          $scope.addTotalNodesOfFollowedMaps($scope.followed);
          $scope.addCompletedNodes(response.data.data.inProgress);
        }, function(err){
          console.log('Failed to get followed maps', err);
        });<commit_msg>fix maps i maade display<commit_after>angular.module('app.dash', [])

.controller('DashboardController', ['$scope','$http', '$state', function($scope, $http, $state){

  $scope.username = '';

  $scope.followedMapsResponseBody = {};

  $scope.myMapsResponseBody = {};

  $scope.hideMyMaps = true;

  $scope.followed = [];

  $scope.myMaps = [];

  $scope.followedTotalNodes = 0;

  // helper functions

  $scope.showMyMaps = function(){
      $scope.hideMyMaps = false;
      angular.element( '#myMapsBtn' ).addClass( 'pressed' );
      angular.element( '#followedBtn' ).removeClass( 'pressed' );
  };

  $scope.showFollowed = function(){
      $scope.hideMyMaps = true;
      angular.element( '#myMapsBtn' ).removeClass( 'pressed' );
      angular.element( '#followedBtn' ).addClass( 'pressed' );
  };

  $scope.addTotalNodesOfFollowedMaps = function (arr){
    arr.forEach(function(map){
      map.totalNodes = map.nodes.length;
    });
  };

  $scope.addTotalNodesOfMyMaps = function (arr){
    arr.forEach(function(map){
      map.totalNodes = map.nodes.length;
    });
  };

  $scope.getMyMaps = function (){
      console.log('calling getMyMaps');
  //    $http.get('http://roadmaptoanything.herokuapp.com/#/api/users/' + $scope.userName )
        $http.get('/api/users/' + localStorage.getItem('user.username') )
          .then(function(response){
                console.log('myMaps response.data', response.data);
                $scope.myMaps = response.data.data.authoredRoadmaps || [];
                $scope.addTotalNodesOfMyMaps($scope.myMaps);
            }, function(err){
              console.log("error with MyMaps request", err);
            });
    };

  $scope.getFollowedMaps = function (){
    // $http.get('http://roadmaptoanything.herokuapp.com/#/api/users/' + $scope.userName )
    $http.get('/api/users/' + localStorage.getItem('user.username') )
      .then(function(response){
          console.log('Got followed maps', response.data);
          $scope.followed = response.data.data.inProgress.roadmaps || [];
          $scope.addTotalNodesOfFollowedMaps($scope.followed);
          $scope.addCompletedNodes(response.data.data.inProgress);
        }, function(err){
          console.log('Failed to get followed maps', err);
        });
{'fraction_non_alphanumeric': 0.1733753091972116, 'fraction_numerical': 0.00044974139869574995, 'mean_word_length': 3.0807339449541282, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4129509', 'n_tokens_mistral': 1430, 'n_tokens_neox': 1396, 'n_words': 198}