fix jobs list header

This commit is contained in:
John Mitchell 2018-07-06 11:59:50 -04:00
parent b445e66ffa
commit 9ae88acc49
No known key found for this signature in database
GPG Key ID: FE6A9B5BD4EB5C94
4 changed files with 26 additions and 9 deletions

View File

@ -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;

View File

@ -3,7 +3,7 @@
<at-panel ng-cloak id="htmlTemplate">
<div>
<div ng-hide="$state.includes('schedules')">
<at-panel-heading title="{{:: vm.strings.get('list.PANEL_TITLE') }}" hide-dismiss="true">
<at-panel-heading title="{{:: vm.strings.get('list.PANEL_TITLE') }}" hide-dismiss="true" badge="{{ vm.count }}">
</at-panel-heading>
<div ui-view="jobsList"></div>
</div>

View File

@ -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': {

View File

@ -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;
}
});
}