<commit_before>(function () {
  "use strict";
  angular
    .module('mnWizard')
    .controller('mnWizardStep1Controller', mnWizardStep1Controller);

  function mnWizardStep1Controller($scope, $state, $q, mnWizardStep1Service, mnSettingsClusterService, mnAuthService, pools, mnHelper, mnServersService, mnPools, mnPoolDefault, mnAlertsService, mnMemoryQuotaService, mnPromiseHelper) {
    var vm = this;

    vm.joinClusterConfig = mnWizardStep1Service.getJoinClusterConfig();
    vm.joinCluster = 'no';
    vm.isEnterprise = pools.isEnterprise;

    vm.onDbPathChange = onDbPathChange;
    vm.onIndexPathChange = onIndexPathChange;
    vm.isJoinCluster = isJoinCluster;
    vm.onSubmit = onSubmit;

    activate();

    function activate() {
      mnPromiseHelper(vm, mnWizardStep1Service.getConfig())
      .applyToScope("config")
      .onSuccess(function (config) {
        vm.onDbPathChange();
        vm.onIndexPathChange();
      });
    }

    function onDbPathChange() {
      vm.dbPathTotal = mnWizardStep1Service.lookup(vm.config.dbPath, vm.config.selfConfig.preprocessedAvailableStorage);
    }
    function onIndexPathChange() {
      vm.indexPathTotal = mnWizardStep1Service.lookup(vm.config.indexPath, vm.config.selfConfig.preprocessedAvailableStorage);
    }
    function isJoinCluster(value) {
      return vm.joinCluster === value;
    }
    function goNext() {
      $state.go('app.wizard.step2');
    }
    function addErrorHandler(query, name) {
      return mnPromiseHelper(vm, query)
        .catchErrors(name + 'Errors')
        .getPromise();
    }
    function postMemoryQuota() {
      return addErrorHandler(mnSettingsClusterService.postPoolsDefault(vm.config.startNewClusterConfig), "postMemory");<commit_msg>MB-12222: do not send index and fts quota if services are not selected<commit_after>(function () {
  "use strict";
  angular
    .module('mnWizard')
    .controller('mnWizardStep1Controller', mnWizardStep1Controller);

  function mnWizardStep1Controller($scope, $state, $q, mnWizardStep1Service, mnSettingsClusterService, mnAuthService, pools, mnHelper, mnServersService, mnPools, mnPoolDefault, mnAlertsService, mnMemoryQuotaService, mnPromiseHelper) {
    var vm = this;

    vm.joinClusterConfig = mnWizardStep1Service.getJoinClusterConfig();
    vm.joinCluster = 'no';
    vm.isEnterprise = pools.isEnterprise;

    vm.onDbPathChange = onDbPathChange;
    vm.onIndexPathChange = onIndexPathChange;
    vm.isJoinCluster = isJoinCluster;
    vm.onSubmit = onSubmit;

    activate();

    function activate() {
      mnPromiseHelper(vm, mnWizardStep1Service.getConfig())
      .applyToScope("config")
      .onSuccess(function (config) {
        vm.onDbPathChange();
        vm.onIndexPathChange();
      });
    }

    function onDbPathChange() {
      vm.dbPathTotal = mnWizardStep1Service.lookup(vm.config.dbPath, vm.config.selfConfig.preprocessedAvailableStorage);
    }
    function onIndexPathChange() {
      vm.indexPathTotal = mnWizardStep1Service.lookup(vm.config.indexPath, vm.config.selfConfig.preprocessedAvailableStorage);
    }
    function isJoinCluster(value) {
      return vm.joinCluster === value;
    }
    function goNext() {
      $state.go('app.wizard.step2');
    }
    function addErrorHandler(query, name) {
      return mnPromiseHelper(vm, query)
        .catchErrors(name + 'Errors')
        .getPromise();
    }
    function postMemoryQuota() {
      var data = _.clone(vm.config.startNewClusterConfig);
      !vm.config.startNewClusterConfig.services.model.index && (delete data.indexMemoryQuota);
      !vm.config.startNewClusterConfig.services.model.fts && (delete data.ftsMemoryQuota);
      return addErrorHandler(mnSettingsClusterService.postPoolsDefault(data), "postMemory");
{'fraction_non_alphanumeric': 0.10957078112503332, 'fraction_numerical': 0.006131698213809651, 'mean_word_length': 3.9695364238410598, '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': '6540632', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1145, 'n_words': 182}