-
Notifications
You must be signed in to change notification settings - Fork 6
132 reactive search routes when token expire logout #164
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
lmarini
merged 45 commits into
main
from
132-reactive-search-routes-when-token-expire-logout
Nov 1, 2022
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
effe8e3
replace dataset card
longshuicy dfec550
Explore page cleanup (#108)
lmarini 142cc43
Merge branch 'main' into 131-custom-widget-and-appearance-for-reactiv…
longshuicy 7e33d7e
remove wrong primary
longshuicy d39146d
add layout
longshuicy 27bb878
add styling
longshuicy d6a5232
customize the searchbox
longshuicy c4a4cb0
styling the search dataset page
longshuicy 69add83
add links to the side bar
longshuicy faf29d3
add files table
longshuicy 60229b4
default to its original
longshuicy b19649d
add TODOs
longshuicy 0d9a92e
Added endpoint to search both file and dataset.
ddey2 f7e569f
embed datasearch to topbar
longshuicy e801032
add embedded search to the correct place
longshuicy ebd7317
wrap the search base on parent comp and dynamically switching between…
longshuicy c3f1577
embedded search working now
longshuicy 8c98f9e
Merge branch '137-create-endpoint-to-search-both-dataset-and-file' in…
longshuicy 3915eba
multi search
longshuicy c1c4d7c
combine two searches into one
longshuicy 1065662
identify based on index
longshuicy 05a5f13
Merge branch 'main' into dropdown-toggle-between-indices
longshuicy c31af35
work on result component
longshuicy 1efa604
initial styles
longshuicy e86b6a4
add more index
longshuicy 5e52597
include more fields on file
longshuicy 7822ea5
fix typo
longshuicy 476b7fb
no need to pass dataset name as a query parameter; get that info from…
longshuicy 8d1c550
black linting
longshuicy 35cf77b
use react router link instead of the refreshing link
longshuicy 320e85d
remove unused component
longshuicy d9f957a
add error boundary
longshuicy 8cd13dd
bump mui icon version up; use dataset icon
longshuicy b73f6cc
Merge branch 'main' into 131-custom-widget-and-appearance-for-reactiv…
longshuicy 3998000
Merge branch '131-custom-widget-and-appearance-for-reactivesearch' in…
longshuicy c4ab9e6
add logic to refresh
longshuicy 3823d85
when expire redirect to login
longshuicy 9909210
add refresh mechanism
longshuicy 2871ad8
separate out search error boundary
longshuicy 417bc8b
change route back
longshuicy a82ba83
Merge branch 'main' into 131-custom-widget-and-appearance-for-reactiv…
longshuicy 6d78112
Merge branch '131-custom-widget-and-appearance-for-reactivesearch' in…
longshuicy ff638a8
Merge branch 'main' into 132-reactive-search-routes-when-token-expire…
longshuicy c919f3e
put hard coded search endpoint to config
longshuicy 10b6355
breadcrumb functional now
longshuicy 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import React from "react"; | ||
| import {ErrorBoundary} from "@appbaseio/reactivesearch"; | ||
| import {V2} from "../../openapi"; | ||
| import {Navigate} from "react-router-dom"; | ||
|
|
||
|
|
||
| import Cookies from "universal-cookie"; | ||
|
|
||
| const cookies = new Cookies(); | ||
|
|
||
| export function SearchErrorBoundary(props) { | ||
|
|
||
| const {children} = props; | ||
|
|
||
| return ( | ||
| <ErrorBoundary | ||
| renderError={error => ( | ||
| <> | ||
| { | ||
| (() => { | ||
| if (error["status"] === 401 || error["status"] === 403) { | ||
| V2.OpenAPI.TOKEN = undefined; | ||
| cookies.remove("Authorization", {path: "/"}); | ||
| return <Navigate to="/auth/login"/>; | ||
| } else { | ||
| // TODO add prettier message or report function | ||
| return <h1>An error has happened.</h1> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will trigger when elasticsearch is dead (e.g. 500 internal error) |
||
| } | ||
| })() | ||
| } | ||
| </> | ||
| )} | ||
| > | ||
| {children} | ||
| </ErrorBoundary> | ||
| ) | ||
| } | ||
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.
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 cannot properly do the refresh token logic here; for now just redirect to the login page