Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ShowEditMode parameter to ControlPanel to allow hiding the Edit Mode toggle button #4895

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

tvatavuk
Copy link
Contributor

@tvatavuk tvatavuk commented Dec 4, 2024

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 to ControlPanel.razor with a default value of true to maintain existing behavior.
• Updated the ControlPanel logic to conditionally display the Edit Mode toggle button based on the ShowEditMode value.

Testing Performed

Extensive testing was conducted to ensure this change works as intended across various scenarios.

Default Themes

  • Themes Tested: Default themes of Oqtane and Blazor.
  • Users: Anonymous and Admin.
  • Render Combinations:
    • Static, Server
    • Static, Client
    • Static, Auto
    • Interactive, Server
    • Interactive, Client
    • Interactive, Auto
  • Results:
    • Anonymous Users: Edit Mode toggle button is not visible (as expected).
    • Admin Users: Edit Mode toggle button is visible (current behavior preserved).

Modified Themes with ShowEditMode="false"

  • Created new theme variations named DefaultHideEditToggle.razor for both Oqtane and Blazor themes.
  • Modification:
      <ControlPanel LanguageDropdownAlignment="right" ShowEditMode="false" />
  • Users: Anonymous and Admin.
  • Render Combinations: Same as above.
  • Results:
    • All Users: Edit Mode toggle button is not visible.
    • Confirmation: Enhancement allows hiding the Edit Mode toggle as intended.

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.

@iJungleboy
Copy link
Contributor

@sbwalker would be great if this could make it into 6.0.1 ;)

@sbwalker sbwalker merged commit 2c721ad into oqtane:dev Dec 4, 2024
1 check 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.

[ENH] Oqtane ControlPanel component forces edit button unto page
3 participants