Skip to content

Fix Devportal button text casing inconsistency#1360

Open
Perera1325 wants to merge 1 commit into
wso2:mainfrom
Perera1325:fix-devportal-button-casing
Open

Fix Devportal button text casing inconsistency#1360
Perera1325 wants to merge 1 commit into
wso2:mainfrom
Perera1325:fix-devportal-button-casing

Conversation

@Perera1325

Copy link
Copy Markdown

Fixes wso2/api-manager#3858. This PR updates the Devportal's defaultTheme.js to disable the default uppercase textTransform on MuiButton, bringing it into consistency with Publisher's title casing.

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds a Material UI theme override in the default theme configuration that disables text transformation on buttons. This allows button text to render in Title Case (as authored) instead of being automatically converted to ALL UPPERCASE by Material UI's default styling.

Changes

Button Text Transform Override

Layer / File(s) Summary
Material UI button text transform override
portals/devportal/src/main/webapp/source/src/app/data/defaultTheme.js
Adds overrides.MuiButton.root.textTransform: 'none' to the default Material UI theme, disabling automatic uppercase transformation of button text.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: disabling uppercase text transform on Devportal buttons to fix casing inconsistency.
Description check ✅ Passed The description directly relates to the changeset, referencing the specific issue (#3858) and explaining the theme configuration update.
Linked Issues check ✅ Passed The PR successfully implements the requirement from issue #3858 by disabling MuiButton's uppercase textTransform in defaultTheme.js to achieve Title Case consistency.
Out of Scope Changes check ✅ Passed The changes are limited to the single configuration update in defaultTheme.js addressing the linked issue requirement, with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
portals/devportal/src/main/webapp/source/src/app/data/defaultTheme.js (2)

410-419: ⚡ Quick win

Consider consolidating overrides at the root level for consistency.

The new overrides configuration (lines 43-49) is correctly placed at the root level of the theme object, as expected by Material-UI. However, these MuiOutlinedInput overrides are nested inside the custom property, which may not be processed by Material-UI's theme system.

For consistency and to ensure these overrides are applied, consider moving them to the root-level overrides object:

♻️ Suggested refactor to consolidate overrides
 overrides: {
     MuiButton: {
         root: {
             textTransform: 'none',
         },
     },
+    MuiOutlinedInput: {
+        root: {
+            borderColor: '`#444`',
+        },
+        notchedOutline: {
+            borderColor: '`#444`',
+        },
+    },
 },
 custom: {
     // ... rest of custom config
     showSwaggerDescriptionOnOverview: false,
-    overrides: {
-        MuiOutlinedInput: {
-            root: {
-                borderColor: '`#444`',
-            },
-            notchedOutline: {
-                borderColor: '`#444`',
-            },
-        },
-    },
 },
🤖 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 `@portals/devportal/src/main/webapp/source/src/app/data/defaultTheme.js` around
lines 410 - 419, The MuiOutlinedInput overrides currently live inside the
theme's custom property and therefore may not be applied; move the entire
MuiOutlinedInput block (the entries for root and notchedOutline with borderColor
'`#444`') from the custom object into the theme's top-level overrides object so
Material-UI can pick them up, ensuring you update any references to overrides
and keep the same property names (overrides, MuiOutlinedInput, root,
notchedOutline) when relocating.

43-49: ⚡ Quick win

Approve: MuiButton textTransform: 'none' is correctly applied app-wide

  • DefaultConfigurations.overrides.MuiButton.root.textTransform: 'none' (lines 43-49) is the correct root-level overrides shape, and DevPortal.jsx wraps the app with createTheme(adaptV4Theme(theme)) after merging in DefaultConfigurations, so this will apply across DevPortal @mui/material/Button instances.
  • The earlier mixed MUI versions concern isn’t applicable here: the portal uses @mui/material / @mui/icons-material v5, with adaptV4Theme to support the v4-style overrides config.
  • Optional: the nested custom.overrides.MuiOutlinedInput (lines ~410-419) is unlikely to be picked up by MUI since it lives under theme.custom (not root theme.overrides); move it to root overrides if you want it to take effect.
🤖 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 `@portals/devportal/src/main/webapp/source/src/app/data/defaultTheme.js` around
lines 43 - 49, The MuiButton textTransform override is correct but the nested
custom.overrides.MuiOutlinedInput will not be applied because it lives under
theme.custom; move the custom.overrides.MuiOutlinedInput block up into the root
DefaultConfigurations.overrides as overrides.MuiOutlinedInput so MUI picks it
up, keeping the existing keys/styles intact; verify DevPortal.jsx still calls
createTheme(adaptV4Theme(theme)) after merging DefaultConfigurations so the
moved overrides are applied app-wide.
🤖 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 `@portals/devportal/src/main/webapp/source/src/app/data/defaultTheme.js`:
- Around line 410-419: The MuiOutlinedInput overrides currently live inside the
theme's custom property and therefore may not be applied; move the entire
MuiOutlinedInput block (the entries for root and notchedOutline with borderColor
'`#444`') from the custom object into the theme's top-level overrides object so
Material-UI can pick them up, ensuring you update any references to overrides
and keep the same property names (overrides, MuiOutlinedInput, root,
notchedOutline) when relocating.
- Around line 43-49: The MuiButton textTransform override is correct but the
nested custom.overrides.MuiOutlinedInput will not be applied because it lives
under theme.custom; move the custom.overrides.MuiOutlinedInput block up into the
root DefaultConfigurations.overrides as overrides.MuiOutlinedInput so MUI picks
it up, keeping the existing keys/styles intact; verify DevPortal.jsx still calls
createTheme(adaptV4Theme(theme)) after merging DefaultConfigurations so the
moved overrides are applied app-wide.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ec4bb5f3-4c93-4256-a9a1-23b4838b7d46

📥 Commits

Reviewing files that changed from the base of the PR and between d19aa09 and 4379601.

📒 Files selected for processing (1)
  • portals/devportal/src/main/webapp/source/src/app/data/defaultTheme.js

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

Make Devportal button text consistent with Publisher by using Title Case

2 participants