Skip to content

Commit

Permalink
Merge pull request #1179 from yaacov/hide-conditions-in-plan-migratin…
Browse files Browse the repository at this point in the history
…g-vm-extended-view

🧼 Hide empty conditions sections
  • Loading branch information
yaacov authored May 29, 2024
2 parents d4c7a97 + aaba117 commit ef4218f
Showing 1 changed file with 32 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,34 +156,38 @@ export const MigrationVirtualMachinesRowExtended: React.FC<RowProps<VMData>> = (
</>
)}

<SectionHeading
text={'Conditions'}
className="forklift-page-plan-details-vm-status__section-header"
/>
<TableComposable aria-label="Expandable table" variant="compact">
<Thead>
<Tr>
<Th width={10}>{t('Type')}</Th>
<Th width={10}>{t('Status')}</Th>
<Th width={20}>{t('Updated')}</Th>
<Th width={10}>{t('Reason')}</Th>
<Th> {t('Message')}</Th>
</Tr>
</Thead>
<Tbody>
{(conditions || []).map((condition) => (
<Tr key={condition.type}>
<Td>{condition.type}</Td>
<Td>{getStatusLabel(condition.status)}</Td>
<Td>
<Timestamp timestamp={condition.lastTransitionTime} />
</Td>
<Td>{condition.reason}</Td>
<Td modifier="truncate">{condition?.message || '-'}</Td>
</Tr>
))}
</Tbody>
</TableComposable>
{(conditions || []).length > 0 && (
<>
<SectionHeading
text={'Conditions'}
className="forklift-page-plan-details-vm-status__section-header"
/>
<TableComposable aria-label="Expandable table" variant="compact">
<Thead>
<Tr>
<Th width={10}>{t('Type')}</Th>
<Th width={10}>{t('Status')}</Th>
<Th width={20}>{t('Updated')}</Th>
<Th width={10}>{t('Reason')}</Th>
<Th> {t('Message')}</Th>
</Tr>
</Thead>
<Tbody>
{(conditions || []).map((condition) => (
<Tr key={condition.type}>
<Td>{condition.type}</Td>
<Td>{getStatusLabel(condition.status)}</Td>
<Td>
<Timestamp timestamp={condition.lastTransitionTime} />
</Td>
<Td>{condition.reason}</Td>
<Td modifier="truncate">{condition?.message || '-'}</Td>
</Tr>
))}
</Tbody>
</TableComposable>
</>
)}

<SectionHeading
text={'Pipeline'}
Expand Down

0 comments on commit ef4218f

Please sign in to comment.