Skip to content

Commit

Permalink
fix(ui): display proper available freight for promote-subscribers (#1200
Browse files Browse the repository at this point in the history
)

Signed-off-by: Remington Breeze <[email protected]>
  • Loading branch information
rbreeze authored Nov 30, 2023
1 parent d639370 commit 122b81a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion ui/src/features/common/freight-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ export const FreightLabel = ({ freight }: { freight?: Freight }) => {
setId(freight?.metadata?.name?.substring(0, 7) || 'N/A');
}, [freight]);

return <>{alias ? <Tooltip title={id}>{alias}</Tooltip> : <>{id}</>}</>;
return (
<span className='truncate'>{alias ? <Tooltip title={id}>{alias}</Tooltip> : <>{id}</>}</span>
);
};
12 changes: 8 additions & 4 deletions ui/src/features/freightline/freightline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,15 @@ export const Freightline = (props: {
}, [promotingStage, freight, promotionType]);

useEffect(() => {
if (!isLoading) {
if (!isLoading && promotingStage !== undefined) {
const initFreight = availableFreightData?.groups['']?.freight || [];
const availableFreight =
promotionType === 'default'
? availableFreightData?.groups['']?.freight || []
: promotingStage?.status?.history || [];
? initFreight
: initFreight.filter(
(f) => !!f?.status?.verifiedIn[promotingStage?.metadata?.name || '']
);

const pe: { [key: string]: boolean } = {};
((availableFreight as Freight[]) || []).map((f: Freight) => {
const name = promotionType === 'default' ? f?.metadata?.name : f?.id;
Expand Down Expand Up @@ -373,7 +377,7 @@ const FreightItem = (props: {
</div>
<div className='mt-auto w-full'>
<div
className={`w-full text-center font-mono text-xs ${
className={`w-full text-center font-mono text-xs truncate ${
confirmingPromotion ? 'text-white' : 'text-gray-400'
}`}
>
Expand Down

0 comments on commit 122b81a

Please sign in to comment.