-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Issues table: Add description column, render expanded description a…
…s markdown, render links under markdown in table and incident viewer, add alert text to all incidents tab (#1116) This PR contains four presentation tweaks to the Issues page from recent discussions: 1. From a recent email discussion, it was decided that the although the issue description can be long, the first line of it is the most meaningful "title" for an issue or issue-based report and it should be included in the table. This change adds the first line of the description to the table, truncated with a tooltip. 2. The issue description in the expanded row content was being rendered in plain text, and now its value can contain markdown. This change wraps it using ReactMarkdown like the incident message. 3. The issue object (and now the issue-related reports as of konveyor/tackle2-hub#434) contains a `links` array that we were not rendering. This change adds external links for these URLs under the issue description in the expanded rows of the issues table, and under the incident message in the incident viewer modal. 4. There was a placeholder TODO string in the info alert above the "all incidents" table in the incident viewer modal. This change adds a first pass of that message: "Full details are only available for the first 5 incidents per file due to performance constraints". We can revisit this if there are any objections to this text. --------- Signed-off-by: Mike Turley <mike.turley@alum.cs.umass.edu> Co-authored-by: Ian Bolton <ibolton@redhat.com>
- Loading branch information
1 parent
aedaf9c
commit 9413509
Showing
4 changed files
with
80 additions
and
20 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
45 changes: 45 additions & 0 deletions
45
client/src/app/pages/issues/components/issue-description-and-links.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,45 @@ | ||
import * as React from "react"; | ||
import ReactMarkdown from "react-markdown"; | ||
import { TextContent, List, ListItem, Button } from "@patternfly/react-core"; | ||
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; | ||
import ExternalLinkSquareAltIcon from "@patternfly/react-icons/dist/esm/icons/external-link-square-alt-icon"; | ||
|
||
import { AnalysisIssueLink } from "@app/api/models"; | ||
import { markdownPFComponents } from "@app/components/markdown-pf-components"; | ||
|
||
export interface IIssueDescriptionAndLinksProps { | ||
description: string; | ||
links?: AnalysisIssueLink[]; | ||
className?: string; | ||
} | ||
|
||
export const IssueDescriptionAndLinks: React.FC< | ||
IIssueDescriptionAndLinksProps | ||
> = ({ description, links, className = "" }) => ( | ||
<div className={className}> | ||
<TextContent className={spacing.mbMd}> | ||
<ReactMarkdown components={markdownPFComponents}> | ||
{description} | ||
</ReactMarkdown> | ||
</TextContent> | ||
{links?.length ? ( | ||
<List isPlain> | ||
{links.map((link) => ( | ||
<ListItem key={link.url}> | ||
<Button | ||
variant="link" | ||
component="a" | ||
icon={<ExternalLinkSquareAltIcon />} | ||
iconPosition="right" | ||
href={link.url} | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
{link.title} | ||
</Button> | ||
</ListItem> | ||
))} | ||
</List> | ||
) : null} | ||
</div> | ||
); |
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