Allow searching for content in the editor navigation

Created on 9 April 2025, 3 months ago

Overview

We currently have a text field for searching for content in the editor navigation that is not functional.

Proposed resolution

Update `\Drupal\experience_builder\Controller\ApiContentControllers::list` to read a `search` query parameter and do a `LIKE` query on the `label` entity key.

Update `contentApi` and `getContentList` to pass the `search` query param.

Update `PageInfo` to pass a function to `Navgation` component's `onSearch` prop to perform a refresh of `useGetContentListQuery` when search is performed.

User interface changes

Pressing "enter" in search no longer shows the "not implemented yet" alert and pages can be searched

Feature request
Status

Active

Version

0.0

Component

Page builder

Created by

🇺🇸United States mglaman WI, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mglaman
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Update `\Drupal\experience_builder\Controller\ApiContentControllers::list` to read a `search` query parameter and do a `LIKE` query on the `label` entity key.

    If only we had QUERY!

    But at least in this case, the querystring itself should be comparatively tiny, so ?search=hello%20world will do just fine 👍

    Note: ApiContentControllers::list() may end up finding hundreds of matches. But the API response does not yet support pagination. Thoughts?

  • 🇺🇸United States mglaman WI, USA

    But the API response does not yet support pagination. Thoughts?

    Technically it'd still be a subset of the default result without a query string. But I do think getting pagination is going to become important pretty soon

  • First commit to issue fork.
  • Pipeline finished with Canceled
    3 months ago
    Total: 63s
    #471320
  • Pipeline finished with Failed
    3 months ago
    Total: 1611s
    #471321
  • Pipeline finished with Failed
    3 months ago
    Total: 1323s
    #471863
  • Pipeline finished with Failed
    3 months ago
    Total: 1690s
    #472811
  • Pipeline finished with Failed
    3 months ago
    Total: 1532s
    #472879
  • Pipeline finished with Canceled
    3 months ago
    Total: 605s
    #472999
  • Pipeline finished with Failed
    3 months ago
    Total: 1865s
    #473004
  • Pipeline finished with Failed
    3 months ago
    Total: 1537s
    #473128
  • Pipeline finished with Failed
    3 months ago
    Total: 1802s
    #473254
  • Pipeline finished with Failed
    3 months ago
    Total: 1931s
    #473289
  • Pipeline finished with Failed
    3 months ago
    Total: 1523s
    #473639
  • 🇮🇳India deepakkm

    All the threads are resolved hence moving into review.

  • Pipeline finished with Failed
    3 months ago
    Total: 1863s
    #473711
  • Pipeline finished with Failed
    3 months ago
    Total: 1624s
    #474249
  • Pipeline finished with Failed
    3 months ago
    Total: 3691s
    #474641
  • Pipeline finished with Failed
    3 months ago
    Total: 1643s
    #474712
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
  • Pipeline finished with Failed
    3 months ago
    Total: 1377s
    #475723
  • Pipeline finished with Canceled
    3 months ago
    Total: 172s
    #476430
  • Pipeline finished with Failed
    3 months ago
    Total: 1942s
    #476435
  • Pipeline finished with Failed
    3 months ago
    Total: 3294s
    #476490
  • Pipeline finished with Canceled
    3 months ago
    Total: 68s
    #478346
  • Pipeline finished with Failed
    3 months ago
    Total: 1978s
    #478347
  • Pipeline finished with Failed
    3 months ago
    Total: 1618s
    #478383
  • Pipeline finished with Failed
    3 months ago
    Total: 1589s
    #478398
  • Pipeline finished with Failed
    3 months ago
    Total: 1707s
    #478421
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
  • Pipeline finished with Failed
    3 months ago
    Total: 1775s
    #479831
  • Pipeline finished with Failed
    3 months ago
    Total: 505s
    #479857
  • Pipeline finished with Failed
    3 months ago
    Total: 2100s
    #479861
  • Pipeline finished with Failed
    3 months ago
    Total: 416s
    #479887
  • Pipeline finished with Failed
    3 months ago
    Total: 2249s
    #479892
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Per @penyaskito's review.

  • 🇬🇧United Kingdom catch

    I'm a bit confused why this is a 1.0 blocker, there's already ways to search for content in Drupal. Where are the requirements for this feature documented?

  • Pipeline finished with Failed
    3 months ago
    Total: 605s
    #481764
  • 🇫🇮Finland lauriii Finland

    Added some more context to the issue summary.

  • Pipeline finished with Canceled
    3 months ago
    #483620
  • Pipeline finished with Failed
    3 months ago
    #483621
  • Pipeline finished with Failed
    3 months ago
    Total: 10790s
    #483823
  • Pipeline finished with Failed
    3 months ago
    Total: 980s
    #484436
  • Pipeline finished with Failed
    3 months ago
    Total: 847s
    #484639
  • Pipeline finished with Failed
    3 months ago
    #485372
  • 🇮🇳India deepakkm

    I think its good to go now. Hence moving it in review.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    @catch's question in #14 is totally fair. Can we please get the designs we're implementing linked here, @lauriii? 🙏

    See detailed review on the MR. Test coverage is not complete enough yet for this to be mergeable. 😅

  • Pipeline finished with Running
    3 months ago
    #485685
  • Pipeline finished with Failed
    3 months ago
    #485865
  • Pipeline finished with Failed
    3 months ago
    Total: 781s
    #487495
  • 🇮🇳India deepakkm

    created to separate ticket to cover autocomplete feature - https://www.drupal.org/project/experience_builder/issues/3522488 🐛 Entity saved with autosaved data is not respected Active

  • Pipeline finished with Failed
    3 months ago
    Total: 848s
    #487633
  • Pipeline finished with Failed
    3 months ago
    Total: 703s
    #487647
  • Pipeline finished with Failed
    2 months ago
    Total: 690s
    #488831
  • Pipeline finished with Canceled
    2 months ago
    Total: 66s
    #488866
  • Pipeline finished with Failed
    2 months ago
    Total: 713s
    #488867
  • Pipeline finished with Failed
    2 months ago
    Total: 800s
    #488875
  • Pipeline finished with Running
    2 months ago
    #488911
  • Pipeline finished with Failed
    2 months ago
    #489018
  • Pipeline finished with Failed
    2 months ago
    Total: 7371s
    #489156
  • Pipeline finished with Failed
    2 months ago
    Total: 731s
    #489789
  • Pipeline finished with Failed
    2 months ago
    Total: 884s
    #489797
  • Pipeline finished with Failed
    2 months ago
    Total: 1131s
    #489818
  • Pipeline finished with Failed
    2 months ago
    #489986
  • Pipeline finished with Failed
    2 months ago
    #490080
  • Pipeline finished with Failed
    2 months ago
    Total: 864s
    #490928
  • Pipeline finished with Failed
    2 months ago
    Total: 872s
    #490956
  • Pipeline finished with Running
    2 months ago
    #491170
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    #19: @deepakkm: Please see my response at 🐛 Entity saved with autosaved data is not respected Active , can you please clarify it?

  • Pipeline finished with Failed
    2 months ago
    Total: 999s
    #492391
  • Pipeline finished with Failed
    2 months ago
    Total: 841s
    #492423
  • Pipeline finished with Failed
    2 months ago
    Total: 678s
    #492434
  • Pipeline finished with Failed
    2 months ago
    Total: 657s
    #492441
  • Pipeline finished with Failed
    2 months ago
    Total: 737s
    #493203
  • Pipeline finished with Failed
    2 months ago
    Total: 807s
    #493208
  • Pipeline finished with Failed
    2 months ago
    Total: 1204s
    #493213
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    The List with search test case of ApiContentControllersList has been failing.

    Also: I found a pretty massive bug which indicates the current test coverage is not adequate.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 773s
    #500572
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1795s
    #500584
  • Pipeline finished with Failed
    about 2 months ago
    Total: 884s
    #500701
  • Pipeline finished with Failed
    about 2 months ago
    Total: 878s
    #500731
  • Pipeline finished with Failed
    about 2 months ago
    Total: 776s
    #500774
  • Pipeline finished with Failed
    about 2 months ago
    Total: 3942s
    #500943
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 437s
    #509637
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 204s
    #509642
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 139s
    #509648
  • Pipeline finished with Failed
    about 2 months ago
    Total: 796s
    #509650
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    I know the sense of urgency y'all were under, so I spent ~30 mins reviewing this during my PTO today.

    This MR is unfortunately not at all ready.

    1. The tests are still hard failing on SQLite and PostgreSQL. You didn't implement what we agreed upon on Wednesday.
    2. navigation.cy.js is consistently failing on the new test coverage, even after I re-tested it.
    3. The information disclosure security vulnerability I pointed out on May 8 is still present, and the review thread was closed with a non-explanation 😅

    … and that's just the big ones. There's plenty of smaller concerns, most of which I pointed out long ago. I have not yet re-reviewed all closed MR threads, because a bunch seem to have been closed prematurely 🙈

  • Assigned to deepakkm
  • Status changed to Needs work about 1 month ago
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1425s
    #523286
  • Pipeline finished with Failed
    about 1 month ago
    #523452
  • Pipeline finished with Failed
    about 1 month ago
    #523458
  • Pipeline finished with Failed
    about 1 month ago
    #523463
  • Pipeline finished with Running
    about 1 month ago
    #523563
  • Pipeline finished with Failed
    about 1 month ago
    #523582
  • 🇫🇮Finland lauriii Finland
  • Pipeline finished with Failed
    27 days ago
    Total: 975s
    #526324
  • Pipeline finished with Failed
    27 days ago
    Total: 1388s
    #526836
  • Pipeline finished with Failed
    27 days ago
    Total: 1151s
    #526962
  • Pipeline finished with Failed
    26 days ago
    Total: 1135s
    #527103
  • 🇮🇳India deepakkm

    Mostly covered everything, but in case something is left do let me know.

  • Pipeline finished with Failed
    26 days ago
    Total: 529s
    #527229
  • Pipeline finished with Failed
    26 days ago
    Total: 4572s
    #527236
  • Pipeline finished with Failed
    24 days ago
    Total: 1315s
    #528954
  • Pipeline finished with Failed
    24 days ago
    Total: 1592s
    #529222
  • Pipeline finished with Failed
    23 days ago
    Total: 1158s
    #530088
  • Pipeline finished with Failed
    22 days ago
    Total: 980s
    #530173
  • Pipeline finished with Failed
    22 days ago
    Total: 1261s
    #530216
  • Pipeline finished with Failed
    22 days ago
    Total: 1253s
    #530295
  • Pipeline finished with Failed
    21 days ago
    Total: 1375s
    #531167
  • Pipeline finished with Failed
    21 days ago
    Total: 3104s
    #531936
  • Pipeline finished with Failed
    21 days ago
    Total: 1321s
    #531988
  • Pipeline finished with Failed
    21 days ago
    Total: 1000s
    #532012
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Did a high-level review. Addressed all my own nits. Since this touches auto-save things I'd like that to be reviewed by @tedbow or @larowlan.

    And I'd definitely like @larowlan to do a thorough review of the changes to ApiContentControllers

  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Addressed the test fails and remaining items I could.

    There are 3 items left that I'm not sure about but @deepakkm is best placed to answer

    1 of them I think is already handled in a follow-up
    The other two I'm not sure of the status/reasoning

  • Pipeline finished with Failed
    20 days ago
    Total: 1444s
    #532756
  • Pipeline finished with Failed
    20 days ago
    Total: 3656s
    #532775
  • 🇮🇳India deepakkm

    This is good for a review now.

  • Pipeline finished with Failed
    17 days ago
    Total: 1038s
    #534934
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    wim leers changed the visibility of the branch 0.x to hidden.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    wim leers changed the visibility of the branch 3532268-xbs-testsite-recipe to hidden.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    I wanted to review, RTBC and merge this, but found myself unable to — so I spent a few hours getting this ready for commit.

    Searching article nodes (which have XB fields and are editable in XB) did not work yet. And that's apparently intentional; but the route definition does not make that clear, nor does the bounds checking. Hardened that, to pave a clearer path for #3498525.

    Most importantly: the logic in \Drupal\experience_builder\Controller\ApiContentControllers::list() would've made XB harder to maintain, because its complexity was disproportionate to the functionality it provided: it was very complicated, not helped by the 8 (!!!) helper methods, incorrectly named variables and unfortunately about a dozen small bugs that made it even harder to understand. 🫣

    Before vs after: improved maintainability and quite literally a simpler MR:

     src/Controller/ApiContentControllers.php | 192 +++++++++++--------------------
     1 file changed, 69 insertions(+), 123 deletions(-)
    

    (See attached diff. @deepakkm, I hope you find the sequence of commits I pushed to this MR useful as a reference in the future. I tried many times to express this in MR comments, but I seem to have failed to convey my message. This is probably the only MR with >200 comment threads. Given this MR needs to land before 🌱 Milestone 1.0.0-beta1: Start creating non-throwaway sites Active , and the GitLab UI is starting to struggle to still load at all, I figured it's reasonable for me to step in and show by example what I failed to convey in my review comments.)

    Landed this despite one known bug: 🐛 Fix front-end performance and scalability of search functionality in navigator Active

    Also ran into a pre-existing bug: #3529924-17: Add access check for using Experience Builder at all: if >=1 content entity type with an XB field can be created or edited. .

  • Pipeline finished with Skipped
    16 days ago
    #535182
  • Pipeline finished with Skipped
    16 days ago
    #535183
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Also, as described at #3522488-3: Follow-up for #3518292: `ApiContentControllers::list()`: search should exclude entity query matches for entities with auto-save data , I don't understand what that issue is about, so I requested failing tests to illustrate the problem @deepakkm spotted 🙏

    That means there's now 2 follow-ups for this that are now unblocked:

    1. 🐛 Entity saved with autosaved data is not respected Active
    2. 🐛 Fix front-end performance and scalability of search functionality in navigator Active

    🚀

    Glad to have this in, it works great! 🤩

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024