Sha256: 64294a0a96796c619b5eca20be15fbaf9343ad0e324de15b6d06e9c11c798eab

Contents?: true

Size: 1.39 KB

Versions: 42

Compression:

Stored size: 1.39 KB

Contents

/**
 * @ngdoc service
 * @name  Bastion.products.details.repositories.service:OSVersions
 *
 * @description
 *   Helper functions for repo osVersions.
 */

angular
    .module('Bastion.repositories')
    .service('OSVersions', function () {

        this.getOSVersionsOptions = function () {
            return [
                { name: 'No restriction', id: '' },
                { name: 'Red Hat Enterprise Linux 8 ', id: 'rhel-8' },
                { name: 'Red Hat Enterprise Linux 7 ', id: 'rhel-7' },
                { name: 'Red Hat Enterprise Linux 6 ', id: 'rhel-6' }
            ];
        };

        // return an array of OS versions
        this.osVersionsParam = function (osVersion) {
            var param = osVersion;
            if (osVersion && osVersion.hasOwnProperty('id')) {
                param = osVersion.id;
            }
            // exclude null, undefined, and ''
            return [param].filter(function (el) {
                return el && el !== '';
            });
        };

        // return the OS versions as comma-separated string
        this.formatOSVersions = function (osVersionList) {
            var individualVersions, versionStr;
            individualVersions = this.osVersionsParam(osVersionList);
            if (individualVersions) {
                versionStr = individualVersions.join(",");
            }
            return versionStr;
        };

    }
    );

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
katello-4.2.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.3.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.2.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.1.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.0.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.2.0.1.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-3.18.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.2.0.1.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.2.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.1.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.2.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.0.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.1.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.1.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-3.18.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.1.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js
katello-4.0.1.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js