<commit_before>/* global $ */
'use strict';

angular.module('squareteam.ressources', [
  'ngCookies',
  'ngResource'
]);

angular.module('squareteam.api', [])
  .config(function($httpProvider) {
    $httpProvider.interceptors.push('ApiHttpInterceptors');
  });

angular
  .module('squareteam.app', [
    'squareteam.api',
    'squareteam.ressources',
    'ngSanitize',
    'ui.router'
  ])
  .config(function ($stateProvider, $urlRouterProvider, ApiSessionRoutingHelpersProvider) {

    ///////////////////////////////////////////
    // Define custom state decorator for ACL //
    ///////////////////////////////////////////

    $stateProvider.decorator('resolve', function(state) {
      var resolve         = state.resolve,
          isAuthenticated = false,
          ptr             = state;

      // try to find the closest parent /w auth needed
      while (!!ptr && !isAuthenticated) {
        isAuthenticated = !!ptr.authenticated;
        ptr = ptr.parent;
      }

      if (isAuthenticated && !state.abstract) {
        if (!!resolve) {
          resolve = {};
        }

        resolve.authenticated = ApiSessionRoutingHelpersProvider.checkAuthenticated;
      }

      return resolve;
    });

    ///////////////////
    // Define states //
    ///////////////////

    $stateProvider
      .state('login', {
        url : '/login',
        templateUrl: 'views/login.html'
      })
      .state('register', {
        url : '/register',
        templateUrl: 'views/register.html'
      })
      .state('register_organization', {
        url : '/register/organization',
        templateUrl : 'views/register_organization.html'
      });

    $stateProvider
      .state('app', {
        abstract : true,
        templateUrl: 'views/app/layout.html',
        authenticated : true,
        controller : function($scope) {
          $scope.currentOrganization = $scope.currentUser.getCurrentOrganization().id;
        }
      })
      .state('app.home', {
        url : '/home',
        templateUrl: 'views/home.html',
        controller: 'HomeCtrl'
      });

    $stateProvider
      .state('app.admin', {
        url : '/manage/:id',
        controller : function($scope, $stateParams) {
          $scope.organization = $.grep($scope.currentUser.getOrganizations(), function(organization) {
            return organization.id === parseInt($stateParams.id, 10);
          })[0];
        },
        templateUrl: 'views/app/admin/index.html'
      })
      .state('app.admin.teams', {
        url : '/teams',
        templateUrl: 'views/app/admin/teams.html'
      })
      .state('app.admin.members', {
        url : '/members',
        templateUrl: 'views/app/admin/members.html'
      });

    $urlRouterProvider
      .otherwise('/home');

  });

var version = '0.0.4';
angular.module('squareteam.app').value('VERSION', version);<commit_msg>fix(app): add deps as array<commit_after>/* global $ */
'use strict';

angular.module('squareteam.ressources', [
  'ngCookies',
  'ngResource'
]);

angular.module('squareteam.api', [])
  .config(function($httpProvider) {
    $httpProvider.interceptors.push('ApiHttpInterceptors');
  });

angular
  .module('squareteam.app', [
    'squareteam.api',
    'squareteam.ressources',
    'ngSanitize',
    'ui.router'
  ])
  .config(function ($stateProvider, $urlRouterProvider, ApiSessionRoutingHelpersProvider) {

    ///////////////////////////////////////////
    // Define custom state decorator for ACL //
    ///////////////////////////////////////////

    $stateProvider.decorator('resolve', function(state) {
      var resolve         = state.resolve,
          isAuthenticated = false,
          ptr             = state;

      // try to find the closest parent /w auth needed
      while (!!ptr && !isAuthenticated) {
        isAuthenticated = !!ptr.authenticated;
        ptr = ptr.parent;
      }

      if (isAuthenticated && !state.abstract) {
        if (!!resolve) {
          resolve = {};
        }

        resolve.authenticated = ApiSessionRoutingHelpersProvider.checkAuthenticated;
      }

      return resolve;
    });

    ///////////////////
    // Define states //
    ///////////////////

    $stateProvider
      .state('login', {
        url : '/login',
        templateUrl: 'views/login.html'
      })
      .state('register', {
        url : '/register',
        templateUrl: 'views/register.html'
      })
      .state('register_organization', {
        url : '/register/organization',
        templateUrl : 'views/register_organization.html'
      });

    $stateProvider
      .state('app', {
        abstract : true,
        templateUrl: 'views/app/layout.html',
        authenticated : true,
        controller : ['$scope', function($scope) {
          $scope.currentOrganization = $scope.currentUser.getCurrentOrganization().id;
        }]
      })
      .state('app.home', {
        url : '/home',
        templateUrl: 'views/home.html',
        controller: 'HomeCtrl'
      });

    $stateProvider
      .state('app.admin', {
        url : '/manage/:id',
        controller : ['$scope', '$stateParams', function($scope, $stateParams) {
          $scope.organization = $.grep($scope.currentUser.getOrganizations(), function(organization) {
            return organization.id === parseInt($stateParams.id, 10);
          })[0];
        }],
        templateUrl: 'views/app/admin/index.html'
      })
      .state('app.admin.teams', {
        url : '/teams',
        templateUrl: 'views/app/admin/teams.html'
      })
      .state('app.admin.members', {
        url : '/members',
        templateUrl: 'views/app/admin/members.html'
      });

    $urlRouterProvider
      .otherwise('/home');

  });

var version = '0.0.4';
angular.module('squareteam.app').value('VERSION', version);
{'fraction_non_alphanumeric': 0.18797643797643798, 'fraction_numerical': 0.002079002079002079, 'mean_word_length': 1.939409368635438, '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': '3347708', 'n_tokens_mistral': 1653, 'n_tokens_neox': 1615, 'n_words': 270}