Sha256: 36c63744d16cb2e12a1759fceeb15291b2c134586fa56b432e2b64cb8c537051

Contents?: true

Size: 1.59 KB

Versions: 36

Compression:

Stored size: 1.59 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.content-views.controller:NewContentViewController
 *
 * @requires $scope
 * @requires ContentView
 * @requires FormUtils
 * @requires CurrentOrganization
 *
 * @description
 */
angular.module('Bastion.content-views').controller('NewContentViewController',
    ['$scope', 'ContentView', 'FormUtils', 'CurrentOrganization',
    function ($scope, ContentView, FormUtils, CurrentOrganization) {

        function success(response) {
            var successState = 'content-view.repositories.yum.available';

            if (response.composite) {
                successState = 'content-view.components.composite-content-views.available';
            }

            $scope.transitionTo(successState, {contentViewId: response.id});
        }

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

        $scope.contentView = new ContentView({'organization_id': CurrentOrganization});
        $scope.createOption = 'new';
        $scope.table = {};

        $scope.save = function (contentView) {
            contentView.$save(success, error);
        };

        $scope.$watch('contentView.name', function () {
            if ($scope.contentViewForm.name) {
                $scope.contentViewForm.name.$setValidity('server', true);
                FormUtils.labelize($scope.contentView);
            }
        });

    }]
);

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
katello-3.8.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.7.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.7.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.8.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.8.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.8.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.7.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.8.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.7.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.7.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.5.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.6.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.6.0.1.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.6.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.6.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.5.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.5.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.5.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.5.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js
katello-3.5.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js