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

feat(noResults): allow providing URL to report missing results #1289

Merged
merged 3 commits into from Feb 2, 2022

Conversation

shortcuts
Copy link
Member

@shortcuts shortcuts commented Jan 31, 2022

Summary

This PR provides an option for the user to define a link to report the missing results, nothing is rendered by default.

With the deprecation of our legacy infra (follow up of algolia/docsearch-configs#5069), the current value of this link (https://github.com/algolia/docsearch-configs) does not make sense anymore.

Other solutions

  • Remove this informative message
  • Allow providing a function or JSX element in order to retrieve current query
    • We did not receive feature requests to customize the noResults screen, which is also doable by importing the DocSearch components.

@netlify
Copy link

netlify bot commented Jan 31, 2022

✔️ Deploy Preview for docsearch ready!

🔨 Explore the source changes: ac4b495

🔍 Inspect the deploy log: https://app.netlify.com/sites/docsearch/deploys/61f960ee81996600072071a1

😎 Browse the preview: https://deploy-preview-1289--docsearch.netlify.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 31, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ac4b495:

Sandbox Source
Vanilla Configuration

@@ -50,6 +50,7 @@ export function DocSearchModal({
disableUserPersonalization = false,
initialQuery: initialQueryFromProp = '',
translations = {},
reportMissingResultsUrl,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's optional but there is are no default?
edit: the component is optional okay 🆗

@shortcuts shortcuts force-pushed the feat/noResults-missingResultsURL branch from bbfd921 to 0934664 Compare February 1, 2022 09:59
@shortcuts shortcuts force-pushed the feat/noResults-missingResultsURL branch from 4f1f3d2 to ced2317 Compare February 1, 2022 10:06
packages/website/docs/api.mdx Outdated Show resolved Hide resolved
packages/website/docs/api.mdx Outdated Show resolved Hide resolved
packages/docsearch-react/src/NoResultsScreen.tsx Outdated Show resolved Hide resolved
@shortcuts shortcuts merged commit 2c1fe7c into next Feb 2, 2022
@shortcuts shortcuts deleted the feat/noResults-missingResultsURL branch February 2, 2022 09:39
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

Successfully merging this pull request may close these issues.

None yet

3 participants