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

UI polish following internal demo #25

Merged
merged 2 commits into from
Jul 5, 2023
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 @@ -11,6 +11,7 @@ import { colors } from '../typedefs/styled';
import Flex from './Flex';
import { Condition } from '../objects';
import reconcile from '../images/reconcile.svg';
import { Tooltip } from '@material-ui/core';

type Props = {
className?: string;
Expand Down Expand Up @@ -241,10 +242,16 @@ function KubeStatusIndicator({
let text = computeMessage(conditions);
if (short || suspended) text = type;

const ready = _.find(conditions, c => c.type === ReadyType.Ready);

return (
<Flex start className={className} align>
{getBackstageIcon(color)} {text}
</Flex>
<Tooltip title={ready?.message || ''}>
<div>
AlinaGoaga marked this conversation as resolved.
Show resolved Hide resolved
<Flex start className={className} align>
{getBackstageIcon(color)} {text}
</Flex>
</div>
</Tooltip>
);
}

Expand Down
11 changes: 4 additions & 7 deletions plugins/backstage-plugin-flux/src/components/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export const Url = ({ resource }: { resource: Source }): JSX.Element => {

export function SyncButton({ resource }: { resource: Source | Deployment }) {
const { sync, isSyncing } = useSyncResource(resource);

const classes = useStyles();
const label = `${resource.namespace}/${resource.name}`;
const title = isSyncing ? `Syncing ${label}` : `Sync ${label}`;
Expand All @@ -85,6 +84,7 @@ export function SyncButton({ resource }: { resource: Source | Deployment }) {
className={classes.syncButton}
size="small"
onClick={sync}
disabled={resource.suspended}
>
<RetryIcon />
</IconButton>
Expand All @@ -107,8 +107,6 @@ export const VerifiedStatus = ({
}: {
resource: VerifiableSource;
}): JSX.Element | null => {
const classes = useStyles();

if (!resource.isVerifiable) return null;

const condition = findVerificationCondition(resource);
Expand All @@ -124,9 +122,7 @@ export const VerifiedStatus = ({

return (
<Tooltip title={condition?.message || 'pending verification'}>
<div className={classes.iconCircle}>
<VerifiedUserIcon style={{ color, height: '16px' }} />
</div>
<VerifiedUserIcon style={{ color, height: '16px' }} />
</Tooltip>
);
};
Expand All @@ -138,7 +134,7 @@ export const nameAndClusterName = ({
}): JSX.Element => (
<Flex column>
<NameLabel resource={resource} />
<span>{resource.clusterName}</span>
<span>cluster: {resource.clusterName}</span>
</Flex>
);

Expand Down Expand Up @@ -230,6 +226,7 @@ export function statusColumn<T extends FluxObject>() {
resource =>
getIndicatorInfo(resource.suspended, resource.conditions).type,
),
minWidth: '130px',
} as TableColumn<T>;
}

Expand Down
11 changes: 1 addition & 10 deletions plugins/backstage-plugin-flux/src/components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const useStyles = makeStyles(theme => ({
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
direction: 'rtl',
maxWidth: '350px',
maxWidth: '300px',
height: '16px',
marginTop: '2px',
},
Expand All @@ -36,15 +36,6 @@ export const useStyles = makeStyles(theme => ({
padding: 0,
margin: '-5px 0',
},
iconCircle: {
backgroundColor: '#ccc',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
height: '22px',
width: '22px',
},
}));

export interface VerifiableSource {
Expand Down