<commit_before>﻿(function () {
  'use strict';

  angular.module('exceptionless.billing')
    .factory('billingService', ['$ExceptionlessClient', 'dialogs', 'dialogService', function ($ExceptionlessClient, dialogs, dialogService) {
      var source = 'exceptionless.billing.billingService';

      function changePlan(organizationId) {
        return dialogs.create('components/billing/change-plan-dialog.tpl.html', 'ChangePlanDialog as vm', organizationId).result;
      }

      function confirmUpgradePlan(message, organizationId) {
        function onSuccess() {
          return changePlan(organizationId);
        }

        function onFailure() {
          $ExceptionlessClient.createFeatureUsage(source + '.confirmUpgradePlan.cancel')
            .setMessage(message)
            .setProperty('OrganizationId', organizationId)
            .submit();
        }

        $ExceptionlessClient.createFeatureUsage(source + '.confirmUpgradePlan')
          .setMessage(message)
          .setProperty('OrganizationId', organizationId)
          .submit();
        return dialogService.confirm(message, 'Upgrade Plan').then(onSuccess, onFailure);
      }

      var service = {
        changePlan: changePlan,
        confirmUpgradePlan: confirmUpgradePlan
      };

      return service;
    }
    ]);
}());
<commit_msg>Fixed #106 Clicking cancel on upgrade plan does not make it go away<commit_after>﻿(function () {
  'use strict';

  angular.module('exceptionless.billing')
    .factory('billingService', ['$ExceptionlessClient', 'dialogs', 'dialogService', '$q', function ($ExceptionlessClient, dialogs, dialogService, $q) {
      var source = 'exceptionless.billing.billingService';

      function changePlan(organizationId) {
        return dialogs.create('components/billing/change-plan-dialog.tpl.html', 'ChangePlanDialog as vm', organizationId).result;
      }

      function confirmUpgradePlan(message, organizationId) {
        function onSuccess() {
          return changePlan(organizationId);
        }

        function onFailure() {
          $ExceptionlessClient.createFeatureUsage(source + '.confirmUpgradePlan.cancel')
            .setMessage(message)
            .setProperty('OrganizationId', organizationId)
            .submit();

          return $q.reject('cancelled');
        }

        $ExceptionlessClient.createFeatureUsage(source + '.confirmUpgradePlan')
          .setMessage(message)
          .setProperty('OrganizationId', organizationId)
          .submit();
        return dialogService.confirm(message, 'Upgrade Plan').then(onSuccess, onFailure);
      }

      var service = {
        changePlan: changePlan,
        confirmUpgradePlan: confirmUpgradePlan
      };

      return service;
    }
    ]);
}());

{'fraction_non_alphanumeric': 0.11636363636363636, 'fraction_numerical': 0.001090909090909091, 'mean_word_length': 2.9696969696969697, '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': '3213162', 'n_tokens_mistral': 724, 'n_tokens_neox': 705, 'n_words': 130}