-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* renaming + new fields in AdvancedSearchFilters * removes forwardRef from SearchLabeledInput * Revert "removes forwardRef from SearchLabeledInput" This reverts commit 7449183. * autocomplete * working Type * switch to state * field rename * options in autoComplete based on const * Updated snapshots (#7390) Co-authored-by: vder <[email protected]> --------- Co-authored-by: Piotr Fałdrowicz <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: vder <[email protected]>
- Loading branch information
1 parent
2623924
commit 9728145
Showing
9 changed files
with
176 additions
and
138 deletions.
There are no files selected for viewing
Binary file modified
BIN
+977 Bytes
(110%)
..._snapshots__/electron/Linux/Process view should have node search toolbar #1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
designer/client/src/components/sidePanels/SearchLabeledAutocomplete.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Autocomplete, FormControl } from "@mui/material"; | ||
import { nodeInput } from "../graph/node-modal/NodeDetailsContent/NodeTableStyled"; | ||
import React from "react"; | ||
|
||
export const SearchLabeledAutocomplete = ({ children, name, options, value, setFilterFields }) => { | ||
function handleChange(_, value) { | ||
setFilterFields((prev) => ({ ...prev, [name]: [value] })); | ||
} | ||
|
||
return ( | ||
<FormControl sx={{ display: "flex", flexDirection: "column", m: 0, gap: 1, width: "100%" }}> | ||
{children} | ||
<Autocomplete | ||
freeSolo | ||
options={options} | ||
value={value.join(",")} | ||
onChange={handleChange} | ||
onInputChange={handleChange} | ||
className={nodeInput} | ||
renderInput={(params) => ( | ||
<div ref={params.InputProps.ref}> | ||
<input name={name} {...params.inputProps} className={nodeInput} /> | ||
</div> | ||
)} | ||
/> | ||
</FormControl> | ||
); | ||
}; | ||
|
||
SearchLabeledAutocomplete.displayName = "SearchLabeledAutocomplete"; |
15 changes: 7 additions & 8 deletions
15
designer/client/src/components/sidePanels/SearchLabeledInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
import { forwardRef, PropsWithChildren } from "react"; | ||
import React from "react"; | ||
import { FormControl } from "@mui/material"; | ||
import { nodeInput } from "../graph/node-modal/NodeDetailsContent/NodeTableStyled"; | ||
import React from "react"; | ||
|
||
export type SearchLabeledInputProps = PropsWithChildren<{ | ||
name: string; | ||
}>; | ||
export const SearchLabeledInput = ({ children, name, value, setFilterFields }) => { | ||
function handleChange(event) { | ||
setFilterFields((prev) => ({ ...prev, [name]: event.target.value.split(",") })); | ||
} | ||
|
||
export const SearchLabeledInput = forwardRef<HTMLInputElement, SearchLabeledInputProps>(({ children, ...props }, ref) => { | ||
return ( | ||
<FormControl sx={{ display: "flex", flexDirection: "column", m: 0, gap: 1, width: "100%" }}> | ||
{children} | ||
<input ref={ref} {...props} className={nodeInput} /> | ||
<input name={name} value={value} className={nodeInput} onChange={handleChange} /> | ||
</FormControl> | ||
); | ||
}); | ||
}; | ||
|
||
SearchLabeledInput.displayName = "SearchLabeledInput"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.