Sha256: ebab725dd3bc46e11b5009aceff0f0ab0ff9f94224f9c8bd4cfc57bd7f46b41c

Contents?: true

Size: 1.34 KB

Versions: 217

Compression:

Stored size: 1.34 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.host-collections.controller:HostCollectionFormController
 *
 * @requires $scope
 * @requires $q
 * @requires HostCollection
 * @requires CurrentOrganization
 *
 * @description
 *   Provides the functionality specific to HostCollections for creating a new host collection
 */
angular.module('Bastion.host-collections').controller('HostCollectionFormController',
    ['$scope', '$q', 'HostCollection', 'CurrentOrganization',
    function ($scope, $q, HostCollection, CurrentOrganization) {

        function success(response) {
            $scope.table.addRow(response);
            $scope.transitionTo('host-collection.info', {hostCollectionId: $scope.hostCollection.id});
        }

        function error(response) {
            $scope.working = false;
            angular.forEach(response.data.errors, function (errors, field) {
                $scope.hostCollectionForm[field].$setValidity('', false);
                $scope.hostCollectionForm[field].$error.messages = errors;
            });
        }

        $scope.hostCollection = $scope.hostCollection || new HostCollection();
        $scope.hostCollection['unlimited_hosts'] = true;

        $scope.save = function (hostCollection) {
            hostCollection['organization_id'] = CurrentOrganization;
            hostCollection.$save(success, error);
        };

    }]
);

Version data entries

217 entries across 217 versions & 1 rubygems

Version Path
katello-4.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.4.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.4.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.4.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.2.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.3.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.3.0.rc4 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.3.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.3.0.rc2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.3.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.3.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.2.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.1.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.0.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.2.0.1.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-3.18.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.2.0.1.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.2.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js
katello-4.1.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/host-collection-form.controller.js