-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
112 additions
and
32 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
34 changes: 23 additions & 11 deletions
34
frontend/src/metabase/browse/components/EllipsifiedWithMarkdown.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,16 +1,28 @@ | ||
import { Ellipsified } from "metabase/core/components/Ellipsified"; | ||
import Markdown from "metabase/core/components/Markdown"; | ||
|
||
export const EllipsifiedWithMarkdown = ({ children }: { children: string }) => { | ||
return ( | ||
<Ellipsified | ||
tooltip={ | ||
<Markdown disallowHeading unstyleLinks lineClamp={12}> | ||
{children} | ||
</Markdown> | ||
} | ||
> | ||
<Markdown disallowHeading>{children.replace(/\s/g, " ")}</Markdown> | ||
</Ellipsified> | ||
export const EllipsifiedWithMarkdown = ({ | ||
shouldMarkdownifyTooltipTarget = false, | ||
shouldMarkdownifyTooltip = true, | ||
children, | ||
}: { | ||
/** NOTE: If the tooltip target is markdownified, | ||
* useIsTruncated won't know whether it has been truncated */ | ||
shouldMarkdownifyTooltipTarget?: boolean; | ||
shouldMarkdownifyTooltip?: boolean; | ||
children: string; | ||
}) => { | ||
const tooltip = shouldMarkdownifyTooltip ? ( | ||
<Markdown disallowHeading unstyleLinks lineClamp={12}> | ||
{children} | ||
</Markdown> | ||
) : ( | ||
children | ||
); | ||
const tooltipTarget = shouldMarkdownifyTooltipTarget ? ( | ||
<Markdown disallowHeading>{children}</Markdown> | ||
) : ( | ||
children | ||
); | ||
return <Ellipsified tooltip={tooltip}>{tooltipTarget}</Ellipsified>; | ||
}; |
10 changes: 10 additions & 0 deletions
10
frontend/src/metabase/browse/components/ModelsTable.styled.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,10 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
import { color } from "metabase/lib/colors"; | ||
|
||
export const ModelTableRow = styled.tr` | ||
cursor: pointer; | ||
:outline { | ||
outline: 2px solid ${color("brand")}; | ||
} | ||
`; |
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