forked from pinterest/querybook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ask users to confirm tables before query generation (pinterest#…
…1339) * feat: ask users to confirm tables before text2sql * comments * hidePitItButton
- Loading branch information
1 parent
2edc691
commit 28de77e
Showing
7 changed files
with
167 additions
and
78 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
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
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,48 @@ | ||
import React from 'react'; | ||
|
||
import { TableTooltipByName } from 'components/CodeMirrorTooltip/TableTooltip'; | ||
import { Popover } from 'ui/Popover/Popover'; | ||
import { PopoverHoverWrapper } from 'ui/Popover/PopoverHoverWrapper'; | ||
import { HoverIconTag } from 'ui/Tag/HoverIconTag'; | ||
|
||
interface ITableTagProps { | ||
metastoreId: number; | ||
tableName: string; | ||
onIconClick?: () => void; | ||
highlighted?: boolean; | ||
} | ||
|
||
export const TableTag: React.FunctionComponent<ITableTagProps> = ({ | ||
metastoreId, | ||
tableName, | ||
onIconClick, | ||
highlighted = false, | ||
}) => ( | ||
<PopoverHoverWrapper> | ||
{(showPopover, anchorElement) => ( | ||
<> | ||
<HoverIconTag | ||
name={tableName} | ||
iconOnHover={onIconClick ? 'X' : undefined} | ||
onIconHoverClick={onIconClick} | ||
mini | ||
highlighted={highlighted} | ||
light | ||
/> | ||
{showPopover && ( | ||
<Popover | ||
onHide={() => null} | ||
anchor={anchorElement} | ||
layout={['right']} | ||
> | ||
<TableTooltipByName | ||
metastoreId={metastoreId} | ||
tableFullName={tableName} | ||
showDetails={true} | ||
/> | ||
</Popover> | ||
)} | ||
</> | ||
)} | ||
</PopoverHoverWrapper> | ||
); |
Oops, something went wrong.