Skip to content

Commit

Permalink
Fixing markdown for truncated column descriptions in the table (#1905)
Browse files Browse the repository at this point in the history
Signed-off-by: Kristen Armes <karmes@lyft.com>
  • Loading branch information
kristenarmes authored Jun 16, 2022
1 parent 991b07f commit 7107864
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
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

0 comments on commit 7107864

Please sign in to comment.