<commit_before>(function() {
  
  'use strict';
  
  angular
    .module('harbor.project')
    .directive('addProject', addProject);
    
  AddProjectController.$inject = ['AddProjectService', '$scope'];
  
  function AddProjectController(AddProjectService, $scope) {
    var vm = this;
    
    $scope.p = {};
    var vm0 = $scope.p;
    vm0.projectName = '';
    vm.isPublic = false;
    
    vm.addProject = addProject;
    vm.cancel = cancel;
        
    vm.reset = reset;
    
    vm.hasError = false;
    vm.errorMessage = '';
        
    function addProject(p) {
      if(p && angular.isDefined(p.projectName)) {
        AddProjectService(p.projectName, vm.isPublic)
          .success(addProjectSuccess)
          .error(addProjectFailed);
      }
    }
    
    function addProjectSuccess(data, status) {
      $scope.$emit('addedSuccess', true);
      vm.hasError = false;
      vm.errorMessage = '';
    }
    
    function addProjectFailed(data, status) {
      vm.hasError = true;
      if(status === 400 && vm0.projectName!= '' && vm0.projectName.length < 4) {<commit_msg>Update add-project.directive.js<commit_after>(function() {
  
  'use strict';
  
  angular
    .module('harbor.project')
    .directive('addProject', addProject);
    
  AddProjectController.$inject = ['AddProjectService', '$scope'];
  
  function AddProjectController(AddProjectService, $scope) {
    var vm = this;
    
    $scope.p = {};
    var vm0 = $scope.p;
    vm0.projectName = '';
    vm.isPublic = false;
    
    vm.addProject = addProject;
    vm.cancel = cancel;
        
    vm.reset = reset;
    
    vm.hasError = false;
    vm.errorMessage = '';
        
    function addProject(p) {
      if(p && angular.isDefined(p.projectName)) {
        AddProjectService(p.projectName, vm.isPublic)
          .success(addProjectSuccess)
          .error(addProjectFailed);
      }
    }
    
    function addProjectSuccess(data, status) {
      $scope.$emit('addedSuccess', true);
      vm.hasError = false;
      vm.errorMessage = '';
      vm.isOpen = false;
    }
    
    function addProjectFailed(data, status) {
      vm.hasError = true;
      if(status === 400 && vm0.projectName!= '' && vm0.projectName.length < 4) {
{'fraction_non_alphanumeric': 0.13789995493465526, 'fraction_numerical': 0.007210455159981974, 'mean_word_length': 2.3893129770992365, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5106632', 'n_tokens_mistral': 708, 'n_tokens_neox': 699, 'n_words': 119}