Skip to content
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
6 changes: 6 additions & 0 deletions .changeset/noble-nebula-shine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@giantswarm/backstage-plugin-gs': patch
'@giantswarm/backstage-plugin-ui-react': patch
---

Fix version truncation not working on deployment details page.
6 changes: 5 additions & 1 deletion plugins/gs/src/components/UI/AboutField/AboutField.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { useElementFilter } from '@backstage/core-plugin-api';
import Typography from '@material-ui/core/Typography';
import { makeStyles } from '@material-ui/core/styles';
import classNames from 'classnames';
import { ReactNode } from 'react';

const useStyles = makeStyles(theme => ({
root: {
minWidth: 0,
},
value: {
fontWeight: 'bold',
overflow: 'hidden',
Expand Down Expand Up @@ -45,7 +49,7 @@ export function AboutField(props: AboutFieldProps) {
);

return (
<div className={className}>
<div className={classNames(classes.root, className)}>
<Typography variant="h2" className={classes.label}>
{label}
</Typography>
Expand Down
1 change: 1 addition & 0 deletions plugins/gs/src/components/UI/Version/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export const Version = ({
? getCommitURL(sourceLocation, commitHash)
: getReleaseNotesURL(sourceLocation, versionLabel)
}
display={truncate ? 'flex' : 'inline-flex'}
>
{versionComponent}
</ExternalLink>
Expand Down
15 changes: 13 additions & 2 deletions plugins/ui-react/src/components/ExternalLink/ExternalLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@ const StyledLaunchOutlinedIcon = styled(LaunchOutlinedIcon)(({ theme }) => ({
type ExternalLinkProps = {
href: string;
children: React.ReactNode;
/**
* CSS display value for the inner flex container.
* Use 'flex' (block-level) when the link needs to participate in a width
* constraint chain (e.g. inside a flex/grid item for text truncation).
* @default 'inline-flex'
*/
display?: 'flex' | 'inline-flex';
};

export const ExternalLink = ({ href, children }: ExternalLinkProps) => {
export const ExternalLink = ({
href,
children,
display = 'inline-flex',
}: ExternalLinkProps) => {
return (
<Link href={href} target="_blank" rel="noopener noreferrer">
<Box display="inline-flex" alignItems="center">
<Box display={display} alignItems="center">
{children}
<StyledLaunchOutlinedIcon />
</Box>
Expand Down