Skip to content

Show the remove-duplicate button to non-admins as disabled - #5503

Merged
ViniciustCosta merged 3 commits into
google:masterfrom
atty57:fix-5452-remove-duplicate-button-visibility
Sep 30, 2026
Merged

ViniciustCosta merged 3 commits into
google:masterfrom
atty57:fix-5452-remove-duplicate-button-visibility

Conversation

@atty57

@atty57 atty57 commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

The "remove duplicate status" button in the testcase detail page is wrapped in a dom-if on info.is_admin, so non-admins see nothing at all and cannot tell the functionality exists (#5452).

This renders the button unconditionally and disables it for non-admins instead, using the disabled$ idiom already used elsewhere in the components. The tooltip moves onto a wrapping span so it describes the action as admin-only for admins and non-admins alike: paper-icon-button sets pointer-events: none while disabled, so a title on the button itself would never surface for non-admins, who are exactly the readers the text is for.

Server-side authorization is unchanged: remove_duplicate.Handler.post still requires check_admin_access.

This covers the first two points of the issue. Whether removing a false dedup should be an admin-only action at all is a product decision and is left for maintainers.

Verified by running butler.py run_server locally and confirming polymer_bundler regenerates src/appengine/templates/testcase-detail.html with the new markup.

Addresses #5452.

The button that removes a testcase's duplicate status was wrapped in a
dom-if on info.is_admin, so non-admins saw nothing at all and had no way
to tell the functionality existed.

Render it unconditionally and disable it for non-admins instead, using the
existing disabled$ idiom. The tooltip moves onto a wrapping span so it
describes the action as admin-only for admins and non-admins alike:
paper-icon-button sets pointer-events: none while disabled, so a title on
the button itself would never surface for the readers who most need it.

Server-side enforcement is unchanged; remove_duplicate.Handler.post still
requires check_admin_access.

Addresses google#5452.
@atty57
atty57 requested a review from a team as a code owner September 28, 2026 17:06
@dylanjew

Copy link
Copy Markdown
Collaborator

/gcbrun

@dylanjew dylanjew left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, appreciate you picking this up! I pushed this to our dev environment and confirmed the button is disabled but still shows up for non-admins.

LGTM, but want to get approval from the core GOSST team.

@dylanjew

Copy link
Copy Markdown
Collaborator
Image

Verified the tooltip shows up correctly

@dylanjew
dylanjew requested a review from a team September 29, 2026 20:13
@dylanjew dylanjew added the ready for GOSST review Pull requests ready for GOSST team review label Sep 29, 2026
@atty57

atty57 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author
Image

Verified the tooltip shows up correctly

Looks as expected

@ViniciustCosta

Copy link
Copy Markdown
Collaborator

/gcbrun

@ViniciustCosta ViniciustCosta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@ViniciustCosta
ViniciustCosta merged commit bb53694 into google:master Sep 30, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for GOSST review Pull requests ready for GOSST team review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants