<commit_before>/*
 * Copyright (c) 2017 Kagilum SAS.
 *
 * This file is part of iceScrum.
 *
 * iceScrum is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License.
 *
 * iceScrum is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with iceScrum.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *
 * <NAME> (<EMAIL>)
 * <NAME> (<EMAIL>)
 * <NAME> (<EMAIL>)
 *
 */

// Try to detect as early as possible that the root misses as slash
// to trigger a redirect and lose as little time as possible
(function() {
    if (window.location.hash == '') {
        var fullPath = window.location.href;
        if (fullPath[fullPath.length - 1] != '/' && fullPath.indexOf('/?') == -1) {
            if (fullPath.indexOf('?') > -1) {
                fullPath = fullPath.replace('?', '/?');
            } else {
                fullPath = fullPath + '/'
            }
            window.location.replace(fullPath);
            throw new Error("Stopping page loading because a forward slash is missing, redirecting to the proper URL...");
        }
    }
})();

angular.module('isCore', ['ui.router'])
    .provider('controllerHooks', function() {
        this.$get = angular.noop;
        this.register = function(entryPoints) {
            _.each(entryPoints, function(appControllerName, pluginControllerName) {
                if (_.has(isSettings.controllerHooks, appControllerName)) {
                    isSettings.controllerHooks[appControllerName].push(pluginControllerName);
                } else {
                    console.error("Application controller " + appControllerName + " is not registered so plugin controller " + pluginControllerName + " cannot be hooked");
                }
            });
        }
    })
    .provider('charts', function() {
        this.$get = function() {
            return this.charts;
        };
        this.charts = {
            project: {
                project: [
                    {id: 'burnup', name: 'is.ui.project.charts.projectBurnup', 'view': 'project'},
                    {id: 'burndown', name: 'is.ui.project.charts.projectBurndown', 'view': 'project'},
                    {id: 'velocity', name: 'is.ui.project.charts.projectVelocity', 'view': 'project'},
                    {id: 'velocityCapacity', name: 'is.ui.project.charts.projectVelocityCapacity', 'view': 'project'},
                    {id: 'parkingLot', name: 'is.ui.project.charts.projectParkingLot', 'view': 'project'},
                    {id: 'flowCumulative', name: 'is.ui.project.charts.projectCumulativeFlow', 'view': 'project'}
                ],
                release: [
                    {id: 'burndown', name: 'is.chart.releaseBurndown', 'view': 'planning'},
                    {id: 'parkingLot', name: 'is.chart.releaseParkingLot', 'view': 'planning'}
                ],
                sprint: [
                    {id: 'burndownRemaining', name: 'is.ui.sprintPlan.charts.sprintBurndownRemainingChart', 'view': 'taskBoard'},
                    {id: 'burnupTasks', name: 'is.ui.sprintPlan.charts.sprintBurnupTasksChart', 'view': 'taskBoard'},
                    {id: 'burnupPoints', name: 'is.ui.sprintPlan.charts.sprintBurnupPointsChart', 'view': 'taskBoard'},
                    {id: 'burnupStories', name: 'is.ui.sprintPlan.charts.sprintBurnupStoriesChart', 'view': 'taskBoard'}
                ]
            }
        };
    })
    .provider('itemTabs', function() {
        this.$get = function() {
            return this.itemTabs;
        };
        this.itemTabs = {
            backlog: {
                details: {}
            },<commit_msg>T353 Project cache<commit_after>/*
 * Copyright (c) 2017 Kagilum SAS.
 *
 * This file is part of iceScrum.
 *
 * iceScrum is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License.
 *
 * iceScrum is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with iceScrum.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *
 * <NAME> (<EMAIL>)
 * <NAME> (<EMAIL>)
 * <NAME> (<EMAIL>)
 *
 */

// Try to detect as early as possible that the root misses as slash
// to trigger a redirect and lose as little time as possible
(function() {
    if (window.location.hash == '') {
        var fullPath = window.location.href;
        if (fullPath[fullPath.length - 1] != '/' && fullPath.indexOf('/?') == -1) {
            if (fullPath.indexOf('?') > -1) {
                fullPath = fullPath.replace('?', '/?');
            } else {
                fullPath = fullPath + '/'
            }
            window.location.replace(fullPath);
            throw new Error("Stopping page loading because a forward slash is missing, redirecting to the proper URL...");
        }
    }
})();

angular.module('isCore', ['ui.router'])
    .provider('controllerHooks', function() {
        this.$get = angular.noop;
        this.register = function(entryPoints) {
            _.each(entryPoints, function(appControllerName, pluginControllerName) {
                if (_.has(isSettings.controllerHooks, appControllerName)) {
                    isSettings.controllerHooks[appControllerName].push(pluginControllerName);
                } else {
                    console.error("Application controller " + appControllerName + " is not registered so plugin controller " + pluginControllerName + " cannot be hooked");
                }
            });
        }
    })
    .provider('charts', function() {
        this.$get = function() {
            return this.charts;
        };
        this.charts = {
            project: {
                project: [
                    {id: 'burnup', name: 'is.ui.project.charts.projectBurnup', 'view': 'project'},
                    {id: 'burndown', name: 'is.ui.project.charts.projectBurndown', 'view': 'project'},
                    {id: 'velocity', name: 'is.ui.project.charts.projectVelocity', 'view': 'project'},
                    {id: 'velocityCapacity', name: 'is.ui.project.charts.projectVelocityCapacity', 'view': 'project'},
                    {id: 'parkingLot', name: 'is.ui.project.charts.projectParkingLot', 'view': 'project'},
                    {id: 'flowCumulative', name: 'is.ui.project.charts.projectCumulativeFlow', 'view': 'project'}
                ],
                release: [
                    {id: 'burndown', name: 'is.chart.releaseBurndown', 'view': 'planning'},
                    {id: 'parkingLot', name: 'is.chart.releaseParkingLot', 'view': 'planning'}
                ],
                sprint: [
                    {id: 'burndownRemaining', name: 'is.ui.sprintPlan.charts.sprintBurndownRemainingChart', 'view': 'taskBoard'},
                    {id: 'burnupTasks', name: 'is.ui.sprintPlan.charts.sprintBurnupTasksChart', 'view': 'taskBoard'},
                    {id: 'burnupPoints', name: 'is.ui.sprintPlan.charts.sprintBurnupPointsChart', 'view': 'taskBoard'},
                    {id: 'burnupStories', name: 'is.ui.sprintPlan.charts.sprintBurnupStoriesChart', 'view': 'taskBoard'}
                ]
            }
        };
    })
    .provider('projectCaches', function() {
        this.$get = function() {
            return this.projectCaches;
        };
        this.projectCaches = {
            story: {
                arrayName: 'stories',
                projectPath: 'backlog'
            },
            feature: {
                arrayName: 'features',
                projectPath: 'backlog'
            },
            release: {
                arrayName: 'releases',
                projectPath: 'parentProject'
            },
            backlog: {
                arrayName: 'backlogs',
                projectPath: 'project'
            }
        };
    })
    .provider('itemTabs', function() {
        this.$get = function() {
            return this.itemTabs;
        };
        this.itemTabs = {
            backlog: {
                details: {}
            },
{'fraction_non_alphanumeric': 0.13350271393925395, 'fraction_numerical': 0.00219424875851715, 'mean_word_length': 2.011126564673157, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5038839', 'n_tokens_mistral': 2478, 'n_tokens_neox': 2323, 'n_words': 613}