Skip to content

fix: cleanup wiki settings#613

Merged
NagariaHussain merged 5 commits intofrappe:developfrom
NagariaHussain:refactor/cleanup-wiki-settings
Apr 28, 2026
Merged

fix: cleanup wiki settings#613
NagariaHussain merged 5 commits intofrappe:developfrom
NagariaHussain:refactor/cleanup-wiki-settings

Conversation

@NagariaHussain
Copy link
Copy Markdown
Collaborator

@NagariaHussain NagariaHussain commented Apr 28, 2026

Cleanup + Closes #612

Drops legacy theme/logo, navbar, app switcher, search, and guest-access
fields from Wiki Settings, along with the associated cache-clearing
on_update hook and clear_wiki_page_cache endpoint. Adds auto-generated
type hints for the remaining fields.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Walkthrough

The Wiki Settings DocType is simplified by removing UI configuration fields from the schema, including logo settings, theme options, search configuration, navbar settings, sidebar collapsing, app switcher list, and guest access controls. The corresponding field definitions and ordering entries are deleted from the schema file. The Python implementation removes the on_update hook and associated cache invalidation functions (clear_wiki_page_cache() and _clear_wiki_page_cache()), while retaining the whitelisted get_all_spaces() function. A TYPE_CHECKING typing block is introduced to define document field types.

🚥 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
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: cleanup wiki settings' is related to the changeset but lacks specificity about what was cleaned up; it should highlight the main changes like removing legacy fields and cache logic.

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

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@wiki/wiki/doctype/wiki_settings/wiki_settings.py`:
- Around line 27-28: The frontend still calls the removed whitelisted method
clear_wiki_page_cache which breaks the "Clear Wiki Page Cache" button; either
restore a compatibility endpoint by re-adding a whitelisted function
clear_wiki_page_cache in the wiki_settings module that performs the cache clear
(and logs/returns success) or update the frontend code that invokes
clear_wiki_page_cache to call the new API/utility (or remove the button). Locate
the caller in the frontend (wiki_settings.js) and either remove/update that
button handler or implement a server-side function named clear_wiki_page_cache
(whitelisted) that delegates to the existing cache-clear logic (e.g., reuse
get_all_spaces or the underlying cache utilities) so the UI no longer errors.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c85fffb7-4a78-4f48-b0aa-075eb922ff09

📥 Commits

Reviewing files that changed from the base of the PR and between 1cff8f8 and 2222a58.

📒 Files selected for processing (2)
  • wiki/wiki/doctype/wiki_settings/wiki_settings.json
  • wiki/wiki/doctype/wiki_settings/wiki_settings.py

Comment thread wiki/wiki/doctype/wiki_settings/wiki_settings.py
NagariaHussain and others added 4 commits April 28, 2026 17:36
Gates the TOC headings list in get_web_context on the
Wiki Settings.enable_table_of_contents flag. The existing template and
SPA navigation already collapse the TOC aside on an empty list, so no
template or JS changes are needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reads head_html from the Wiki Settings single via frappe.get_cached_value
and renders it inside <head> on every wiki page, allowing admins to add
analytics, meta tags, or custom <head> markup site-wide.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NagariaHussain NagariaHussain changed the title refactor: remove unused fields and cache logic from Wiki Settings fix: cleanup wiki settings Apr 28, 2026
@NagariaHussain NagariaHussain merged commit b930c96 into frappe:develop Apr 28, 2026
5 checks 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.

<head> HTML from website settings is not injected in latest wiki

1 participant