Merge pull request #1065 from mabashian/summary-fields-id

Summary fields
This commit is contained in:
Michael Abashian 2016-02-26 13:28:02 -05:00
commit 479f106820
2 changed files with 5 additions and 5 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

@ -78,8 +78,8 @@ 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];
// Get the ID from the correct summary field
var update_id = (source.current_update) ? source.summary_fields.current_update.id : source.summary_fields.last_update.id;
$state.go('inventorySyncStdout', {id: update_id});