Skip to content

fix(search-results): fixes no-data not being rendered - #3409

Merged
Nickii Miaro (Mnickii) merged 3 commits into
microsoftgraph:mainfrom
tobi1220:fix-3374
Mar 18, 2025
Merged

fix(search-results): fixes no-data not being rendered#3409
Nickii Miaro (Mnickii) merged 3 commits into
microsoftgraph:mainfrom
tobi1220:fix-3374

Conversation

@tobi1220

@tobi1220 tobi (tobi1220) commented Mar 2, 2025

Copy link
Copy Markdown
Contributor

Closes #3374

PR Type

Bugfix

Description of the changes

The no-data template is not being rendered in case no hits were retrieved, because in that case there is still an empty hitContainer present. This is why I changed the condition from:

if (this.response?.value[0]?.hitsContainers[0])

to:

if (this.response?.value[0]?.hitsContainers[0]?.hits)

PR checklist

  • Project builds (yarn build) and changes have been tested in at least two supported browsers (Edge + non-Chromium based browser)
  • All public APIs (classes, methods, etc) have been documented following the jsdoc syntax
  • Stories have been added and existing stories have been tested
  • Added appropriate documentation. Docs PR:
  • License header has been added to all new source files (yarn setLicense)
  • Contains NO breaking changes

Other information

@tobi1220

Copy link
Copy Markdown
Contributor Author

Any thoughts on this?

@Mnickii

Copy link
Copy Markdown
Collaborator

Thank you tobi (@tobi1220) for this fix!
Would you also please add a templating story for this scenario?

@github-project-automation github-project-automation Bot moved this to Done ✔️ in Graph Toolkit Mar 18, 2025
@Mnickii
Nickii Miaro (Mnickii) merged commit f185d90 into microsoftgraph:main Mar 18, 2025
@github-project-automation github-project-automation Bot moved this from Done ✔️ to Shipped 🚀 in Graph Toolkit Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[BUG] search-results doesn't render "no-data"-template when no results were found

2 participants