engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.controller.js in katello-2.2.2 vs engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.controller.js in katello-2.4.0.rc1
- old
+ new
@@ -1,19 +1,6 @@
/**
- * Copyright 2014 Red Hat, Inc.
- *
- * This software is licensed to you under the GNU General Public
- * License as published by the Free Software Foundation; either version
- * 2 of the License (GPLv2) or (at your option) any later version.
- * There is NO WARRANTY for this software, express or implied,
- * including the implied warranties of MERCHANTABILITY,
- * NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
- * have received a copy of GPLv2 along with this software; if not, see
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-*/
-
-/**
* @ngdoc object
* @name Bastion.errata.controller:ErrataController
*
* @requires $scope
* @requires $location
@@ -30,22 +17,26 @@
*/
angular.module('Bastion.errata').controller('ErrataController',
['$scope', '$location', 'translate', 'Nutupane', 'Erratum', 'Task', 'Repository', 'CurrentOrganization',
function ($scope, $location, translate, Nutupane, Erratum, Task, Repository, CurrentOrganization) {
var nutupane, params = {
- 'organization_id': CurrentOrganization,
- 'search': $location.search().search || "",
- 'sort_by': 'updated',
- 'sort_order': 'DESC',
- 'paged': true,
+ 'organization_id': CurrentOrganization,
+ 'search': $location.search().search || "",
+ 'sort_by': 'updated',
+ 'sort_order': 'DESC',
+ 'paged': true,
'errata_restrict_applicable': true
};
nutupane = $scope.nutupane = new Nutupane(Erratum, params);
$scope.table = nutupane.table;
$scope.removeRow = nutupane.removeRow;
+ Erratum.queryPaged({'organization_id': CurrentOrganization}, function (result) {
+ $scope.errataCount = result.total;
+ });
+
$scope.table.closeItem = function () {
$scope.transitionTo('errata.index');
};
$scope.repository = {name: translate('All Repositories'), id: 'all'};
@@ -56,11 +47,11 @@
taskSearchParams = {
'type': 'all',
"resource_type": "Organization",
"resource_id": CurrentOrganization,
"action_types": "Actions::Katello::ContentView::IncrementalUpdates",
- "active_only" : true
+ "active_only": true
};
taskSearchComplete = function (results) {
$scope.incrementalUpdates = results;
$scope.incrementalUpdateInProgress = results.length > 0;
@@ -82,29 +73,29 @@
});
$scope.showApplicable = true;
$scope.showInstallable = false;
- $scope.toggleApplicable = function () {
- nutupane.table.params['errata_restrict_applicable'] = $scope.showApplicable;
- nutupane.refresh();
- };
+ $scope.toggleFilters = function () {
+ if ($scope.showInstallable === true) {
+ $scope.showApplicable = true;
+ }
- $scope.toggleInstallable = function () {
+ nutupane.table.params['errata_restrict_applicable'] = $scope.showApplicable;
nutupane.table.params['errata_restrict_installable'] = $scope.showInstallable;
nutupane.refresh();
};
$scope.$watch('repository', function (repository) {
- var params = nutupane.getParams();
+ var nutupaneParams = nutupane.getParams();
if (repository.id === 'all') {
- params['repository_id'] = null;
- nutupane.setParams(params);
+ nutupaneParams['repository_id'] = null;
+ nutupane.setParams(nutupaneParams);
} else {
$location.search('repositoryId', repository.id);
- params['repository_id'] = repository.id;
- nutupane.setParams(params);
+ nutupaneParams['repository_id'] = repository.id;
+ nutupane.setParams(nutupaneParams);
}
if (!nutupane.table.initialLoad) {
nutupane.refresh();
}