<commit_before>﻿define([
	'../moduleDef',
	'require',
	'angular',
	'text!./moduleMenu.tpl.html',
	'./page'
], function (module, require, angular, moduleMenuTpl) {
	module.config(['$stateProvider', function($stateProvider) {
		$stateProvider.state('page.project', {
			url: '/project/:project',
			views: {
				'content': { template: '<div ui-view></div>' },
				'moduleMenu': { template: moduleMenuTpl }
			},
			onEnter: function(apinetService, $state, $stateParams, $rootScope) {
				$rootScope.breadcrumbs.push({
					name: 'projects.list.title',
					url: 'page.projects.projectsList'
				});

				apinetService.getModel({
					method: 'core/projects/projectInfo',
					project: $stateParams.project
				}).then(function(data) {
					if(!data || !data.Module) {
						return;
					}

					//used in moduleConfig for requesting module configuration
					//and in security/service for switching user role in project
					$rootScope.module = data.Module;
					$rootScope.currentProjectName = data.Name;

					var breadcrumb = {
						name: $rootScope.currentProjectName,
						url: 'page.project.' + data.Module
					};

					if($rootScope.breadcrumbs.length > 1) {
						$rootScope.breadcrumbs.splice(1,0, breadcrumb);
					}
					else {
						$rootScope.breadcrumbs.push(breadcrumb);
					}

					require([data.Module], function() {
						require([data.Module + '/module'], function () {
							if($state.current.name === 'page.project') {
								$state.go('.' + data.Module);
							}
						});
					});
				}, function() {
					$state.go('page.projects.projectsList');
				});
			},
			onExit: function($rootScope) {
				var count = 1;
				if($rootScope.currentProjectName) {
					count = 2;
				}

				$rootScope.breadcrumbs.splice($rootScope.breadcrumbs.length - count, count);<commit_msg>fix module case sensitivity bug<commit_after>﻿define([
	'../moduleDef',
	'require',
	'angular',
	'text!./moduleMenu.tpl.html',
	'./page'
], function (module, require, angular, moduleMenuTpl) {
	module.config(['$stateProvider', function($stateProvider) {
		$stateProvider.state('page.project', {
			url: '/project/:project',
			views: {
				'content': { template: '<div ui-view></div>' },
				'moduleMenu': { template: moduleMenuTpl }
			},
			onEnter: function(apinetService, $state, $stateParams, $rootScope) {
				$rootScope.breadcrumbs.push({
					name: 'projects.list.title',
					url: 'page.projects.projectsList'
				});

				apinetService.getModel({
					method: 'core/projects/projectInfo',
					project: $stateParams.project
				}).then(function(data) {
					if(!data || !data.Module) {
						return;
					}

					//used in moduleConfig for requesting module configuration
					//and in security/service for switching user role in project
					$rootScope.module = data.Module;
					$rootScope.currentProjectName = data.Name;

					var breadcrumb = {
						name: $rootScope.currentProjectName,
						url: 'page.project.' + data.Module
					};

					if($rootScope.breadcrumbs.length > 1) {
						$rootScope.breadcrumbs.splice(1,0, breadcrumb);
					}
					else {
						$rootScope.breadcrumbs.push(breadcrumb);
					}

					var m = data.Module.toLowerCase();
					require([m], function() {
						require([m + '/module'], function () {
							if($state.current.name === 'page.project') {
								$state.go('.' + m);
							}
						});
					});
				}, function() {
					$state.go('page.projects.projectsList');
				});
			},
			onExit: function($rootScope) {
				var count = 1;
				if($rootScope.currentProjectName) {
					count = 2;
				}

				$rootScope.breadcrumbs.splice($rootScope.breadcrumbs.length - count, count);
{'fraction_non_alphanumeric': 0.16372170071783546, 'fraction_numerical': 0.0027609055770292656, 'mean_word_length': 2.942328618063112, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '6509377', 'n_tokens_mistral': 1528, 'n_tokens_neox': 1157, 'n_words': 202}