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

    export var AppOverviewController = _module.controller("Apiman.AppOverviewController",
        ['$q', '$scope', '$location', 'OrgSvcs', 'PageLifecycle', ($q, $scope, $location, OrgSvcs, PageLifecycle) => {
            var params = $location.search();
            $scope.version = params.version;
            var promise = $q.all({
                org: $q(function(resolve, reject) {
                    OrgSvcs.get({ organizationId: params.org }, function(org) {
                        resolve(org);
                    }, function(error) {
                        reject(error);
                    });
                }),
                app: $q(function(resolve, reject) {
                    OrgSvcs.get({ organizationId: params.org, entityType: 'applications', entityId: params.app }, function(app) {
                        resolve(app);
                    }, function(error) {
                        reject(error);
                    });
                }),
                versions: $q(function(resolve, reject) {
                    OrgSvcs.query({ organizationId: params.org, entityType: 'applications', entityId: params.app, versionsOrActivity: 'versions', version: $scope.version }, function(versions) {
                        if (params.version != null) {
                            for (var i = 0; i < versions.length; i++) {
                                if (params.version == versions[i].version) {
                                    $scope.selectedAppVersion = versions[i];
                                    break;
                                }
                            }
                        } else {
                            $scope.selectedAppVersion = versions[0];
                        }
                        resolve(versions);
                    }, function(error) {
                        reject(error);
                    });
                }),
                members: $q(function(resolve, reject) {
                    OrgSvcs.query({ organizationId: params.org, entityType: 'members' }, function(members) {
                        resolve(members);
                    }, function(error) {
                        reject(error);
                    });
                })
            });

            $scope.setVersion = function(app) {
                $scope.selectedAppVersion = app;
                $location.path(Apiman.pluginName + "/app-overview.html").search('org', params.org).search('app', params.app).search('version', app.version);
            };
        }])

}<commit_msg>added the page lifecycle call to the app-contracts page<commit_after>/// <reference path="apimanPlugin.ts"/>
/// <reference path="services.ts"/>
module Apiman {

    export var AppOverviewController = _module.controller("Apiman.AppOverviewController",
        ['$q', '$scope', '$location', 'OrgSvcs', 'PageLifecycle', ($q, $scope, $location, OrgSvcs, PageLifecycle) => {
            var params = $location.search();
            $scope.version = params.version;
            var promise = $q.all({
                org: $q(function(resolve, reject) {
                    OrgSvcs.get({ organizationId: params.org }, function(org) {
                        resolve(org);
                    }, function(error) {
                        reject(error);
                    });
                }),
                app: $q(function(resolve, reject) {
                    OrgSvcs.get({ organizationId: params.org, entityType: 'applications', entityId: params.app }, function(app) {
                        resolve(app);
                    }, function(error) {
                        reject(error);
                    });
                }),
                versions: $q(function(resolve, reject) {
                    OrgSvcs.query({ organizationId: params.org, entityType: 'applications', entityId: params.app, versionsOrActivity: 'versions', version: $scope.version }, function(versions) {
                        if (params.version != null) {
                            for (var i = 0; i < versions.length; i++) {
                                if (params.version == versions[i].version) {
                                    $scope.selectedAppVersion = versions[i];
                                    break;
                                }
                            }
                        } else {
                            $scope.selectedAppVersion = versions[0];
                        }
                        resolve(versions);
                    }, function(error) {
                        reject(error);
                    });
                }),
                members: $q(function(resolve, reject) {
                    OrgSvcs.query({ organizationId: params.org, entityType: 'members' }, function(members) {
                        resolve(members);
                    }, function(error) {
                        reject(error);
                    });
                })
            });

            $scope.setVersion = function(app) {
                $scope.selectedAppVersion = app;
                $location.path(Apiman.pluginName + "/app-overview.html").search('org', params.org).search('app', params.app).search('version', app.version);
            };
            
            PageLifecycle.loadPage('AppContracts', promise, $scope);
        }])

}
{'fraction_non_alphanumeric': 0.12476996687523004, 'fraction_numerical': 0.000736105999263894, 'mean_word_length': 1.2412371134020619, 'pattern_counts': {'":': 0, '<': 9, '<?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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2367256', 'n_tokens_mistral': 1313, 'n_tokens_neox': 1227, 'n_words': 233}