diff --git a/static/js/directives/ui/repo-tag-history.js b/static/js/directives/ui/repo-tag-history.js index c6ba6120d..0fbffab5b 100644 --- a/static/js/directives/ui/repo-tag-history.js +++ b/static/js/directives/ui/repo-tag-history.js @@ -17,6 +17,9 @@ angular.module('quay').directive('repoTagHistory', function () { $scope.tagHistoryData = null; $scope.tagHistoryLeaves = {}; + // A delete followed by a create of a tag within this threshold is considered a move. + var MOVE_THRESHOLD = 2; + var loadTimeline = function() { if (!$scope.repository || !$scope.isEnabled) { return; } @@ -68,11 +71,11 @@ angular.module('quay').directive('repoTagHistory', function () { // If the tag has an end time, it was either deleted or moved. if (tag.end_ts) { - // If a future entry exists with a start time equal to the end time for this tag, + // If a future entry exists with a start time "equal" to the end time for this tag, // then the action was a move, rather than a delete and a create. var currentEntries = tagEntries[tagName]; var futureEntry = currentEntries.length > 0 ? currentEntries[currentEntries.length - 1] : {}; - if (futureEntry.start_ts == tag.end_ts) { + if (tag.end_ts - futureEntry.start_ts <= MOVE_THRESHOLD) { removeEntry(futureEntry); addEntry(futureEntry.reversion ? 'revert': 'move', tag.end_ts, futureEntry.docker_image_id, dockerImageId);