Skip to content

Fix auth controls for multi-spec API pages#386

Merged
half-ogre merged 1 commit intomainfrom
half-ogre/fix-multi-api
Mar 27, 2026
Merged

Fix auth controls for multi-spec API pages#386
half-ogre merged 1 commit intomainfrom
half-ogre/fix-multi-api

Conversation

@half-ogre
Copy link
Copy Markdown
Collaborator

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Bug fix.

This PR:

  • Fixes the API page auth dropdown and cookie status badge not working after the multi-spec changes in v1.11.0
  • The v1.11.0 template added {{@index}} suffixes to auth element IDs (e.g. api-auth-type-0) but api.js still referenced the unsuffixed IDs via getElementById
  • Switches api.js to use class selectors (querySelector) instead of ID lookups, which works for both single and multi-spec configurations

@half-ogre half-ogre requested a review from jaredwray March 27, 2026 17:48
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.95%. Comparing base (78af1af) to head (98d71db).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #386   +/-   ##
=======================================
  Coverage   99.95%   99.95%           
=======================================
  Files          16       16           
  Lines        2364     2364           
  Branches      696      696           
=======================================
  Hits         2363     2363           
  Partials        1        1           

☔ 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

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the authentication logic in templates/modern/js/api.js by replacing ID-based element selection with class-based selectors. This modification ensures compatibility with multi-spec environments where element IDs are dynamically indexed. I have no feedback to provide.

@half-ogre half-ogre merged commit 9cd10f0 into main Mar 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant