Skip to content

Disable Remove button when gem has only one confirmed owner#6384

Open
tmchow wants to merge 2 commits intorubygems:masterfrom
tmchow:osc/5666-hide-remove-sole-owner
Open

Disable Remove button when gem has only one confirmed owner#6384
tmchow wants to merge 2 commits intorubygems:masterfrom
tmchow:osc/5666-hide-remove-sole-owner

Conversation

@tmchow
Copy link
Copy Markdown

@tmchow tmchow commented Apr 3, 2026

The Remove button on the owners page is clickable even when the gem has only one owner. Clicking it silently fails (server rejects but no error shown to user).

Disables the button via disabled: @ownerships.select(&:confirmed?).count <= 1 so it's visually inactive when removing the owner would leave the gem with zero owners.

This contribution was developed with AI assistance (Claude Code).

Fixes #5666

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.49%. Comparing base (5c01c81) to head (f960fb0).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6384      +/-   ##
==========================================
- Coverage   97.08%   94.49%   -2.59%     
==========================================
  Files         489      489              
  Lines       10392    10451      +59     
==========================================
- Hits        10089     9876     -213     
- Misses        303      575     +272     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@jenshenny jenshenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! There looks to be some system tests that need to be adjusted, but other than that, this looks good to me.

tmchow added 2 commits April 7, 2026 16:55
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 rubygems#5666
Replace the test that clicked Remove on the sole owner (which now
fails because the button is disabled). The new tests verify:
- Button is disabled when only one confirmed owner exists
- Button is enabled when multiple confirmed owners exist
@tmchow tmchow force-pushed the osc/5666-hide-remove-sole-owner branch from f960fb0 to 59d8b6e Compare April 7, 2026 23:55
@tmchow
Copy link
Copy Markdown
Author

tmchow commented Apr 8, 2026

Thanks! There looks to be some system tests that need to be adjusted, but other than that, this looks good to me.

Done!

@colby-swandale
Copy link
Copy Markdown
Member

👋 I appreciate the contribution! Just a heads up, #5709 is attempting to solve this same issue and will most likely be the PR we merge to resolve #5666.

@tmchow
Copy link
Copy Markdown
Author

tmchow commented Apr 8, 2026

👋 I appreciate the contribution! Just a heads up, #5709 is attempting to solve this same issue and will most likely be the PR we merge to resolve #5666.

no problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

The delete remove button on the list of owners should not be active only there is one owner

3 participants