Sha256: f05e305b54bc8606d6cbddbaa1ec6dece7e8ca35933a63c0e3edd30a46c96f1e

Contents?: true

Size: 1.72 KB

Versions: 37

Compression:

Stored size: 1.72 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.activation-keys.controller:ActivationKeyProductsController
 *
 * @requires $scope
 * @requires translate
 * @requires ActivationKey
 * @requires Product
 * @requires CurrentOrganization
 *
 * @description
 *   Provides the functionality for the activation-key products action pane.
 */
angular.module('Bastion.activation-keys').controller('ActivationKeyProductsController',
    ['$scope', 'translate', 'ActivationKey', 'Product', 'CurrentOrganization',
    function ($scope, translate, ActivationKey, Product, CurrentOrganization) {

        $scope.successMessages = [];
        $scope.errorMessages = [];
        $scope.displayArea = { working: true, isAvailableContent: false };

        $scope.isAnyAvailableContent = function (products) {
            var isAvailableContent = false;
            angular.forEach(products, function (product) {
                if (product['available_content'].length > 0) {
                    isAvailableContent = true;
                }
            });
            return isAvailableContent;
        };

        $scope.activationKey.$promise.then(function () {
            ActivationKey.products({id: $scope.activationKey.id,
                                    'organization_id': CurrentOrganization,
                                    enabled: true,
                                    'full_result': true,
                                    'include_available_content': true
                                   }, function (response) {
                $scope.products = response.results;
                $scope.displayArea.isAvailableContent = $scope.isAnyAvailableContent($scope.products);
                $scope.displayArea.working = false;
            });
        });

    }]
);

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
katello-3.3.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.3.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.3.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.3.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.3.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.3.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.3.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.2.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.2.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.2.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.2.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.2.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.2.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.1.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.1.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.1.0.rc2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-3.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js
katello-2.4.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-products.controller.js