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

misc issues/feature requests #221

Open
phot0n opened this issue Mar 27, 2024 · 1 comment
Open

misc issues/feature requests #221

phot0n opened this issue Mar 27, 2024 · 1 comment

Comments

@phot0n
Copy link
Contributor

phot0n commented Mar 27, 2024

  • feature to hide a group in the sidebar - should be straightforward from the backend (wiki space doctype) - would probably need some design effort from the front end (like in edit page/group thing, even the hidden groups will be visible so they can be unhidden)

  • the allow_guest feature should only make the pages visible in sidebar if the user is logged in - currently they are "visible" even when the user is guest

  • feature to add a sidebar group above/below a group directly from a particular sidebar group - currently new groups get added to the bottom?

  • clear wiki_sidebar cache upon wiki page's route updation - currently happens on title change or deletion of page

  • image
    This checkbox is hella confusing - since it's before the dark logo button - i thought it's for asking if you want to add dark mode logo or not - apparently it's for showing the switch for dark/light theme for ui 😅 - also we can probably just show that switch by default on the UI? and do away with that checkbox?
@phot0n
Copy link
Contributor Author

phot0n commented Apr 1, 2024

This is horrible:

for wiki_sidebar in self.wiki_sidebars:
wiki_page = frappe.get_doc("Wiki Page", wiki_sidebar.wiki_page)
prepend_string = f"{self.route}/" if self.route else ""
try:
frappe.db.set_value(
"Wiki Page",
wiki_page.name,
{"route": f"{prepend_string}{wiki_page.route.split('/')[-1]}"},
)
except pymysql.err.IntegrityError:
try:
# prepending group name
frappe.db.set_value(
"Wiki Page",
wiki_page.name,
{
"route": f"{prepend_string}{cleanup_page_name(wiki_sidebar.parent_label)}-{wiki_page.route.split('/')[-1]}"
},
)
except pymysql.err.IntegrityError:
# prepending group name and appending random number
frappe.db.set_value(
"Wiki Page",
wiki_page.name,
{
"route": f"{prepend_string}{cleanup_page_name(wiki_sidebar.parent_label)}-{wiki_page.route.split('/')[-1]}-{random() * 10000}"
},
)

the route of all wiki pages is being destroyed here - which will essentially mean all the a tags which link to docs will also suffer - this needs to be removed or altered to only replace the old route prefix from the wiki pages route (that too with a warning)

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

No branches or pull requests

1 participant