diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js b/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js index a26a47ea980..48ee6752e35 100644 --- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js @@ -22,6 +22,7 @@ angular.module('Bastion.products').controller('ProductRepositoriesController', 'enabled': true, 'full_result': true }); + repositoriesNutupane.masterOnly = true; function getParams() { return { @@ -35,7 +36,7 @@ angular.module('Bastion.products').controller('ProductRepositoriesController', function success(response) { angular.forEach(response.task.input.target_ids, function (row) { - $scope.repositoriesTable.removeRow(row); + $scope.detailsTable.removeRow(row); }); $scope.removingTasks.push(response.task.id); } @@ -49,8 +50,8 @@ angular.module('Bastion.products').controller('ProductRepositoriesController', $scope.errorMessages = []; $scope.checksums = [{name: translate('Default'), id: null}, {id: 'sha256', name: 'sha256'}, {id: 'sha1', name: 'sha1'}]; - $scope.repositoriesTable = repositoriesNutupane.table; - $scope.repositoriesTable.removeRow = repositoriesNutupane.removeRow; + $scope.detailsTable = repositoriesNutupane.table; + $scope.detailsTable.removeRow = repositoriesNutupane.removeRow; repositoriesNutupane.query(); $scope.syncSelectedRepositories = function () { diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-repositories.html b/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-repositories.html index aaa761f0e7d..583e38af4ae 100644 --- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-repositories.html +++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-repositories.html @@ -1,36 +1,31 @@ {{ 'Repositories for Product:' | translate }} {{ product.name }} -
-
-
-

Removal of selected repositories initiated successfully.

-
- Click here to check the status of the task. +
+
+
{{ 'Repositories' | translate }}
+
+
+
+

Removal of selected repositories initiated successfully.

+ +
+
+
+
+ There were errors while removing the following Repositories: +
    +
  1. + {{ message }} +
  2. +
+ Click here to see the task for the successful removals.
-
-
-
- There were errors while removing the following Repositories: -
    -
  1. - {{ message }} -
  2. -
- Click here to see the task for the successful removals. -
-

Repositories

- - - - +
-
Remove {{ repositoriesTable.numSelected }} Repositories?
-
Are you sure you want to remove the {{ repositoriesTable.numSelected }} repositories selected?
+
Remove {{ detailsTable.numSelected }} Repositories?
+
Are you sure you want to remove the {{ detailsTable.numSelected }} repositories selected?
@@ -51,7 +46,7 @@

Repositories

- - -
+ + +
- - - - - - - - - + + You currently don't have any Repositories included in this Product, you can add Repositories using the button on the right. + - - - - - - + + +
NameTypeSync StatusContent
- {{ repository.name }} - {{ repository.content_type }} - - - Not Synced - - - {{ repository.last_sync.result | capitalize}} - {{ repository.last_sync_words }} ago - - - N/A - - - - {{ repository.content_counts.puppet_module || 0 }} Puppet Modules - - +
+ + + + + + + + + - - + + + + + + - - -
NameTypeSync StatusContent
+ {{ repository.name }} + {{ repository.content_type }} + + + Not Synced + + + {{ repository.last_sync.result | capitalize}} + {{ repository.last_sync_words }} ago + + + N/A + + + + {{ repository.content_counts.puppet_module || 0 }} Puppet Modules + + - - + + - -
- - {{ repository.content_counts.docker_image || 0 }} Docker Images + -
-
- - {{ repository.content_counts.docker_tag || 0 }} Docker Tags + + +
+ + {{ repository.content_counts.docker_image || 0 }} Docker Images + +
+
+ + {{ repository.content_counts.docker_tag || 0 }} Docker Tags + +
-
-
-
- +
+
+
-

- - You currently don't have any Repositories included in this Product, you can add Repositories using the button on the right. - -

+
diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/repository-details-info.controller.js b/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/repository-details-info.controller.js index 6d6449b4e51..42bda774dd9 100644 --- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/repository-details-info.controller.js +++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/repository-details-info.controller.js @@ -143,7 +143,7 @@ angular.module('Bastion.repositories').controller('RepositoryDetailsInfoControll $scope.errorMessages = response.data.errors; }; - $scope.repositoriesTable.removeRow(repository.id); + $scope.detailsTable.removeRow(repository.id); repository.$delete(success, error); }; @@ -155,7 +155,7 @@ angular.module('Bastion.repositories').controller('RepositoryDetailsInfoControll }; updateRepositoriesTable = function () { - $scope.repositoriesTable.replaceRow($scope.repository); + $scope.detailsTable.replaceRow($scope.repository); }; }] ); diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/new/new-repository.controller.js b/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/new/new-repository.controller.js index dfd58d21d5d..081188740e3 100644 --- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/new/new-repository.controller.js +++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/new/new-repository.controller.js @@ -16,7 +16,7 @@ angular.module('Bastion.repositories').controller('NewRepositoryController', function ($scope, Repository, GPGKey, FormUtils, translate) { function success(response) { - $scope.repositoriesTable.rows.push(response); + $scope.detailsTable.rows.push(response); $scope.successMessages.push(translate('Repository %s successfully created.').replace('%s', $scope.repository.name)); $scope.transitionTo('products.details.repositories.index', {productId: $scope.$stateParams.productId}); } diff --git a/engines/bastion_katello/test/products/details/product-repositories.controller.test.js b/engines/bastion_katello/test/products/details/product-repositories.controller.test.js index 234bbf22cc7..1e01a11f848 100644 --- a/engines/bastion_katello/test/products/details/product-repositories.controller.test.js +++ b/engines/bastion_katello/test/products/details/product-repositories.controller.test.js @@ -56,7 +56,7 @@ describe('Controller: ProductRepositoriesController', function() { })); it("sets up the repositories nutupane table", function() { - expect($scope.repositoriesTable).toBe(expectedTable); + expect($scope.detailsTable).toBe(expectedTable); }); it("provides a way to remove all of the selected repositories in the table", function() { diff --git a/engines/bastion_katello/test/repositories/details/repository-details-info.controller.test.js b/engines/bastion_katello/test/repositories/details/repository-details-info.controller.test.js index d532ec5aa0a..e82714bf6e1 100644 --- a/engines/bastion_katello/test/repositories/details/repository-details-info.controller.test.js +++ b/engines/bastion_katello/test/repositories/details/repository-details-info.controller.test.js @@ -21,7 +21,7 @@ describe('Controller: RepositoryDetailsInfoController', function() { repositoryId: 1 }; - $scope.repositoriesTable = { + $scope.detailsTable = { replaceRow: function (row) {}, removeRow: function () {} }; @@ -62,22 +62,22 @@ describe('Controller: RepositoryDetailsInfoController', function() { it('should save the repository and return a promise', function() { var promise; - spyOn($scope.repositoriesTable, 'replaceRow'); + spyOn($scope.detailsTable, 'replaceRow'); promise = $scope.save($scope.repository); expect(promise.then).toBeDefined(); - expect($scope.repositoriesTable.replaceRow).toHaveBeenCalledWith($scope.repository); + expect($scope.detailsTable.replaceRow).toHaveBeenCalledWith($scope.repository); }); it('should save the repository successfully', function() { - spyOn($scope.repositoriesTable, 'replaceRow'); + spyOn($scope.detailsTable, 'replaceRow'); $scope.save($scope.repository); expect($scope.errorMessages.length).toBe(0); expect($scope.successMessages.length).toBe(1); - expect($scope.repositoriesTable.replaceRow).toHaveBeenCalledWith($scope.repository); + expect($scope.detailsTable.replaceRow).toHaveBeenCalledWith($scope.repository); }); it('should fail to save the repository', function() { @@ -113,14 +113,14 @@ describe('Controller: RepositoryDetailsInfoController', function() { }); it('should set the upload status to success and refresh the repository if a file upload status is success', function() { - spyOn($scope.repositoriesTable, 'replaceRow'); + spyOn($scope.detailsTable, 'replaceRow'); spyOn($scope.repository, '$get'); $scope.uploadContent('
{"status": "success"}
', true); expect($scope.uploadErrorMessages.length).toBe(0); expect($scope.uploadSuccessMessages.length).toBe(1); expect($scope.repository.$get).toHaveBeenCalled(); - expect($scope.repositoriesTable.replaceRow).toHaveBeenCalledWith($scope.repository); + expect($scope.detailsTable.replaceRow).toHaveBeenCalledWith($scope.repository); }); it('should provide a method to determine if a repository is currently being syncd', function() { @@ -134,11 +134,11 @@ describe('Controller: RepositoryDetailsInfoController', function() { it("provides a way to sync a repository", function() { spyOn($state, 'go'); - spyOn($scope.repositoriesTable, 'replaceRow'); + spyOn($scope.detailsTable, 'replaceRow'); $scope.syncRepository($scope.repository); expect($state.go).toHaveBeenCalled(); - expect($scope.repositoriesTable.replaceRow).toHaveBeenCalledWith($scope.repository); + expect($scope.detailsTable.replaceRow).toHaveBeenCalledWith($scope.repository); }); it("should provide a valid reason for a repo deletion disablement", function() { @@ -172,12 +172,12 @@ describe('Controller: RepositoryDetailsInfoController', function() { it('should provide a way to remove a repository', function() { repository.id = 1; - spyOn($scope.repositoriesTable, 'removeRow'); + spyOn($scope.detailsTable, 'removeRow'); spyOn($scope, 'transitionTo'); $scope.removeRepository(repository); - expect($scope.repositoriesTable.removeRow).toHaveBeenCalledWith(1); + expect($scope.detailsTable.removeRow).toHaveBeenCalledWith(1); expect($scope.transitionTo).toHaveBeenCalledWith('products.details.repositories.index', {productId: 1}); }); }); diff --git a/engines/bastion_katello/test/repositories/new/new-repository.controller.test.js b/engines/bastion_katello/test/repositories/new/new-repository.controller.test.js index 421d59be103..903cc257616 100644 --- a/engines/bastion_katello/test/repositories/new/new-repository.controller.test.js +++ b/engines/bastion_katello/test/repositories/new/new-repository.controller.test.js @@ -15,7 +15,7 @@ describe('Controller: NewRepositoryController', function() { $httpBackend = $injector.get('$httpBackend'); FormUtils = $injector.get('FormUtils'); - $scope.repositoriesTable = {rows: []}; + $scope.detailsTable = {rows: []}; $scope.successMessages = []; $scope.$stateParams = {productId: 1}; $scope.repositoryForm = $injector.get('MockForm');