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(theme-classic): allow className as option for type: "search" #7357

Merged
merged 3 commits into from
May 25, 2022

Conversation

JPeer264
Copy link
Contributor

@JPeer264 JPeer264 commented May 6, 2022

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
    • Could not find any tests for these changes. Please correct me if I am wrong.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Please refer to this issue comment
#7164 (comment)

Test Plan

I tried to use yarn lerna link and linked it in a new setup project but still got [ERROR] ValidationError: "navbar.items[0].className" is not allowed although it has been added to the Joi validation schema. I might need help on this part (cc: @slorber)

Test links

Deploy preview: https://deploy-preview-7357--docusaurus-2.netlify.app/
New changes: https://deploy-preview-7357--docusaurus-2.netlify.app/docs/api/themes/configuration#navbar-search

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 6, 2022
@Josh-Cena Josh-Cena added the pr: new feature This PR adds a new API or behavior. label May 6, 2022
@netlify
Copy link

netlify bot commented May 6, 2022

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 54253da
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/628e04ca887492000854ce27
😎 Deploy Preview https://deploy-preview-7357--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented May 6, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 62 🟢 100 🟢 100 🟢 100 🟢 90 Report
/docs/installation 🟠 83 🟢 99 🟢 100 🟢 100 🟢 90 Report

Copy link
Collaborator

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

Please add a test case for the validation schema, although it's kind of obvious that it will work. Unit tests are always more effective than yarn link 😉

@JPeer264
Copy link
Contributor Author

JPeer264 commented May 6, 2022

@Josh-Cena I would be more than happy to add one, but could not find any tests there. Are there some existing which I overlooked? I am pretty sure I am not the first person adding tests for this

@Josh-Cena
Copy link
Collaborator

The tests are here: https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-theme-classic/src/__tests__/validateThemeConfig.test.ts

@JPeer264
Copy link
Contributor Author

JPeer264 commented May 6, 2022

Oh ya true. Just found them thanks, I will add them right away.

@JPeer264 JPeer264 force-pushed the feature/classname-search branch from 54e97d6 to 141a79e Compare May 6, 2022 14:31
@JPeer264
Copy link
Contributor Author

JPeer264 commented May 6, 2022

@Josh-Cena implementation wise (apart from the validation) there are no tests am I right?

@Josh-Cena
Copy link
Collaborator

No, we don't have theme tests yet😞 I think this is the best we can do. It doesn't look like it shouldn't work.

@JPeer264 JPeer264 force-pushed the feature/classname-search branch from 141a79e to 7e89d49 Compare May 6, 2022 14:38
@JPeer264
Copy link
Contributor Author

@Josh-Cena friendly ping :)

Copy link
Collaborator

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

Yes, it's good from my side. However I'd also like to get @slorber's approval. He'd been unavailable for the past two weeks; I think he'll be back this week.

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Josh-Cena Josh-Cena merged commit 5fcb742 into facebook:main May 25, 2022
@Josh-Cena
Copy link
Collaborator

Thanks @JPeer264!

@JPeer264 JPeer264 deleted the feature/classname-search branch May 25, 2022 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants