-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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(sampledata): Route from buckets index to Data Explorer #17085
Changes from 6 commits
1942112
4170733
1ac2213
1ef67e8
b1972b7
a55f597
a547831
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Libraries | ||
import React, {PureComponent} from 'react' | ||
import React, {FC, useEffect} from 'react' | ||
import {connect} from 'react-redux' | ||
|
||
// Components | ||
|
@@ -9,40 +9,46 @@ import RateLimitAlert from 'src/cloud/components/RateLimitAlert' | |
|
||
// Actions | ||
import {setActiveTimeMachine} from 'src/timeMachine/actions' | ||
import {setBuilderBucketIfExists} from 'src/timeMachine/actions/queryBuilder' | ||
|
||
// Utils | ||
import {HoverTimeProvider} from 'src/dashboards/utils/hoverTime' | ||
import {queryBuilderFetcher} from 'src/timeMachine/apis/QueryBuilderFetcher' | ||
import {readQueryParams} from 'src/shared/utils/queryParams' | ||
|
||
interface DispatchProps { | ||
onSetActiveTimeMachine: typeof setActiveTimeMachine | ||
onSetBuilderBucketIfExists: typeof setBuilderBucketIfExists | ||
} | ||
|
||
type Props = DispatchProps | ||
class DataExplorer extends PureComponent<Props, {}> { | ||
constructor(props: Props) { | ||
super(props) | ||
|
||
props.onSetActiveTimeMachine('de') | ||
const DataExplorer: FC<Props> = ({ | ||
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. just want to call out that switching from a 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. thanks.. I'll test it a bit.. |
||
onSetActiveTimeMachine, | ||
onSetBuilderBucketIfExists, | ||
}) => { | ||
useEffect(() => { | ||
const bucketQP = readQueryParams()['bucket'] | ||
onSetActiveTimeMachine('de') | ||
queryBuilderFetcher.clearCache() | ||
} | ||
|
||
public render() { | ||
return ( | ||
<LimitChecker> | ||
<RateLimitAlert /> | ||
<div className="data-explorer"> | ||
<HoverTimeProvider> | ||
<TimeMachine /> | ||
</HoverTimeProvider> | ||
</div> | ||
</LimitChecker> | ||
) | ||
} | ||
onSetBuilderBucketIfExists(bucketQP) | ||
}, []) | ||
|
||
return ( | ||
<LimitChecker> | ||
<RateLimitAlert /> | ||
<div className="data-explorer"> | ||
<HoverTimeProvider> | ||
<TimeMachine /> | ||
</HoverTimeProvider> | ||
</div> | ||
</LimitChecker> | ||
) | ||
} | ||
|
||
const mdtp: DispatchProps = { | ||
onSetActiveTimeMachine: setActiveTimeMachine, | ||
onSetBuilderBucketIfExists: setBuilderBucketIfExists, | ||
} | ||
|
||
export default connect<{}, DispatchProps, {}>( | ||
|
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.
👍