Commit 8fcb914 1 parent 30c1e2b commit 8fcb914 Copy full SHA for 8fcb914
File tree 2 files changed +29
-3
lines changed
js_modules/dagster-ui/packages/ui-core/src
2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change
1
+ import { useCallback } from 'react' ;
1
2
import styled from 'styled-components' ;
2
3
3
4
import { RunGraphQueryItem } from './toGraphQueryItems' ;
4
5
import {
5
6
ganttChartSelectionSyntaxSupportedAttributes ,
6
7
useGanttChartSelectionAutoCompleteProvider ,
7
8
} from './useGanttChartSelectionAutoCompleteProvider' ;
9
+ import { isUnmatchedValueQuery } from '../asset-selection/isUnmatchedValueQuery' ;
10
+ import { parseRunSelectionQuery } from '../run-selection/AntlrRunSelection' ;
8
11
import { RunSelectionLexer } from '../run-selection/generated/RunSelectionLexer' ;
9
12
import { RunSelectionParser } from '../run-selection/generated/RunSelectionParser' ;
10
13
import { InputDiv , SelectionAutoCompleteInput } from '../selection/SelectionInput' ;
@@ -14,12 +17,23 @@ import {weakMapMemoize} from '../util/weakMapMemoize';
14
17
export const GanttChartSelectionInput = ( {
15
18
items,
16
19
value,
17
- onChange,
20
+ onChange : _onChange ,
18
21
} : {
19
22
items : RunGraphQueryItem [ ] ;
20
23
value : string ;
21
24
onChange : ( value : string ) => void ;
22
25
} ) => {
26
+ const onChange = useCallback (
27
+ ( value : string ) => {
28
+ if ( parseRunSelectionQuery ( [ ] , value ) instanceof Error && isUnmatchedValueQuery ( value ) ) {
29
+ _onChange ( `name:"*${ value } *"` ) ;
30
+ } else {
31
+ _onChange ( value ) ;
32
+ }
33
+ } ,
34
+ [ _onChange ] ,
35
+ ) ;
36
+
23
37
return (
24
38
< Wrapper >
25
39
< SelectionAutoCompleteInput
Original file line number Diff line number Diff line change
1
+ import { useCallback } from 'react' ;
1
2
import styled from 'styled-components' ;
2
3
3
4
import {
4
5
opGraphSelectionSyntaxSupportedAttributes ,
5
6
useOpGraphSelectionAutoCompleteProvider ,
6
7
} from './useOpGraphSelectionAutoCompleteProvider' ;
7
8
import { GraphQueryItem } from '../app/GraphQueryImpl' ;
9
+ import { isUnmatchedValueQuery } from '../asset-selection/isUnmatchedValueQuery' ;
10
+ import { parseOpSelectionQuery } from '../op-selection/AntlrOpSelection' ;
8
11
import { OpSelectionLexer } from '../op-selection/generated/OpSelectionLexer' ;
9
12
import { OpSelectionParser } from '../op-selection/generated/OpSelectionParser' ;
10
13
import { InputDiv , SelectionAutoCompleteInput } from '../selection/SelectionInput' ;
11
14
import { createSelectionLinter } from '../selection/createSelectionLinter' ;
12
15
import { weakMapMemoize } from '../util/weakMapMemoize' ;
13
-
14
16
export const OpGraphSelectionInput = ( {
15
17
items,
16
18
value,
17
- onChange,
19
+ onChange : _onChange ,
18
20
} : {
19
21
items : GraphQueryItem [ ] ;
20
22
value : string ;
21
23
onChange : ( value : string ) => void ;
22
24
} ) => {
25
+ const onChange = useCallback (
26
+ ( value : string ) => {
27
+ if ( parseOpSelectionQuery ( [ ] , value ) instanceof Error && isUnmatchedValueQuery ( value ) ) {
28
+ _onChange ( `name:"*${ value } *"` ) ;
29
+ } else {
30
+ _onChange ( value ) ;
31
+ }
32
+ } ,
33
+ [ _onChange ] ,
34
+ ) ;
23
35
return (
24
36
< Wrapper >
25
37
< SelectionAutoCompleteInput
You can’t perform that action at this time.
0 commit comments