From 9ae88acc49801d50fe45d871caf52842544587f5 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 6 Jul 2018 11:59:50 -0400 Subject: [PATCH] fix jobs list header --- .../client/features/jobs/index.controller.js | 19 +++++++++++++++++++ awx/ui/client/features/jobs/index.view.html | 2 +- .../client/features/jobs/routes/jobs.route.js | 6 ++---- .../features/templates/index.controller.js | 8 ++++---- 4 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 awx/ui/client/features/jobs/index.controller.js diff --git a/awx/ui/client/features/jobs/index.controller.js b/awx/ui/client/features/jobs/index.controller.js new file mode 100644 index 0000000000..3cdf3026cb --- /dev/null +++ b/awx/ui/client/features/jobs/index.controller.js @@ -0,0 +1,19 @@ +function IndexJobsController ($scope, strings, dataset) { + const vm = this; + vm.strings = strings; + vm.count = dataset.data.count; + + $scope.$on('updateDataset', (e, { count }) => { + if (count) { + vm.count = count; + } + }); +} + +IndexJobsController.$inject = [ + '$scope', + 'JobsStrings', + 'Dataset' +]; + +export default IndexJobsController; diff --git a/awx/ui/client/features/jobs/index.view.html b/awx/ui/client/features/jobs/index.view.html index 9e3709790d..a1fa58df9e 100644 --- a/awx/ui/client/features/jobs/index.view.html +++ b/awx/ui/client/features/jobs/index.view.html @@ -3,7 +3,7 @@
- +
diff --git a/awx/ui/client/features/jobs/routes/jobs.route.js b/awx/ui/client/features/jobs/routes/jobs.route.js index e2adf9af09..28ee828370 100644 --- a/awx/ui/client/features/jobs/routes/jobs.route.js +++ b/awx/ui/client/features/jobs/routes/jobs.route.js @@ -1,5 +1,6 @@ import { N_ } from '../../../src/i18n'; import jobsListController from '../jobsList.controller'; +import indexController from '../index.controller'; const indexTemplate = require('~features/jobs/index.view.html'); const jobsListTemplate = require('~features/jobs/jobsList.view.html'); @@ -59,10 +60,7 @@ export default { views: { '@': { templateUrl: indexTemplate, - controller: ['JobsStrings', (strings) => { - const vm = this || {}; - vm.strings = strings; - }], + controller: indexController, controllerAs: 'vm' }, 'jobsList@jobs': { diff --git a/awx/ui/client/features/templates/index.controller.js b/awx/ui/client/features/templates/index.controller.js index c859255070..06723a6ed5 100644 --- a/awx/ui/client/features/templates/index.controller.js +++ b/awx/ui/client/features/templates/index.controller.js @@ -1,12 +1,12 @@ function IndexTemplatesController ($scope, strings, dataset) { - let vm = this; + const vm = this; vm.strings = strings; vm.count = dataset.data.count; $scope.$on('updateDataset', (e, { count }) => { - if (count) { - vm.count = count; - } + if (count) { + vm.count = count; + } }); }