1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

Merge pull request #2057 from leigh-johnson/SyncFailureStateParams

Add $stateParams to filter inventories / projects with sync failures
This commit is contained in:
Akita Noek 2016-05-31 17:04:59 -04:00
commit 32b6553cea
5 changed files with 6 additions and 6 deletions

View File

@ -270,7 +270,7 @@ var tower = angular.module('Tower', [
}). }).
state('projects', { state('projects', {
url: '/projects', url: '/projects?{status}',
templateUrl: urlPrefix + 'partials/projects.html', templateUrl: urlPrefix + 'partials/projects.html',
controller: ProjectsList, controller: ProjectsList,
data: { data: {

View File

@ -22,7 +22,7 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams,
Wait('start'); Wait('start');
var list = ProjectList, var list = ProjectList,
defaultUrl = GetBasePath('projects'), defaultUrl = GetBasePath('projects') + ($stateParams.status ? '?status=' + $stateParams.status : ''),
view = GenerateList, view = GenerateList,
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
mode = (base === 'projects') ? 'edit' : 'select', mode = (base === 'projects') ? 'edit' : 'select',

View File

@ -49,7 +49,7 @@ export default
label: "Inventories", label: "Inventories",
}, },
{ {
url: "/#/inventories/?inventory_sources_with_failures", url: "/#/inventories?status=sync-failed",
number: scope.data.inventories.inventory_failed, number: scope.data.inventories.inventory_failed,
label: "Inventory Sync Failures", label: "Inventory Sync Failures",
isFailureCount: true isFailureCount: true
@ -60,7 +60,7 @@ export default
label: "Projects" label: "Projects"
}, },
{ {
url: "/#/projects/?status=failed", url: "/#/projects?status=failed",
number: scope.data.projects.failed, number: scope.data.projects.failed,
label: "Project Sync Failures", label: "Project Sync Failures",
isFailureCount: true isFailureCount: true

View File

@ -17,7 +17,7 @@ function InventoriesList($scope, $rootScope, $location, $log,
Find, Empty, $state) { Find, Empty, $state) {
var list = InventoryList, var list = InventoryList,
defaultUrl = GetBasePath('inventory'), defaultUrl = GetBasePath('inventory') + ($stateParams.status === 'sync-failed' ? '?not__inventory_sources_with_failures=0' : ''),
view = generateList, view = generateList,
paths = $location.path().replace(/^\//, '').split('/'), paths = $location.path().replace(/^\//, '').split('/'),
mode = (paths[0] === 'inventories') ? 'edit' : 'select'; mode = (paths[0] === 'inventories') ? 'edit' : 'select';

View File

@ -9,7 +9,7 @@ import InventoriesList from './inventory-list.controller';
export default { export default {
name: 'inventories', name: 'inventories',
route: '/inventories', route: '/inventories?{status}',
templateUrl: templateUrl('inventories/inventories'), templateUrl: templateUrl('inventories/inventories'),
controller: InventoriesList, controller: InventoriesList,
data: { data: {