File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
browser/data-browser/src/components/forms/SearchBox Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ interface SearchBoxProps {
1818 autoFocus ?: boolean ;
1919 value : string | undefined ;
2020 isA ?: string ;
21- scope ?: string ;
21+ scopes ?: string [ ] ;
2222 placeholder ?: string ;
2323 disabled ?: boolean ;
2424 required ?: boolean ;
@@ -32,7 +32,7 @@ export function SearchBox({
3232 autoFocus,
3333 value,
3434 isA,
35- scope ,
35+ scopes ,
3636 placeholder,
3737 disabled,
3838 required,
@@ -167,7 +167,7 @@ export function SearchBox({
167167 < SearchBoxWindow
168168 searchValue = { inputValue }
169169 onChange = { setInputValue }
170- scope = { scope }
170+ scopes = { scopes }
171171 isA = { isA }
172172 placeholder = { placeholderText }
173173 triggerRef = { triggerRef }
Original file line number Diff line number Diff line change @@ -9,13 +9,14 @@ import { focusOffsetElement } from '../../../helpers/focusOffsetElement';
99import { isURL } from '../../../helpers/isURL' ;
1010import { useAvailableSpace } from '../hooks/useAvailableSpace' ;
1111import { remToPixels } from '../../../helpers/remToPixels' ;
12+ import { useSettings } from '../../../helpers/AppSettings' ;
1213
1314const BOX_HEIGHT_REM = 20 ;
1415
1516interface SearchBoxWindowProps {
1617 searchValue : string ;
1718 isA ?: string ;
18- scope ?: string ;
19+ scopes ?: string [ ] ;
1920 placeholder ?: string ;
2021 triggerRef : React . RefObject < HTMLButtonElement > ;
2122 onExit : ( lostFocus : boolean ) => void ;
@@ -28,13 +29,14 @@ export function SearchBoxWindow({
2829 searchValue,
2930 onChange,
3031 isA,
31- scope ,
32+ scopes ,
3233 placeholder,
3334 triggerRef,
3435 onExit,
3536 onSelect,
3637 onCreateItem,
3738} : SearchBoxWindowProps ) : JSX . Element {
39+ const { drive } = useSettings ( ) ;
3840 const [ realIndex , setIndex ] = useState < number | undefined > ( undefined ) ;
3941 const { below } = useAvailableSpace ( true , triggerRef ) ;
4042 const wrapperRef = React . useRef < HTMLDivElement > ( null ) ;
@@ -45,9 +47,14 @@ export function SearchBoxWindow({
4547 [ isA ] ,
4648 ) ;
4749
50+ const parents = useMemo (
51+ ( ) => scopes ?? [ drive , 'https://atomicdata.dev' ] ,
52+ [ scopes ] ,
53+ ) ;
54+
4855 const { results } = useServerSearch ( searchValue , {
4956 filters,
50- scope ,
57+ parents ,
5158 } ) ;
5259
5360 const isAboveTrigger = below < remToPixels ( BOX_HEIGHT_REM ) ;
You can’t perform that action at this time.
0 commit comments