-
Notifications
You must be signed in to change notification settings - Fork 6
836 public search option #964
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
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
bbc9ddf
the issue is that on this branch the status is not indexed
tcnichol 80c6693
Merge branch 'main' into 836-public-search-option
tcnichol ad4d58c
Merge branch 'main' into 836-public-search-option
tcnichol 0e12d5f
working on putting public search in
tcnichol 060d507
search not hidden
tcnichol 1877c98
use public search endpoint, still need to remove cookie and authentic…
tcnichol aee8489
trying to use name
tcnichol d9f193b
lowerecase matches
tcnichol 186b9d0
lowerecase matches
tcnichol ae8b023
indexing for file status was wrong
tcnichol 6e54315
error in public search because of admin mode, not sure why its still …
tcnichol e1d0a8b
public layout not layout
tcnichol 5780c23
public search is not commented out
tcnichol d4ec27c
formatting, fix test for search
tcnichol 824a28c
need a public search result with public routes
tcnichol 585e534
removing creator filter
tcnichol ee26a54
Merge branch 'main' into 836-public-search-option
tcnichol f64ff8c
added missing import
tcnichol 7975453
Merge branch 'main' into 836-public-search-option
tcnichol 5e33165
inconsistent use of public/datasets and public_datasets fixed
tcnichol 99ba123
Merge remote-tracking branch 'origin/836-public-search-option' into 8…
tcnichol fd1d71a
Merge branch 'main' into 836-public-search-option
tcnichol 6e2f35d
_ for public files instead of /
tcnichol 2d3ca91
_ for public datasets instead of /
tcnichol b76b4a8
file status should be fixed now
tcnichol 265ac91
Merge branch 'main' into 836-public-search-option
tcnichol 9c0abb8
formatting
tcnichol 604dc73
fixing the link for public file result
tcnichol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import React, { useEffect, useState } from "react"; | ||
| import { DataSearch, ReactiveBase } from "@appbaseio/reactivesearch"; | ||
|
|
||
| import { useNavigate } from "react-router-dom"; | ||
| import config from "../../app.config"; | ||
| import { searchTheme } from "../../theme"; | ||
| import Cookies from "universal-cookie"; | ||
|
|
||
| export function EmbeddedPublicSearch() { | ||
| const history = useNavigate(); | ||
| const cookies = new Cookies(); | ||
| const [authorizationHeader, setAuthorizationHeader] = useState({ | ||
| Authorization: cookies.get("Authorization"), | ||
| }); | ||
| const getUpdatedCookie = () => { | ||
| const cookies = new Cookies(); | ||
| setAuthorizationHeader({ Authorization: cookies.get("Authorization") }); | ||
| }; | ||
|
|
||
| // Pulling latest cookie | ||
| useEffect(() => { | ||
| const intervalId = setInterval( | ||
| getUpdatedCookie, | ||
| config.refreshTokenInterval | ||
| ); | ||
| return () => clearInterval(intervalId); | ||
| }, []); | ||
|
|
||
| // @ts-ignore | ||
| return ( | ||
| <ReactiveBase | ||
| url={config.publicSearchEndpoint} | ||
| app="all" | ||
| headers={authorizationHeader} | ||
| theme={searchTheme} | ||
| > | ||
| <DataSearch | ||
| componentId="searchbox" | ||
| autosuggest={true} | ||
| highlight={true} | ||
| queryFormat="or" | ||
| fuzziness={0} | ||
| debounce={100} | ||
| // apply react to the filter | ||
| URLParams={true} | ||
| showFilter={true} | ||
| showClear | ||
| renderNoSuggestion="No suggestions found." | ||
| dataField={["name", "description"]} | ||
| // placeholder="Search for Dataset" | ||
| innerClass={{ | ||
| title: "search-title", | ||
| input: "embedded-search-input", | ||
| }} | ||
| onValueSelected={function (value, cause, _) { | ||
| if ( | ||
| cause === "SUGGESTION_SELECT" || | ||
| cause === "ENTER_PRESS" || | ||
| cause === "SEARCH_ICON_CLICK" | ||
| ) { | ||
| history(`/public_search?searchbox="${value}"`); | ||
| } | ||
| }} | ||
| /> | ||
| </ReactiveBase> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.