mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Update name/description whenever the activities array changes
This commit is contained in:
@@ -283,18 +283,29 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
scope.activities.forEach(function(activity, i) {
|
if(scope.activities && scope.activities.length > 0) {
|
||||||
// build activity.user
|
buildUserAndDescription();
|
||||||
if (scope.activities[i].summary_fields.actor) {
|
}
|
||||||
scope.activities[i].user = "<a href=\"/#/users/" + scope.activities[i].summary_fields.actor.id + "\">" +
|
|
||||||
scope.activities[i].summary_fields.actor.username + "</a>";
|
|
||||||
} else {
|
|
||||||
scope.activities[i].user = 'system';
|
|
||||||
}
|
|
||||||
// build description column / action text
|
|
||||||
BuildDescription(scope.activities[i]);
|
|
||||||
|
|
||||||
|
scope.$watch('activities', function(){
|
||||||
|
// Watch for future update to scope.activities (like page change, column sort, search, etc)
|
||||||
|
buildUserAndDescription();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function buildUserAndDescription(){
|
||||||
|
scope.activities.forEach(function(activity, i) {
|
||||||
|
// build activity.user
|
||||||
|
if (scope.activities[i].summary_fields.actor) {
|
||||||
|
scope.activities[i].user = "<a href=\"/#/users/" + scope.activities[i].summary_fields.actor.id + "\">" +
|
||||||
|
scope.activities[i].summary_fields.actor.username + "</a>";
|
||||||
|
} else {
|
||||||
|
scope.activities[i].user = 'system';
|
||||||
|
}
|
||||||
|
// build description column / action text
|
||||||
|
BuildDescription(scope.activities[i]);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user