<commit_before>define([
    'angular',
    'angular-route'
], function(angular) {
    'use strict';

    /**
     * Activity service
     *
     * Activity service is used to configure both menuProvider and $routeProvider,
     * as they have many common elements.
     * 
     * Usage:
     * 
     * Registering an activity:
     *
     * activityProvider.activity(id, options);
     *
     * Params:
     *
     * @param {string} id - activity id.
     *
     * @param {object} options - options for activity. Additionally, any option that
     * needs to be passed to $routeProvider (controller, templateUrl) can be added
     * to options.
     *
     * Available options are:
     * href: (mandatory) Directly passed to menuProvider and $routeProvider for
     * defining url.
     *
     * label: (mandatory) Used for display name used in $routeProvider and
     * (if menuLabel is not provided) menuProvider.
     *
     * priority: (optional) Used for sorting menu items.
     *
     * menu: (optional) Used to determine if activity will be displayed in navigation
     * menu or not. Default is true.
     *
     * menuLabel: (optional) If menu label needs to be different than route, this
     * is used to override label for menuProvider.
     *
     * menuHref: (optional) If menu href needs to be different than route, this
     * is used to override route for menuProvider.
     *
     * parent: (optional) Directly passed to menu provider, to manage menu hierarchy.
     *
     */
    angular.module('superdesk.services.activity', ['ngRoute'])
        .provider('activity', ['menuProvider', '$routeProvider', function(menuProvider, $routeProvider) {
            var activities = {};

            return {
                $get: function() {
                    
                },
                activity: function(id, item) {
                    activities[id] = item;
                    
                    if (item.menu !== false) {
                        menuProvider.menu(id, {
                            label: item.menuLabel || item.label,
                            href: item.menuHref || item.href,
                            priority: item.priority,
                            parent: item.parent
                        });
                    }
                    var route = _.omit(_.extend({}, item), ['priority', 'href', 'menuLabel', 'menuHref']);
                    $routeProvider.when(item.href, route);

                    return this;
                }
            };

        }]);

});<commit_msg>Fixed activity provider.<commit_after>define([
    'angular',
    'angular-route'
], function(angular) {
    'use strict';

    /**
     * Activity service
     *
     * Activity service is used to configure both menuProvider and $routeProvider,
     * as they have many common elements.
     * 
     * Usage:
     * 
     * Registering an activity:
     *
     * activityProvider.activity(id, options);
     *
     * Params:
     *
     * @param {string} id - activity id.
     *
     * @param {object} options - options for activity. Additionally, any option that
     * needs to be passed to $routeProvider (controller, templateUrl) can be added
     * to options.
     *
     * Available options are:
     * href: (mandatory) Directly passed to menuProvider and $routeProvider for
     * defining url.
     *
     * label: (mandatory) Used for display name used in $routeProvider and
     * (if menuLabel is not provided) menuProvider.
     *
     * priority: (optional) Used for sorting menu items.
     *
     * menu: (optional) Used to determine if activity will be displayed in navigation
     * menu or not. Default is true.
     *
     * menuLabel: (optional) If menu label needs to be different than route, this
     * is used to override label for menuProvider.
     *
     * menuHref: (optional) If menu href needs to be different than route, this
     * is used to override route for menuProvider.
     *
     * parent: (optional) Directly passed to menu provider, to manage menu hierarchy.
     *
     */
    angular.module('superdesk.services.activity', ['ngRoute'])
        .provider('activity', ['menuProvider', '$routeProvider', function(menuProvider, $routeProvider) {
            var activities = {};

            return {
                $get: function() {
                    return activities;
                },
                activity: function(id, item) {
                    activities[id] = item;

                    if (item.menu !== false) {
                        menuProvider.menu(id, {
                            label: item.menuLabel || item.label,
                            href: item.menuHref || item.href,
                            priority: item.priority,
                            parent: item.parent
                        });
                    }
                    var route = _.omit(_.extend({}, item), ['priority', 'href', 'menuLabel', 'menuHref']);
                    $routeProvider.when(item.href, route);

                    return this;
                }
            };

        }]);

});
{'fraction_non_alphanumeric': 0.09970559371933269, 'fraction_numerical': 0.0, 'mean_word_length': 1.6500260010400416, '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': '4900947', 'n_tokens_mistral': 1296, 'n_tokens_neox': 1251, 'n_words': 416}