Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixing markdown for truncated column descriptions in the table #1905

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export const COLUMN_LINEAGE_UPSTREAM_TITLE = `Top ${COLUMN_LINEAGE_LIST_SIZE} Up
export const COLUMN_LINEAGE_MORE_TEXT = 'See More';
export const HAS_COLUMN_STATS_TEXT = 'Column stats available';
export const DELAY_SHOW_POPOVER_MS = 500;
export const BREAK_MARKDOWN_TYPE = 'break';
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import * as React from 'react';
import * as ReactMarkdown from 'react-markdown';
import { OverlayTrigger, Popover } from 'react-bootstrap';

import { NestingArrow } from 'components/SVGIcons/NestingArrow';
Expand Down Expand Up @@ -32,7 +33,11 @@ import { buildTableKey, TablePageParams } from 'utils/navigationUtils';
import { GraphIcon } from 'components/SVGIcons/GraphIcon';

import ColumnType from './ColumnType';
import { EMPTY_MESSAGE, HAS_COLUMN_STATS_TEXT } from './constants';
import {
BREAK_MARKDOWN_TYPE,
EMPTY_MESSAGE,
HAS_COLUMN_STATS_TEXT,
} from './constants';

import './styles.scss';

Expand Down Expand Up @@ -258,7 +263,12 @@ const ColumnList: React.FC<ColumnListProps> = ({
)}
{columnMetadataIcons}
</div>
<p className="column-desc truncated">{description}</p>
<ReactMarkdown
className="column-desc"
disallowedTypes={[BREAK_MARKDOWN_TYPE]}
>
{description}
</ReactMarkdown>
</div>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,14 @@ $nested-column-row-color: $gray5;
white-space: normal;
}

.column-desc {
.column-desc p {
@extend %text-body-w3;

margin: 0;
max-width: $description-max-width-small;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;

@media (min-width: $screen-md-max) {
max-width: $description-max-width-med;
Expand Down