Sha256: 2ea4afc3bc69f6676e69b3fb0c8c4ee03c2620e63e4d96096491ff873edfb112

Contents?: true

Size: 1.81 KB

Versions: 22

Compression:

Stored size: 1.81 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.content-credentials.controller:NewContentCredentialController
 *
 * @requires $scope
 * @requires $state
 * @requires translate
 * @requires ContentCredential
 * @requires CurrentOrganization
 * @requires Notification
 *
 * @description
 *   Controls the creation of an empty ContentCredential object for use by sub-controllers.
 */
angular.module('Bastion.content-credentials').controller('NewContentCredentialController',
    ['$scope', '$state', 'translate', 'ContentCredential', 'CurrentOrganization', 'Notification',
    function ($scope, $state, translate, ContentCredential, CurrentOrganization, Notification) {
        $scope.panel = {loading: false};
        $scope.contentCredential = new ContentCredential();
        $scope.CurrentOrganization = CurrentOrganization;
        $scope.progress = {uploading: false};
        $scope.uploadURL = 'katello/api/v2/content_credentials?organization_id=' + CurrentOrganization;

        // Labels so breadcrumb strings can be translated
        $scope.label = translate('New Content Credential');

        $scope.uploadContent = function (response) {
            if (response) {
                if (angular.isUndefined(response.errors)) {
                    $scope.uploadStatus = 'success';
                    $scope.transitionTo('content-credential.info', {contentCredentialId: response.id});
                    Notification.setSuccessMessage(translate('Content Credential %s has been created.').replace('%s', response.name));
                } else {
                    Notification.setErrorMessage(translate("An error occurred while creating the Content Credential: ") + response.displayMessage);
                    $scope.uploadStatus = 'error';
                }

                $scope.progress.uploading = false;
            }
        };
    }]
);

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
katello-4.14.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.15.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.15.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.15.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.14.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.14.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.14.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.14.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.14.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.14.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.13.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.13.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.12.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.13.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.12.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.12.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.12.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.12.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.11.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
katello-4.11.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js