UI Improvements for Read-Only User Experience in Publisher Portal #1168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


Overview
This PR implements 8 UI/UX improvements to enhance the read-only user experience in the WSO2 API Manager Publisher portal. Read-only users (with
internal/observerrole) should have a clear, consistent experience where all editing capabilities are properly disabled with appropriate visual feedback.Problem Statement
Read-only users with scopes
apim:api_viewandapim:publisher_settingsencountered several UX issues:Changes Implemented
1. Deployments Page
File:
DeploymentOnbording.jsxDisabled the "Add a description" buttons for revision deployment by adding
disabled={isCreateOrPublishRestricted()}prop, preventing read-only users from attempting to add descriptions.2. Basic Info - Labels Section
File:
DesignConfigurations.jsxDisabled the "Attach Labels" IconButton with
disabled={isAccessRestricted()}, preventing read-only users from opening the label selection dialog.3. Runtime Configurations - Audience Validation
File:
Audience.jsxisRestrictedfrom AuthManagerdisabled={isAccessRestricted()}to both the Audience Validation Switch and the Allowed Audience ChipInput4. MCP Tools - Delete Button
File:
Tools.jsxChanged
disableDelete={false}todisableDelete={disableUpdate}to ensure the delete button respects the same read-only restrictions as other editing operations.5. Tryout Console - API Key Generation
File:
TryOutConsole.jsxisRestrictedfrom AuthManager6. Scopes Page - Edit Button Feedback
File:
Scopes.jsx<span>to ensure tooltip works with disabled button7. Global Policy Page
File:
Listing.tsxNo changes required - existing implementation already shows appropriate onboarding message: "Please contact a privileged user to create a global policy" when users lack
apim:gateway_policy_managepermission.8. API Policies - Drag and Drop
Files:
DraggablePolicyCard.tsx,PolicyList.tsx,TabPanel.tsx(both API-specific and shared)isReadOnlyprop to DraggablePolicyCard interfacecanDrag: !isReadOnlyin the useDrag hook configuration'default'instead of'move'for read-only usersisReadOnlyprop through component hierarchy (PolicyList → TabPanel → TabPanelShared → DraggablePolicyCard)Technical Approach
AuthManager.isRestricted()method with appropriate scopesTesting Recommendations
Internal/observerroleFiles Changed
Fixes #[issue_number]
Original prompt
Fixes wso2/api-manager#4278
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.