Skip to content

Allow any Font Awesome style for the OAuth2 button icon (#7641)#10036

Open
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:fix-7641-oauth-icon-style
Open

Allow any Font Awesome style for the OAuth2 button icon (#7641)#10036
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:fix-7641-oauth-icon-style

Conversation

@dpage

@dpage dpage commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #7641.

The login page hardcoded the fab (brands) Font Awesome style for the OAuth2 button icon (<Icon className={'fab '+oauth.OAUTH2_ICON} ...>), so administrators couldn't use non-brand icons (e.g. a generic fas fa-key for a custom provider).

Now the configured OAUTH2_ICON is used as-is when it already includes a style class, and falls back to fab when only an icon name is given — preserving existing configurations.

Changes

  • LoginPage.jsx: derive the icon class from OAUTH2_ICON, defaulting to fab only when no style is present.
  • oauth2.rst: document that a style class can be included.
  • Added release note (9.16).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • OAuth2 login button icon now supports additional Font Awesome icon styles beyond brand icons (e.g., fas fa-key).
  • Documentation

    • Updated OAuth2 icon documentation with clarified guidance on Font Awesome icon formatting.
    • Published version 9.16 release notes.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@dpage, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 7 minutes and 29 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bd66c8cd-8a0e-4e30-84c6-8756bb1fd823

📥 Commits

Reviewing files that changed from the base of the PR and between 9052489 and 0616849.

📒 Files selected for processing (3)
  • docs/en_US/oauth2.rst
  • docs/en_US/release_notes_9_16.rst
  • web/pgadmin/static/js/SecurityPages/LoginPage.jsx

Walkthrough

This PR enables Font Awesome icon style flexibility for OAuth2 login buttons. The LoginPage.jsx component now detects whether the configured OAUTH2_ICON already includes a style prefix and uses it directly; otherwise, it prepends the default fab brand style for backward compatibility. Parameter documentation and release notes are updated accordingly.

Changes

OAuth2 Icon Style Support

Layer / File(s) Summary
OAuth2 icon style detection
web/pgadmin/static/js/SecurityPages/LoginPage.jsx
Icon rendering logic checks for known Font Awesome style tokens (fab, fas, far, fal, fad) in the configured OAUTH2_ICON value. If a style prefix is present, the icon class is used as-is; otherwise, fab is prepended for backward compatibility.
Documentation and release notes
docs/en_US/oauth2.rst, docs/en_US/release_notes.rst, docs/en_US/release_notes_9_16.rst
Updated OAUTH2_ICON parameter description to document Font Awesome brand icon defaults and the ability to explicitly include style classes for other styles. Added version 9.16 release notes entry for Issue #7641 and registered the release notes file in the documentation toctree.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enabling Font Awesome styles beyond the hardcoded 'fab' for OAuth2 button icons.
Linked Issues check ✅ Passed The PR directly addresses issue #7641 by modifying LoginPage.jsx to detect and preserve Font Awesome style prefixes in configured icon values, enabling non-brand icons as requested.
Out of Scope Changes check ✅ Passed All changes are scoped to the issue: LoginPage.jsx icon logic, oauth2.rst documentation clarity, and release notes for version 9.16.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
web/pgadmin/static/js/SecurityPages/LoginPage.jsx (1)

52-53: 💤 Low value

Consider adding Font Awesome 6 Sharp family styles for completeness.

The iconStyles array covers standard Font Awesome 6 styles but omits the Sharp family variants: fa-sharp-solid, fa-sharp-regular, fa-sharp-light, and fa-sharp-thin. While these are premium/less common styles, adding them would make the detection more comprehensive for users with Font Awesome Pro licenses.

✨ Optional enhancement for Sharp styles
 const iconStyles = ['fab', 'fas', 'far', 'fal', 'fat', 'fad',
-  'fa-brands', 'fa-solid', 'fa-regular', 'fa-light', 'fa-thin', 'fa-duotone'];
+  'fa-brands', 'fa-solid', 'fa-regular', 'fa-light', 'fa-thin', 'fa-duotone',
+  'fa-sharp-solid', 'fa-sharp-regular', 'fa-sharp-light', 'fa-sharp-thin'];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/pgadmin/static/js/SecurityPages/LoginPage.jsx` around lines 52 - 53, The
iconStyles array in LoginPage.jsx (variable name iconStyles) misses Font Awesome
6 Sharp family variants; update the array to include the sharp prefixes (e.g.,
'fa-sharp-solid', 'fa-sharp-regular', 'fa-sharp-light', 'fa-sharp-thin') so
detection covers Sharp styles as well — locate the iconStyles definition and
append these four strings to the list.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@web/pgadmin/static/js/SecurityPages/LoginPage.jsx`:
- Around line 52-53: The iconStyles array in LoginPage.jsx (variable name
iconStyles) misses Font Awesome 6 Sharp family variants; update the array to
include the sharp prefixes (e.g., 'fa-sharp-solid', 'fa-sharp-regular',
'fa-sharp-light', 'fa-sharp-thin') so detection covers Sharp styles as well —
locate the iconStyles definition and append these four strings to the list.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a2b504fc-fc64-42e2-89d2-82107965ee96

📥 Commits

Reviewing files that changed from the base of the PR and between 937d34e and 9052489.

📒 Files selected for processing (4)
  • docs/en_US/oauth2.rst
  • docs/en_US/release_notes.rst
  • docs/en_US/release_notes_9_16.rst
  • web/pgadmin/static/js/SecurityPages/LoginPage.jsx

@dpage dpage force-pushed the fix-7641-oauth-icon-style branch 2 times, most recently from 7d41944 to f4513a2 Compare June 9, 2026 11:36
…7641

The login page hardcoded the 'fab' (brands) Font Awesome style for the
OAuth2 button icon, so non-brand icons could not be used. Use the
configured OAUTH2_ICON as-is when it already specifies a style class
(e.g. 'fas fa-key'), and fall back to 'fab' when only an icon name is
given, preserving backward compatibility.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dpage dpage force-pushed the fix-7641-oauth-icon-style branch from f4513a2 to 0616849 Compare June 9, 2026 11:37
@asheshv asheshv requested a review from Copilot June 10, 2026 14:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes pgAdmin’s OAuth2 login button icon rendering to support any Font Awesome style class (not just fab), while preserving backward compatibility for existing configurations that only provide an icon name.

Changes:

  • Update LoginPage.jsx to use OAUTH2_ICON as-is when it already includes a Font Awesome style class; otherwise default to fab.
  • Clarify OAuth2 documentation to note that OAUTH2_ICON may include an explicit style class (e.g. fas fa-key).
  • Add a 9.16 release note entry referencing Issue #7641.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
web/pgadmin/static/js/SecurityPages/LoginPage.jsx Implements style-aware OAUTH2_ICON handling with a backward-compatible fab fallback.
docs/en_US/oauth2.rst Documents that OAUTH2_ICON may include a style class to select non-brand icons.
docs/en_US/release_notes_9_16.rst Adds a release note entry for Issue #7641 describing the enhancement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +52 to +55
const iconStyles = ['fab', 'fas', 'far', 'fal', 'fat', 'fad',
'fa-brands', 'fa-solid', 'fa-regular', 'fa-light', 'fa-thin', 'fa-duotone'];
const hasStyle = oauth.OAUTH2_ICON?.split(/\s+/).some((c)=>iconStyles.includes(c));
const iconClassName = hasStyle ? oauth.OAUTH2_ICON : 'fab '+oauth.OAUTH2_ICON;
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.

Limitation in personalization of oauth icon

2 participants