Skip to content

Commit f960fb0

Browse files
committed
Disable Remove button when gem has only one confirmed owner
The Remove button on the owners page was clickable even when the gem had only one owner. The server rejected the request silently. Now the button is disabled when there's only one confirmed ownership, preventing the confusing no-op. Fixes #5666
1 parent 5c01c81 commit f960fb0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/views/owners/_owners_table.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<%= button_to t("remove"),
5858
rubygem_owner_path(@rubygem.slug, ownership.user.display_id),
5959
method: "delete",
60+
disabled: @ownerships.select(&:confirmed?).count <= 1,
6061
data: { confirm: t("owners.index.confirm_remove") },
6162
class: "form__submit form__submit--small" %>
6263
<% end %>

0 commit comments

Comments
 (0)