fix $stateParams coming from dashboard -> inventory/project w/ sync failures, resolves #1792

This commit is contained in:
Leigh Johnson
2016-05-26 01:44:05 -04:00
parent bef61f4003
commit 6b0e0de041
5 changed files with 6 additions and 7 deletions

View File

@@ -269,7 +269,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,8 +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',
url = (base === 'teams') ? GetBasePath('teams') + $stateParams.team_id + '/projects/' : defaultUrl, url = (base === 'teams') ? GetBasePath('teams') + $stateParams.team_id + '/projects/' : defaultUrl,

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