Sha256: 01a109f3f305bd06c49cb5277aab5abea1a8fcf6c4893c5541e9f23eab585eaf

Contents?: true

Size: 1.68 KB

Versions: 107

Compression:

Stored size: 1.68 KB

Contents

/**
* @ngdoc object
* @name Bastion.capsule-content.config
*
* @requires $stateProvider
* @requires $urlRouterProvider
*
* @description
*   Used for systems level configuration such as setting up the ui state machine.
*/
angular.module('Bastion.capsule-content').config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
    //Catch the url to prevent the router to perform redirect.
    $urlRouterProvider.when('/smart_proxies/:proxyId', ['$match', '$stateParams', function ($match, $stateParams) {
        $stateParams.pageName = 'smart_proxies/detail';
        return true;
    }]);

    // Add rule to redirect links on the smart proxy detail page.
    // Changing state doesn't work there since there's no <ui-view> element there
    $urlRouterProvider.rule(function ($injector, $location) {
        var $stateParams = $injector.get('$stateParams'),
            $window = $injector.get('$window');

        if ($stateParams.pageName === 'smart_proxies/detail') {
            $window.location.href = $location.path();
        }
    });
}]);

/**
 * @ngdoc run
 * @name Bastion.capsule-content.run
 *
 * @requires $rootScope
 * @requires $window
 * @requires $timeout
 *
 * @description
 *   Ensure foreman's setTab() function is called on capsule content pages.
 */
angular.module('Bastion.capsule-content').run(['$rootScope', '$window', '$timeout', function ($rootScope, $window, $timeout) {
    var smartProxiesRegex = new RegExp("/smart_proxies/.+#.+");
    $rootScope.$on('$locationChangeStart', function (event, newUrl) {
        if (newUrl.match(smartProxiesRegex)) {
            $timeout(function () {
                $window.setTab();
            });
        }
    });
}]);

Version data entries

107 entries across 107 versions & 1 rubygems

Version Path
katello-3.16.0.rc5 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.16.0.rc4.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.15.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.15.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.16.0.rc4 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.16.0.rc3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.15.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.16.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.16.0.rc2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.16.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.15.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.16.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.15.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.16.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.15.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.15.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.15.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.15.0.rc1.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.15.0.rc1.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js
katello-3.15.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js