Skip to content

Commit c713428

Browse files
shwetaapzhuje
authored andcommitted
COO-761: Add the DateTime Range selection in the tp when the focus button is clicked
Signed-off-by: Shweta Padubidri <spadubid@redhat.com>
1 parent 662675c commit c713428

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

web/src/components/Korrel8rPanel.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { usePluginAvailable } from '../hooks/usePluginAvailable';
2525
import { useURLState } from '../hooks/useURLState';
2626
import { getGoalsGraph, getNeighborsGraph } from '../korrel8r-client';
2727
import { Graph } from '../korrel8r/client/models/Graph';
28-
import { Query, QueryType, setPersistedQuery } from '../redux-actions';
28+
import { Constraint, Query, QueryType, setPersistedQuery } from '../redux-actions';
2929
import { State } from '../redux-reducers';
3030
import './korrel8rpanel.css';
3131
import { 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

Comments
 (0)