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

Swap out regex on related for IDs in summary_fields

This commit is contained in:
Michael Abashian 2016-02-26 11:58:53 -05:00
parent fc16473c03
commit 6870a5d60c
2 changed files with 4 additions and 4 deletions

View File

@ -204,12 +204,12 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams,
$scope.removeGoToJobDetails();
}
$scope.removeGoToJobDetails = $scope.$on('GoToJobDetails', function(e, data) {
if (data.related.current_update || data.related.last_update) {
if (data.summary_fields.current_update || data.summary_fields.last_update) {
Wait('start');
// Pull the id out of the URL
var id = (data.related.current_update) ? data.related.current_update.replace(/^\//, '').split('/')[3] : data.related.last_update.replace(/^\//, '').split('/')[3];
// Grab the id from summary_fields
var id = (data.summary_fields.current_update) ? data.summary_fields.current_update.id : data.summary_fields.last_update.id;
$state.go('scmUpdateStdout', {id: id});

View File

@ -79,7 +79,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
scope.removeSourceReady = scope.$on('SourceReady', function(e, source) {
// Pull the ID out of related.current_update / related.last_update
var update_id = (source.current_update) ? source.related.current_update.replace(/^\//, '').split('/')[3] : source.related.last_update.replace(/^\//, '').split('/')[3];
var update_id = (source.current_update) ? source.summary_fields.current_update.id : source.summary_fields.last_update.id;
$state.go('inventorySyncStdout', {id: update_id});