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(docs): enable search functionality #2020

Merged
merged 6 commits into from
Jul 18, 2019
Merged

Conversation

wesleygrimes
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Closes #1860

What is the new behavior?

Re-enable search box on website

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@ngrxbot
Copy link
Collaborator

ngrxbot commented Jul 16, 2019

Preview docs changes for fdd1a8f at https://previews.ngrx.io/pr2020-fdd1a8f/

@ngrxbot
Copy link
Collaborator

ngrxbot commented Jul 16, 2019

Preview docs changes for 777ef72 at https://previews.ngrx.io/pr2020-777ef72/

@wesleygrimes
Copy link
Contributor Author

wesleygrimes commented Jul 17, 2019

So this has been an interesting journey. The problem is that aio-search-box needs to be nested underneath aio-top-menu in order for styling to work correctly. I went down the path of adding ng-content to aio-top-menu so that I can nest aio-search-box directly from app.component.ts and not have to refactor everything. That appears to work but then the tests fail with the following error:

AppComponent search click handling should show developer source view if the footer is clicked while holding the meta and alt keys FAILED
	TypeError: Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node'.
	    at http://localhost:9876/src/app/app.component.ts?:310:31
	    at Array.some (<anonymous>)
	    at QueryList.push../node_modules/@angular/core/fesm5/core.js.QueryList.some (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:15129:1)
	    at AppComponent../src/app/app.component.ts.AppComponent.onClick (http://localhost:9876/src/app/app.component.ts?:309:28)
	    at UserContext.<anonymous> (http://localhost:9876/src/app/app.component.spec.ts?:376:26)
	    at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/node_modules/zone.js/dist/zone.js?:388:1)
	    at ProxyZoneSpec.push../node_modules/zone.js/dist/zone-testing.js.ProxyZoneSpec.onInvoke (http://localhost:9876/node_modules/zone.js/dist/zone-testing.js?:288:1)
	    at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/node_modules/zone.js/dist/zone.js?:387:1)
	    at Zone../node_modules/zone.js/dist/zone.js.Zone.run (http://localhost:9876/node_modules/zone.js/dist/zone.js?:138:1)
	    at runInTestZone (http://localhost:9876/node_modules/zone.js/dist/zone-testing.js?:509:1)

This appears to have something to do with ng-content and event bubbling...

I can go down the path of actually moving aio-search-box down a level into aio-top-menu but that will require a decent amount of refactoring due to how search results are tied into the main app component.

Any thoughts?

As an aside, the Angular.io website, which this is based upon, has the aio-search-box at the top level because their top-nav is left aligned. The NgRx top-nav is right aligned so it doesn't quite work the same. We could also right align the nav, but that would be a change.

@ngrxbot
Copy link
Collaborator

ngrxbot commented Jul 17, 2019

Preview docs changes for 36a0281 at https://previews.ngrx.io/pr2020-36a0281/

@ngrxbot
Copy link
Collaborator

ngrxbot commented Jul 17, 2019

Preview docs changes for 07eea44 at https://previews.ngrx.io/pr2020-07eea44/

@ngrxbot
Copy link
Collaborator

ngrxbot commented Jul 17, 2019

Preview docs changes for 2f89a42 at https://previews.ngrx.io/pr2020-2f89a42/

@ngrxbot
Copy link
Collaborator

ngrxbot commented Jul 17, 2019

Preview docs changes for d446b79 at https://previews.ngrx.io/pr2020-d446b79/

@brandonroberts brandonroberts merged commit 3cc4f3d into master Jul 18, 2019
jordanpowell88 pushed a commit to jordanpowell88/platform that referenced this pull request Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add search functionality for api similar to Angular
4 participants