Skip to content

[SearchBar] attemptPageTypeSearch property doesn't work on multi-word department #1100

@EduardoRodriguesF

Description

@EduardoRodriguesF

Describe the bug
Using search-bar's attemptPageTypeSearch property only works for single-word departments and still falls into a regular search page when searching for more than one word.

To Reproduce
Steps to reproduce the behavior:

  1. Set search-bar's attemptPageTypeSearch property to true
  2. Search for a department with two or more words in it
  3. It enters a regular search page

Expected behavior
It should identify that there is a department with that name and access /my-department-example instead of /my%20department%20example.

Additional: If there is not a department that fits the term, it should fallback to regular search route /example?_q=example&map=ft

Screenshots
image

Department is not searchable through normal search-bar settings.

image

We then added attemptPageTypeSearch property as true.

image

It works perfectly for single-word departments as the one in the image.

image

It fails to recognize and convert "tapete infantil" to its department URL.

Desktop:

  • OS: Windows
  • Browser: Chrome

Additional context
This project has a department called "Enxoval" and another that is called "Tapete Infantil". We've used those as an example because they demonstrate when attemptPageTypeSearch is effective and where is its pitfalls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions