-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ui: Add block search feature Signed-off-by: Shafiya Adzhani <[email protected]> * fix: fis props on source view test Signed-off-by: Shafiya Adzhani <[email protected]> * ui: add build from search ui Signed-off-by: Shafiya Adzhani <[email protected]> * fix(search block): fix code reviews on pr Signed-off-by: Shafiya Adzhani <[email protected]> * build(search block): build assets Signed-off-by: Shafiya Adzhani <[email protected]> * docs(search block): add changelog Signed-off-by: Shafiya Adzhani <[email protected]>
- Loading branch information
Showing
8 changed files
with
241 additions
and
160 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
pkg/ui/react-app/src/thanos/pages/blocks/BlockSearchInput.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,31 @@ | ||
import React, { FC, ChangeEvent } from 'react'; | ||
import { Button, InputGroup, InputGroupAddon, InputGroupText, Input, Form } from 'reactstrap'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faSearch } from '@fortawesome/free-solid-svg-icons'; | ||
import styles from './blocks.module.css'; | ||
|
||
interface BlockSearchInputProps { | ||
onChange: ({ target }: ChangeEvent<HTMLInputElement>) => void; | ||
onClick: () => void; | ||
defaultValue: string; | ||
} | ||
|
||
export const BlockSearchInput: FC<BlockSearchInputProps> = ({ onChange, onClick, defaultValue }) => { | ||
return ( | ||
<Form onSubmit={(e) => e.preventDefault()}> | ||
<InputGroup className={styles.blockInput}> | ||
<InputGroupAddon addonType="prepend"> | ||
<InputGroupText> | ||
<FontAwesomeIcon icon={faSearch} /> | ||
</InputGroupText> | ||
</InputGroupAddon> | ||
<Input placeholder="Search block by ulid" onChange={onChange} defaultValue={defaultValue} /> | ||
<InputGroupAddon addonType="append"> | ||
<Button className="execute-btn" color="primary" onClick={onClick} type="submit"> | ||
Search | ||
</Button> | ||
</InputGroupAddon> | ||
</InputGroup> | ||
</Form> | ||
); | ||
}; |
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
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 |
---|---|---|
|
@@ -190,3 +190,7 @@ | |
.level-6 { | ||
background: var(--level-6); | ||
} | ||
|
||
.blockInput { | ||
margin-bottom: 12px; | ||
} |
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