Sha256: 7f5ae03cbb0517946a0ccdfd566c9c803f10ca8470f4ec1d7a35f40c237af21c

Contents?: true

Size: 1.56 KB

Versions: 209

Compression:

Stored size: 1.56 KB

Contents

(function () {
    /**
     * @ngdoc run
     * @name Bastion.run:ContentOverrideHelper
     *
     * @description
     *  Provides common functionality for repository sets content overrides.
     */
    function ContentOverrideHelper() {
        var self = this;

        this.getContentOverrides = function (productRepositorySets, overrideName, overrideValue, remove) {
            var contentOverrides = [];

            angular.forEach(productRepositorySets, function (productRepositorySet) {
                var repositorySet = {
                    'content_label': productRepositorySet.content.label,
                    name: overrideName,
                    value: overrideValue
                };

                if (remove) {
                    repositorySet.remove = true;
                }

                contentOverrides.push(repositorySet);
            });

            return {'content_overrides': contentOverrides};
        };

        this.getEnabledContentOverrides = function (productRepositorySets) {
            return self.getContentOverrides(productRepositorySets, 'enabled', true);
        };

        this.getDisabledContentOverrides = function (productRepositorySets) {
            return self.getContentOverrides(productRepositorySets, 'enabled', false);
        };

        this.getDefaultContentOverrides = function (productRepositorySets) {
            return self.getContentOverrides(productRepositorySets, 'enabled', false, true);

        };
    }

    angular.module('Bastion.repository-sets').service('ContentOverrideHelper', ContentOverrideHelper);
})();

Version data entries

209 entries across 209 versions & 1 rubygems

Version Path
katello-4.7.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.6.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.6.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.7.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.6.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.7.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.7.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.4.2.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.4.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.4.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.5.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.6.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.6.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.6.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.5.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.5.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.4.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.5.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.4.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js
katello-4.4.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/content-override-helper.service.js