Enable global Control Panel search via plone.restapi searchable text - 1981#1982
Enable global Control Panel search via plone.restapi searchable text - 1981#1982Manik-Khajuria-5 wants to merge 3 commits intoplone:mainfrom
Conversation
|
@Manik-Khajuria-5 thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment: To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
|
@jenkins-plone-org please run jobs |
|
@stevepiercy can u help why docs test is failig I have included it |
|
@davisagli I’ve opened a PR that adds a backend endpoint returning aggregated searchable text for Control Panel settings, following the discussion in the Volto issue |
|
@Manik-Khajuria-5 sorry, I have no idea. What did you try? What do the error messages say and advise you to do? It's a good idea to run the tests locally and follow the guidelines from https://6.docs.plone.org/plone.restapi/docs/source/contributing/index.html. |
|
okay will try to improve locally it was working fine |
| for rule in registered_rules: | ||
| if isinstance(rule, dict): | ||
| if rule.get("title"): | ||
| text_parts.append(rule["title"]) |
There was a problem hiding this comment.
Don't add special cases for the dexterity types and content rules control panels here.
Instead, give those control panel classes (in types.py and rules.py) their own get_searchable_text method which calls super() and then adds additional text.
| ), | ||
| "title": self.controlpanel.title, | ||
| "group": self.controlpanel.group, | ||
| "searchable_text": self.controlpanel.get_searchable_text(), |
There was a problem hiding this comment.
Be careful and make sure it doesn't break if the control panel doesn't have this method (there can be other control panels from addons which haven't been updated to add the new method).
|
I think some of the CI failures were due to a github incident in progress. So let's see what happens next time you update the PR. |
|
@davisagli Thanks for review I will update PR shortly as per changes recomended |
|
@davisagli Implemented the changes successfully Should I work on frontend issue now for searchable text? |
Fixes #1981:
Summary
This PR adds a single Control Panel REST API endpoint that exposes aggregated searchable text for all control panel settings.
The endpoint returns panel titles,as searchable text, enabling efficient global Control Panel search without fetching individual schemas on the frontend.
References
Closes #1981