<commit_before>/// <reference path="apimanPlugin.ts"/>
module Apiman {

    export var NewPlanController = _module.controller("Apiman.NewPlanController",
        ['$location', '$scope', 'UserSvcs', 'OrgSvcs', ($location, $scope, UserSvcs, OrgSvcs) => {
            $scope.plan.initialVersion = '1.0';
            
            UserSvcs.query({ entityType: 'organizations' }, function(userOrgs) {
                $scope.organizations = userOrgs;
                $scope.selectedOrg = $scope.organizations[0];
            }, function(error) {
                alert("ERROR=" + error);
            });
            $scope.setOrg = function(org) {
                $scope.selectedOrg = org;
            };
            $scope.saveNewPlan = function() {
                OrgSvcs.save({ organizationId: $scope.selectedOrg.id, entityType: 'plans' }, $scope.plan, function(reply) {
                    $location.path(Apiman.pluginName + '/plan-overview.html').search('org', reply.organization.id).search('plan', reply.name).search('version', $scope.plan.initialVersion);
                }, function(error) {
                    if (error.status == 409) {
                        $location.path('apiman/error-409.html');
                    } else {
                        alert("ERROR=" + error.status + " " + error.statusText);
                    }
                });
            };
        }]);

}<commit_msg>minor bug fix setting the default initial version<commit_after>/// <reference path="apimanPlugin.ts"/>
module Apiman {

    export var NewPlanController = _module.controller("Apiman.NewPlanController",
        ['$location', '$scope', 'UserSvcs', 'OrgSvcs', ($location, $scope, UserSvcs, OrgSvcs) => {
            UserSvcs.query({ entityType: 'organizations' }, function(userOrgs) {
                $scope.organizations = userOrgs;
                $scope.selectedOrg = $scope.organizations[0];
            }, function(error) {
                alert("ERROR=" + error);
            });
            $scope.setOrg = function(org) {
                $scope.selectedOrg = org;
            };
            $scope.saveNewPlan = function() {
                OrgSvcs.save({ organizationId: $scope.selectedOrg.id, entityType: 'plans' }, $scope.plan, function(reply) {
                    $location.path(Apiman.pluginName + '/plan-overview.html').search('org', reply.organization.id).search('plan', reply.name).search('version', $scope.plan.initialVersion);
                }, function(error) {
                    if (error.status == 409) {
                        $location.path('apiman/error-409.html');
                    } else {
                        alert("ERROR=" + error.status + " " + error.statusText);
                    }
                });
            };
            // Initialize the model - the default initial version for a new plan is always 1.0
            $scope.plan = {
                initialVersion: '1.0'
            };
        }]);

}
{'fraction_non_alphanumeric': 0.14581213970837573, 'fraction_numerical': 0.00678195998643608, 'mean_word_length': 1.7595884003741815, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3104121', 'n_tokens_mistral': 825, 'n_tokens_neox': 778, 'n_words': 136}