Skip to content

Commit

Permalink
Adding onClick handlers.
Browse files Browse the repository at this point in the history
  • Loading branch information
phix committed Jul 3, 2024
1 parent 96ab8f8 commit e828b2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/src/components/search/es-search/EsSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import MqText from '../../core/text/MqText'
import React, { useCallback, useEffect } from 'react'
import airflow_logo from './airlfow-logo.svg'
import spark_logo from './spark-logo.svg'
import {useNavigate} from "react-router-dom";

interface StateProps {
esSearchJobs: IEsSearchJobsState
Expand Down Expand Up @@ -94,6 +95,7 @@ const EsSearch: React.FC<StateProps & DispatchProps & Props> = ({
esSearchDatasets,
}) => {
const [selectedIndex, setSelectedIndex] = React.useState<Nullable<number>>(null)
const navigate = useNavigate()

useArrowKeys((direction) => {
if (direction === 'up') {
Expand Down Expand Up @@ -143,6 +145,7 @@ const EsSearch: React.FC<StateProps & DispatchProps & Props> = ({
return (
<Box
key={hit.run_id}
onClick={() => navigate(`/lineage/job/${hit.namespace}/${hit.name}`)}
px={2}
py={1}
borderBottom={1}
Expand Down Expand Up @@ -264,6 +267,7 @@ const EsSearch: React.FC<StateProps & DispatchProps & Props> = ({
return (
<Box
key={hit.run_id}
onClick={() => navigate(`/lineage/dataset/${hit.namespace}/${hit.name}`)}
px={2}
py={1}
borderBottom={1}
Expand Down

0 comments on commit e828b2b

Please sign in to comment.