Change tag history revert operation to apply to the *current* entry, rather than the "next"

Before this change, the restore operation next to a history entry would bring the tag back to the state *at that entry*, rather than *before that entry*, which is neither the expected behavior, nor allowed for an immediate restore when moving a tag. This fixes the problem.

Fixes https://jira.coreos.com/browse/QS-100
This commit is contained in:
Joseph Schorr 2017-12-20 16:23:17 -05:00
parent b4df9fb805
commit d95a9e3c59

View file

@ -16,7 +16,7 @@
<td class="icon-col"></td>
<td class="history-col">Tag Change</td>
<td class="datetime-col hidden-sm hidden-xs">Date/Time</td>
<td class="revert-col hidden-sm hidden-xs"><span ng-if="repository.can_write">Restore</span></td>
<td class="revert-col hidden-sm hidden-xs"><span ng-if="repository.can_write">Revert</span></td>
</thead>
<tbody>
<tr style="height: 20px;"><td colspan="4"></td></tr>
@ -85,31 +85,19 @@
<td class="revert-col hidden-xs hidden-sm">
<div ng-if="!entry.date_break && repository.can_write" class="history-revert">
<span ng-switch on="entry.action">
<a ng-switch-when="create" ng-click="askRestoreTag(entry, true)" ng-if="!isCurrent(entry)">
Restore <span class="tag-span"><span>{{ entry.tag_name }}</span></span> to
<span class="image-link" repository="repository"
image-id="entry.docker_image_id"
manifest-digest="entry.manifest_digest"></span>
</a>
<a ng-switch-when="recreate" ng-click="askRestoreTag(entry, true)" ng-if="!isCurrent(entry)">
Restore <span class="tag-span"><span>{{ entry.tag_name }}</span></span> to
<span class="image-link" repository="repository"
image-id="entry.docker_image_id"
manifest-digest="entry.manifest_digest"></span>
</a>
<a ng-switch-when="delete" ng-click="askRestoreTag(entry, true)">
Restore <span class="tag-span"><span>{{ entry.tag_name }}</span></span> to
<span class="image-link" repository="repository"
image-id="entry.docker_image_id"
manifest-digest="entry.manifest_digest"></span>
</a>
<a ng-switch-when="move" ng-click="askRestoreTag(entry, false)" ng-if="!isCurrent(entry)">
Restore <span class="tag-span" data-title="{{ entry.tag_name }}" bs-tooltip><span>{{ entry.tag_name }}</span></span> to
<a ng-switch-when="move" ng-click="askRestoreTag(entry, false)">
Revert <span class="tag-span" data-title="{{ entry.tag_name }}" bs-tooltip><span>{{ entry.tag_name }}</span></span> to
<span class="image-link" repository="repository"
image-id="entry.old_docker_image_id"
manifest-digest="entry.old_manifest_digest"></span>
</a>
<a ng-switch-when="revert" ng-click="askRestoreTag(entry, false)" ng-if="!isCurrent(entry)">
<a ng-switch-when="revert" ng-click="askRestoreTag(entry, false)">
Restore <span class="tag-span" data-title="{{ entry.tag_name }}" bs-tooltip><span>{{ entry.tag_name }}</span></span> to
<span class="image-link" repository="repository"
image-id="entry.old_docker_image_id"