<commit_before>define(function(require) {
  'use strict';

  var modules = require('modules');
  var states = require('states');
  var angular = require('angular');
  var _ = require('lodash');

  require('scripts/orchestrators/controllers/orchestrator_location_new');
  require('scripts/orchestrators/controllers/orchestrator_location_config');
  require('scripts/orchestrators/controllers/orchestrator_location_nodes');
  require('scripts/orchestrators/controllers/orchestrator_location_services');
  require('scripts/orchestrators/controllers/orchestrator_location_policies');
  require('scripts/orchestrators/controllers/orchestrator_location_metaprops');
  require('scripts/orchestrators/controllers/orchestrator_location_security');
  require('scripts/orchestrators/services/orchestrator_location_service');
  require('scripts/orchestrators/services/location_resources_processor');

  states.state('admin.orchestrators.details.locations', {
    url: '/locations',
    templateUrl: 'views/orchestrators/orchestrator_locations.html',
    controller: 'OrchestratorLocationsCtrl',
    menu: {
      id: 'menu.orchestrators.locations',
      state: 'admin.orchestrators.details.locations',
      key: 'ORCHESTRATORS.NAV.LOCATIONS',
      icon: 'fa fa-cloud',
      priority: 400
    }
  });

  modules.get('a4c-orchestrators', ['ui.router', 'ui.bootstrap', 'a4c-common']).controller('OrchestratorLocationsCtrl',
    ['$scope', '$modal', '$http', 'locationService', 'orchestrator', 'menu', 'locationResourcesProcessor', '$translate',
      function($scope, $modal, $http, locationService, orchestrator, menu, locationResourcesProcessor, $translate) {
        $scope.envTypes = ['OTHER', 'DEVELOPMENT', 'INTEGRATION_TESTS', 'USER_ACCEPTANCE_TESTS', 'PRE_PRODUCTION', 'PRODUCTION'];
        $scope.orchestrator = orchestrator;
        $scope.menu = menu;
        var locationSupport;
        // query to get the location support informations for the orchestrator.

        $http.get('rest/orchestrators/' + orchestrator.id + '/locationsupport').success(function(response) {
          if (_.defined(response.data)) {
            locationSupport = response.data;
            $scope.multipleLocations = locationSupport.multipleLocations;
            $scope.locationTypes = locationSupport.types;
          }
        });

        // get all locations (no need for paginations as we never expect a huge number of locations for an orchestrator)
        function updateLocations() {
          locationService.get({orchestratorId: orchestrator.id}, function(result) {
            $scope.locations = result.data;
            if ($scope.locations.length > 0 && _.isUndefined($scope.location)) {
              // For the moment show only first location
              $scope.selectLocation($scope.locations[0]);
            }<commit_msg>directly go to resources configuration when selection a location on locations view<commit_after>define(function(require) {
  'use strict';

  var modules = require('modules');
  var states = require('states');
  var angular = require('angular');
  var _ = require('lodash');

  require('scripts/orchestrators/controllers/orchestrator_location_new');
  require('scripts/orchestrators/controllers/orchestrator_location_config');
  require('scripts/orchestrators/controllers/orchestrator_location_nodes');
  require('scripts/orchestrators/controllers/orchestrator_location_services');
  require('scripts/orchestrators/controllers/orchestrator_location_policies');
  require('scripts/orchestrators/controllers/orchestrator_location_metaprops');
  require('scripts/orchestrators/controllers/orchestrator_location_security');
  require('scripts/orchestrators/services/orchestrator_location_service');
  require('scripts/orchestrators/services/location_resources_processor');

  states.state('admin.orchestrators.details.locations', {
    url: '/locations',
    templateUrl: 'views/orchestrators/orchestrator_locations.html',
    controller: 'OrchestratorLocationsCtrl',
    menu: {
      id: 'menu.orchestrators.locations',
      state: 'admin.orchestrators.details.locations',
      key: 'ORCHESTRATORS.NAV.LOCATIONS',
      icon: 'fa fa-cloud',
      priority: 400
    }
  });

  modules.get('a4c-orchestrators', ['ui.router', 'ui.bootstrap', 'a4c-common']).controller('OrchestratorLocationsCtrl',
    ['$scope', '$modal', '$http', 'locationService', 'orchestrator', 'menu', 'locationResourcesProcessor', '$translate', '$state',
      function($scope, $modal, $http, locationService, orchestrator, menu, locationResourcesProcessor, $translate, $state) {
        $scope.envTypes = ['OTHER', 'DEVELOPMENT', 'INTEGRATION_TESTS', 'USER_ACCEPTANCE_TESTS', 'PRE_PRODUCTION', 'PRODUCTION'];
        $scope.orchestrator = orchestrator;
        $scope.menu = menu;
        var locationSupport;
        // query to get the location support informations for the orchestrator.

        $http.get('rest/orchestrators/' + orchestrator.id + '/locationsupport').success(function(response) {
          if (_.defined(response.data)) {
            locationSupport = response.data;
            $scope.multipleLocations = locationSupport.multipleLocations;
            $scope.locationTypes = locationSupport.types;
          }
        });

        // get all locations (no need for paginations as we never expect a huge number of locations for an orchestrator)
        function updateLocations() {
          locationService.get({orchestratorId: orchestrator.id}, function(result) {
            $scope.locations = result.data;
            if ($scope.locations.length > 0 && _.isUndefined($scope.location)) {
              // For the moment show only first location
              $scope.selectLocation($scope.locations[0]);
              $state.go('admin.orchestrators.details.locations.config');
            }
{'fraction_non_alphanumeric': 0.12555976575955907, 'fraction_numerical': 0.002411298656562177, 'mean_word_length': 4.120811287477954, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3527947', 'n_tokens_mistral': 1633, 'n_tokens_neox': 1629, 'n_words': 282}