Add ShowEditMode parameter to ControlPanel to allow hiding the Edit Mode toggle button #4895
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.
Fix #4883 [ENH] Oqtane ControlPanel component forces edit button unto page
This enhancement addresses issue #4883 by introducing a ShowEditMode parameter to the ControlPanel component. This allows theme developers to hide the Edit Mode toggle button when desired.
Changes Made
• Added a new
ShowEditMode
parameter toControlPanel.razor
with a default value oftrue
to maintain existing behavior.• Updated the
ControlPanel
logic to conditionally display the Edit Mode toggle button based on theShowEditMode
value.Testing Performed
Extensive testing was conducted to ensure this change works as intended across various scenarios.
Default Themes
Default
themes of Oqtane and Blazor.Modified Themes with
ShowEditMode="false"
DefaultHideEditToggle.razor
for both Oqtane and Blazor themes.Conclusion
The addition of the
ShowEditMode
parameter provides theme developers with the flexibility to hide the Edit Mode toggle button when necessary. The default behavior remains unchanged for existing themes, ensuring backward compatibility.Note: All tests confirm that the enhancement functions correctly without affecting current Oqtane behavior in default themes.