@@ -25,7 +25,7 @@ import { usePluginAvailable } from '../hooks/usePluginAvailable';
2525import { useURLState } from '../hooks/useURLState' ;
2626import { getGoalsGraph , getNeighborsGraph } from '../korrel8r-client' ;
2727import { Graph } from '../korrel8r/client/models/Graph' ;
28- import { Query , QueryType , setPersistedQuery } from '../redux-actions' ;
28+ import { Constraint , Query , QueryType , setPersistedQuery } from '../redux-actions' ;
2929import { State } from '../redux-reducers' ;
3030import './korrel8rpanel.css' ;
3131import { Korrel8rTopology } from './topology/Korrel8rTopology' ;
@@ -39,16 +39,16 @@ type Result = {
3939 isError ?: boolean ;
4040} ;
4141
42- const focusQuery = ( urlQuery : string ) : Query => {
42+ const focusQuery = (
43+ urlQuery : string ,
44+ constraint : Constraint = { start : null , end : null } ,
45+ ) : Query => {
4346 return {
4447 query : urlQuery ,
4548 queryType : QueryType . Neighbour ,
4649 depth : 3 ,
4750 goal : null ,
48- constraint : {
49- start : null , // Initially null
50- end : null , // Initially null
51- } ,
51+ constraint : constraint ,
5252 } ;
5353} ;
5454
@@ -171,7 +171,7 @@ export default function Korrel8rPanel() {
171171 < Tooltip content = { focusTip } >
172172 < Button
173173 isAriaDisabled = { ! korrel8rQueryFromURL }
174- onClick = { ( ) => runQuery ( focusQuery ( korrel8rQueryFromURL ) ) }
174+ onClick = { ( ) => runQuery ( focusQuery ( korrel8rQueryFromURL , persistedQuery . constraint ) ) }
175175 >
176176 { t ( 'Focus' ) }
177177 </ Button >
0 commit comments