-
Notifications
You must be signed in to change notification settings - Fork 78
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: add content search modal [FC-0040] #928
feat: add content search modal [FC-0040] #928
Conversation
Thanks for the pull request, @rpenido! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #928 +/- ##
==========================================
+ Coverage 92.00% 92.01% +0.01%
==========================================
Files 612 616 +4
Lines 10745 10771 +26
Branches 2304 2312 +8
==========================================
+ Hits 9886 9911 +25
- Misses 830 831 +1
Partials 29 29 ☔ View full report in Codecov by Sentry. |
package.json
Outdated
@@ -43,7 +43,7 @@ | |||
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2", | |||
"@edx/frontend-component-ai-translations": "^2.0.0", | |||
"@edx/frontend-component-footer": "^13.0.2", | |||
"@edx/frontend-component-header": "^5.0.2", | |||
"@edx/frontend-component-header": "github:open-craft/frontend-component-header#rpenido/dist/fal-3693-add-search-menu-button", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update after merge:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: 6f05189
2da3cc8
to
493456c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Great work on this @rpenido ! Everything looks good to me, just left a few comments on the test cases.
- I tested this: I following the testing instruction in the PR, it works as expected
- I read through the code
- I checked for accessibility issues
-
Includes documentation
src/studio-home/StudioHome.test.jsx
Outdated
it('should render Studio home title', () => { | ||
render(<RootWrapper />); | ||
screen.logTestingPlaygroundURL(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this testcase missing a check or testing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @yusuf-musleh! Thank you for the review.
Cleaned here: 0d58997
src/studio-home/StudioHome.test.jsx
Outdated
it('should show search button and open search modal when button clicked, if search flag enabled', async () => { | ||
setConfig({ | ||
...getConfig(), | ||
MEILISEARCH_ENABLED: 'false', | ||
}); | ||
const { queryByRole } = render(<RootWrapper />); | ||
expect(queryByRole('button', { name: 'Search content' })).not.toBeInTheDocument(); | ||
}); | ||
|
||
it('should show search button if meilisearch flag disabled', async () => { | ||
setConfig({ | ||
...getConfig(), | ||
MEILISEARCH_ENABLED: 'false', | ||
}); | ||
const { queryByRole } = render(<RootWrapper />); | ||
expect(queryByRole('button', { name: 'Search content' })).not.toBeInTheDocument(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 testcases seem to have the same test code? And it seems to be doing the opposite of what is described in the first case, and the second case should be "should not show" right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't check if the search button was showing in the header. This test was not working. I removed it here: 0d58997
Thank you for pointing out!
85f4c4f
to
a017f13
Compare
a017f13
to
0d58997
Compare
@bradenmacdonald Sure! I'll test it first thing tomorrow! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand most of the UI is placeholder. So I haven't looked at it too deeply.
Sorry for the delay, but I had some difficulty getting everything running. Running tutor dev launch
again fixed the API key issue, and the indexing command you mentioned fixed the missing index issue.
This is good to go.
webpack.dev-tutor.config.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: beeaafa
Thank you for the review @xitij2000!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xitij2000 Do you prefer to merge this or the @bradenmacdonald PR (#918)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that include all the changes from this?
Even so I think it's better to have smaller changes. Could you please fix the merge issues and I'll merge .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xitij2000 Yes, it does.
I updated it here with master changes and let npm install
handle the conflicts in the package-lock.json
file. I got a huge diff and some dependency package updates.
It seems the bot updates the package but not the dependencies..
Have I done something wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think when you run npm install on a broken package-lock, it regenerates it from scratch which might resolve some dependencies differently. I think it should be OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To resolve issues with package-lock.json
I normally recommend something like this:
- Checkout
master
and runnpm ci
so yourpackage-lock.json
matches master exactly. - Checkout your branch, and reset any changes to
package-lock.json
, so there are only changes topackage.json
showing in git. - Run
npm install
(inside the Tutor container, not on the host)
fb25ce0
to
7fa6127
Compare
…icking-search-icon-in-header
@rpenido 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Description
This PR implements a front-end UI to the metasearch engine prototype. The modal is shown after clicking the new search icon button in the Studio Header.
The feature is only enabled if the
MEILISEARCH_ENABLED
env variable is set totrue
.More Info
Closes [Course Search] Trigger Course Search Modal in Course Authoring MFE modular-learning#199
Depends on feat: add search menu button to header [FC-0040] frontend-component-header#474
Testing Instructions
meilisearch
setup locally, follow the setup instructions here https://github.com/open-craft/tutor-contrib-meilisearch, but use the following branch for the plugin (https://github.com/rpenido/tutor-contrib-meilisearch/tree/rpenido/fal-3693-pass-meilisearch-enabled-env-to-mfe-config) to make sure theMEILISEARCH_ENABLED
is configured in the MFEs.tutor dev run cms bash
and./manage.py cms reindex_studio
NOTE: If you don't see the search icon in the header, check the following URL: http://local.edly.io:8000/api/mfe_config/v1
You must have the
MEILISEARCH_ENABLED
config as show below:If you don't have this configuration, check step 2.
Private ref: FAL-3693